:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --ink: #0f172a;
  --body: #334155;
  --muted: #475569;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --radius: 10px;
  --container: 1140px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body);
  background-color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--ink);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 64px;
  position: relative;
}

.brand-link {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.5rem 0;
}

.brand-link:hover {
  color: var(--accent);
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.primary-nav a {
  color: var(--body);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 7px;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 7px;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--surface-alt);
  color: var(--ink);
}

.mobile-nav {
  display: block;
}

.mobile-nav summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
}

.mobile-nav-panel a:hover,
.mobile-nav-panel a[aria-current="page"] {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.header-cta-desktop {
  display: none;
}

@media (min-width: 860px) {
  .primary-nav {
    display: flex;
  }
  .header-cta-desktop {
    display: inline-flex;
  }
  .mobile-nav {
    display: none;
  }
}

/* Main Page Shell */
.page-main {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #94a3b8;
}

/* Hero (Homepage) */
.hero-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.75rem;
}

.hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.hero-card h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.625rem, 3.2vw, 2.375rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.hero-lead {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  max-width: 72ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .hero-card {
    padding: 2.25rem 2.25rem;
  }
}

/* Responsive Content + Sidebar Grid */
.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 960px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 2rem;
  }
}

/* Article & Content Surfaces */
.content-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
}

@media (min-width: 768px) {
  .content-card {
    padding: 2.25rem 2.5rem;
  }
}

.article-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.article-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.article-body {
  max-width: 74ch;
}

.article-body h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.article-body h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--ink);
}

.article-body p {
  margin: 0 0 1.25rem;
  font-size: 1.03125rem;
  line-height: 1.75;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35rem;
  padding-left: 1.35rem;
}

.article-body li {
  margin-bottom: 0.55rem;
  line-height: 1.7;
}

.article-body figure {
  margin: 1.5rem auto;
  text-align: center;
}

.article-body figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.article-body img {
  margin: 1.5rem auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.article-body dl {
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg);
  padding: 1rem 1.25rem;
}

.article-body dt {
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.75rem;
}

.article-body dt:first-child {
  margin-top: 0;
}

.article-body dd {
  margin: 0.25rem 0 0;
  color: var(--body);
}

/* FAQ Accordions */
.article-body details {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  padding: 0.9rem 1.1rem;
}

.article-body details summary {
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.45;
  min-height: 28px;
}

.article-body details[open] summary {
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.article-body details p:last-child {
  margin-bottom: 0;
}

/* Homepage Article List */
.section-heading {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.post-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1875rem;
  line-height: 1.35;
}

.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post-card p {
  margin: 0 0 0.75rem;
  color: var(--body);
  font-size: 0.96875rem;
  line-height: 1.65;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

/* Related Links Box */
.related-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-box h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  color: var(--ink);
}

.related-box ul {
  margin: 0;
  padding-left: 1.25rem;
}

.related-box li {
  margin-bottom: 0.4rem;
}

/* Directory Section on Homepage */
.directory-section {
  margin-top: 2rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.directory-intro {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.directory-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 680px) {
  .directory-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.directory-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  background-color: var(--bg);
}

.directory-group h3 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.directory-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}

.directory-grid li {
  border-top: 1px solid var(--surface-alt);
}

.directory-grid li:first-child {
  border-top: 0;
}

.directory-grid a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.90625rem;
  line-height: 1.45;
  color: var(--body);
  text-decoration: none;
}

.directory-grid a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Sidebar */
.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.sidebar-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.sidebar-card p {
  margin: 0 0 0.85rem;
  font-size: 0.90625rem;
  line-height: 1.6;
  color: var(--body);
}

.sidebar-card p:last-child {
  margin-bottom: 0;
}

.sidebar-badge-img {
  margin-top: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-links li {
  border-top: 1px solid var(--surface-alt);
}

.sidebar-links li:first-child {
  border-top: 0;
}

.sidebar-links a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--body);
  text-decoration: none;
}

.sidebar-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
  }
}

.site-footer h2 {
  margin: 0 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
}

.site-footer p,
.site-footer li {
  margin: 0 0 0.45rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--body);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

@media print {
  .site-header,
  .site-sidebar,
  .mobile-nav,
  .skip-link,
  .hero-actions {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .content-card,
  .hero-card,
  .post-card {
    border: 0;
    padding: 0;
  }
}
