/* Readers of Edinburgh 2026 — shared styles (index + legal) */
:root {
  --cream: #f0ece4;
  --cream-deep: #e8e2d6;
  --paper: #f7f3eb;
  --ink: #2a2622;
  --ink-soft: #5a5249;
  --forest: #2d4a3a;
  --forest-deep: #1f3528;
  --terracotta: #c46a4a;
  --terracotta-deep: #a65538;
  --peach: #e6c4ad;
  --rule: #c9bfae;
  --night: #171513;            /* ground for the cover + lightbox */
  --pad: clamp(16px, 3vw, 44px);
  --serif: "Lora", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
/* --notice-h: height of the launch notice above the bar (0 when hidden; set by site.js) */
html { --notice-h: 0px; scroll-behavior: smooth; scroll-padding-top: calc(64px + var(--notice-h)); }
/* keep the page still behind an open viewer; the gutter stops the layout jumping */
html { scrollbar-gutter: stable; }
html.is-locked, html:has(dialog[open]) { overflow: hidden; }
dialog { overscroll-behavior: contain; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--forest); color: var(--cream); }
img { display: block; max-width: 100%; }
a { color: var(--terracotta-deep); text-decoration: none; border-bottom: 1px solid rgba(196,106,74,.35); transition: border-color .15s, color .15s; }
a:hover { color: var(--terracotta); border-bottom-color: var(--terracotta); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0 0 .9em; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--paper); padding: 8px 12px; border: none; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: var(--notice-h) 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 16px var(--pad);
  font-size: 13px; letter-spacing: .04em;
  color: var(--ink);
  background: var(--paper);
  transition: background .25s, color .25s;
}
.bar a { border: none; color: inherit; white-space: nowrap; }
.bar a:hover { color: var(--terracotta); }
.bar nav { display: flex; gap: 28px; }
.bar .brand { font-family: var(--serif); font-style: italic; font-size: 16px; letter-spacing: 0; }
.bar .brand span { opacity: .6; }
/* over the dark cover: same dark ground, light text */
.home .bar.on-cover { background: var(--night); color: var(--cream); }

/* ---------- launch evening notice: strip fixed above the top bar ---------- */
.notice {
  position: fixed; z-index: 21; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 44px;                      /* room for the close button */
  background: var(--forest-deep); color: var(--cream);
  font-size: 14px; line-height: 1.4; text-align: center;
  opacity: 0; transition: opacity .6s ease;
}
.notice.is-in { opacity: 1; }
.notice[hidden] { display: none; }
.notice a { color: var(--cream); border: none; padding: 9px 0; }
.notice a:hover { color: #fff; }
.notice strong { color: var(--peach); font-weight: 500; }
.notice .sep { opacity: .5; margin: 0 4px; }
.notice .nw { white-space: nowrap; }
.notice-x { all: unset; cursor: pointer; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px 12px; font-size: 18px; line-height: 1; opacity: .75; }
.notice-x:hover { opacity: 1; }
.notice-x:focus-visible { outline: 2px solid var(--peach); outline-offset: -4px; }
/* the bar and page slide down smoothly when the notice arrives or leaves */
.bar, .cover { transition: top .5s ease, padding .5s ease, background .25s, color .25s; }
.about-body p.launch { color: var(--ink); }
.about-body p.launch strong { font-weight: 500; color: var(--terracotta-deep); }

/* ---------- cover: winning photograph at full size ---------- */
.cover {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 520px;
  background: var(--night);
  color: var(--cream);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(64px + var(--notice-h)) var(--pad) 0;
}
.cover-img {
  all: unset; cursor: zoom-in;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
}
.cover-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.cover-cap {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 6px 32px;
  padding: 18px 0 22px;
  font-size: 14px;
}
.cover-cap h1 {
  grid-column: 1 / -1;
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--peach);
}
.cover-cap p { margin: 0; font-family: var(--serif); font-size: 17px; }
.cover-cap .n { font-family: var(--sans); font-size: 12px; opacity: .6; margin-right: 8px; }
.cover-cap .dim { opacity: .6; }
.cover-down { color: var(--cream); border-bottom-color: rgba(240,236,228,.35); white-space: nowrap; }
.cover-down:hover { color: #fff; border-bottom-color: #fff; }

/* ---------- intro ---------- */
.intro {
  background: var(--peach);
  padding: clamp(56px, 11vh, 128px) var(--pad);
  margin-bottom: clamp(56px, 10vh, 120px);
}
.intro .lead { font-family: var(--serif); font-size: clamp(24px, 2.8vw, 40px); line-height: 1.28; color: var(--forest-deep); max-width: 32ch; margin: 0; }

/* ---------- shortlist: masonry grid, images uncropped ---------- */
.wall {
  columns: 3 300px;
  column-gap: clamp(14px, 1.8vw, 28px);
  padding: 0 var(--pad) clamp(80px, 14vh, 160px);
}
.entry { break-inside: avoid; margin-bottom: clamp(24px, 3vw, 44px); }
.entry-img { all: unset; cursor: pointer; display: block; width: 100%; }
.entry-img img {
  width: 100%; height: auto;
  background: var(--cream-deep);
  min-height: 120px;              /* visible slot while the file loads */
  transition: opacity .2s;
}
.entry-img:hover img { opacity: .88; }
.entry-img:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }
.entry .cap { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding-top: 10px; font-size: 14px; }
.entry .cap b { font-weight: 500; color: var(--ink-soft); font-size: 12px; }
.entry .cap i { font-family: var(--serif); color: var(--terracotta-deep); }

