/* darktigerfootball.com: chalkboard. Dark green field, chalk text, gold. */
:root {
  --green: #0d1712;
  --green-deep: #070d0a;
  --chalk: #ecead9;
  --gold: #ffd34d;
  --mute: #8a9a8e;
  --line: rgba(236, 234, 217, 0.14);
  --code-bg: #05100c;
  --cta-ink: #1a1408;
  --strong: #ffffff;
  /* Line length, measured rather than guessed. 34rem at 18px renders 61
     characters per line, BELOW the 65 to 75 band that reads comfortably. The
     wide-screen step in the structure file raises this on laptops. */
  --measure: 34rem;
}

/* SHARED STRUCTURE. No colour literals below this line, ever.
 *
 * This file is served to both sites, so a hex value baked in here is a value
 * chosen for one of them and inflicted on the other. `strong { color: #fff }`
 * was correct on the football chalkboard and rendered every bold phrase in the
 * Foyer articles as white text on a cream page: invisible. The reader saw
 * "        target 70 to 90 percent" with the label simply missing.
 *
 * Every colour comes from a token defined in tokens-<site>.css. There is a test
 * that fails if a literal reappears here. */

/* Blog styling for darktigerfootball.com.
 *
 * Deliberately its own file rather than an addition to the site's inline
 * styles, so nothing here can change a page that already works. The palette is
 * lifted from index.html so the blog reads as part of the site rather than a
 * bolt-on.
 *
 * Typography is the whole job on an article page. Line length, line height and
 * contrast decide whether a two thousand word piece gets read or bounced. */

/* Palette comes from a per-site token block prepended at build time. */

* { box-sizing: border-box; }

.blog-body {
  margin: 0;
  background: var(--green-deep);
  color: var(--chalk);
  font: 400 18px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Scoped to the site header specifically.
 *
 * A bare `nav` selector here is wrong: the table of contents and the
 * previous/next block are both <nav> too, and giving them display:flex laid the
 * contents out as a label beside its own list. An article page has three navs
 * and only one of them is the header. */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line);
  background: var(--green); position: sticky; top: 0; z-index: 10;
}
.site-nav .logo { font-size: 15px; letter-spacing: 1px; color: var(--chalk); }
.site-nav .logo b { color: var(--gold); }
.site-nav .links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--chalk); text-decoration: none; font-size: 14px; opacity: 0.85; }
.site-nav a:hover { opacity: 1; }
.site-nav a.cta, .post-cta .cta {
  background: var(--gold); color: var(--cta-ink); padding: 9px 15px;
  border-radius: 7px; font-weight: 700; opacity: 1;
}

main { max-width: 62rem; margin: 0 auto; padding: 34px 22px 70px; }

/* ── article ─────────────────────────────────────────────────────────── */

.post-head { max-width: var(--measure); margin: 0 auto 26px; }
.post-cat {
  display: inline-block; color: var(--gold); font-size: 13px;
  letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; margin-bottom: 12px;
}
.post h1 {
  font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.post-sub { color: var(--mute); font-size: 20px; margin: 0 0 14px; }
.post-meta {
  display: flex; flex-wrap: wrap; gap: 14px; color: var(--mute);
  font-size: 14px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line);
}

.post-hero {
  display: block; width: 100%; height: auto; border-radius: 12px;
  margin: 0 auto 30px; border: 1px solid var(--line);
}

.post-toc {
  max-width: var(--measure); margin: 0 auto 30px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--green);
}
.post-toc p { margin: 0 0 8px; font-size: 13px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--mute); }
.post-toc ul { margin: 0; padding-left: 18px; }
.post-toc a { color: var(--chalk); }

.post-body { max-width: var(--measure); margin: 0 auto; }
.post-body > * { margin-inline: auto; }
.post-body h2 {
  font-size: 27px; line-height: 1.25; margin: 42px 0 12px;
  scroll-margin-top: 80px;                 /* so anchors clear the sticky nav */
}
.post-body h3 { font-size: 21px; margin: 30px 0 10px; scroll-margin-top: 80px; }
.post-body p { margin: 0 0 20px; }
.post-body a { color: var(--gold); text-underline-offset: 3px; }
.post-body strong { color: var(--strong); }
.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body img { max-width: 100%; height: auto; border-radius: 10px; }

.post-body blockquote {
  margin: 26px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--gold); color: var(--chalk); font-style: italic;
}
.post-body pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 15px;
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
}
.post-body :not(pre) > code {
  background: var(--code-bg); padding: 2px 6px; border-radius: 5px;
}

/* Wide content gets its own scroll container so the PAGE never scrolls
   sideways on a phone, which is the most common mobile layout failure. */
.table-wrap { overflow-x: auto; margin: 0 0 22px; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.post-body th, .post-body td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.post-body th { color: var(--gold); font-size: 14px; letter-spacing: 0.5px; }

.video { position: relative; padding-top: 56.25%; margin: 0 0 24px; }
.video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: 10px;
}

.post-tags {
  max-width: var(--measure); margin: 30px auto 0; padding: 0;
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
}
.post-tags li {
  font-size: 13px; color: var(--mute); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px;
}

.post-cta {
  max-width: var(--measure); margin: 44px auto 0; padding: 24px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--green);
  text-align: center;
}
.post-cta p { margin: 0 0 16px; }
.post-cta .cta-secondary { color: var(--chalk); margin-left: 14px; font-size: 14px; }

/* ── related, previous and next ──────────────────────────────────────── */

