/* ============================================================
   GC E-Paper reader
   Scoped under .gc-ep so nothing leaks into the rest of the site.
   Tokens match the masthead used elsewhere (navy / gold / red).
   ============================================================ */
.gc-ep {
  --ep-navy: #052962;
  --ep-gold: #c8a951;
  --ep-red:  #ce242c;
  --ep-ink:  #141618;
  --ep-line: #e6e4df;
  --ep-muted:#5b6472;
  --ep-paper:#faf9f6;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 56px;
  color: var(--ep-ink);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- masthead ---- */
.gc-ep-head { text-align: center; padding: 26px 0 16px; border-bottom: 2px solid var(--ep-navy); margin-bottom: 18px; }
.gc-ep-kicker { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ep-red); }
.gc-ep-title { margin: 0; font-family: "Playfair Display", Georgia, serif; color: var(--ep-navy);
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); line-height: 1.1; }
.gc-ep-date { margin: 8px 0 0; color: var(--ep-muted); font-size: .92rem; }
.gc-ep-badge { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #eee; color: var(--ep-muted); font-size: .66rem; letter-spacing: .06em; }
.gc-ep-badge--on { background: var(--ep-navy); color: #fff; }

/* ---- archive ---- */
.gc-ep-archive { display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--ep-line); overflow-x: auto; }
.gc-ep-archive__label { flex: 0 0 auto; font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ep-muted); }
.gc-ep-archive ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.gc-ep-archive li { flex: 0 0 auto; }
.gc-ep-archive a { display: block; padding: 5px 11px; border: 1px solid var(--ep-line);
  border-radius: 999px; font-size: .82rem; text-decoration: none; color: var(--ep-navy); white-space: nowrap; }
