/*
Theme Name: Jim Goetz Baseball
Theme URI: https://jimgoetzbaseball.com/
Author: Jim Goetz
Description: The scorebook theme for jimgoetzbaseball.com. Pages live in /pages as HTML fragments; posts use the blog templates.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: jgb
*/

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-display: swap; src: url("fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url("fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 900; font-display: swap; src: url("fonts/big-shoulders-display-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url("fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Reenie Beanie"; font-weight: 400; font-display: swap; src: url("fonts/reenie-beanie-latin-400-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --paper: #ffffff;
  --grid: #d3e2ef;        /* scorebook rule */
  --grid-strong: #a9c4dc;
  --ink: #1d2833;         /* graphite navy: text */
  --pencil: #56636f;      /* secondary text */
  --field: #14452f;       /* outfield green: primary action */
  --field-dark: #0d3322;
  --seam: #b3122e;        /* stitch red: marks and flags only */
  --chalk: #f2f6f9;       /* cool off-white band */
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --hand: "Reenie Beanie", "Bradley Hand", "Segoe Print", cursive;
  --measure: 66ch;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 1.05rem + 0.15vw, 19px);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--field); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--field-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--seam); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Type scale ---------- */
h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.005em;
  margin: 0 0 0.4em;
  color: var(--ink);
}
h1 { font-size: clamp(3rem, 2rem + 5vw, 6.2rem); font-weight: 900; }
h2 { font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3.3rem); }
h3 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); font-weight: 700; line-height: 1.05; }
p, ul, ol { margin: 0 0 1em; }
.lede { font-size: 1.18em; line-height: 1.5; max-width: 34em; }
.small { font-size: 0.86em; color: var(--pencil); }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--grid); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { font-family: var(--display); font-weight: 900; font-size: 1.7rem; line-height: 1; color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.brand span { color: var(--seam); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.95rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--seam); }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .site-head .wrap { flex-wrap: wrap; }
  .nav-toggle { display: inline-block; font: inherit; font-size: 0.95rem; background: none; border: 1px solid var(--grid-strong); border-radius: var(--r); padding: 6px 12px; color: var(--ink); }
  .nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: 8px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--grid); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--serif); font-weight: 600; font-size: 1rem;
  padding: 14px 22px; border-radius: var(--r); text-decoration: none; cursor: pointer;
  border: 2px solid var(--field); background: var(--field); color: #fff; line-height: 1.2;
}
.btn:hover { background: var(--field-dark); border-color: var(--field-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--field); }
.btn.ghost:hover { background: var(--field); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }

