/* ═══════════════════════════════════════════════════
   TI-84 Online — Shared Stylesheet
   Aesthetic: Clean Academic / EDU-GOV Authority
   ═══════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --navy:       #0d2d4f;
  --navy-mid:   #1a4570;
  --gold:       #c8952a;
  --gold-light: #e8b84b;
  --bg:         #ffffff;
  --bg-soft:    #f5f6f8;
  --border:     #dde1e7;
  --text-dark:  #141c26;
  --text-body:  #2d3748;
  --text-muted: #5c6b7a;
  --red:        #c0392b;
  --green:      #1a7340;

  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans:  'DM Sans', system-ui, -apple-system, sans-serif;

  --max-width: 1120px;
  --gap: 24px;
  --radius: 8px;
  --header-h: 62px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--gold); }

kbd {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--navy);
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

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

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-dark);
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo strong { font-weight: 700; }
.site-logo:hover { color: var(--navy); opacity: 0.85; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--bg-soft);
  color: var(--navy);
}
.nav-link.active {
  background: var(--navy);
  color: #fff;
}
.nav-link.active:hover { background: var(--navy-mid); color: #fff; }

/* ── NAV DROPDOWN ── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  border-radius: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  background: var(--bg-soft);
  color: var(--navy);
}
.nav-dropdown-toggle.active {
  background: var(--navy);
  color: #fff;
}
.nav-dropdown-toggle svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-dropdown.open .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
  padding: 6px;
  z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-dropdown-menu a:hover { background: var(--bg-soft); color: var(--navy); }
.nav-dropdown-menu a.active { background: #eef4fb; color: var(--navy); font-weight: 600; }
.nav-dropdown-menu .menu-icon {
  width: 28px; height: 28px;
  background: var(--navy);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.nav-dropdown-menu .menu-label { line-height: 1.3; }
.nav-dropdown-menu .menu-label small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}
.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* Mobile dropdown inside open nav */
@media (max-width: 640px) {
  .nav-dropdown-toggle { width: 100%; justify-content: space-between; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--bg-soft);
    margin: 2px 0 4px 12px;
    padding: 4px;
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-dark);
  line-height: 1;
}

/* ── SECTION TITLES ── */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.25;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-primary:hover { background: var(--navy-mid); color: #fff; }
.btn-primary:focus { background: var(--navy-mid); color: #fff; outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.925rem;
  padding: 11px 28px;
  border-radius: 6px;
  border: 1.5px solid var(--navy);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-outline:focus { background: var(--navy); color: #fff; }

.btn-gold {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.925rem;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-gold:focus { background: var(--gold-light); color: var(--navy); }

/* ── BREADCRUMB ── */
.breadcrumb {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.825rem;
  color: var(--text-muted);
}
.breadcrumb li + li::before {
  content: "›";
  color: var(--border);
  margin-right: 6px;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-dark); font-weight: 500; }

/* ── PAGE HERO (interior pages) ── */
.page-hero {
  background: var(--navy);
  color: #fff;
  padding: 52px 0 44px;
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 14px;
}
.page-hero h1 em { font-style: normal; color: var(--gold-light); }
.page-hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1.05rem;
  max-width: 560px;
  line-height: 1.65;
}

/* ── ALERT BOXES ── */
.info-box {
  background: #eef4fb;
  border-left: 4px solid var(--navy);
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 24px 0;
}
.info-box strong { color: var(--navy); }

.warn-box {
  background: #fef9ec;
  border-left: 4px solid var(--gold);
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 24px 0;
}

/* ── TABLES ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.data-table thead { background: var(--navy); color: #fff; }
.data-table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  line-height: 1.5;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--bg-soft); }

/* ── CONTENT PROSE ── */
.content-wrap {
  max-width: 780px;
  margin: 0 auto;
}
.prose h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 600;
  color: var(--text-dark);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  line-height: 1.3;
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 32px 0 10px;
}
.prose p {
  margin-bottom: 16px;
  color: var(--text-body);
  line-height: 1.75;
}
.prose ul, .prose ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.prose li {
  margin-bottom: 6px;
  color: var(--text-body);
  line-height: 1.65;
}
.prose strong { color: var(--text-dark); font-weight: 600; }
.prose a { color: var(--navy); font-weight: 500; }

/* ── FOOTER ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding-top: 56px;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand .site-logo { margin-bottom: 14px; }
.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  max-width: 240px;
  margin: 0;
}
.footer-nav {
  display: contents;
}
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 18px 0;
}
.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  margin: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 20px;
    gap: 2px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  }
  .nav-toggle { display: flex; }

  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .container { padding: 0 16px; }
}
