/* EGYPHILEX public site. Logo palette: navy #07304A, red #D74F35, cream #FEF8EF; EB Garamond (Latin) and Amiri (Arabic).
   Red #D74F35 is for rules, borders and accents only (3.9:1 on cream); red text uses --red-text #B5402A (5.3:1). */
:root {
  color-scheme: light;
  --navy: #07304A;
  --navy-dk: #041F31;
  --red: #D74F35;
  --red-text: #B5402A;
  --ink: #14202B;
  --mute: #5C6670;
  --paper: #FEF8EF;
  --rule: #E8DFD2;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --arabic: "Amiri", "Noto Naskh Arabic", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font: 18px/1.6 var(--serif); }
[lang="ar"] body, body:lang(ar) { font-family: var(--arabic); font-size: 19px; line-height: 1.8; }
a { color: var(--navy); }
a:hover { color: var(--navy-dk); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip, .trap { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; inset-inline-start: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

.top { background: #fff; border-bottom: 4px solid var(--red); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 6px; }
.brand { text-decoration: none; color: var(--navy); font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand .logo { width: 44px; height: 44px; flex: none; }
.brand .yr { color: var(--red-text); font-weight: 400; letter-spacing: .02em; }
.langs { display: flex; gap: 14px; font-size: 16px; }
.langs a { text-decoration: none; }
.menu { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-bottom: 12px; font-size: 17px; }
.menu a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu a:hover, .menu a[aria-current] { color: var(--navy); border-bottom-color: var(--red); }

.hero { background: var(--navy); color: var(--paper); padding: 56px 0 48px; border-bottom: 6px solid var(--red); }
.hero .kicker { margin: 0 0 6px; font-size: 18px; opacity: .9; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(44px, 8vw, 84px); line-height: 1; font-weight: 600; letter-spacing: .06em; }
.hero h1 span { font-weight: 400; letter-spacing: .02em; }
.hero .sub { margin: 10px 0 0; font-size: 22px; }
.hero .opens { margin: 22px 0 14px; font-size: 18px; font-style: italic; }
[dir="rtl"] .hero .opens { font-style: normal; }
.countdown { display: flex; gap: 12px; }
.countdown div { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); padding: 10px 16px; min-width: 96px; text-align: center; }
.countdown b { display: block; font-size: 36px; font-weight: 500; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 15px; opacity: .85; }
.countdown.done { font-size: 22px; }

.cols { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 48px; padding-top: 40px; padding-bottom: 16px; }
@media (max-width: 760px) { .cols { grid-template-columns: minmax(0,1fr); gap: 8px; } }
h2 { color: var(--navy); font-weight: 500; font-size: 26px; margin: 28px 0 10px; }
.dates { list-style: none; padding: 0; margin: 0; }
.dates li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.dates .d { min-width: 170px; color: var(--red-text); font-weight: 500; white-space: nowrap; }
.btn { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; padding: 10px 20px; border-radius: 2px; }
.btn:hover { background: var(--navy-dk); color: #fff; }

.signup { padding-top: 16px; padding-bottom: 48px; }
.sform { max-width: 560px; }
.sform label { display: block; margin: 8px 0 4px; }
.sform .row { display: flex; flex-wrap: wrap; gap: 8px; }
.sform input[type=email] { flex: 1 1 200px; min-width: 0; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid #b9aca8; border-radius: 2px; background: #fff; min-height: 44px; }
.sform button { font: inherit; background: var(--navy); color: #fff; border: 0; padding: 0 22px; border-radius: 2px; min-height: 44px; cursor: pointer; }
.sform .chk { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; margin-top: 12px; }
.sform .chk input { margin-top: 6px; width: 18px; height: 18px; }
.sform .msg { min-height: 1.6em; color: var(--navy); font-weight: 500; }

.page { padding-top: 32px; padding-bottom: 56px; max-width: 820px; }
.page h1 { color: var(--navy); font-weight: 500; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; margin: 0 0 16px; }
.lead { font-size: 21px; }
table { border-collapse: collapse; width: 100%; margin: 12px 0 20px; font-size: 17px; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--navy); font-weight: 500; border-bottom: 2px solid var(--red); }
.timeline { padding-inline-start: 20px; }
.timeline li { padding: 8px 0; }
.timeline strong { display: block; color: var(--red-text); font-weight: 500; }

.foot { border-top: 1px solid var(--rule); color: var(--mute); font-size: 16px; padding: 22px 0 40px; }
@media (max-width: 520px) {
  body { font-size: 17px; }
  .brand { font-size: 20px; gap: 8px; letter-spacing: .05em; } .brand .logo { width: 34px; height: 34px; }
  .menu { gap: 2px 14px; font-size: 16px; }
  .countdown div { min-width: 0; flex: 1; padding: 8px; }
  .countdown b { font-size: 28px; }
  .dates li { flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Portal and admin */
.topr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.area { font-size: 16px; text-decoration: none; border: 1px solid var(--navy); padding: 4px 12px; border-radius: 2px; white-space: nowrap; }
.area.on, .area:hover { background: var(--navy); color: #fff; }
.portal.wide { max-width: 1180px; }
.pform { max-width: 720px; }
.pform.narrow { max-width: 440px; }
.pform label, .pform .field { display: block; margin: 12px 0; }
.pform .lbl { display: block; margin-bottom: 4px; }
.pform input:not([type=checkbox]), .pform select, .pform textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 17px; padding: 9px 11px; border: 1px solid #b9aca8; border-radius: 2px; background: #fff; min-height: 44px; }
.pform textarea { min-height: 88px; }
.pform button, .btn.small { font: inherit; background: var(--navy); color: #fff; border: 0; padding: 10px 22px; border-radius: 2px; min-height: 44px; cursor: pointer; margin-top: 8px; }
.pform button.alt { background: #4A5560; } .pform button.danger { background: var(--red-text); }
.btn.small { padding: 4px 12px; min-height: 32px; font-size: 15px; margin: 0 6px; }
.pform .chk { display: flex; gap: 10px; align-items: flex-start; }
.pform .chk input { margin-top: 6px; width: 18px; height: 18px; flex: none; }
.pform fieldset { border: 1px solid var(--rule); border-radius: 2px; padding: 8px 18px 14px; margin: 18px 0; background: #fff; }
.pform legend { color: var(--navy); font-size: 21px; padding: 0 6px; }
.pform .help { color: var(--mute); font-size: 16px; margin: 4px 0; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.checks .chk { margin: 4px 0; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 16px; }
.award { display: grid; grid-template-columns: 2fr 1.2fr 1.4fr .8fr .9fr; gap: 0 10px; border-bottom: 1px dashed var(--rule); }
.fee { font-size: 20px; margin: 14px 0 4px; } .fee b { color: var(--red-text); }
.warntext { display: block; font-size: 16px; color: var(--red-text); }
.note { padding: 10px 14px; border-inline-start: 4px solid var(--red); background: #fff; }
.note.warn { border-color: var(--red-text); background: #FBEDE8; }
.devnote { padding: 8px 12px; background: #fff7d6; border: 1px dashed #c9a400; }
.st { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 15px; background: #eee6e3; white-space: nowrap; }
.st-submitted, .st-under_review { background: #e7eef8; } .st-accepted { background: #e5f4e4; } .st-declined { background: #fbe9e7; }
.st-queried, .st-draft { background: #fdf1d8; }
td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; max-width: none; }
.filters label { margin: 6px 0; } .filters select, .filters input { min-width: 120px; }
.linkbtn { background: none; border: 0; color: var(--navy); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; margin-top: 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.scroll { overflow-x: auto; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .grid2, .grid3, .award { grid-template-columns: minmax(0,1fr); }
  .stack thead { display: none; } .stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--rule); } .stack td { display: block; border: 0; padding: 2px 0; }
  td.num { text-align: start; }
}

/* ---- Page upload (Milestone 4) ---- */
.frameup { margin: 26px 0; }
.slots { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; background: #0B2233; border: 6px solid #1C3B52; }
.slot { background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.slot.dbl { grid-column: span 2; }
.slot .thumb { position: relative; aspect-ratio: 210 / 297; background: var(--paper); border: 1px dashed #b9c3cc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slot.dbl .thumb { aspect-ratio: 420 / 297; }
.slot.has .thumb { border-style: solid; border-color: var(--rule); }
.slot .thumb img { width: 100%; height: 100%; object-fit: contain; }
.slot .num { position: absolute; inset-block-start: 4px; inset-inline-start: 6px; font-size: 13px; color: var(--mute); background: rgba(255,255,255,.85); padding: 0 5px; }
.slot .pick { display: block; text-align: center; border: 1px solid var(--navy); color: var(--navy); padding: 6px 4px; cursor: pointer; min-height: 40px; }
.slot .pick:hover, .slot .pick:focus-within { background: var(--navy); color: #fff; }
.slot .pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.slot .rm { margin: 0; font-size: 14px; align-self: center; }
.slot .state { margin: 0; min-height: 1.3em; font-size: 14px; line-height: 1.3; color: var(--mute); }
.slot .state.warn { color: var(--red-text); }
.slot.busy { opacity: .7; pointer-events: none; }
.count { font-weight: 500; color: var(--navy); }
@media (max-width: 700px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; } .slot.dbl { grid-column: span 2; } }

/* ---- Exhibit viewer ---- */
.vframe { margin: 24px 0; }
.vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.2vw, 14px); padding: clamp(10px, 2vw, 22px); background: #0B2233; border: 6px solid #1C3B52; }
.vpg { padding: 0; border: 0; background: #fff; cursor: zoom-in; display: block; }
.vpg img { display: block; width: 100%; height: auto; }
.vpg:hover, .vpg:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
html.viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 50; background: #06141F; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.vbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--navy); color: var(--paper); border-bottom: 3px solid var(--red); flex-wrap: wrap; font-size: 16px; }
.vsp { flex: 1; }
.vbtn { min-width: 44px; height: 44px; border: 1px solid #2E5674; background: #0B2233; color: var(--paper); border-radius: 3px; font: inherit; font-size: 18px; padding: 0 10px; cursor: pointer; }
.vbtn:hover { background: #163E5C; }
.osd { flex: 1; min-height: 0; }
.vhint { position: absolute; inset-inline-start: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; background: rgba(7,48,74,.9); color: var(--paper); font-size: 14px; padding: 6px 14px; border-radius: 3px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
[dir="rtl"] .vhint { transform: translateX(50%); }
.vhint.gone { opacity: 0; }
@media (max-width: 600px) { .vt { order: -1; flex-basis: 100%; } }
form.inline { display: inline; }
.vpg.c1 { grid-column: 1; } .vpg.c2 { grid-column: 2; } .vpg.c3 { grid-column: 3; } .vpg.c4 { grid-column: 4; }
.vpg.c1.dbl { grid-column: 1 / span 2; } .vpg.c2.dbl { grid-column: 2 / span 2; } .vpg.c3.dbl { grid-column: 3 / span 2; }
.vpg.r1 { grid-row: 1; } .vpg.r2 { grid-row: 2; } .vpg.r3 { grid-row: 3; } .vpg.r4 { grid-row: 4; }
.vgrid { align-items: start; }

/* ---- Jury portal (Milestone 5) ---- */
.jnav { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 16px; }
.jnav a { text-decoration: none; }
.jnav a:hover { text-decoration: underline; }
table.kv th { width: 13em; color: var(--mute); font-weight: 400; border-bottom-color: var(--rule); }
table.sheet { width: 100%; }
table.sheet td { vertical-align: top; }
table.sheet input[type=number] { width: 4.5em; font: inherit; padding: 6px; border: 1px solid #b9aca8; border-radius: 2px; text-align: end; }
table.sheet textarea { width: 100%; min-width: 14em; font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid #b9aca8; border-radius: 2px; }
table.sheet tfoot th, table.sheet tfoot td { border-top: 2px solid var(--navy); border-bottom: 0; }
table.consensus td.num, table.consensus th.num { text-align: center; }
.rescard { border: 1px solid var(--rule); background: #fff; padding: 12px 16px; margin: 12px 0; }
.rescard h3 { margin: 0 0 6px; font-size: 20px; font-weight: 500; color: var(--navy); }
.rescard h3 small { color: var(--mute); font-size: 15px; }
.rescard .ok, p.ok { color: #1f5e3a; }
.resform { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; margin: 6px 0 0; }
.resform label { margin: 0; }
.resform input:not([type=checkbox]), .resform select { min-width: 8em; }
.resform fieldset { margin: 6px 0; flex-basis: 100%; }
form.assign { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
form.assign select { font: inherit; font-size: 15px; padding: 4px; max-width: 12em; }
.pick3 { display: inline-flex; align-items: center; gap: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
details { margin: 10px 0; } details summary { cursor: pointer; color: var(--navy); }
.result { font-size: 20px; color: var(--navy); border-inline-start: 4px solid var(--red); padding: 6px 12px; background: #fff; }

/* ---- Exhibits gallery and results (Milestone 6) ---- */
.page.wide { max-width: 1100px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; margin: 10px 0 28px; }
.excard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--rule); padding: 12px; }
.excard:hover, .excard:focus-visible { border-color: var(--red); }
.excard .shot { display: block; aspect-ratio: 17 / 11; background: #0B2233; border: 4px solid #1C3B52; overflow: hidden; }
.excard .shot img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.excard .ttl { font-size: 20px; color: var(--navy); line-height: 1.2; margin-top: 6px; }
.excard .ttl-ar { font-family: var(--arabic); color: var(--navy); }
.excard .meta { color: var(--mute); font-size: 15px; }
.excard .aw, .palm td { font-size: 16px; }
.medal { color: var(--red-text); font-weight: 600; }
.gp { color: var(--navy); }
.gpbox { background: #fff; border-inline-start: 6px solid var(--red); padding: 10px 18px; margin: 12px 0 24px; }
.gpbox p { margin: 8px 0; font-size: 19px; }

/* Demo site only (demo.egyphilex.org) */
.demo-banner{background:#7a2e1f;color:#fff;text-align:center;padding:8px 16px;font-size:.95rem;line-height:1.4}
.demo-banner a{color:#fff;text-decoration:underline;margin-inline-start:.5em}
.personas{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:18px;margin-top:24px}
.persona form{border:1px solid #d9cfc0;border-radius:6px;padding:16px 18px;background:#fff;height:100%;display:flex;flex-direction:column;gap:6px}
.persona h2{margin:0;font-size:1.15rem}
.persona .roles{margin:0;color:#B5402A;font-weight:600;font-size:.9rem}
.persona p{margin:0}
.persona button{margin-top:auto;align-self:flex-start;font:inherit;background:var(--navy);color:#fff;border:0;padding:10px 22px;border-radius:2px;min-height:44px;cursor:pointer}
