:root {
  --primary: #1a6e8a;
  --primary-dark: #0d5570;
  --primary-light: #d4edf5;
  --accent: #70bdbd;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --nav-height: 60px;
  --max-width: 1100px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── Navigation ───────────────────────────────── */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  gap: 2rem;
}
.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav-brand:hover { color: white; text-decoration: none; opacity: 0.9; }
.nav-brand span { font-weight: 300; opacity: 0.85; font-size: 0.9rem; margin-left: 0.4rem; }
.nav-links {
  display: flex;
  list-style: none;
  gap: 0.1rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: white;
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

/* ── Hero (index only) ────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a6e8a 0%, #0a4a64 100%);
  color: white;
  padding: 3rem 0 2.5rem;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
}
.hero-text { flex: 1; }
.hero-text h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.hero-text h1 abbr { text-decoration: none; border-bottom: 2px solid var(--accent); }
.hero-text p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 580px;
  line-height: 1.7;
}
.hero-search { min-width: 320px; padding-top: 0.5rem; }
.hero-search form { display: flex; }
.hero-search input[type="text"] {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.hero-search input[type="text"]::placeholder { color: rgba(255, 255, 255, 0.65); }
.hero-search input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.22);
}
.hero-search button {
  padding: 0.65rem 1.1rem;
  background: white;
  color: var(--primary);
  border: 2px solid white;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.hero-search button:hover { background: var(--primary-light); }
.hero-search .search-examples {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  opacity: 0.82;
}
.hero-search .search-examples a { color: rgba(255, 255, 255, 0.88); text-decoration: underline; }
.hero-search .search-examples a:hover { color: white; }

/* ── Main content wrapper ─────────────────────── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ── Card grid ────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); }
.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
  display: block;
}
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.6rem;
}
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--primary-dark); text-decoration: none; }
.card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ── Page headings ────────────────────────────── */
.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--primary-light);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--primary-light);
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.25rem 0 0.4rem;
}

p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
li { margin-bottom: 0.3rem; }

/* ── FAQ styles ───────────────────────────────── */
.faq-toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}
.faq-toc h3 { margin-top: 0; font-size: 1rem; margin-bottom: 0.75rem; }
.faq-toc-group { margin-bottom: 1rem; }
.faq-toc-group h4 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.faq-toc ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.faq-toc li { margin: 0; font-size: 0.88rem; }

.faq-item { margin-bottom: 1.75rem; scroll-margin-top: 80px; }
.faq-item .faq-q {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.7rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: 0;
}
.faq-item .faq-a {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem 1.1rem;
  background: var(--bg);
}

.back-to-top { font-size: 0.8rem; display: inline-block; margin-top: 0.6rem; }

/* ── Related links sidebar ────────────────────── */
.related-links {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 2.5rem;
}
.related-links h3 { margin-top: 0; font-size: 0.95rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.related-links ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; }
.related-links li { margin: 0; font-size: 0.9rem; }

/* ── Callout boxes ────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.callout-info { background: #e8f4f8; border: 1px solid #b8dcea; color: #1a4a5f; }
.callout-warning { background: #fff8e1; border: 1px solid #ffe082; color: #6b4c00; }

/* ── Footer ───────────────────────────────────── */
.site-footer {
  background: #2c3e50;
  color: rgba(255, 255, 255, 0.75);
  padding: 1.5rem 0;
  font-size: 0.83rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-footer a { color: rgba(255, 255, 255, 0.65); }
.site-footer a:hover { color: white; text-decoration: none; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; }
  .hero-search { min-width: unset; width: 100%; padding-top: 0; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
@media (max-width: 500px) {
  .hero-text h1 { font-size: 1.6rem; }
  main { padding: 1.5rem 1rem 2.5rem; }
}
