:root {
  --brand: #0ea5e9;
  --brand-dark: color-mix(in srgb, var(--brand) 78%, black);
  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --header-bg: #0f172a;
  --max: 760px;
  --wide: 1100px;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

body.nav-open { overflow: hidden; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }

.container { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }

/* ── Header & navigation ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  color: #fff;
  border-bottom: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  flex-wrap: wrap;
}

.header-brand { min-width: 0; }

.site-header .brand {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.site-header .tagline {
  margin: 0.2rem 0 0;
  color: #94a3b8;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  color: #fff;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  width: 100%;
  display: none;
}

.site-nav.is-open { display: block; }

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav-item { position: relative; }

.nav-link,
.nav-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-trigger:hover,
.nav-item.submenu-open > .nav-trigger {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-item.submenu-open > .nav-trigger .nav-chevron { transform: rotate(180deg); }

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.5rem 0.75rem;
  display: none;
  border-left: 2px solid var(--brand);
}

.nav-item.submenu-open > .nav-submenu { display: block; }

.nav-sublink {
  display: block;
  padding: 0.45rem 0.75rem;
  color: #94a3b8;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.nav-sublink:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.nav-sublink-all {
  font-weight: 600;
  color: var(--brand);
}

.nav-sublink-all:hover { color: #fff; }

@media (min-width: 768px) {
  .nav-toggle { display: none; }

  .header-inner {
    flex-wrap: nowrap;
    padding: 0.75rem 0;
  }

  .site-nav {
    display: block !important;
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.125rem;
    padding: 0;
  }

  .nav-link,
  .nav-trigger {
    width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    padding: 0.375rem;
    margin: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-left: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 50;
  }

  /* Invisible bridge so pointer can reach submenu without losing :hover */
  .nav-submenu::before {
    content: "";
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
  }

  .nav-item.has-children:hover > .nav-submenu,
  .nav-item.has-children:focus-within > .nav-submenu,
  .nav-item.has-children > .nav-submenu:hover {
    display: block;
  }

  .nav-item.submenu-open > .nav-submenu { display: none; }

  .nav-item.has-children:hover > .nav-trigger .nav-chevron,
  .nav-item.has-children:focus-within > .nav-trigger .nav-chevron {
    transform: rotate(180deg);
  }
}

/* ── Main layout ── */

main { padding: 1.75rem 0 3rem; }

/* ── Two-column layout (WP sidebar pattern) ── */

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
  align-items: start;
}

.page-main { min-width: 0; }

.sidebar { min-width: 0; }

.sidebar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  border-bottom: 2px solid var(--brand-soft);
  padding-bottom: 0.5rem;
}

.sidebar-categories,
.sidebar-subcategories,
.sidebar-recent {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-categories > .sidebar-cat-item {
  margin-bottom: 0.35rem;
}

.sidebar-categories > .sidebar-cat-item > a {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  padding: 0.2rem 0;
}

.sidebar-categories > .sidebar-cat-item > a:hover { color: var(--brand-dark); }

.sidebar-subcategories {
  margin: 0.25rem 0 0.5rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.sidebar-subcategories a {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.15rem 0;
}

.sidebar-subcategories a:hover { color: var(--brand-dark); }

.sidebar-recent li { margin-bottom: 0.5rem; }

.sidebar-recent a {
  display: block;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text);
}

.sidebar-recent a:hover { color: var(--brand-dark); }

.home-featured h1 { margin-top: 0; }

.home-buying-guides {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.home-buying-guides-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--brand-dark);
}

.home-buying-guides-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.home-buying-guides-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-buying-guides-list li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.home-buying-guides-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.home-buying-guides-list a {
  display: block;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.home-buying-guides-list a:hover { color: var(--brand-dark); }

.home-buying-guides-excerpt {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
}

.read-full {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.archive-item:last-child { border-bottom: none; }

.archive-item a {
  font-weight: 600;
  color: var(--text);
}

.archive-item a:hover { color: var(--brand-dark); }

.archive-item p {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.article-wrap { max-width: none; margin: 0; }

h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); line-height: 1.15; margin: 0 0 0.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }

.meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.25rem; }