.gc-ep-archive a:hover { border-color: var(--ep-gold); }
.gc-ep-archive a.is-current { background: var(--ep-navy); color: #fff; border-color: var(--ep-navy); }

/* ---- preview: cover beside the offer ----
   A broadsheet is ~1.65x taller than wide. Rendered at container width that is a two-metre
   scroll of unreadable newsprint before anyone reaches the price, so the cover is capped and
   the offer sits next to it. */
.gc-ep-preview { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 34px; align-items: start; }
.gc-ep-cover { margin: 0; position: relative; background: #fff; border: 1px solid var(--ep-line);
  box-shadow: 0 6px 26px rgba(5,41,98,.13); }
.gc-ep-cover img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.gc-ep-cover figcaption { padding: 9px 12px; font-size: .74rem; color: var(--ep-muted);
  border-top: 1px solid var(--ep-line); background: var(--ep-paper); text-align: center; }
.gc-ep-preview .gc-ep-wall { margin-top: 0; }

/* ---- viewer: one page at a time, fitted to the screen ---- */
.gc-ep-frame { display: flex; flex-direction: column; gap: 26px; }
.gc-ep-page { margin: 0; background: #fff; border: 1px solid var(--ep-line);
  box-shadow: 0 2px 14px rgba(5,41,98,.07); }
.gc-ep-page img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.gc-ep-page figcaption { padding: 8px 12px; font-size: .76rem; color: var(--ep-muted);
  border-top: 1px solid var(--ep-line); background: var(--ep-paper); }

/* Only applied once JS has taken over. Without it every page stays visible and stacked —
   harder to read, but still the whole newspaper rather than a page that cannot be navigated. */
.gc-ep-viewer.is-ready .gc-ep-frame { display: block; }
.gc-ep-viewer.is-ready .gc-ep-page { display: none; }
/* fit-content so the card hugs the page rather than leaving a wide white margin either
   side of a portrait broadsheet that has been scaled down to fit the window */
.gc-ep-viewer.is-ready .gc-ep-page.is-active { display: block; width: fit-content; margin: 0 auto; }
.gc-ep-viewer.is-ready .gc-ep-page img { max-height: calc(100vh - 160px); width: auto;
  max-width: 100%; margin: 0 auto; }

.gc-ep-pager { display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 16px; }
.gc-ep-nav { padding: 9px 18px; border: 1px solid var(--ep-navy); border-radius: 4px;
  background: #fff; color: var(--ep-navy); font-weight: 700; font-size: .86rem; cursor: pointer; }
.gc-ep-nav:hover:not(:disabled) { background: var(--ep-navy); color: #fff; }
.gc-ep-nav:disabled { opacity: .35; cursor: not-allowed; }
.gc-ep-counter { font-size: .86rem; color: var(--ep-muted); min-width: 116px; text-align: center; }

/* ---- thumbnails ---- */
.gc-ep-thumbs { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ep-line); }
.gc-ep-thumbs ul { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.gc-ep-thumbs a { display: block; width: 74px; text-align: center; text-decoration: none; color: var(--ep-muted); }
.gc-ep-thumbs img { width: 100%; height: auto; border: 1px solid var(--ep-line); display: block; }
.gc-ep-thumbs span { display: block; font-size: .7rem; margin-top: 3px; }
.gc-ep-thumbs a:hover img { border-color: var(--ep-gold); }
.gc-ep-thumbs a.is-current img { border-color: var(--ep-navy); box-shadow: 0 0 0 2px var(--ep-navy); }
.gc-ep-thumbs a.is-current span { color: var(--ep-navy); font-weight: 700; }

/* ---- paywall ---- */
.gc-ep-wall { margin-top: 24px; padding: 30px 24px; text-align: center;
  background: var(--ep-paper); border: 1px solid var(--ep-line); border-top: 3px solid var(--ep-gold); }
.gc-ep-wall h2 { margin: 0 0 6px; font-family: "Playfair Display", Georgia, serif;
  color: var(--ep-navy); font-size: 1.5rem; }
.gc-ep-wall > p { margin: 0 0 20px; color: var(--ep-muted); }
.gc-ep-plans { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.gc-ep-plan { flex: 0 1 220px; padding: 20px 18px; background: #fff; border: 1px solid var(--ep-line); border-radius: 6px; }
.gc-ep-plan--best { border-color: var(--ep-gold); box-shadow: 0 4px 16px rgba(200,169,81,.18); }
.gc-ep-plan__name { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ep-red); }
.gc-ep-plan__price { margin: 6px 0 2px; font-family: "Playfair Display", Georgia, serif;
  font-size: 2.1rem; color: var(--ep-navy); line-height: 1; }
.gc-ep-plan__note { margin: 0 0 14px; font-size: .78rem; color: var(--ep-muted); }
.gc-ep-btn { display: inline-block; width: 100%; padding: 10px 16px; border: 1px solid var(--ep-navy);
  border-radius: 4px; background: var(--ep-navy); color: #fff; font-weight: 700; font-size: .9rem;
  text-decoration: none; cursor: pointer; }
.gc-ep-btn:hover:not(:disabled) { background: #073a86; }
.gc-ep-btn:disabled { opacity: .5; cursor: not-allowed; }
.gc-ep-wall__soon { margin: 18px 0 0; font-size: .9rem; color: var(--ep-ink); }
.gc-ep-wall__fine { margin: 16px auto 0; max-width: 560px; font-size: .76rem; color: var(--ep-muted); line-height: 1.6; }
.gc-ep-wall__fine a { color: var(--ep-muted); }

/* Pre-launch banner, shown to signed-in staff only. Deliberately loud: the risk it guards
   against is somebody assuming the e-paper is live because they can see it. */
.gc-ep-staffnote { margin: 0 0 18px; padding: 11px 15px; border-radius: 5px;
  background: #fff4d6; border: 1px solid var(--ep-gold); border-left: 4px solid var(--ep-gold);
  font-size: .88rem; color: var(--ep-ink); }
.gc-ep-staffnote a { color: var(--ep-navy); }

.gc-ep-empty { padding: 60px 20px; text-align: center; color: var(--ep-muted); }
.gc-ep-empty h2 { font-family: "Playfair Display", Georgia, serif; color: var(--ep-navy); }

/* ---- zoom ---- */
.gc-ep-zoom { position: fixed; inset: 0; z-index: 99999; background: rgba(8,12,20,.94);
  display: flex; align-items: center; justify-content: center; overflow: auto; padding: 20px; }
.gc-ep-zoom img { max-width: none; width: auto; height: auto; cursor: zoom-out; }
.gc-ep-zoom__close { position: fixed; top: 14px; right: 18px; background: #fff; color: var(--ep-ink);
  border: 0; border-radius: 4px; padding: 7px 14px; font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
  .gc-ep-preview { grid-template-columns: 1fr; gap: 24px; }
  /* Cover stays a cover on a phone rather than growing to fill the screen. */
  .gc-ep-cover { max-width: 340px; margin: 0 auto; }
  .gc-ep-viewer.is-ready .gc-ep-page img { max-height: calc(100vh - 150px); }
}
@media (max-width: 640px) {
  .gc-ep-plan { flex: 1 1 100%; }
  .gc-ep-thumbs a { width: 58px; }
  .gc-ep-pager { gap: 10px; }
  .gc-ep-nav { padding: 8px 12px; font-size: .8rem; }
}
/* ---- free-access offer ----
   Reads as an announcement, not a paywall: gold rule and paper ground like the wall, but
   left-aligned and lighter, because it is telling the reader something good rather than
   stopping them. Sits directly under the masthead where a first-time visitor lands. */
.gc-ep-offer { margin: 18px 0 4px; padding: 16px 20px;
  background: var(--ep-paper); border: 1px solid var(--ep-line);
  border-left: 4px solid var(--ep-gold); }
.gc-ep-offer__preview { margin: 0 0 8px; padding: 4px 9px; display: inline-block;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #7a5a00; background: #fdf3d8; border: 1px solid #e8cf8a; border-radius: 3px; }
.gc-ep-offer__kicker { margin: 0 0 4px; font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 700; color: var(--ep-red); }
.gc-ep-offer__title { margin: 0 0 6px; font-family: "Playfair Display", Georgia, serif;
  font-size: 1.32rem; line-height: 1.25; color: var(--ep-navy); }
.gc-ep-offer__body { margin: 0; color: var(--ep-ink); font-size: .95rem; line-height: 1.55; }
.gc-ep-offer__note { margin: 10px 0 0; font-size: .78rem; color: var(--ep-muted); line-height: 1.55; }
.gc-ep-offer__cta { margin: 14px 0 0; }
.gc-ep-offer__cta .gc-ep-btn { width: auto; padding: 9px 22px; }

/* Standalone [gc_epaper_offer], e.g. on the homepage. */
.gc-ep--offeronly .gc-ep-offer { margin: 0; }

@media (max-width: 600px) {
  .gc-ep-offer { padding: 14px 15px; }
  .gc-ep-offer__title { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gc-ep-page, .gc-ep-btn { transition: none; }
}