/* ---------- section divider ---------- */
.divider {
  display: flex; justify-content: space-between;
  margin: 0 var(--pad) clamp(28px, 5vh, 56px);
  padding-top: 14px; border-top: 1px solid var(--rule);
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-soft);
}

.divider.big { align-items: baseline; padding-top: 18px; }
.divider.big h2 { font-style: normal; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.1; color: var(--forest-deep); }

/* ---------- plates: one entry per screen, photograph beside its words ---------- */
.plate {
  --bar: calc(58px + var(--notice-h));
  min-height: calc(100vh - var(--bar)); min-height: calc(100svh - var(--bar));
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
  padding: clamp(24px, 4vh, 48px) var(--pad);
  margin-bottom: clamp(48px, 10vh, 120px);
}
.plate-img {
  all: unset; cursor: zoom-in;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: 0;
}
.plate-img img {
  width: auto; height: auto;
  max-width: 100%;
  max-height: calc(100vh - 180px); max-height: calc(100svh - 180px);
  background: var(--cream-deep);
  min-width: 200px; min-height: 200px;   /* placeholder until the file exists */
}
.plate-img::after {
  content: "Click to enlarge";
  font-size: 12px; letter-spacing: .06em; color: var(--ink-soft);
  opacity: 0; transition: opacity .2s;
}
.plate-img:hover::after, .plate-img:focus-visible::after { opacity: 1; }
.label { max-width: 58ch; }
.label .num { font-family: var(--serif); font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.label .place { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta-deep); margin-bottom: 6px; }
.label .name { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; color: var(--forest-deep); }
.label .title { font-family: var(--serif); font-style: italic; font-size: 18px; margin-top: 6px; }
.label .sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.label .ig { display: inline-block; margin-top: 8px; font-size: 13px; }
.statement {
  position: relative;
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: clamp(16px, 1.25vw, 19px); line-height: 1.55;
  color: var(--forest);
}
/* opening mark hangs in the margin so the text keeps a clean left edge */
.statement p:first-of-type::before {
  content: "\201C";
  position: absolute; left: -0.62em; top: 14px;
  font-size: 2.6em; line-height: 1; color: var(--terracotta);
}
.statement p:last-of-type::after { content: "\201D"; color: var(--terracotta); }
/* book titles: italic in the statement, roman inside the italic citation */
.statement cite { font-style: italic; }
.statement blockquote cite { font-style: normal; }
.statement blockquote {
  margin: 1em 0 0; padding-left: 14px; border-left: 2px solid var(--peach);
  font-size: .88em; font-style: italic; color: var(--ink-soft);
}

