/* Daily History — reading view (story pages and the archive index).
   Loaded on top of site.css, which owns the tokens, masthead and footer. */

/* ------------------------------------------------------------- story page -- */
.article-shell { width: 100%; max-width: 46rem; margin-inline: auto; padding-inline: var(--gutter); }

.dateline {
  padding: clamp(2.2rem, 6vw, 4rem) 0 clamp(1.4rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}
.dateline .eyebrow { display: block; margin-bottom: 0.8rem; }
.dateline-date {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.8rem, 4.6vw, 2.8rem); line-height: 1;
  letter-spacing: -0.02em;
}
.dateline-count { margin-top: 0.7rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-faint); }

.story { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.story + .story { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--line); }

.story-cat {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent);
}
.story-cat::before { content: ''; width: 20px; height: 1px; background: var(--accent); }

.story-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.7rem, 4.3vw, 2.7rem); line-height: 1.06;
  letter-spacing: -0.018em; text-wrap: balance; margin: 0;
}
h1.story-title { font-size: clamp(1.95rem, 5vw, 3.1rem); }

.story-when {
  margin-top: 0.95rem; display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  font-size: 0.71rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-faint);
}
.story-when .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--accent-lo); }
.story-where { color: var(--accent); }

/* -------------------------------------------------------------- body copy -- */
.story-body {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  font-size: 1.075rem; line-height: 1.78; color: #e6ded2;
  hanging-punctuation: first last;
}
.story-body p { margin-bottom: 1.35em; max-width: var(--measure); }
.story-body p.lede { font-size: 1.22rem; line-height: 1.62; color: var(--paper); }

@media (min-width: 460px) {
  .story-body p.lede::first-letter {
    float: left; font-family: var(--serif); font-weight: 600;
    font-size: 3.4em; line-height: 0.76; padding: 0.05em 0.09em 0 0;
    color: var(--accent);
  }
}

