/* ==========================================================================
   D5 LTG — Harlem CSD 5 Learning Technology Grant
   Shared design system. Edit colors/fonts here; every page inherits.
   ========================================================================== */

:root {
  /* Brand */
  --navy:        #1F4E79;
  --navy-light:  #4A7BB0;
  --navy-dark:   #163A5A;
  --gold:        #E8A23C;
  --gold-soft:   #F6DFB8;

  /* District logo accents */
  --d5-red:      #D8382C;
  --d5-gold:     #F4A818;
  --d5-green:    #1A9A52;

  /* Surfaces */
  --bg:          #F7F9FC;
  --card:        #FFFFFF;
  --border:      #DDE3EC;
  --text:        #1A2B3D;
  --text-muted:  #5A6B7E;

  /* Legs */
  --leg-myon:    #00897B;
  --leg-le:      #277DA1;

  /* Little Engineers unit colors (carried over from the original dashboard) */
  --unit1: #D62828;
  --unit2: #00897B;
  --unit3: #8E44AD;
  --unit4: #F77F00;
  --unit5: #277DA1;
  --bonus: #888888;

  /* Asset type colors */
  --type-lesson:    #00897B;
  --type-deck:      #1F4E79;
  --type-blueprint: #277DA1;
  --type-handout:   #E8A23C;
  --type-template:  #8E44AD;
  --type-other:     #888888;

  /* States (deliberately distinct from brand navy/gold) */
  --ok:      #2E7D32;
  --caution: #E67E22;
  --alert:   #C0392B;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(26,43,61,.06), 0 4px 14px rgba(26,43,61,.05);
  --maxw: 1180px;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; }

a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--navy-light); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.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;
}

/* Skip link ------------------------------------------------------------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* ==========================================================================
   Site header + navigation
   ========================================================================== */

.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
}
.site-header a { color: #fff; text-decoration: none; }

.header-bar {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
}
.header-logo { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; background: #fff; }
.header-titles { min-width: 0; }
.header-titles .site-name {
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; display: block;
}
.header-titles .site-sub {
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--gold-soft); display: block;
}

.nav-toggle {
  margin-left: auto; display: none; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3); color: #fff;
  font: inherit; font-size: .9rem; padding: 9px 14px; border-radius: 8px; cursor: pointer;
  min-height: 42px;
}

.site-nav { margin-left: auto; }
.site-nav ul {
  list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap;
}
.site-nav a {
  display: block; padding: 10px 14px; border-radius: 8px; font-size: .95rem;
  transition: background .18s ease;
}
.site-nav a:hover, .site-nav a:focus { background: rgba(255,255,255,.14); }
.site-nav a[aria-current="page"], .site-nav a.is-active {
  background: rgba(255,255,255,.18); box-shadow: inset 0 -3px 0 var(--gold);
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { flex-basis: 100%; margin-left: 0; display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding-bottom: 10px; }
  .header-bar { flex-wrap: wrap; }
}

/* Breadcrumb ------------------------------------------------------------ */
.crumbs { background: #fff; border-bottom: 1px solid var(--border); font-size: .88rem; }
.crumbs ol {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
  max-width: var(--maxw); margin: 0 auto; padding: 10px 24px;
}
.crumbs li + li::before { content: "›"; color: var(--text-muted); margin-right: 6px; }
.crumbs a { color: var(--text-muted); }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, #2C6396 100%);
  color: #fff; padding: 64px 0 72px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 6px;
  background: linear-gradient(90deg, var(--d5-red), var(--d5-gold), var(--d5-green), var(--navy-light));
}
.hero h1 { color: #fff; margin-bottom: .3em; }
.hero .eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; color: var(--gold-soft);
}
.hero .lede { font-size: 1.15rem; max-width: 62ch; color: #E4EDF6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 11px 22px; border-radius: 999px; font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #26313D; }
.btn-primary:hover { background: #F2B35A; color: #26313D; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-solid { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-light); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy-light); color: var(--navy); }

/* ==========================================================================
   Sections + cards
   ========================================================================== */

.section { padding: 56px 0; }
.section-alt { background: #fff; border-block: 1px solid var(--border); }
.section-head { max-width: 66ch; margin-bottom: 32px; }
.section-head .kicker {
  font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-light); font-weight: 700; margin-bottom: 8px;
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }

a.card { text-decoration: none; color: inherit; display: block; transition: border-color .18s, transform .15s, box-shadow .18s; }
a.card:hover { border-color: var(--navy-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,43,61,.10); }
a.card .go { color: var(--navy); font-weight: 600; font-size: .93rem; }
a.card:hover .go { text-decoration: underline; }

/* Cycle cards ----------------------------------------------------------- */
.cycle-card { position: relative; padding-top: 26px; }
.cycle-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--navy-light);
}
.cycle-card.is-current::before { background: linear-gradient(90deg, var(--gold), var(--d5-red)); }
.cycle-card .years { font-size: .95rem; color: var(--text-muted); font-weight: 500; }

