/* ============================================================
   CEMI Fútbol — Documentation stylesheet
   "Broadcast chalkboard": Persona-style match-day identity, but a
   LIGHT reading surface with a dark stadium header band.

   Stadium Black #0b0f0c · Chalk #f2f0e6 · Grass #12b76a · Gold #ffc53d
   Display: Anton / Archivo (Google Fonts). Body: Archivo.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

:root {
  --stadium: #0b0f0c;
  --stadium-2: #12181300;
  --chalk: #f2f0e6;
  --grass: #12b76a;
  --grass-d: #0e9356;
  --gold: #ffc53d;
  --gold-d: #b8842a;
  --red: #e5484d;

  --paper: #f6f5ef;
  --paper-2: #ffffff;
  --card: #ffffff;
  --ink: #171b18;
  --ink-soft: #545b54;
  --line: #dcdbcf;
  --line-2: #c9c8ba;

  --shadow: 0 2px 10px rgba(11,15,12,.06), 0 8px 28px rgba(11,15,12,.05);
  --radius: 14px;

  --f-display: 'Anton', system-ui, sans-serif;
  --f-body: 'Archivo', system-ui, sans-serif;
}

* , *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--f-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TOP NAV (injected by navigation.js)
   ============================================================ */
.doc-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--stadium);
  color: var(--chalk);
  border-bottom: 3px solid var(--grass);
}
.doc-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.doc-nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--f-display);
  font-size: 1.25rem;
  letter-spacing: .5px;
  color: var(--chalk);
  text-decoration: none;
  white-space: nowrap;
}
.doc-nav-brand .ball { color: var(--gold); display: inline-flex; }
.doc-nav-brand span.accent { color: var(--grass); }
.doc-nav-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: 6px;
}
.doc-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #cfd6cf;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  transition: background .15s, color .15s;
}
.doc-nav-pill svg { width: 15px; height: 15px; }
.doc-nav-pill:hover { background: rgba(255,255,255,.08); color: #fff; }
.doc-nav-pill.active { background: var(--grass); color: #06231a; }
.doc-nav-spacer { flex: 1 1 auto; }
.doc-nav-lang {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  overflow: hidden;
}
.doc-nav-lang a {
  padding: 5px 11px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: #cfd6cf;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.doc-nav-lang a + a { border-left: 1px solid rgba(255,255,255,.16); }
.doc-nav-lang a:hover { background: rgba(255,255,255,.1); color: #fff; }
.doc-nav-lang a.active { background: var(--gold); color: #2a1e00; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
    radial-gradient(1200px 400px at 50% -160px, rgba(18,183,106,.25), transparent),
    var(--stadium);
  color: var(--chalk);
  padding: 60px 20px 66px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--grass) 0 40px, var(--gold) 40px 80px);
  opacity: .85;
}
.hero .kicker {
  font-family: var(--f-body);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--gold);
}
.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: .96;
  margin: 12px 0 10px;
  letter-spacing: 1px;
}
.hero h1 em { color: var(--grass); font-style: normal; }
.hero p {
  max-width: 640px;
  margin: 0 auto;
  color: #d6dbd4;
  font-size: 1.06rem;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 20px 40px;
}
.wrap.wide { max-width: 1120px; }

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  margin: 26px 0;
}
section > h2 {
  font-family: var(--f-display);
  font-size: 1.9rem;
  letter-spacing: .5px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
section > h2 .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--stadium);
  color: var(--gold);
}
section > h2 .tag svg { width: 22px; height: 22px; }
section .lead {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 4px 0 18px;
}
h3 {
  font-size: 1.22rem;
  font-weight: 800;
  margin: 26px 0 8px;
  color: var(--ink);
}
h4 { font-size: 1.02rem; font-weight: 800; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--grass-d); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }
strong { font-weight: 700; }
code {
  font-family: 'Cascadia Code', 'Fira Code', ui-monospace, Consolas, monospace;
  font-size: .88em;
  background: #eef0e6;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
kbd {
  font-family: ui-monospace, monospace;
  font-size: .82em;
  background: var(--stadium);
  color: var(--chalk);
  border-radius: 5px;
  padding: 2px 7px;
  border: 1px solid #333;
}
hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }

