/* River City Press — site styles */

:root {
  --brand-red: #e63d2a; /* the red in the River City Press banner */
  --paper: #faf7f0;
  --paper-2: #f1ece0;
  --surface: #ffffff;
  --ink: #1d1b18;
  --ink-2: #57524a;
  --line: #e2dccd;
  --river: #0f4c5c;
  --river-2: #16697e;
  --river-ink: #ffffff;
  --sun: #e8a33d;
  --danger: #b3261e;
  --success: #1e6b3a;
  --facebook: #1877f2;
  --shadow: 0 1px 2px rgb(29 27 24 / 6%), 0 8px 24px rgb(29 27 24 / 8%);
  --radius: 10px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15191b;
    --paper-2: #1c2224;
    --surface: #20272a;
    --ink: #eeeae1;
    --ink-2: #aaa59b;
    --line: #333b3e;
    --river: #6fbfd1;
    --river-2: #8fd0de;
    --river-ink: #0b2a32;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    --danger: #f2877f;
    --success: #7fd19a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--river); text-underline-offset: 3px; }
a:hover { color: var(--river-2); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 1.5vw + 1rem, 1.9rem); font-weight: 700; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code { font-size: .95em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap--narrow { max-width: 780px; }
.wrap--tiny { max-width: 520px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.inline { display: inline; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .75em; }

/* ----- Masthead ----- */
.masthead { background: var(--paper); border-bottom: 3px double var(--ink); }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand:hover { color: var(--ink); }
.brand__name { font-family: var(--serif); font-weight: 900; font-size: clamp(1.7rem, 3vw + .8rem, 2.4rem); line-height: 1; letter-spacing: -0.02em; }
.brand__tag { display: flex; align-items: center; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); margin-top: 7px; }
/* Red dots between the words, as in the printed banner ("THE · GOOD · NEWS · PAPER"). */
.brand__dot { overflow: hidden; color: transparent; width: .38em; height: .38em; margin: 0 .5em 0 .36em; border-radius: 50%; background: var(--brand-red); flex: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 -10px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 500; padding: 8px 10px; border-radius: 6px; font-size: .95rem; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--river); box-shadow: inset 0 -2px 0 var(--river); border-radius: 0; }
.nav__admin { color: var(--river) !important; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  padding: 12px 18px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); min-height: 44px;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn--primary { background: var(--river); border-color: var(--river); color: var(--river-ink); }
.btn--primary:hover { background: var(--river-2); border-color: var(--river-2); color: var(--river-ink); }
.btn--facebook { background: var(--facebook); border-color: var(--facebook); color: #fff; width: 100%; }
.btn--facebook:hover { background: #0d65d9; color: #fff; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); color: var(--danger); }
.btn--small { padding: 7px 12px; min-height: 36px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--river); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ----- Hero ----- */
.hero { padding: 48px 0 56px; border-bottom: 1px solid var(--line); }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero__title { margin-bottom: .35em; }
.hero__lede { font-family: var(--serif); font-size: 1.3rem; color: var(--ink-2); max-width: 32ch; }
.hero__meta { color: var(--ink-2); font-size: .9rem; }
.hero__paper { display: block; justify-self: center; max-width: 440px; width: 100%; transform: rotate(1.2deg); transition: transform .25s ease; }
.hero__paper img { box-shadow: var(--shadow), 0 20px 50px rgb(29 27 24 / 18%); border-radius: 2px; background: #fff; }
.hero__paper:hover { transform: rotate(0) translateY(-4px); }

/* ----- Sections ----- */
.section { padding: 48px 0; }
.section--tint { background: var(--paper-2); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section__head h2 { margin: 0; }
.page-head { margin-bottom: 28px; }
.page-head p { color: var(--ink-2); }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel--center { text-align: center; }
.panel--center .btn { margin-top: 8px; }
.panel__contact { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.stats { list-style: none; padding: 0; margin: 24px 0 0; display: flex; gap: 28px; flex-wrap: wrap; }
.stats li { color: var(--ink-2); font-size: .9rem; }
.stats strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--ink); line-height: 1.1; }

/* ----- Edition cards ----- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 20px; }
.card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.card__cover { display: block; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 8px; transition: transform .2s ease, box-shadow .2s ease; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__cover { transform: translateY(-3px); box-shadow: var(--shadow), 0 12px 28px rgb(29 27 24 / 14%); }
.card__date { font-weight: 600; }
.card:hover { color: var(--river); }
.years { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.years a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; }
.years a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.month { font-size: 1.25rem; margin: 36px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.empty { color: var(--ink-2); padding: 24px 0; }

/* ----- Reader ----- */
.reader__bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.reader__bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.reader__title h1 { font-size: 1.35rem; margin: 0; }
.reader__title p { margin: 0; color: var(--ink-2); font-size: .88rem; }
.reader__tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reader__count { font-size: .88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: 500 .82rem var(--sans); padding: 7px 11px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.reader__body { display: grid; grid-template-columns: 112px 1fr; gap: 24px; padding-top: 24px; padding-bottom: 48px; }
.thumbs { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding: 2px 4px 2px 2px; }
.thumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.thumbs a { display: block; padding: 5px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: .75rem; line-height: 1.5; text-align: center; transition: background-color .15s ease; }
.thumbs img { width: 100%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 15%); margin-bottom: 4px; opacity: .6; outline: 3px solid transparent; transition: opacity .15s ease; }
.thumbs span { display: inline-block; min-width: 1.9em; padding: 0 6px; border-radius: 999px; }
.thumbs a:hover img { opacity: 1; }
/* The page being read stands out: full brightness, a thick outline, tinted tile and a filled page number. */
.thumbs a[aria-current="page"] { background: color-mix(in srgb, var(--river) 22%, transparent); }
.thumbs a[aria-current="page"] img { opacity: 1; outline-color: var(--river); }
.thumbs a[aria-current="page"] span { background: var(--river); color: var(--river-ink); font-weight: 700; }
.pages { min-width: 0; overflow-x: auto; }
.page { margin: 0 auto 12px; scroll-margin-top: 84px; }
.page img { width: 100%; background: #fff; box-shadow: var(--shadow); }
.sheet { position: relative; container-type: inline-size; }
.sheet img { user-select: none; -webkit-user-select: none; }
/* Invisible text laid over the page image so it can be selected and copied. */
.textlayer { position: absolute; inset: 0; z-index: 0; overflow: hidden; font: 1px/1 Arial, Helvetica, sans-serif; color: transparent; }
.textlayer span { position: absolute; white-space: pre; transform-origin: 0 0; cursor: text; }
.textlayer ::selection { background: rgb(22 105 126 / 35%); color: transparent; }
.textlayer br::selection { background: transparent; }
.textlayer__end { position: absolute; inset: 100% 0 0; z-index: -1; user-select: none; cursor: default; }
.textlayer--selecting .textlayer__end { top: 0; }
/* Links: ones found in the text, and hyperlinks exported from InDesign.
   No tint; just a pointer cursor, plus an underline on hover for text links. */
.textlayer a, .hotspot { color: transparent; text-decoration: none; cursor: pointer; }
.hotspot { position: absolute; z-index: 1; }
.textlayer a:hover { text-decoration: underline; text-decoration-color: var(--river-2); text-decoration-thickness: .08em; }
.textlayer a:focus-visible, .hotspot:focus-visible { outline: 2px solid var(--river-2); outline-offset: 1px; }
/* Bigger invisible tap targets on touch screens, where links are small at full-page zoom. */
@media (pointer: coarse) {
  .textlayer a { position: relative; }
  .textlayer a::after, .hotspot::after { content: ''; position: absolute; inset: -10px -4px; }
}
.page figcaption { text-align: center; font-size: .72rem; line-height: 1.2; color: var(--ink-2); margin-top: 3px; }
[data-zoom="fit"] .page { max-width: min(100%, calc((100vh - 130px) * var(--ar, 0.72))); }
[data-zoom="wide"] .page { max-width: 1000px; }
/* Two-page spreads on wide screens: pages 1–2, 3–4, 5–6… side by side,
   meeting in the middle like an opened paper. */
.seg--spread { display: none; }
@media (min-width: 1000px) {
  .seg--spread { display: inline-flex; }
  /* The spread gets as much width as it needs to reach full Fit height (sidebar +
     gap + two pages + spine + side padding), centred; Large may use the whole window. */
  [data-spread="on"][data-zoom="fit"] .reader__body { max-width: calc(176px + 24px + 4px + 2 * (100vh - 130px) * var(--ar, 0.72) + 32px); }
  [data-spread="on"][data-zoom="wide"] .reader__body { max-width: none; }
  [data-spread="on"] .pages { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; align-items: start; }
  [data-spread="on"] .page { width: 100%; margin: 0 0 12px; }
  [data-spread="on"] .page:nth-child(odd) { justify-self: end; }
  [data-spread="on"] .page:nth-child(even) { justify-self: start; }
  [data-spread="on"] .pager { grid-column: 1 / -1; }
  /* Sidebar thumbnails in pairs too, matching the spreads. */
  [data-spread="on"] .reader__body { grid-template-columns: 176px 1fr; }
  [data-spread="on"] .thumbs ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 0; row-gap: 8px; }
  /* Both pages of the current spread share one highlighted tile. */
  [data-spread="on"] .thumbs li:nth-child(odd) a { border-radius: 6px 0 0 6px; padding-right: 2px; }
  [data-spread="on"] .thumbs li:nth-child(even) a { border-radius: 0 6px 6px 0; padding-left: 2px; }
  [data-spread="on"] .thumbs a.is-pair { background: color-mix(in srgb, var(--river) 22%, transparent); }
  [data-spread="on"] .thumbs a.is-pair img { opacity: 1; outline-color: var(--river); }
  [data-spread="on"] .thumbs a.is-pair span { background: var(--river); color: var(--river-ink); font-weight: 700; }
}
}
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager__link { display: flex; flex-direction: column; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.pager__link small { font: 500 .8rem var(--sans); color: var(--ink-2); }
.pager__link--next { text-align: right; margin-left: auto; }

/* ----- Form fields ----- */
input[type="text"], input[type="date"] {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input:focus { outline: none; border-color: var(--river); box-shadow: 0 0 0 3px color-mix(in srgb, var(--river) 25%, transparent); }

/* ----- About / contact ----- */
.prose { font-size: 1.06rem; }
.prose .lede { font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; }
.prose h2 { margin-top: 1.5em; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--paper-2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-size: .9rem; }
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 560px) { .contact { grid-template-columns: 1fr; } }
.contact__item { display: flex; flex-direction: column; gap: 4px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.contact__item span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }
.contact__item strong { font-family: var(--serif); font-size: 1.15rem; }
.contact__item:hover { border-color: var(--river); color: var(--river); }

/* ----- Admin ----- */
.admin { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.field { margin-bottom: 20px; }
.field label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--ink-2); }
.hint { font-size: .86rem; color: var(--ink-2); margin: 6px 0 0; }
.hint--warn { color: #9a5b00; }
details.hint summary { cursor: pointer; color: var(--river); font-weight: 500; }
details.hint ol { padding-left: 20px; margin: 8px 0; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--paper); font-weight: 400; overflow-wrap: anywhere; }
.drop strong { color: var(--river); font-size: 1.05rem; }
.drop span { font-size: .88rem; color: var(--ink-2); }
.drop--over, .drop:hover { border-color: var(--river); background: color-mix(in srgb, var(--river) 6%, var(--paper)); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 3px solid var(--sun); outline-offset: 2px; }
.preview { margin-bottom: 16px; }
.preview__summary { font-size: .9rem; color: var(--ink-2); }
.preview__pages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; max-height: 320px; overflow-y: auto; }
.preview__pages li { font-size: .72rem; color: var(--ink-2); text-align: center; }
.preview__pages img { border: 1px solid var(--line); background: #fff; margin-bottom: 2px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--river); }
.progress { margin-bottom: 14px; }
.progress__bar { height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: var(--river); transition: width .2s ease; }
.progress p { font-size: .88rem; color: var(--ink-2); margin: 6px 0 0; }
.alert { padding: 12px 14px; border-radius: 8px; background: var(--paper-2); border: 1px solid var(--line); font-size: .92rem; }
.alert--error { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.alert--success { border-color: var(--success); color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.manage { list-style: none; padding: 0; margin: 0; max-height: 640px; overflow-y: auto; }
.manage li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.manage img { width: 44px; border: 1px solid var(--line); background: #fff; flex: none; }
.manage__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.manage__info a { font-weight: 600; }
.manage__info small { color: var(--ink-2); }
.manage form { margin: 0; }
.copyable { user-select: all; font-size: 1.1rem; }

/* ----- Footer ----- */
.footer { background: var(--ink); color: var(--paper); padding: 40px 0 32px; margin-top: auto; font-size: .92rem; }
.footer a, .footer .linklike { color: var(--paper); }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer__name { font-family: var(--serif); font-weight: 900; font-size: 1.4rem; margin-bottom: 6px; }
.footer p { opacity: .85; }
.footer__meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; opacity: .85; }
@media (prefers-color-scheme: dark) {
  .footer { background: #0d1011; color: var(--ink); }
  .footer a, .footer .linklike { color: var(--ink); }
}

/* ----- Responsive ----- */
@media (max-width: 860px) {
  .hero { padding: 28px 0 40px; }
  .hero__inner, .split, .admin, .footer__inner { grid-template-columns: 1fr; }
  .hero__paper { max-width: 320px; order: -1; }
  .reader__body { grid-template-columns: 1fr; padding-top: 12px; }
  .thumbs { position: sticky; top: var(--bar-h, 96px); z-index: 5; max-height: none; overflow-x: auto; overflow-y: hidden; background: var(--paper); margin: 0 -16px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
  .thumbs ol { flex-direction: row; gap: 8px; }
  .thumbs li { flex: 0 0 46px; }
  .thumbs a span { display: none; }
  .thumbs a { padding: 3px; }
  .seg { display: none; }
  [data-zoom] .page { max-width: 100%; width: auto; }
  .page { scroll-margin-top: 200px; margin-bottom: 20px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .nav { width: 100%; }
  .reader__title h1 { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
