/* =====================================================================
   NFL Week Writeups — site.css
   A clean, "statline" aesthetic: deep field-green accent, warm off-white
   canvas, strong hierarchy, generous cards for games, readable long-form
   article layout for each writeup. No icon fonts, no external requests.
   ===================================================================== */

:root {
  /* GameDay Forecast brand ink (from the wordmark/stadium SVGs) */
  --bg:        #ffffff;
  --surface:   #ffffff;
  --surface-2: #f6f5f5;
  --ink:       #231f20;         /* brand ink                          */
  --ink-soft:  #57535a;
  --ink-faint: #8f8b8c;
  --field:     #231f20;         /* primary accent = brand ink          */
  --field-2:   #4a4748;
  --field-ink: #ffffff;
  --rule:      #e7e5e6;
  --rule-2:    #d6d3d4;
  --up:        #1f7a4d;         /* positive / winner indicator         */
  --down:      #b1453a;
  --conf-lean:    #b07d1e;
  --conf-mod:     #2d7fd9;
  --conf-strong:  #1f7a4d;
  --shadow:    0 1px 2px rgba(35,31,32,.05), 0 8px 24px -12px rgba(35,31,32,.14);
  --radius:    14px;
  --maxw:      1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
a.brand {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}
.brand-name {
  height: 28px;
  width: auto;
  display: block;
}

.week-nav {
  flex: 1 1 auto;
  display: flex; gap: 4px; align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
}
.wk-btn {
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.wk-btn:hover { border-color: var(--field-2); color: var(--field-2); }
.wk-btn.active {
  background: var(--field);
  border-color: var(--field);
  color: var(--field-ink);
}
.wk-btn:disabled { opacity: .4; cursor: not-allowed; }

.header-status {
  flex: 0 0 auto;
  font-size: 12px; color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- layout ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 60px;
}

.index-summary {
  margin: 0 0 18px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.index-summary h1 {
  margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em;
}
.index-summary .count {
  font-size: 14px; color: var(--ink-faint);
}
.index-summary .season {
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--rule-2);
  background: var(--surface-2);
  padding: 3px 10px; border-radius: 999px;
}
.no-games {
  text-align: center; padding: 80px 20px; color: var(--ink-faint);
}
.no-games h2 { font-size: 20px; color: var(--ink-soft); margin-bottom: 8px; }

/* ---------- game grid ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.game-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.game-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--ink-faint), var(--ink));
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--rule-2);
}
.game-card:focus-visible {
  outline: 2px solid var(--field); outline-offset: 2px;
}
.gc-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-faint);
}
.gc-week {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.gc-time { font-size: 12px; color: var(--ink-faint); }

.gc-teams {
  display: flex; flex-direction: column; gap: 6px;
}
.team-line {
  display: flex; align-items: center; gap: 10px;
}
.team-ab {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  color: #fff;
}
.team-name { font-size: 15px; font-weight: 600; }
.team-home { font-weight: 700; }
.team-sub { font-size: 12px; color: var(--ink-faint); margin-left: 6px; }
.team-record {
  margin-left: auto;
  font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.gc-divider {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 12px; font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: .05em;
}
.gc-divider .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink);
}

.gc-line {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.gc-line .tag {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.gc-line .val { font-weight: 600; color: var(--ink); }
.gc-line .val.ou { color: var(--ink-soft); font-weight: 500; }

.gc-prediction {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-soft);
  flex-wrap: wrap;
}
.gc-prediction .pred-w {
  flex: 0 0 auto;
  font-weight: 800; font-size: 12px;
  color: var(--up);
  letter-spacing: .04em;
  background: color-mix(in srgb, var(--up) 10%, white);
  border: 1px solid color-mix(in srgb, var(--up) 20%, transparent);
  padding: 2px 8px; border-radius: 6px;
}
.gc-prediction .score {
  font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.gc-prediction .confidence {
  margin-left: auto;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  color: #fff;
}
.gc-prediction .confidence.lean    { background: var(--conf-lean); }
.gc-prediction .confidence.moderate{ background: var(--conf-mod); }
.gc-prediction .confidence.strong  { background: var(--conf-strong); }
.gc-prediction .confidence.low     { background: #848f89; }
.gc-prediction .confidence.medium  { background: #848f89; }
.gc-prediction .confidence.high    { background: var(--conf-strong); }
.gc-prediction .no-pred { color: var(--ink-faint); font-size: 12px; margin-left: auto; }

/* ---------- detail view ---------- */
.btn-back {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  margin-bottom: 18px;
}
.btn-back:hover { border-color: var(--field-2); color: var(--field-2); }

.detail-body {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.d-head {
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--surface-2), white);
}
.d-head-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 12px; color: var(--ink-faint); letter-spacing: .06em;
  text-transform: uppercase;
}
.d-head-top .season {
  color: var(--ink);
  font-weight: 700;
  border: 1px solid var(--rule-2);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: 999px;
}
.d-matchesup {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.d-team {
  flex: 1 1 200px;
  display: flex; align-items: center; gap: 14px;
}
.d-team.right { flex-direction: row-reverse; text-align: right; }
.d-ab {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow);
}
.d-team h2 {
  margin: 0 0 4px;
  font-size: 20px; font-weight: 700;
  letter-spacing: -.01em;
}
.d-record {
  font-size: 13px; color: var(--ink-soft); font-weight: 500;
}
.d-at {
  font-size: 13px; color: var(--ink-faint); font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  user-select: none;
}

