/* ==========================================================================
   Jeori Public School — Design System
   Palette: Mountain Pine (deep green) + Marigold (warm orange accent)
   Type: Fraunces (display/serif), Work Sans (body), IBM Plex Mono (data)
   ========================================================================== */

:root {
  /* Pine greens */
  --pine-900: #12231a;
  --pine-800: #1a3226;
  --pine-700: #234433;
  --pine-600: #2f5941;
  --pine-500: #3d715373;
  --pine-500: #3d7153;
  --pine-100: #e6ede8;

  /* Marigold accents */
  --marigold-600: #c9791f;
  --marigold-500: #e08e26;
  --marigold-400: #eaa953;
  --marigold-100: #fbf0dd;

  /* Neutrals */
  --stone-900: #201d19;
  --stone-700: #4a443c;
  --stone-500: #766e62;
  --stone-200: #e9e3d8;
  --stone-100: #f6f2ea;
  --white: #ffffff;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 3px rgba(18, 35, 26, 0.08);
  --shadow-md: 0 8px 24px rgba(18, 35, 26, 0.12);
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--stone-900);
  background: var(--stone-100);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--pine-800);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a {
  color: var(--pine-700);
  text-decoration: none;
}

a:hover { color: var(--marigold-600); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--marigold-600);
  display: block;
  margin-bottom: 0.75em;
}

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--pine-900);
  box-shadow: var(--shadow-sm);
}

.topbar {
  background: var(--pine-800);
  color: var(--stone-200);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar a { color: var(--marigold-400); }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--marigold-500);
  color: var(--pine-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-text .name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--white);
  display: block;
  line-height: 1.15;
}

.brand-text .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--marigold-400);
  letter-spacing: 0.08em;
}

#nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.main-nav > ul {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav > ul > li > a {
  display: block;
  padding: 10px 12px;
  color: var(--stone-200);
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a {
  background: var(--pine-700);
  color: var(--white);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.18s ease;
  z-index: 10;
}

.main-nav > ul > li:hover .dropdown,
.main-nav > ul > li:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--pine-800);
  font-size: 0.86rem;
}

.dropdown a:hover {
  background: var(--pine-100);
  color: var(--pine-800);
}

.nav-cta {
  background: var(--marigold-500) !important;
  color: var(--pine-900) !important;
  margin-left: 6px;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--marigold-400) !important;
}

@media (max-width: 980px) {
  #nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: fixed;
    inset: 0;
    top: 0;
    background: var(--pine-900);
    flex-direction: column;
    align-items: stretch;
    padding: 90px 24px 24px;
    overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav > ul {
    flex-direction: column;
    width: 100%;
  }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--pine-800);
    display: none;
    margin-top: 4px;
  }
  .main-nav > ul > li.open .dropdown { display: block; }
  .dropdown a { color: var(--stone-200); }
  .dropdown a:hover { background: var(--pine-700); color: var(--white); }
  #mobile-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    display: none;
    z-index: 101;
  }
  .main-nav.open ~ #mobile-close,
  .navbar.menu-open #mobile-close { display: block; }
}

/* ---------- Hero / page header ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--pine-800), var(--pine-900));
  color: var(--white);
  padding: 64px 0 56px;
}

.page-hero .breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--stone-200);
  margin-bottom: 14px;
}

.page-hero .breadcrumb a { color: var(--marigold-400); }
.page-hero h1 { color: var(--white); margin-bottom: 0.3em; }
.page-hero p.lede { color: var(--stone-200); max-width: 640px; font-size: 1.05rem; }

/* ---------- Content sections ---------- */
.section {
  padding: 56px 0;
}

.section-tight { padding: 32px 0; }
.section-alt { background: var(--white); }
.section-pine {
  background: var(--pine-800);
  color: var(--stone-200);
}
.section-pine h2, .section-pine h3 { color: var(--white); }

.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card h3 { margin-bottom: 0.4em; }

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.card-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--stone-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-list li:last-child { border-bottom: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--marigold-500);
  color: var(--pine-900);
}
.btn-primary:hover { background: var(--marigold-400); color: var(--pine-900); }
.btn-outline {
  border-color: var(--white);
  color: var(--white);
  background: transparent;
}
.btn-outline:hover { background: var(--white); color: var(--pine-800); }
.btn-outline-dark {
  border-color: var(--pine-700);
  color: var(--pine-700);
  background: transparent;
}
.btn-outline-dark:hover { background: var(--pine-700); color: var(--white); }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--white);
}
table.data-table th, table.data-table td {
  padding: 12px 14px;
  border: 1px solid var(--stone-200);
  text-align: left;
}
table.data-table th {
  background: var(--pine-100);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pine-800);
}
table.data-table td.mono, table.data-table th.mono { font-family: var(--font-mono); }

.download-list { list-style: none; margin: 0; padding: 0; }
.download-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.download-list .file-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--stone-500);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}
.subnav a {
  padding: 8px 16px;
  border: 1px solid var(--stone-200);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.85rem;
  color: var(--pine-700);
}
.subnav a:hover, .subnav a.active {
  background: var(--pine-700);
  color: var(--white);
  border-color: var(--pine-700);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gallery-grid .tile {
  aspect-ratio: 4/3;
  background: var(--pine-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pine-600);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: center;
  padding: 8px;
  overflow: hidden;
}
@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.notice-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--marigold-100);
  color: var(--marigold-600);
}

/* ---------- Footer ---------- */
#site-footer {
  background: var(--pine-900);
  color: var(--stone-200);
  padding: 56px 0 24px;
  margin-top: 40px;
}
#site-footer h4 {
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}
#site-footer a { color: var(--stone-200); }
#site-footer a:hover { color: var(--marigold-400); }
#site-footer ul { list-style: none; padding: 0; margin: 0; }
#site-footer li { margin-bottom: 10px; font-size: 0.9rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 40px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--stone-500);
}