.badge {
  display: inline-block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge-current  { background: #E8F5E9; color: #1B5E20; }
.badge-complete { background: #ECEFF3; color: #45566B; }
.badge-planned  { background: #FFF4E2; color: #8A5A11; }

/* Leg cards ------------------------------------------------------------- */
.leg-card { border-top: 5px solid var(--navy-light); }
.leg-card.leg-myon { border-top-color: var(--leg-myon); }
.leg-card.leg-le   { border-top-color: var(--leg-le); }
.leg-tag {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  color: var(--leg-le);
}
.leg-myon .leg-tag { color: var(--leg-myon); }

/* Stats ----------------------------------------------------------------- */
.stat { text-align: center; padding: 22px 16px; }
.stat .num { font-family: var(--serif); font-size: 2.4rem; color: var(--navy); line-height: 1; display: block; }
.stat .label { font-size: .9rem; color: var(--text-muted); margin-top: 6px; display: block; }

/* Timeline -------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
@media (min-width: 760px) { .timeline { grid-template-columns: repeat(3, 1fr); } }
.timeline li {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; box-shadow: var(--shadow);
}
.timeline .yr {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  color: var(--navy-light); display: block; margin-bottom: 6px;
}
.timeline li.is-now { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.timeline li h3 { font-size: 1.1rem; }
.timeline li p { font-size: .95rem; color: var(--text-muted); margin: 0; }

/* Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: #F2F5F9; font-weight: 600; font-size: .85rem; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
tbody tr:last-child td { border-bottom: 0; }

/* Notices --------------------------------------------------------------- */
.notice {
  border-left: 4px solid var(--gold); background: #FFFAF0;
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 24px;
}
.notice.notice-info { border-left-color: var(--navy-light); background: #F0F6FC; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: 4px; }

/* File lists ------------------------------------------------------------ */
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  text-decoration: none; color: inherit; transition: border-color .18s, background .18s;
  min-height: 46px;
}
.file-item:hover { border-color: var(--navy-light); background: #FBFCFE; }
.file-ext {
  flex: 0 0 auto; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--type-other);
  padding: 5px 8px; border-radius: 5px; min-width: 46px; text-align: center;
}
.ext-docx { background: #2B579A; }
.ext-pptx { background: #C43E1C; }
.ext-pdf  { background: #B32025; }
.ext-md   { background: #4B5563; }
.ext-link { background: var(--navy-light); }
.file-meta { min-width: 0; }
.file-name { display: block; font-weight: 500; overflow-wrap: anywhere; }
.file-kind { display: block; font-size: .82rem; color: var(--text-muted); }

/* Chips / filters ------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  font: inherit; font-size: .88rem; padding: 8px 15px; min-height: 40px;
  border-radius: 999px; border: 1px solid var(--border); background: #fff;
  color: var(--text); cursor: pointer; transition: all .16s ease;
}
.chip:hover { border-color: var(--navy-light); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.search-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-row input[type="search"] {
  flex: 1 1 260px; font: inherit; padding: 11px 15px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.search-row input[type="search"]:focus { outline: 2px solid var(--navy-light); outline-offset: 1px; }
.result-count { font-size: .9rem; color: var(--text-muted); margin-bottom: 14px; }

/* Lesson cards ---------------------------------------------------------- */
.lesson-card { position: relative; padding-left: 26px; }
.lesson-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6px;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--bonus);
}
.lesson-card[data-unit="1"]::before { background: var(--unit1); }
.lesson-card[data-unit="2"]::before { background: var(--unit2); }
.lesson-card[data-unit="3"]::before { background: var(--unit3); }
.lesson-card[data-unit="4"]::before { background: var(--unit4); }
.lesson-card[data-unit="5"]::before { background: var(--unit5); }
.lesson-num {
  font-family: var(--serif); font-size: 1.6rem; color: var(--navy); line-height: 1;
}
.lesson-unit { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.lesson-card h3 { font-size: 1.12rem; margin: 6px 0 8px; }
.lesson-focus { font-size: .93rem; color: var(--text-muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: .74rem; padding: 3px 9px; border-radius: 999px;
  background: #EEF2F7; color: #45566B; font-weight: 600;
}

/* Detail panel ---------------------------------------------------------- */
details.lesson-detail { margin-top: 14px; }
details.lesson-detail > summary {
  cursor: pointer; font-weight: 600; color: var(--navy); font-size: .93rem;
  padding: 8px 0; list-style: none;
}
details.lesson-detail > summary::-webkit-details-marker { display: none; }
details.lesson-detail > summary::before { content: "▸ "; }
details.lesson-detail[open] > summary::before { content: "▾ "; }
.detail-body { border-top: 1px solid var(--border); padding-top: 14px; font-size: .93rem; }
.detail-body h4 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 16px 0 6px; }
.detail-body h4:first-child { margin-top: 0; }
.detail-body ul { margin: 0; padding-left: 20px; }
.detail-body li { margin-bottom: 4px; }

/* Steps ----------------------------------------------------------------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; position: relative; padding-left: 52px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding-block: 16px; padding-right: 18px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: .9rem; font-weight: 700; font-family: var(--sans);
}
.steps li strong { display: block; margin-bottom: 2px; }
.steps li p { margin: 0; font-size: .93rem; color: var(--text-muted); }

.cred {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #EEF2F7; padding: 2px 7px; border-radius: 5px; font-size: .9em;
  overflow-wrap: anywhere;
}

/* Gallery --------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; background: #E7EDF4; }

/* Footer ---------------------------------------------------------------- */
.site-footer {
  background: var(--navy-dark); color: #C9D8E6; margin-top: 64px;
  padding: 44px 0 28px; font-size: .93rem;
}
.site-footer h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 10px; }
.site-footer a { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14); margin-top: 30px; padding-top: 18px;
  font-size: .84rem; color: #93A9BF;
}

/* Print ----------------------------------------------------------------- */
@media print {
  .site-header, .site-nav, .nav-toggle, .crumbs, .hero-actions,
  .chips, .search-row, .site-footer, .skip { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .hero { background: #fff !important; color: #000; padding: 0 0 12pt; }
  .hero h1, .hero .lede { color: #000; }
  .card, .timeline li, .file-item { break-inside: avoid; box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
