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

:root {
  --navy: #1a2f4e;
  --slate: #2e4a6b;
  --teal: #2a7f8a;
  --teal-light: #3ba8b6;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1e2d3d;
  --muted: #5a6a7a;
  --border: #d1dbe6;
  --ad-bg: #f9f9f9;
}

body {
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-light); text-decoration: underline; }

/* ===== SKIP LINK (accessibility) ===== */
.skip-link {
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 8px; top: 8px; width: auto; height: auto;
  background: var(--teal); color: #fff; padding: 8px 16px; border-radius: 4px; z-index: 9999; font-size: 0.9rem;
}

/* ===== HEADER ===== */
header {
  background: var(--navy);
  color: #fff;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.site-title { font-size: 1.5rem; font-weight: 700; color: #fff; line-height: 1.2; }
.site-title a { color: #fff; text-decoration: none; }
.site-title a:hover { color: #fff; text-decoration: none; opacity: 0.9; }
.site-title span { color: var(--teal-light); }
.site-tagline { font-size: 0.78rem; color: #9bb5cc; margin-top: 3px; }

/* Desktop nav */
nav ul { list-style: none; display: flex; gap: 8px; align-items: center; }
nav a {
  color: #cde; font-size: 0.88rem; font-weight: 500;
  padding: 6px 12px; border-radius: 4px; display: block;
  transition: background 0.15s, color 0.15s;
}
nav a:hover, nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,0.12); text-decoration: none; }

/* ===== HAMBURGER (mobile only) ===== */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: #cde;
}
.nav-toggle svg { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="false"] .icon-close { display: none; }

/* ===== LEADERBOARD AD ===== */
.ad-leaderboard {
  background: var(--ad-bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 10px 0;
}
.ad-leaderboard .ad-label { font-size: 0.7rem; color: #999; margin-bottom: 4px; }
.ad-slot-728 {
  display: inline-block;
  width: 728px;
  max-width: 100%;
  height: 90px;
  background: #e8eef5;
  border: 1px dashed #bbc;
  line-height: 90px;
  font-size: 0.8rem;
  color: #888;
}

/* ===== LAYOUT ===== */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}
.page-wrap.full-width { grid-template-columns: 1fr; }
main { min-width: 0; }

/* ===== SIDEBAR ===== */
aside { display: flex; flex-direction: column; gap: 20px; }
.ad-box {
  background: var(--ad-bg);
  border: 1px dashed #bbc;
  text-align: center;
  padding: 8px;
}
.ad-box .ad-label { font-size: 0.7rem; color: #999; display: block; margin-bottom: 6px; }
.ad-slot-300x250 {
  display: block;
  width: 300px;
  max-width: 100%;
  height: 250px;
  background: #e8eef5;
  line-height: 250px;
  font-size: 0.8rem;
  color: #888;
}
.ad-slot-300x600 {
  display: block;
  width: 300px;
  max-width: 100%;
  height: 600px;
  background: #e8eef5;
  line-height: 600px;
  font-size: 0.8rem;
  color: #888;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--slate) 0%, var(--teal) 100%);
  color: #fff;
  border-radius: 8px;
  padding: 40px 32px;
  margin-bottom: 24px;
}
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero p { font-size: 1rem; color: #cde; max-width: 600px; }

/* ===== CARDS / DIRECTORY GRID ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--teal);
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.dir-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.dir-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: var(--teal); }
.dir-card .flag { font-size: 1.8rem; margin-bottom: 8px; }
.dir-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.dir-card .since { font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.dir-card .form-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: #e0f0f3;
  color: var(--teal);
  border-radius: 12px;
  padding: 2px 8px;
  margin-bottom: 10px;
}
.dir-card a.read-more {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
}

/* ===== ARTICLE / DETAIL PAGE ===== */
.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--teal); }

.article-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
}
.article-header .flag-title { display: flex; align-items: center; gap: 14px; }
.article-header .flag-title span { font-size: 3rem; }
.article-header h1 { font-size: 1.8rem; color: var(--navy); }
.article-header .subtitle { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 16px;
  background: #e4f1f4;
  color: var(--slate);
  font-weight: 600;
}
.chip.green { background: #e4f5ea; color: #1e7a3c; }
.chip.amber { background: #fef3e2; color: #a05f00; }

.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}
.content-card h2 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.content-card ul { padding-left: 20px; }
.content-card li { margin-bottom: 6px; font-size: 0.92rem; }
.content-card p { font-size: 0.92rem; margin-bottom: 10px; }
.content-card p:last-child { margin-bottom: 0; }

.in-content-ad {
  background: var(--ad-bg);
  border: 1px dashed #bbc;
  text-align: center;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
}
.in-content-ad .ad-label { font-size: 0.7rem; color: #999; display: block; margin-bottom: 6px; }
.ad-slot-468 {
  display: inline-block;
  width: 468px;
  max-width: 100%;
  height: 60px;
  background: #e8eef5;
  line-height: 60px;
  font-size: 0.8rem;
  color: #888;
}

.orgs-list { list-style: none; padding: 0; }
.orgs-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.orgs-list li:last-child { border-bottom: none; }

/* ===== STATE LIST ===== */
.state-list { list-style: none; padding: 0; }
.state-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.state-list li:last-child { border-bottom: none; }
.state-list .state-name { font-weight: 600; color: var(--navy); }
.state-list .state-year { font-size: 0.8rem; color: var(--muted); }

/* ===== DISCLAIMER ===== */
.disclaimer {
  background: #fff8e1;
  border-left: 4px solid #f5a623;
  border-radius: 4px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: #5a4500;
  margin-bottom: 20px;
}

/* ===== FOOTER ===== */
footer {
  background: var(--navy);
  color: #9bb5cc;
  margin-top: 48px;
  padding: 32px 24px;
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
footer h4 { color: #fff; margin-bottom: 10px; font-size: 0.95rem; }
footer h4 a { color: #fff; text-decoration: none; }
footer h4 a:hover { color: var(--teal-light); text-decoration: none; }
footer ul { list-style: none; }
footer li { margin-bottom: 6px; }
footer a { color: #9bb5cc; }
footer a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid #2e4a6b;
  font-size: 0.78rem;
  color: #6a8a9a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .page-wrap { grid-template-columns: 1fr; }
  aside { flex-direction: row; flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .article-header h1 { font-size: 1.5rem; }
}

@media (max-width: 680px) {
  /* Show hamburger, hide desktop nav */
  .nav-toggle { display: flex; align-items: center; }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--slate);
    padding: 8px 0 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
  nav.open { display: block; }
  nav ul { flex-direction: column; gap: 0; }
  nav a { padding: 12px 24px; font-size: 1rem; border-radius: 0; }

  /* Layout */
  .page-wrap { padding: 16px 12px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.3rem; }
  .hero p { font-size: 0.9rem; }
  .article-header { padding: 18px; }
  .article-header h1 { font-size: 1.3rem; }
  .article-header .flag-title span { font-size: 2rem; }
  .content-card { padding: 16px; }
  .directory-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }

  /* Typography scale-down */
  body { font-size: 16px; }
  .content-card li, .content-card p { font-size: 0.95rem; }

  /* Leaderboard: show mobile banner instead */
  .ad-slot-728 { height: 50px; line-height: 50px; font-size: 0.75rem; }

  /* Chips wrap better */
  .meta-chips { gap: 6px; }
  .chip { font-size: 0.72rem; padding: 3px 9px; }
}

/* ===== FOCUS / A11Y ===== */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal-light);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== PRINT ===== */
@media print {
  header, footer, aside, .ad-leaderboard, .in-content-ad, .ad-box { display: none !important; }
  .page-wrap { grid-template-columns: 1fr; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}

/* Hide placeholder ad boxes on screen so no empty/dummy "Ad — NxN" boxes ship.
   Ads are served by AdSense Auto Ads via the loader script in each <head>. */
.ad-leaderboard, .in-content-ad, .ad-box { display: none !important; }