.section-header { margin-bottom: 1.25rem; }
.section-desc { color: var(--muted); font-size: 0.9375rem; margin: 0; }

/* ── Hero ── */

.hero {
  margin: -0.5rem 0 2.5rem;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--card) 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.hero h1 { margin-bottom: 0.5rem; }

.hero-lead {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 42rem;
}

/* ── Category grid (homepage) ── */

.section-categories { margin-bottom: 2.75rem; }

.category-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.category-card-link {
  display: block;
  padding: 1.25rem;
  color: inherit;
}

.category-card-link:hover { color: inherit; }

.category-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.category-icon svg { width: 1.35rem; height: 1.35rem; }

.category-card h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--text); }

.category-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

.category-sublist {
  list-style: none;
  margin: 0;
  padding: 0 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.category-sublist a {
  font-size: 0.8125rem;
  color: var(--muted);
}

.category-sublist a:hover { color: var(--brand-dark); }

/* ── Article cards ── */

.section-articles { margin-bottom: 1rem; }

.article-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
  color: inherit;
}

.article-card-link:hover { color: inherit; }

.article-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
}

.article-card p {
  margin: 0 0 0.75rem;
  flex: 1;
  font-size: 0.875rem;
  color: var(--muted);
}

.article-card-cta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-dark);
}

/* Legacy .card / .grid (article pages, related) */

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow 0.15s;
}

.card:hover { box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card p { color: var(--muted); font-size: 0.875rem; margin: 0; }

/* ── Category archive page ── */

.category-page { max-width: var(--wide); }

.category-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.category-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.category-header-icon .category-icon svg { width: 1.65rem; height: 1.65rem; }

.category-intro {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 40rem;
}

.category-siblings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-siblings-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.category-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

.category-pill:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ── Prose & article content ── */

.prose {
  text-align: left;
}

.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.prose p { margin: 0 0 1rem; text-align: left; }
.prose ul, .prose ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
  text-align: left;
  list-style-position: outside;
}

.prose li { text-align: left; margin-bottom: 0.35rem; }
.prose h2, .prose h3, .prose h4 { text-align: left; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--card);
}

.prose thead th {
  background: var(--brand-soft);
  font-weight: 600;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.625rem 0.875rem;
  text-align: left;
  vertical-align: top;
}

.prose tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg) 70%, white);
}

.page-main .prose {
  overflow-x: auto;
}

.disclosure {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.cta-box {
  background: var(--card);
  border: 2px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 2rem 0;
  text-align: center;
}

.cta-inline {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: center;
}

.cta-inline img,
.prose .product-img img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 0 auto;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  margin-top: 0.5rem;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--brand-dark); color: #fff !important; }

.related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.1rem; }
.related ul { padding-left: 1.25rem; }
.related li { margin-bottom: 0.35rem; }

.breadcrumb {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-dark); }

/* ── Footer ── */

.site-footer {
  background: var(--header-bg);
  color: #94a3b8;
  padding: 2rem 0;
  font-size: 0.875rem;
  margin-top: 2rem;
}

.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.footer-copy { margin: 0 0 0.5rem; }
.footer-disclosure { margin: 0; font-size: 0.8125rem; color: #64748b; }

.page-content h1 { margin-top: 0; }

/* ── Contact form ── */

.contact-form-wrap { margin-top: 2rem; }

.contact-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.contact-form-heading {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-field label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

.contact-field input,
.contact-field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder { color: #94a3b8; }

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.contact-field textarea {
  resize: vertical;
  min-height: 9rem;
}

.contact-form-actions { padding-top: 0.25rem; }

.contact-form .contact-submit,
.contact-form button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 14rem;
  margin: 0;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s ease;
}

.contact-form .contact-submit:hover,
.contact-form button.btn:hover { background: var(--brand-dark); }

.contact-honeypot { display: none !important; }

.contact-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.contact-alert-success { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.contact-alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  main { padding: 1.25rem 0 2rem; }
  .category-header { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
