/* Daily Digest page */
.digest-page {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0 2rem;
  --bg2: #1a1a1e;
  --bg3: #212126;
  --border: #2a2a30;
  --sub: #a0a0b0;
  --muted: #6a6a7e;
  --muted2: #4c4c5e;
  --red: #e8473f;
  --gold: #f0a500;
  --green: #34d27e;
  --mono: 'JetBrains Mono', monospace;
  --head: 'Barlow Condensed', sans-serif;
}

/* Hero spans full width */
.digest-page .hero-banner {
  grid-column: 1 / -1;
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.digest-page .hero-banner .hero-left { flex: 1; min-width: 0; }
.digest-page .hero-banner .hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: .81rem; flex-shrink: 0; }
.digest-page .hero-banner .hero-stats-strip { margin-top: 0; flex-shrink: 0; }
.digest-page .hero-kicker { font-family: var(--mono); font-size: .68rem; color: var(--red); letter-spacing: .18em; text-transform: uppercase; margin-bottom: .4rem; }
.digest-page .hero-title { font-family: var(--head); font-weight: 900; font-style: italic; font-size: clamp(2.8rem, 6vw, 5rem); line-height: .92; text-transform: uppercase; letter-spacing: -.01em; color: var(--text, #d8d8e4); }
.digest-page .hero-title .accent { color: var(--red); }
.digest-page .hero-desc { margin-top: .9rem; color: var(--sub); font-size: .9rem; font-weight: 300; max-width: 480px; line-height: 1.65; }

/* Main column — left */
.digest-main { grid-column: 1; display: flex; flex-direction: column; gap: 2.5rem; }

/* Month recaps: no sidebar — span full grid width (avoids empty 340px track shoving content) */
.recap-page.digest-page .digest-main {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
  overflow-x: hidden;
}
.recap-page.digest-page .hero-banner {
  min-width: 0;
}
.recap-page.digest-page .hero-banner .hero-right {
  min-width: 0;
  flex-shrink: 1;
}
.recap-page.digest-page .hero-stats-strip {
  max-width: 100%;
}

/* Sidebar — right */
.digest-sidebar { grid-column: 2; display: flex; flex-direction: column; gap: 1.25rem; }
.digest-widget { background: var(--bg2); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.digest-widget-head { padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg3); }
.digest-widget-title { font-family: var(--head); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.digest-recent-list { display: flex; flex-direction: column; }
.digest-recent-item { padding: .65rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; display: flex; gap: 10px; align-items: flex-start; transition: background .12s; }
.digest-recent-item:last-child { border-bottom: none; }
.digest-recent-item:hover { background: rgba(255,255,255,.02); }
.digest-recent-num { font-family: var(--head); font-size: 1.2rem; font-weight: 900; color: var(--muted2); line-height: 1; flex-shrink: 0; width: 20px; }
.digest-recent-date { font-family: var(--mono); font-size: .6rem; color: var(--red); letter-spacing: .05em; margin-bottom: 2px; }
.digest-recent-title { font-size: .8rem; font-weight: 500; color: var(--sub); line-height: 1.35; }

/* Section label */
.sec-label { display: flex; align-items: center; gap: 10px; margin-bottom: 1.25rem; }
.sec-label-text { font-family: var(--head); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.sec-label-line { flex: 1; height: 1px; background: var(--border); }
.sec-label-date { font-family: var(--mono); font-size: .62rem; color: var(--muted2); white-space: nowrap; }

/* Featured digest card */
.digest-card--featured {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 6px;
  overflow: hidden;
}
.digest-card-head {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.digest-tag {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--red);
  letter-spacing: .12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: .45rem;
}
.digest-title {
  font-family: var(--head);
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.1;
  margin: 0 0 .5rem;
  color: var(--text, #eaeaee);
}
.digest-meta {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--muted2);
}

/* Digest body — markdown-style rendering (featured card + single-article archive) */
.digest-body,
.digest-article-page .art-body {
  padding: 1.5rem 1.75rem 1.75rem;
  color: #d8d8e2;
  font-size: .95rem;
  line-height: 1.75;
}
.digest-body br,
.digest-article-page .art-body br { display: block; content: ''; margin: .2rem 0; }

.digest-body p,
.digest-article-page .art-body p { margin: 0 0 1rem; }
.digest-body p:last-child,
.digest-article-page .art-body p:last-child { margin-bottom: 0; }
.digest-body h2,
.digest-article-page .art-body h2 {
  font-family: var(--head);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #eaeaee;
  margin: 1.5rem 0 .6rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.digest-body h2:first-child,
.digest-article-page .art-body h2:first-child { margin-top: 0; }
.digest-body h3,
.digest-article-page .art-body h3 {
  font-family: var(--head);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--sub);
  margin: 1.1rem 0 .4rem;
}
.digest-body strong,
.digest-article-page .art-body strong { color: #eaeaee; font-weight: 600; }
.digest-body em,
.digest-article-page .art-body em { color: var(--sub); font-style: italic; }

/*
 * Fallback: links inside digest HTML should never fall back to browser default blue.
 * (simple_md adds digest-matchup-link / digest-team-link; this covers edge cases and old cache.)
 */
.digest-body a,
.digest-article-page .art-body a {
  color: #eaeaee;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(232, 71, 63, 0.45);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.digest-body a:hover,
.digest-article-page .art-body a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

/* Matchup link: "Mets @ Giants" → game page */
.digest-body .digest-matchup-link,
.digest-article-page .art-body .digest-matchup-link {
  color: #eaeaee;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
  transition: color .15s;
}
.digest-body .digest-matchup-link:hover,
.digest-article-page .art-body .digest-matchup-link:hover { color: var(--red); }

/* Team name links */
.digest-body .digest-team-link,
.digest-article-page .art-body .digest-team-link {
  color: #eaeaee;
  text-decoration: underline;
  text-decoration-color: rgba(232, 71, 63, 0.45);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.digest-body .digest-team-link:hover,
.digest-article-page .art-body .digest-team-link:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

/* Stat number highlight */
.digest-body .stat-num,
.digest-article-page .art-body .stat-num {
  color: var(--gold);
  font-family: var(--mono);
  font-size: .9em;
  font-weight: 600;
  letter-spacing: .02em;
}

/* Archive */
.digest-archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.digest-archive-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.1rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.digest-archive-item:last-child { border-bottom: none; }
.digest-archive-item:hover { background: var(--bg3); }

.darch-date {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--red);
  letter-spacing: .06em;
  min-width: 46px;
  flex-shrink: 0;
}
.darch-body { flex: 1; min-width: 0; }
.darch-title {
  font-family: var(--head);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--sub);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.darch-excerpt {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
  margin: .2rem 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.darch-arrow {
  flex-shrink: 0;
  color: var(--muted2);
  display: flex;
  align-items: center;
}
.darch-arrow .lucide-link-arrow { width: 1em; height: 1em; }

/* Archive pagination */
.digest-archive-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
}
.digest-archive-nav-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted2);
  letter-spacing: 0.04em;
}
.digest-archive-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--head);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  text-decoration: none;
  transition: opacity 0.12s;
}
.digest-archive-nav-btn:hover { opacity: 0.85; }
.digest-archive-nav-btn .lucide-link-arrow { width: 0.9em; height: 0.9em; }
.digest-archive-nav-btn--disabled {
  color: var(--muted2);
  cursor: default;
  pointer-events: none;
}

/* Empty state */
.digest-empty {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: .9rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 1000px) {
  .digest-page { grid-template-columns: 1fr; }
  .digest-sidebar { grid-column: 1; }
}
@media (max-width: 900px) {
  .digest-page .hero-banner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .digest-page .hero-banner .hero-right { width: 100%; align-items: flex-end; }
  .digest-page .hero-banner .hero-stats-strip { width: 100%; max-width: 100%; }
}
@media (max-width: 600px) {
  .digest-page { padding: 0 1rem 3rem; }
  .digest-body { padding: 1.1rem 1.1rem 1.25rem; }
  .darch-excerpt { display: none; }
}

/* Breadcrumb inside main column (same grid as /digest/) */
.digest-main-breadcrumb {
  max-width: none;
  margin: 0 0 0.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted2);
}
.digest-main-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.digest-main-breadcrumb a:hover { color: var(--text, #eaeaee); }
.digest-main-breadcrumb span.sep { color: var(--muted2); }

.digest-recent-item--current {
  background: rgba(232, 71, 63, 0.07);
  box-shadow: inset 3px 0 0 var(--red);
}

/* Sidebar: evergreen site guide */
.digest-widget--guide .digest-widget-head {
  border-bottom-color: var(--border);
}
.digest-guide-card {
  display: block;
  padding: 1rem 1.1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s, box-shadow 0.12s;
}
.digest-guide-card:hover {
  background: rgba(240, 165, 0, 0.06);
}
.digest-guide-card--current {
  background: rgba(240, 165, 0, 0.08);
  box-shadow: inset 3px 0 0 var(--gold);
}
.digest-guide-card-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.digest-guide-card-title {
  display: block;
  font-family: var(--head);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: var(--text, #eaeaee);
}
.digest-guide-card-desc {
  margin: 0.45rem 0 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.digest-guide-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.digest-guide-card-arrow {
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
}

/* Guide article: gold accent top stripe */
.digest-card--guide {
  border-top-color: var(--gold);
}
.digest-card--guide .digest-tag {
  color: var(--gold);
}

.digest-back-sep {
  margin: 0 0.5rem;
  color: var(--muted2);
  user-select: none;
}

.digest-article-back-wrap { margin-top: 1.25rem; }
.digest-back-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--sub);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.digest-back-link:hover { color: var(--text, #eaeaee); }

/* Mobile: single column — main first, sidebar after (desktop grid unchanged above 900px) */
@media (max-width: 900px) {
  .digest-page {
    grid-template-columns: 1fr;
    /* Horizontal inset comes from .fq-inner-main — avoid double gutter + overflow */
    padding: 0 0 3rem 0;
    gap: 1.5rem 0;
    min-width: 0;
  }
  .digest-main,
  .digest-sidebar {
    min-width: 0;
    max-width: 100%;
  }
  .digest-card--featured,
  .digest-body {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  .digest-body pre,
  .digest-body code {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .digest-body {
    padding: 1.25rem 1rem 1.5rem;
  }
  .digest-page .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .digest-main {
    grid-column: 1;
    order: 1;
  }
  .digest-sidebar {
    grid-column: 1;
    order: 2;
  }
  .digest-body img {
    max-width: 100%;
    height: auto;
  }
  .digest-back-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