/* ---------- Scorebook paper ---------- */
.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--grid-strong); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(40px, 7vw, 96px); }
.hero h1 { margin-bottom: 0.3em; }
.hero h1 .line { display: block; }
.hero .lede { background: rgba(255,255,255,0.88); }
.hero .creds { margin-top: 1.2em; font-size: 0.92em; color: var(--pencil); background: rgba(255,255,255,0.88); max-width: 36em; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

/* The ledger: the one memorable thing */
.ledger {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r);
  box-shadow: 8px 8px 0 var(--grid-strong);
  padding: 16px 16px 12px; font-size: 0.9rem; transform: rotate(-1.2deg);
}
.ledger-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 4px; }
.ledger-title b { font-family: var(--display); font-size: 1.5rem; font-weight: 800; }
.ledger-title .hand { font-size: 1.5rem; }
.ledger table { width: 100%; border-collapse: collapse; }
.ledger th { font-weight: 600; font-size: 0.78rem; color: var(--pencil); text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--grid-strong); }
.ledger td { border-bottom: 1px solid var(--grid); padding: 2px 4px; height: 34px; vertical-align: middle; }
.ledger td:first-child { font-weight: 600; width: 3.2em; }
.hand { font-family: var(--hand); color: #3a4652; font-size: 1.55rem; line-height: 1; }
.ledger .hand { font-size: 1.4rem; }
.ledger td:nth-child(3) .hand, .ledger td:nth-child(4) .hand, .ledger-title .hand { white-space: nowrap; }
.flag { position: relative; display: inline-block; padding: 0 6px; }
.flag::after { content: ""; position: absolute; inset: -4px -6px; border: 2px solid var(--seam); border-radius: 50%; transform: rotate(-6deg); }
.ledger tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 600; }
.ledger-note { margin: 10px 0 0; font-size: 0.8rem; color: var(--pencil); }
@media (prefers-reduced-motion: no-preference) {
  .ledger .hand { opacity: 0; animation: write 0.5s ease-out forwards; }
  .ledger tbody tr:nth-child(1) .hand { animation-delay: 0.25s; }
  .ledger tbody tr:nth-child(2) .hand { animation-delay: 0.45s; }
  .ledger tbody tr:nth-child(3) .hand { animation-delay: 0.65s; }
  .ledger tbody tr:nth-child(4) .hand { animation-delay: 0.85s; }
  .ledger tbody tr:nth-child(5) .hand { animation-delay: 1.05s; }
  .ledger tbody tr:nth-child(6) .hand { animation-delay: 1.25s; }
  .ledger tfoot .hand { animation-delay: 1.5s; }
  .ledger .flag::after { clip-path: inset(0 100% 0 0); animation: circle 0.6s 1.9s ease-out forwards; }
  @keyframes write { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
  @keyframes circle { to { clip-path: inset(0 0 0 0); } }
}

/* ---------- Sections ---------- */
.band { padding-block: clamp(48px, 7vw, 96px); }
.band.chalk { background: var(--chalk); border-block: 1px solid var(--grid); }
.band.dark { background: var(--ink); color: #e9eef3; }
.band.dark h2, .band.dark h3 { color: #fff; }
.band.dark a { color: #fff; }

.quote { max-width: 40em; margin: 0; }
.quote p { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.7rem); line-height: 1.45; font-style: italic; margin-bottom: 0.6em; }
.quote footer { font-size: 0.95rem; color: #b9c6d2; }

/* The three doors: a ruled list, not cards */
.doors { border-top: 2px solid var(--ink); margin-top: 1.5em; }
.door { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px 32px; align-items: start; padding: 26px 0; border-bottom: 1px solid var(--grid-strong); }
.door h3 { margin: 0; }
.door p { margin: 0; max-width: 40em; }
.door .btn { white-space: nowrap; }
@media (max-width: 820px) { .door { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.cite { display: block; margin-top: 2px; font-size: 0.82em; color: var(--pencil); }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 14px 0 14px 34px; border-bottom: 1px solid var(--grid); position: relative; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 14px; height: 14px; border: 2px solid var(--seam); border-radius: 50%; }

/* ---------- Formats (clinics) ---------- */
.formats { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.format { display: grid; grid-template-columns: 120px 1fr; gap: 6px 28px; padding: 24px 0; border-bottom: 1px solid var(--grid-strong); }
.format .len { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.format .len small { display: block; font-family: var(--serif); font-weight: 400; font-size: 0.8rem; color: var(--pencil); margin-top: 4px; }
.format h3 { margin-bottom: 0.25em; }
@media (max-width: 640px) { .format { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.form { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); padding: clamp(18px, 3vw, 32px); box-shadow: 8px 8px 0 var(--grid-strong); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 6px; }
.form .hint { display: block; font-weight: 400; font-size: 0.82rem; color: var(--pencil); }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid var(--grid-strong); border-bottom: 2px solid var(--ink); border-radius: 0; padding: 10px 2px; margin: 0 0 18px;
}
.form textarea { min-height: 110px; border: 1px solid var(--grid-strong); padding: 10px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-bottom-color: var(--seam); box-shadow: 0 2px 0 var(--seam); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.95rem; margin-bottom: 18px; }
.form .check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--field); flex: none; }
.form .hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { width: 100%; font-size: 1.05rem; }
.form .fine { font-size: 0.8rem; color: var(--pencil); margin: 12px 0 0; }

/* ---------- Kit preview ---------- */
.sheets { list-style: none; padding: 0; margin: 0 0 1em; counter-reset: s; }
.sheets li { padding: 14px 0; border-bottom: 1px solid var(--grid); }
.sheets b { font-family: var(--display); font-weight: 800; font-size: 1.45rem; display: block; line-height: 1.05; }

/* ---------- Blog ---------- */
.post-list { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.post-list li { padding: 22px 0; border-bottom: 1px solid var(--grid-strong); }
.post-list h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-bottom: 0.25em; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--field); }
.post-meta { font-size: 0.86rem; color: var(--pencil); margin-bottom: 0.6em; }
.entry { max-width: var(--measure); }
.entry h2 { font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.4rem); margin-top: 1.4em; }
.entry h3 { margin-top: 1.3em; }
.entry img { border-radius: var(--r); }
.entry blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 3px solid var(--seam); font-style: italic; }
.entry table { border-collapse: collapse; width: 100%; font-size: 0.92em; margin: 1em 0 1.4em; }
.entry th, .entry td { border-bottom: 1px solid var(--grid-strong); padding: 8px 6px; text-align: left; }
.post-cta { margin-top: 2.4em; padding: 22px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--chalk); }
.post-cta h3 { margin-top: 0; }
.pager { display: flex; justify-content: space-between; margin-top: 28px; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #c8d3dd; padding-block: 40px; font-size: 0.92rem; }
.site-foot a { color: #fff; }
.site-foot .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-foot .brand { color: #fff; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 6px; }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }

/* ---------- Utilities ---------- */
.mt0 { margin-top: 0; }
.center { text-align: center; }
.tight { max-width: 46em; }
hr.rule { border: 0; border-top: 2px solid var(--ink); margin: 2em 0; }
.notice { border-left: 4px solid var(--seam); padding: 10px 16px; background: var(--chalk); }
@media print { .site-head, .site-foot, .actions { display: none; } }