/* ---------- about ---------- */
.about {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 72px);
  padding: 0 var(--pad) clamp(96px, 16vh, 180px);
  max-width: calc(1280px + 2 * var(--pad)); margin: 0 auto;
}
.about > h2 { font-size: 26px; color: var(--forest-deep); }
.about-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; }
.about-body .lead { grid-column: 1 / -1; font-family: var(--serif); font-size: 20px; line-height: 1.5; max-width: 40ch; }
.about-body h3 { font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta-deep); margin-bottom: 10px; font-weight: 500; }
.about-body h3.mt { margin-top: 28px; }
.about-body p { color: var(--ink-soft); }
.judges { grid-column: 1 / -1; }
.judges dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 56px; }
.judges dt { font-family: var(--serif); font-size: 16px; }
.judges dd { margin: 0; color: var(--ink-soft); }

/* ---------- footer ---------- */
.foot { background: var(--forest-deep); color: var(--cream); padding: 80px var(--pad) 44px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 64px; align-items: start; max-width: 1280px; margin: 0 auto; }
.foot h4 { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--peach); font-size: 14px; margin: 0 0 16px; letter-spacing: .04em; }
.foot h4.mt { margin-top: 36px; }
.foot p, .foot a { color: rgba(240,236,228,.82); font-size: 15px; line-height: 1.6; }
.foot a { border-bottom-color: rgba(230,196,173,.35); color: var(--peach); }
.foot a:hover { color: #fff; border-bottom-color: #fff; }
.foot .narrow { max-width: 360px; }
.foot .small { margin-top: 14px; font-size: 14px; }
.foot .aside { margin-top: 18px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--peach); }
.foot-title { font-family: var(--serif); font-size: 28px; color: var(--cream); margin: 0 0 14px; line-height: 1.15; font-weight: 500; }
.foot-title em { font-style: italic; }
.partner { display: inline-block; border: none; }
.partner img { height: 56px; width: auto; max-width: 220px; object-fit: contain; filter: brightness(0) invert(1) opacity(.92); transition: filter .15s; }
.partner:hover img { filter: brightness(0) invert(1) opacity(1); }
.partner.host img { height: 88px; max-width: 200px; }
.partner.agitate img { height: 76px; }
.partner-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.colophon {
  max-width: 1280px; margin: 64px auto 0; padding-top: 28px;
  border-top: 1px solid rgba(240,236,228,.15);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  font-size: 13px; color: rgba(240,236,228,.55); letter-spacing: .04em;
}
.colophon nav { display: flex; gap: 24px; flex-wrap: wrap; }
.colophon a { font-size: 13px; color: rgba(240,236,228,.75); border-bottom-color: rgba(240,236,228,.25); }

/* ---------- lightbox ---------- */
dialog.lb {
  border: none; padding: 0; margin: 0;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  background: var(--night); color: #eee;
}
dialog.lb[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
dialog.lb::backdrop { background: var(--night); }
.lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 20px 20px 0; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 20px 18px; font-size: 14px; }
.lb-cap em { font-family: var(--serif); }
.lb-cap .dim { opacity: .6; }
.lb-ctl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lb-count { font-size: 12px; opacity: .6; margin-right: 8px; font-variant-numeric: tabular-nums; }
.lb button { all: unset; cursor: pointer; padding: 8px 14px; border: 1px solid rgba(255,255,255,.3); font-size: 13px; letter-spacing: .04em; }
.lb button:hover { background: rgba(255,255,255,.1); }
.lb button:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; }