.story-source { margin-top: 1.8rem; font-size: 0.73rem; color: var(--paper-faint); letter-spacing: 0.02em; }
.story-source a { color: var(--paper-dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.story-source a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- figures -- */
.story-fig { margin: clamp(2rem, 5vw, 3rem) 0; }
.story-fig img { display: block; width: 100%; height: auto; background: var(--ink-2); }
.fig-credit { margin-top: 0.7rem; font-size: 0.65rem; letter-spacing: 0.05em; color: var(--paper-faint); }
.fig-credit a { color: var(--paper-dim); text-decoration: none; }
.fig-credit a:hover { color: var(--accent); }

/* Let figures break the measure on wide screens — the asymmetry the layout is
   built on, applied to the reading column. */
@media (min-width: 1000px) {
  .story-fig { width: calc(100% + 9rem); margin-left: -4.5rem; }
  .story-fig--right { margin-left: 0; margin-right: -4.5rem; }
}

/* ------------------------------------------------------------- app offers -- */
.quiz-card {
  display: grid; gap: 1rem; margin: clamp(2.2rem, 5vw, 3rem) 0;
  padding: 1.6rem 0; border-top: 1px solid var(--accent-lo); border-bottom: 1px solid var(--line);
}
.quiz-card-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; color: var(--paper); }
.quiz-card p { font-size: 0.9rem; line-height: 1.6; color: var(--paper-dim); max-width: 46ch; }
.quiz-card-cta {
  justify-self: start; text-decoration: none; font-size: 0.82rem; font-weight: 600;
  padding: 0.7rem 1.3rem; border-radius: 100px; background: var(--paper); color: var(--ink);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.quiz-card-cta:hover { transform: translateY(-2px); background: #fff; }

.story-cta { margin: clamp(2.8rem, 6vw, 4.5rem) 0 1rem; padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.story-cta h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 0.8rem 0 0.7rem; }
.story-cta p { font-size: 0.95rem; line-height: 1.6; color: var(--paper-dim); max-width: 44ch; margin-bottom: 1.6rem; }

.stores { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.store-btn {
  display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none;
  padding: 0.8rem 1.3rem; border-radius: 100px; font-weight: 600;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.store-btn .lbl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.12; }
.store-btn .lbl small { font-size: 0.6rem; font-weight: 500; opacity: 0.7; letter-spacing: 0.07em; text-transform: uppercase; }
.store-btn .lbl span { font-size: 0.96rem; }
.store-btn.primary { background: var(--paper); color: var(--ink); }
.store-btn.primary:hover { background: #fff; transform: translateY(-2px); }
.store-btn.secondary { border: 1px solid var(--line); color: var(--paper); }
.store-btn.secondary:hover { border-color: var(--accent); transform: translateY(-2px); }

/* --------------------------------------------------------------- day nav -- */
.day-nav { display: grid; gap: 0.6rem; margin: clamp(2rem, 5vw, 3rem) 0 1rem; }
@media (min-width: 640px) { .day-nav { grid-template-columns: 1fr 1fr; gap: 1rem; } }
.day-nav-item {
  display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none;
  padding: 1.1rem 0; border-top: 1px solid var(--line);
  transition: padding-inline 0.4s var(--ease);
}
a.day-nav-item:hover { padding-inline: 0.5rem; }
.day-nav-item.empty { border-top-color: transparent; pointer-events: none; }
.day-nav-item.next { text-align: right; }
.day-nav-label { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.day-nav-date { font-family: var(--serif); font-size: 1.15rem; color: var(--paper); }

.archive-back { margin: 1.6rem 0 0; font-size: 0.85rem; }
.archive-back a { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------- archive index -- */
.arch-list { list-style: none; margin: 0; padding: 0; }
.arch-item + .arch-item { margin-top: 0; }
.arch-link {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.1rem; align-items: center;
  padding: 1.1rem 0; border-top: 1px solid var(--line-soft); text-decoration: none;
  transition: padding-inline 0.4s var(--ease), background 0.4s var(--ease);
}
.arch-item:last-child .arch-link { border-bottom: 1px solid var(--line-soft); }
.arch-link:hover { padding-inline: 0.6rem; background: rgba(244,239,231,0.022); }
.arch-thumb { width: 56px; height: 56px; object-fit: cover; flex-shrink: 0; }
.arch-thumb--empty { background: var(--ink-3); display: block; }
.arch-text { display: flex; flex-direction: column; gap: 0.28rem; min-width: 0; }
.arch-date { font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-variant-numeric: tabular-nums; }
.arch-title { font-family: var(--serif); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.25; color: var(--paper); }
.arch-cat { font-size: 0.66rem; letter-spacing: 0.06em; color: var(--paper-faint); }
.arch-go { color: var(--paper-faint); transition: transform 0.4s var(--ease), color 0.4s var(--ease); }
.arch-link:hover .arch-go { transform: translateX(5px); color: var(--accent); }
@media (max-width: 560px) { .arch-thumb { width: 44px; height: 44px; } .arch-go { display: none; } }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; }
.pager-btn { font-size: 0.78rem; color: var(--accent); text-decoration: none; }
.pager-btn.disabled { visibility: hidden; }
.pager-status { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-faint); }

/* -------------------------------------------------------------- app bar -- */
.app-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  animation: rise 0.6s var(--ease) both; animation-delay: 1.2s;
}
.app-bar[hidden] { display: none; }
.app-bar-logo { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.app-bar-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.app-bar-text strong { font-size: 0.8rem; font-weight: 600; }
.app-bar-text small { font-size: 0.68rem; color: var(--paper-faint); }
.app-bar-cta {
  flex-shrink: 0; text-decoration: none; font-size: 0.76rem; font-weight: 600;
  padding: 0.55rem 1.1rem; border-radius: 100px; background: var(--paper); color: var(--ink);
}
.app-bar-close {
  flex-shrink: 0; background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--paper-faint); font-size: 1.3rem; line-height: 1; padding: 0 0.2rem;
}
.app-bar-close:hover { color: var(--paper); }
body.has-app-bar footer { padding-bottom: 5.5rem; }
@media (min-width: 760px) {
  .app-bar { left: auto; right: 1.4rem; bottom: 1.4rem; max-width: 24rem; border: 1px solid var(--line); border-radius: 14px; }
  body.has-app-bar footer { padding-bottom: clamp(2rem, 4vw, 3rem); }
}

/* --------------------------------------------------------------- ad slots -- */
/* Empty by design. No reserved height: a fixed-height empty box is a visible
   gap. Give it a min-height when a unit actually lands here. */
.ad-slot { display: block; }