.post-related, .post-nav { max-width: var(--measure); margin: 46px auto 0; }
.post-related h2 { font-size: 19px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--mute); margin: 0 0 14px; }
.post-related-grid, .post-nav { display: grid; gap: 12px; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }

.post-nav-card {
  display: block; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; color: var(--chalk);
  background: var(--green);
}
.post-nav-card:hover { border-color: var(--gold); }
.post-nav-label {
  display: block; font-size: 12px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--mute); margin-bottom: 5px;
}
.post-nav-title { display: block; font-weight: 700; line-height: 1.35; }

/* ── the list page ───────────────────────────────────────────────────── */

.blog-head { max-width: var(--measure); margin: 0 auto 34px; }
.blog-head h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 8px; }
.blog-head > p { color: var(--mute); margin: 0 0 20px; }

.blog-search input {
  width: 100%; padding: 12px 15px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--green);
  color: var(--chalk); font-size: 16px;   /* 16px stops iOS zooming on focus */
}
.blog-search input::placeholder { color: var(--mute); }

.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.blog-filters button {
  background: none; border: 1px solid var(--line); color: var(--mute);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
}
.blog-filters button.on { border-color: var(--gold); color: var(--gold); }

.blog-grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .blog-grid { grid-template-columns: 1fr 1fr; } }

.blog-card a {
  display: block; text-decoration: none; color: var(--chalk);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--green); height: 100%;
}
.blog-card a:hover { border-color: var(--gold); }
.blog-card img { width: 100%; height: auto; display: block; }
.blog-card h2 { font-size: 21px; line-height: 1.3; margin: 16px 18px 8px; }
.blog-card p { color: var(--mute); font-size: 15px; margin: 0 18px 14px; }
.blog-card-meta { font-size: 13px !important; }
.blog-empty { text-align: center; color: var(--mute); padding: 40px 0; }

footer {
  border-top: 1px solid var(--line); padding: 26px 22px; text-align: center;
  color: var(--mute); font-size: 14px;
}
footer a { color: var(--mute); }

/* ── laptops and desktops ────────────────────────────────────────────────
 *
 * More room means a longer line AND bigger type, raised together. Widening the
 * column alone would push past 75 characters and get harder to read, not
 * easier: the two have to move in step to land back around 68. */
@media (min-width: 1024px) {
  .blog-body { font-size: 19px; }
  :root { --measure: 40rem; }
}

@media (min-width: 1500px) {
  .blog-body { font-size: 20px; }
  :root { --measure: 43rem; }
  main { max-width: 72rem; }
}

/* ── the header on a phone ────────────────────────────────────────────────
 *
 * At 375px the desktop header wrapped into a 230px block, a quarter of the
 * screen, permanently, because it is sticky. The logo also broke across two
 * lines mid-name. On a narrow screen the header gets out of the way: the logo
 * sits on its own row, the links scroll sideways under it, and the whole thing
 * stops sticking so an article gets the full viewport. */
@media (max-width: 640px) {
  .site-nav {
    position: static;
    flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
  }
  .site-nav .logo { white-space: nowrap; font-size: 14px; }
  /* Wrap rather than scroll sideways. A sideways-scrolling row left the
     "Get the Cheat Cards" button clipped at the screen edge, and a clipped
     button reads as a broken page even though it was reachable. The lead
     magnet is the one link on this page that has a job to do. */
  .site-nav .links {
    width: 100%; flex-wrap: wrap; gap: 12px 16px;
  }
  .site-nav .links a { white-space: nowrap; }
  .site-nav a.cta { padding: 7px 12px; font-size: 13px; }

  /* Anchor targets no longer need to clear a sticky bar. */
  .post-body h2, .post-body h3 { scroll-margin-top: 12px; }

  main { padding: 22px 16px 56px; }
  .post-cta { padding: 20px 16px; }
  .post-cta .cta-secondary { display: block; margin: 14px 0 0; }
}

/* ── wide screens: the contents move beside the article ──────────────────
 *
 * Stacked above the body, the contents block is a 336px wall of links between
 * the headline and the first sentence, and the article itself was using 34% of
 * a 2000px screen with 656px of nothing down each side. Moving the contents
 * into that empty space fixes both at once: the reader meets the writing
 * immediately, and the page stops looking like a phone column on a desktop.
 *
 * It becomes a sidebar only when there is genuinely room for one. Below this
 * width it stays exactly where it was. */
@media (min-width: 1200px) {
  .post {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) 16rem;
    column-gap: 3.5rem;
    justify-content: center;
    align-items: start;
  }
  .post-head, .post-hero, .post-tags, .post-cta,
  .post-related, .post-nav { grid-column: 1; }

  /* Both pinned to the same row so they sit side by side rather than the
     contents floating above an empty column. */
  .post-body { grid-column: 1; grid-row: 3; margin: 0; }
  .post-toc  { grid-column: 2; grid-row: 3; margin: 0; max-width: none;
               position: sticky; top: 96px; }

  .post-toc ul { list-style: none; padding: 0; }
  .post-toc li { margin-bottom: 10px; line-height: 1.4; font-size: 15px; }
  .post-toc a { text-decoration: none; opacity: 0.8; }
  .post-toc a:hover { opacity: 1; text-decoration: underline; }
}

/* Very wide: give the words more room rather than more margin. Type size and
   column width rise together so the line stays inside the readable band. */
@media (min-width: 1700px) {
  .blog-body { font-size: 21px; }
  :root { --measure: 46rem; }
}