/* ---------- shortlist detail: photograph beside its statement ---------- */
dialog.dt {
  border: none; padding: 0; margin: 0;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  background: var(--paper); color: var(--ink);
}
dialog.dt[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
dialog.dt::backdrop { background: rgba(23,21,19,.6); }
.dt-inner {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 72px); align-items: center;
  padding: clamp(24px, 4vh, 48px) var(--pad) 0; min-height: 0;
}
.dt-img { display: flex; justify-content: center; align-items: center; min-height: 0; height: 100%; }
.dt-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dt-text { max-height: 100%; overflow-y: auto; padding: 4px 4px 4px 40px; }   /* room for the hanging quote mark */
.dt-text .label { max-width: 58ch; }
.dt-ctl { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px var(--pad) 18px; }
.dt button { all: unset; cursor: pointer; padding: 8px 14px; border: 1px solid var(--rule); font-size: 13px; letter-spacing: .04em; color: var(--ink); }
.dt button:hover { background: var(--cream-deep); }
.dt button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* ---------- link to a photographer's other submissions ---------- */
.more-link {
  display: inline-block; margin-top: 22px;
  font-size: 14px; letter-spacing: .02em;
  color: var(--terracotta-deep); border-bottom-color: rgba(166,85,56,.45);
}

/* ---------- photographer view: every submission, photograph beside statement ---------- */
dialog.pg {
  border: none; padding: 0; margin: 0;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  background: var(--paper); color: var(--ink); overflow-y: auto;
}
dialog.pg::backdrop { background: rgba(23,21,19,.6); }
.pg-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 14px var(--pad); background: var(--paper); border-bottom: 1px solid var(--rule);
}
.pg-kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta-deep); }
.pg-head h2 { font-size: clamp(22px, 2.4vw, 32px); color: var(--forest-deep); }
.pg button { all: unset; cursor: pointer; padding: 8px 14px; border: 1px solid var(--rule); font-size: 13px; letter-spacing: .04em; }
.pg button:hover { background: var(--cream-deep); }
.pg button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.pg-item {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 72px); align-items: center;
  padding: clamp(28px, 5vh, 56px) var(--pad);
  min-height: calc(100vh - 80px); min-height: calc(100dvh - 80px);
}
.pg-item + .pg-item { border-top: 1px solid var(--rule); }
.pg-img { display: flex; justify-content: center; }
.pg-img img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
.pg-item .label { padding-left: 40px; }   /* room for the hanging quote mark */

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .bar nav { gap: 16px; }
  .notice { font-size: 13px; }
  .bar .brand span { display: none; }
  .bar nav .hide-sm { display: none; }
  .cover { padding: calc(56px + var(--notice-h)) 0 0; }
  .cover-cap { grid-template-columns: 1fr; padding-inline: var(--pad); }
  .cover-down { justify-self: start; margin-top: 10px; }
  .about, .about-body, .judges dl { grid-template-columns: 1fr; }
  /* on phones: photograph edge to edge, words beneath */
  .plate { display: block; min-height: 0; padding: 0; }
  .plate-img img { max-height: none; width: 100%; min-width: 0; }
  .plate-img::after { display: none; }
  .plate .label { padding: 20px var(--pad) 0; max-width: none; }
  .statement p:first-of-type::before { position: static; font-size: 1.7em; vertical-align: -0.3em; margin-right: 3px; }
  .foot-grid { grid-template-columns: 1fr; gap: 40px; }
  .lb-foot { flex-direction: column; align-items: flex-start; }
  dialog.dt[open] { display: block; overflow-y: auto; }
  .pg-item { display: block; min-height: 0; padding: 0 0 36px; }
  .pg-img img { width: 100%; max-height: none; }
  .pg-item .label { padding: 20px var(--pad) 0; }
  .dt-inner { display: block; padding: 0; }
  .dt-img { height: auto; }
  .dt-img img { width: 100%; max-height: none; }
  .dt-text { max-height: none; overflow: visible; padding: 20px var(--pad) 0; }
  .dt-ctl { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--rule); }
}
@media (max-width: 420px) {
  .bar { gap: 12px; font-size: 12px; letter-spacing: .02em; }
  .bar nav { gap: 12px; }
  .bar .brand { font-size: 14px; }
}
@media (max-width: 340px) {
  .bar .brand { font-size: 13px; }
  .bar nav { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
