/* The Inner Press · web app */

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #d2d2d7;
  --fill: #e8e8ed;
  --accent: #c8102e;
  --link: #0066cc;
  --button: #0071e3;
  --danger: #d70015;
  --paper: #fbfaf7;
  --ink: #111111;
  --band: #111111;
  --radius: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "New York", ui-serif, Georgia, "Times New Roman", serif;
  --masthead: "Bodoni 72", "Didot", "Bodoni MT", Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #8e8e93;
    --line: #38383a;
    --fill: #2c2c2e;
    --accent: #ff453a;
    --link: #2997ff;
    --danger: #ff453a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.45; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--button); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.noscript { padding: 24px; text-align: center; }

.splash { min-height: 100vh; display: grid; place-content: center; gap: 14px; justify-items: center; color: var(--muted); }
.splash img { border-radius: 16px; }

/* Shell */
.shell { min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.top .brand img { width: 28px; height: 28px; border-radius: 7px; }
.top .spacer { flex: 1; }
.main { width: min(760px, 100% - 32px); margin: 8px auto 0; }
.wide .main { width: min(1100px, 100% - 32px); }

.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 30px rgba(0,0,0,.14), 0 0 0 0.5px var(--line);
}
.tabs a {
  display: grid; justify-items: center; gap: 2px; min-width: 76px; padding: 7px 12px; border-radius: 999px;
  color: var(--text); font-size: 11px; font-weight: 500; white-space: nowrap;
}
@media (max-width: 420px) { .tabs a { min-width: 0; padding: 7px 10px; font-size: 10.5px; } }
@media (max-width: 350px) { .tabs { width: calc(100% - 16px); justify-content: space-between; } .tabs a { padding: 6px 4px; font-size: 10px; } }
.row select { max-width: 62%; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { background: var(--fill); }

/* Type */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.large-title { font-size: clamp(34px, 6vw, 44px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; margin: 6px 0 18px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; margin: 26px 4px 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.footnote { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }

/* Groups (inset lists like iOS) */
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 48px;
  border: 0; background: none; width: 100%; text-align: left; color: var(--text);
}
.row + .row { border-top: 0.5px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .value { color: var(--muted); font-size: 15px; }
button.row, a.row { cursor: pointer; }
button.row:hover, a.row:hover { background: color-mix(in srgb, var(--fill) 50%, transparent); }
.chev::after { content: "›"; color: var(--faint); font-size: 22px; line-height: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#b8b8bd, #8e8e93); color: #fff; font-weight: 600; flex: none; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 14px 20px; font-weight: 600; cursor: pointer;
  background: var(--text); color: var(--bg); width: 100%;
}
.btn.blue { background: var(--button); color: #fff; }
.btn.apple { background: #000; color: #fff; border-radius: 999px; padding: 12px 20px; font-weight: 500; }
@media (prefers-color-scheme: dark) { .btn.apple { background: #fff; color: #000; } }
.btn.plain { background: var(--fill); color: var(--text); }
.btn.small { width: auto; padding: 8px 14px; border-radius: 999px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: default; }
.link-btn { border: 0; background: none; color: var(--link); padding: 0; cursor: pointer; font-size: inherit; }
.danger { color: var(--danger) !important; }
.field { display: block; padding: 4px 16px; }
.field + .field { border-top: 0.5px solid var(--line); }
.field input, .field textarea, .field select {
  width: 100%; border: 0; background: none; padding: 11px 0; outline: none; resize: vertical;
}
.field textarea { min-height: 160px; line-height: 1.5; }
.field label { display: block; font-size: 12px; color: var(--muted); padding-top: 8px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--fill); border-radius: 12px; }
.seg button { border: 0; padding: 8px; border-radius: 9px; background: none; cursor: pointer; font-size: 15px; }
#lg { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 600; }
.stack { display: grid; gap: 12px; }
.error { color: var(--danger); font-size: 15px; margin: 10px 4px 0; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); }
.auth-card .logo { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 18px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.auth-card h1 { text-align: center; font-size: 30px; }
.auth-card .lead { text-align: center; color: var(--muted); margin: 8px 0 22px; }
.store-hint { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }

/* Cards on the home screen */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.next { display: flex; gap: 14px; align-items: center; }
.next .badge { width: 44px; height: 44px; border-radius: 12px; background: var(--fill); display: grid; place-items: center; flex: none; }
.issue-card { display: block; background: var(--paper); color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 30px -16px rgba(0,0,0,.35); }
.issue-card .inner { padding: 18px 20px 22px; }
.issue-card .photo { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: #ddd; }
.issue-card h2 { font-family: var(--serif); font-size: 26px; line-height: 1.15; margin-top: 8px; }
.archive a { color: var(--text); }
.poll-option { position: relative; display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--fill); cursor: pointer; overflow: hidden; }
.poll-option .bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--button) 22%, transparent); }
.poll-option span { position: relative; }
.poll-option.mine { outline: 2px solid var(--button); }

/* Newspaper (reading view) */
.paper { background: var(--paper); color: var(--ink); border-radius: 6px; padding: clamp(18px, 4vw, 44px); box-shadow: 0 20px 50px -24px rgba(0,0,0,.4); }
@media (prefers-color-scheme: dark) { .paper { box-shadow: none; } }
.mast { text-align: center; }
.mast .tag { font-size: 9px; font-weight: 600; letter-spacing: .3em; }
.mast .rule { border-top: 0.6px solid var(--ink); margin: 8px 0; }
.mast .title { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mast .title img { max-height: 54px; max-width: 90px; object-fit: contain; }
.mast h1 { font-family: var(--masthead); font-weight: 700; font-size: clamp(34px, 7.5vw, 66px); line-height: 1.05; letter-spacing: -0.01em; }
.mast .double { border-top: 2.8px solid var(--ink); border-bottom: 0.6px solid var(--ink); height: 6px; margin: 8px 0 6px; }
.mast .band { background: var(--band); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .08em; display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 520px) {
  .mast .band .count { display: none; }
  .mast .tag { letter-spacing: .14em; font-size: 8px; }
}
.paper[data-theme="sport"] { --band: #0d783d; }
.paper[data-theme="business"] { --band: #122e61; }
.paper[data-theme="boulevard"] { --band: #d6121f; }
.paper[data-theme="pop"] { --band: #1a296b; }
.paper[data-theme="teen"] { --band: #ed0d8c; }
.paper[data-theme="sport"] .mast h1 { font-family: "Avenir Next Condensed", "Arial Narrow", var(--sans); font-style: italic; font-weight: 800; }
.paper[data-theme="business"] .mast h1, .paper[data-theme="business"] .story h2 { font-family: "Avenir Next", var(--sans); font-weight: 700; }
.paper[data-theme="teen"] .mast h1, .paper[data-theme="teen"] .story h2 { font-family: "Futura", "Avenir Next Condensed", var(--sans); font-weight: 800; }
.stories { columns: 1; column-gap: 28px; margin-top: 22px; }
@media (min-width: 900px) { .wide .stories { columns: 3; column-rule: 0.5px solid #cfcac0; } .wide .stories .lead { column-span: all; } }
.story { break-inside: avoid; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 0.5px solid #cfcac0; }
.story .section { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--band); }
.story h2 { font-family: var(--serif); font-size: 22px; line-height: 1.18; margin: 6px 0; }
.story.lead h2 { font-size: clamp(28px, 4.5vw, 40px); }
.story .subtitle { font-family: var(--serif); font-size: 17px; color: #555; margin-bottom: 6px; }
.story .by { font-size: 12px; color: #6b6b6b; margin-bottom: 8px; }
.story .body { font-family: var(--serif); font-size: 16.5px; line-height: 1.55; white-space: pre-line; hyphens: auto; -webkit-hyphens: auto; text-align: justify; }
.story.lead .body { font-size: 17.5px; }
.story figure { margin: 6px 0 12px; }
.story figure img { width: 100%; border-radius: 2px; background: #e5e1d8; }
.story figcaption { font-size: 12px; color: #6b6b6b; margin-top: 4px; }
.group-head { column-span: all; border-top: 2.5px solid var(--band); padding-top: 6px; margin: 4px 0 12px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.talk { display: flex; gap: 18px; margin-top: 12px; font-family: var(--sans); font-size: 14px; }
.talk button { border: 0; background: none; padding: 0; cursor: pointer; color: #6b6b6b; display: inline-flex; gap: 6px; align-items: center; }
.talk button.on { color: #d70015; }
.letter { margin-top: 10px; padding-left: 10px; border-left: 2px solid #cfcac0; font-family: var(--serif); font-style: italic; font-size: 15px; }
.letter small { display: block; font-family: var(--sans); font-style: normal; font-size: 12px; color: #6b6b6b; }
.box { break-inside: avoid; border-top: 2.5px solid var(--band); padding-top: 8px; margin-bottom: 18px; font-family: var(--sans); }
.box h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.box .barrow { display: grid; gap: 4px; margin: 8px 0; font-size: 13px; }
.box .barline { height: 6px; background: #e3ded4; }
.box .barline i { display: block; height: 100%; background: var(--band); }
.paper-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin: 0 0 12px; }

/* Sheets */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); display: grid; align-items: end; justify-items: center; }
@media (min-width: 700px) { .sheet-back { align-items: center; } }
.sheet { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet { border-radius: 22px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 17px; }

/* Photos in the editor */
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: var(--fill); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.add-photo { width: 92px; height: 92px; border-radius: 12px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 13px; text-align: center; }

#toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 60; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 15px; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Print: the issue as a newspaper */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .top, .tabs, .paper-actions, .talk, .letter, #toast { display: none !important; }
  .main, .wide .main { width: auto; margin: 0; }
  .paper { box-shadow: none; padding: 0; background: #fff; }
  .stories { columns: 3 !important; column-gap: 7mm; column-rule: 0.3pt solid #999; }
  .story.lead { column-span: all; }
  .story .body { font-size: 9.5pt; line-height: 1.38; }
  .story h2 { font-size: 13pt; }
  .story.lead h2 { font-size: 24pt; }
  .story.lead .body { columns: 2; column-gap: 7mm; font-size: 10pt; }
  .mast h1 { font-size: 40pt; }
  .story, .box { page-break-inside: avoid; }
}

/* Parity with the app: larger text, quiz, crossword, results, year review, captions */
.paper.comfort .story .body { font-size: 20px; line-height: 1.6; }
.paper.comfort .story h2 { font-size: 26px; }
.quiz-opt { display: block; width: 100%; text-align: left; border: 0.5px solid #cfcac0; background: none; padding: 7px 10px; margin-top: 6px; border-radius: 8px; font: 14px var(--sans); color: var(--ink); cursor: pointer; }
.quiz-opt.right { background: #d8f0dc; border-color: #34a853; }
.quiz-opt.wrong { background: #fbe0e0; border-color: #d70015; }
.xw { display: grid; gap: 0; }
.xw i, .xw b { aspect-ratio: 1; position: relative; display: grid; place-items: center; font: 600 13px var(--sans); }
.xw b { border: 0.7px solid var(--ink); margin: -0.35px; background: #fff; }
.xw sup { position: absolute; top: 1px; left: 2px; font-size: 7px; font-weight: 500; }
.xw-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.xw-row span { flex: 1; }
.xw-row input { width: 110px; border: 0.5px solid #cfcac0; border-radius: 6px; padding: 4px 6px; font: 600 13px var(--sans); text-transform: uppercase; background: #fff; color: var(--ink); }
.xw-row input.right { border-color: #34a853; background: #e6f6e9; }
.res { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; font-size: 9px; margin-left: 4px; background: #111; }
.res-S { background: var(--band); } .res-U { background: #888; }
.slides { display: grid; gap: 14px; margin-top: 12px; }
.slide { border-radius: 24px; color: #fff; padding: 34px 26px; min-height: 260px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.slide .big { font-size: clamp(40px, 9vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.slide .big span { font-size: 0.4em; font-weight: 600; }
.slide-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.slide-pics img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; background: rgba(255,255,255,.2); }
.cap { width: 92px; margin-top: 6px; font-size: 12px; border: 0; border-bottom: 0.5px solid var(--line); background: none; padding: 3px 0; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.row select { max-width: 62%; }
.mast .dedication { text-align: center; font-family: var(--serif); font-style: italic; font-size: 17px; margin: 4px 0 8px; }
.week-q { column-span: all; font-family: var(--serif); font-size: 20px; font-weight: 700; margin: 0 0 12px; }