.d-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.d-stat {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
}
.d-stat .label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.d-stat .value {
  font-size: 15px; font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.d-stat .value.winner { color: var(--up); }

/* score line */
.d-score {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 14px;
}
.d-score .tag {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.d-score .score {
  font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.d-score .conf {
  margin-left: auto;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  color: #fff;
}
.d-score .conf.lean     { background: var(--conf-lean); }
.d-score .conf.moderate { background: var(--conf-mod); }
.d-score .conf.strong   { background: var(--conf-strong); }
.d-score .conf.low      { background: #848f89; }
.d-score .conf.medium   { background: #848f89; }
.d-score .conf.high     { background: var(--conf-strong); }

/* article body */
.d-article { padding: 26px 32px 32px; }
.d-article section { margin-bottom: 28px; }
.d-article section:last-child { margin-bottom: 0; }
.d-article section h3 {
  margin: 0 0 12px;
  font-size: 20px; font-weight: 700; letter-spacing: -.01em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.d-article section.prediction h3 { color: var(--field-2); }

.d-article p { margin: 0 0 14px; font-size: 16px; line-height: 1.7; }
.d-article ul, .d-article ol { margin: 0 0 14px; padding-left: 24px; }
.d-article li { margin-bottom: 7px; font-size: 15px; line-height: 1.6; }
.d-article code {
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.d-article blockquote {
  margin: 0 0 14px;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--ink);
  color: var(--ink-soft);
}
.d-article hr { border: none; border-top: 1px solid var(--rule); margin: 22px 0; }

/* tables */
.stat-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  margin-bottom: 6px;
}
.stat-table th, .stat-table td {
  border: 1px solid var(--rule);
  padding: 8px 12px;
  text-align: left;
}
.stat-table th {
  background: var(--surface-2);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.stat-table td { color: var(--ink); }
.stat-table td:first-child {
  color: var(--ink-faint); font-weight: 500;
  font-size: 13px;
}
.stat-table tbody tr:nth-child(even) { background: var(--surface-2); }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 40px;
  text-align: center;
  font-size: 12px; color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  margin-top: 40px;
}
.footer-brand { margin-top: 8px; }
.footer-mark {
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .d-matchesup { flex-direction: column; align-items: stretch; }
  .d-team, .d-team.right { flex-direction: row; text-align: left; }
  .d-at { align-self: center; margin: 6px 0; }
  .d-stats-row { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .d-article { padding: 22px 18px 28px; }
  .d-head { padding: 20px 18px 18px; }
  .brand-logo { height: 32px; }
  .brand-name { height: 22px; }
  .header-status { display: none; }
}