/* ============================================================
   CARDS (hub)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--grass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); text-decoration: none; box-shadow: 0 10px 30px rgba(11,15,12,.12); }
.card.gold { border-top-color: var(--gold); }
.card.red { border-top-color: var(--red); }
.card .ic {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--stadium);
  color: var(--gold);
  margin-bottom: 12px;
}
.card .ic svg { width: 26px; height: 26px; }
.card h3 { margin: 0 0 6px; font-size: 1.3rem; }
.card p { color: var(--ink-soft); margin: 0; font-size: .98rem; }
.card .go {
  display: inline-block;
  margin-top: 14px;
  font-weight: 800;
  color: var(--grass-d);
  letter-spacing: .5px;
}

/* ============================================================
   ACTIVITY BLOCKS
   ============================================================ */
.activity {
  border: 1px solid var(--line);
  border-left: 4px solid var(--grass);
  border-radius: 10px;
  background: #fbfbf6;
  padding: 16px 20px;
  margin: 16px 0;
}
.activity h4 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  color: var(--ink);
}
.activity h4 .n {
  font-family: var(--f-display);
  color: var(--grass-d);
  margin-right: 8px;
}
.activity dl { margin: 0; }
.activity dt {
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--grass-d);
  margin-top: 10px;
}
.activity dd { margin: 2px 0 0; }
.activity.note-teacher { border-left-color: var(--gold); }
.activity .teach {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
  font-size: .95rem;
  color: var(--ink-soft);
}
.activity .teach strong { color: var(--gold-d); }

/* pill labels for subject areas */
.subject {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e7f6ee;
  color: var(--grass-d);
  margin-bottom: 8px;
}
.subject.phys { background: #e9f0fb; color: #2a5aa0; }
.subject.bio { background: #eaf6e6; color: #3a7a2a; }
.subject.lang { background: #fbeee6; color: #b0552a; }
.subject.math { background: #f2eafb; color: #6a4aaa; }
.subject.prog { background: #eef0e6; color: #55603a; }

/* ============================================================
   TABLES
   ============================================================ */
.table-scroll { overflow-x: auto; margin: 16px 0; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: .94rem;
}
th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  background: var(--stadium);
  color: var(--chalk);
  font-size: .78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
tbody tr:nth-child(even) { background: #faf9f3; }
td code { white-space: nowrap; }

/* callouts */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  background: #fffbf0;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
}
.callout.grass { border-left-color: var(--grass); background: #f2fbf6; }
.callout p:last-child { margin-bottom: 0; }

/* code-as-curriculum reference pill */
.src-hint {
  font-size: .86rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */
.doc-footer {
  background: var(--stadium);
  color: #cfd6cf;
  text-align: center;
  padding: 30px 20px 40px;
  margin-top: 20px;
  border-top: 3px solid var(--grass);
}
.doc-footer strong { color: var(--chalk); }
.doc-footer .links { margin-top: 10px; }
.doc-footer a { color: var(--gold); }

/* ============================================================
   SOURCE LINKS (clickable code refs — viewer styles injected by JS)
   ============================================================ */
.source-link {
  color: var(--grass-d);
  cursor: pointer;
  border-bottom: 1px dashed rgba(14,147,86,.5);
}
.source-link:hover { color: var(--grass); text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  section { padding: 22px 18px; }
  .doc-nav-inner { padding: 8px 14px; gap: 8px; }
  .doc-nav-pills { order: 3; width: 100%; }
  .doc-nav-spacer { display: none; }
  .hero { padding: 44px 16px 50px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .doc-nav, .hero::after, .doc-footer .links { display: none; }
  body { background: #fff; }
  section, .card, .activity { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .hero { color: #000; background: #fff; border-bottom: 2px solid #000; }
  .hero h1 em, a { color: #000; }
  thead th { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
