/* Fleet site Light/Dark/Auto — remaps shared tokens; leave ads/iframes alone. */

html[data-site-theme="dark"],
html[data-site-theme="auto"] {
  color-scheme: light dark;
}

/* Compact header control */
.site-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  padding: 0.18rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.site-theme-toggle[hidden] {
  display: none !important;
}

.site-theme-toggle-btn {
  appearance: none;
  border: 0;
  margin: 0;
  min-height: 1.85rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-theme-toggle-btn:hover,
.site-theme-toggle-btn:focus-visible {
  color: #fff;
  outline: none;
}

.site-theme-toggle-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

@media (max-width: 720px) {
  .site-theme-toggle-btn {
    min-height: 2rem;
    padding: 0.32rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* ---- Dark token overrides (explicit dark + Auto when OS is dark) ---- */
html[data-site-theme="dark"],
html[data-site-theme="dark"] body {
  --bg: #12171d;
  --bg-soft: #1a222c;
  --surface: #12171d;
  --card: #1c2430;
  --text: #f0ebe3;
  --muted: #a8b0ba;
  --line: rgba(240, 235, 227, 0.12);
  --fd-bg: #12171d;
  --fd-bg-soft: #1a222c;
  --fd-surface: #1c2430;
  --fd-text: #f0ebe3;
  --fd-muted: #a8b0ba;
  --fd-line: rgba(240, 235, 227, 0.12);
  --fd-accent: #f0ebe3;
  --fd-chip: rgba(240, 235, 227, 0.08);
  --fd-chip-hover: rgba(240, 235, 227, 0.14);
  --fd-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  background-color: #12171d;
  color: #f0ebe3;
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"],
  html[data-site-theme="auto"] body {
    --bg: #12171d;
    --bg-soft: #1a222c;
    --surface: #12171d;
    --card: #1c2430;
    --text: #f0ebe3;
    --muted: #a8b0ba;
    --line: rgba(240, 235, 227, 0.12);
    --fd-bg: #12171d;
    --fd-bg-soft: #1a222c;
    --fd-surface: #1c2430;
    --fd-text: #f0ebe3;
    --fd-muted: #a8b0ba;
    --fd-line: rgba(240, 235, 227, 0.12);
    --fd-accent: #f0ebe3;
    --fd-chip: rgba(240, 235, 227, 0.08);
    --fd-chip-hover: rgba(240, 235, 227, 0.14);
    --fd-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    background-color: #12171d;
    color: #f0ebe3;
  }
}

/* Common light-only surfaces → dark cards */
html[data-site-theme="dark"] .promo-strip,
html[data-site-theme="dark"] .post-card,
html[data-site-theme="dark"] .card,
html[data-site-theme="dark"] .topic-card,
html[data-site-theme="dark"] .blog-card,
html[data-site-theme="dark"] .newsletter-box,
html[data-site-theme="dark"] .newsletter-landing-card,
html[data-site-theme="dark"] .process,
html[data-site-theme="dark"] .program-card,
html[data-site-theme="dark"] .why-card,
html[data-site-theme="dark"] .service-card,
html[data-site-theme="dark"] .quote-panel,
html[data-site-theme="dark"] .our-brands-item,
html[data-site-theme="dark"] .partners-card,
html[data-site-theme="dark"] .site-search-overlay,
html[data-site-theme="dark"] .site-search-panel,
html[data-site-theme="dark"] .latest-card,
html[data-site-theme="dark"] .featured-aside,
html[data-site-theme="dark"] .category-card {
  background: var(--card, #1c2430) !important;
  color: var(--text, #f0ebe3);
  border-color: var(--line, rgba(240, 235, 227, 0.12));
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"] .promo-strip,
  html[data-site-theme="auto"] .post-card,
  html[data-site-theme="auto"] .card,
  html[data-site-theme="auto"] .topic-card,
  html[data-site-theme="auto"] .blog-card,
  html[data-site-theme="auto"] .newsletter-box,
  html[data-site-theme="auto"] .newsletter-landing-card,
  html[data-site-theme="auto"] .process,
  html[data-site-theme="auto"] .program-card,
  html[data-site-theme="auto"] .why-card,
  html[data-site-theme="auto"] .service-card,
  html[data-site-theme="auto"] .quote-panel,
  html[data-site-theme="auto"] .our-brands-item,
  html[data-site-theme="auto"] .partners-card,
  html[data-site-theme="auto"] .site-search-overlay,
  html[data-site-theme="auto"] .site-search-panel,
  html[data-site-theme="auto"] .latest-card,
  html[data-site-theme="auto"] .featured-aside,
  html[data-site-theme="auto"] .category-card {
    background: var(--card, #1c2430) !important;
    color: var(--text, #f0ebe3);
    border-color: var(--line, rgba(240, 235, 227, 0.12));
  }
}

html[data-site-theme="dark"] .site-footer,
html[data-site-theme="dark"] .site-footer a {
  color: color-mix(in srgb, var(--text, #f0ebe3) 88%, transparent);
}

html[data-site-theme="dark"] input,
html[data-site-theme="dark"] textarea,
html[data-site-theme="dark"] select {
  background: #1a222c;
  color: var(--text, #f0ebe3);
  border-color: var(--line, rgba(240, 235, 227, 0.18));
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"] .site-footer,
  html[data-site-theme="auto"] .site-footer a {
    color: color-mix(in srgb, var(--text, #f0ebe3) 88%, transparent);
  }
  html[data-site-theme="auto"] input,
  html[data-site-theme="auto"] textarea,
  html[data-site-theme="auto"] select {
    background: #1a222c;
    color: var(--text, #f0ebe3);
    border-color: var(--line, rgba(240, 235, 227, 0.18));
  }
}

/* Article / blog list surfaces */
html[data-site-theme="dark"] .article-body,
html[data-site-theme="dark"] .post-body,
html[data-site-theme="dark"] .content-main,
html[data-site-theme="dark"] .blog-list,
html[data-site-theme="dark"] .latest-grid article,
html[data-site-theme="dark"] .topic-rail,
html[data-site-theme="dark"] .nav-dropdown-panel,
html[data-site-theme="dark"] .nav-articles-subnav {
  background-color: transparent;
  color: var(--text, #f0ebe3);
}

html[data-site-theme="dark"] .nav-dropdown-panel,
html[data-site-theme="dark"] .nav-articles-subnav {
  background: #1c2430;
  border-color: var(--line, rgba(240, 235, 227, 0.12));
}

html[data-site-theme="dark"] .article-body a,
html[data-site-theme="dark"] .post-body a {
  color: color-mix(in srgb, var(--accent, #d4b499) 85%, #fff);
}

html[data-site-theme="dark"] .article-body pre,
html[data-site-theme="dark"] .article-body code,
html[data-site-theme="dark"] .post-body pre,
html[data-site-theme="dark"] .post-body code {
  background: #1a222c;
  color: var(--text, #f0ebe3);
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"] .nav-dropdown-panel,
  html[data-site-theme="auto"] .nav-articles-subnav {
    background: #1c2430;
    border-color: var(--line, rgba(240, 235, 227, 0.12));
  }
  html[data-site-theme="auto"] .article-body a,
  html[data-site-theme="auto"] .post-body a {
    color: color-mix(in srgb, var(--accent, #d4b499) 85%, #fff);
  }
  html[data-site-theme="auto"] .article-body pre,
  html[data-site-theme="auto"] .article-body code,
  html[data-site-theme="auto"] .post-body pre,
  html[data-site-theme="auto"] .post-body code {
    background: #1a222c;
    color: var(--text, #f0ebe3);
  }
}

/* Mobile drawer stays readable on dark header */
@media (max-width: 720px) {
  html[data-site-theme="dark"] .site-header.is-nav-open .site-nav,
  html[data-site-theme="auto"] .site-header.is-nav-open .site-nav {
    background: rgba(15, 20, 25, 0.98);
  }
}

/* Do not restyle ad / consent iframes */
html[data-site-theme="dark"] iframe[id*="google_ads"],
html[data-site-theme="dark"] .adsbygoogle,
html[data-site-theme="auto"] iframe[id*="google_ads"],
html[data-site-theme="auto"] .adsbygoogle {
  background: transparent !important;
}

/* ---- Article TOC (fleet-toc.css is light-only) ---- */
html[data-site-theme="dark"] .wp-block-rank-math-toc-block {
  background: var(--card, #1c2430);
  border-color: var(--line, rgba(240, 235, 227, 0.12));
  color: var(--text, #f0ebe3);
}

html[data-site-theme="dark"] .wp-block-rank-math-toc-block h2 {
  background: #242e3b;
  color: var(--text, #f0ebe3);
  border-bottom-color: var(--line, rgba(240, 235, 227, 0.12));
}

html[data-site-theme="dark"] .wp-block-rank-math-toc-block h2:after {
  border-color: var(--muted, #a8b0ba) transparent transparent transparent;
}

html[data-site-theme="dark"] .wp-block-rank-math-toc-block > nav > ul > li {
  border-bottom-color: var(--line, rgba(240, 235, 227, 0.1));
}

html[data-site-theme="dark"] .article-body .wp-block-rank-math-toc-block li a,
html[data-site-theme="dark"] .post-body .wp-block-rank-math-toc-block li a,
html[data-site-theme="dark"] .wp-block-rank-math-toc-block li a,
html[data-site-theme="dark"] .wp-block-rank-math-toc-block li a:visited {
  color: #9ec9ff !important;
}

html[data-site-theme="dark"] .wp-block-rank-math-toc-block li a:hover {
  background: rgba(240, 235, 227, 0.08);
  color: #c5e0ff !important;
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block {
    background: var(--card, #1c2430);
    border-color: var(--line, rgba(240, 235, 227, 0.12));
    color: var(--text, #f0ebe3);
  }
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block h2 {
    background: #242e3b;
    color: var(--text, #f0ebe3);
    border-bottom-color: var(--line, rgba(240, 235, 227, 0.12));
  }
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block h2:after {
    border-color: var(--muted, #a8b0ba) transparent transparent transparent;
  }
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block > nav > ul > li {
    border-bottom-color: var(--line, rgba(240, 235, 227, 0.1));
  }
  html[data-site-theme="auto"] .article-body .wp-block-rank-math-toc-block li a,
  html[data-site-theme="auto"] .post-body .wp-block-rank-math-toc-block li a,
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block li a,
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block li a:visited {
    color: #9ec9ff !important;
  }
  html[data-site-theme="auto"] .wp-block-rank-math-toc-block li a:hover {
    background: rgba(240, 235, 227, 0.08);
    color: #c5e0ff !important;
  }
}

/* ---- Related Posts (fleet-home.css.j2 hardcodes #f9f9f9 / #333) ---- */
html[data-site-theme="dark"] .hutts-related-posts {
  background: var(--card, #1c2430) !important;
  color: var(--text, #f0ebe3);
  border: 1px solid var(--line, rgba(240, 235, 227, 0.12));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

html[data-site-theme="dark"] .hutts-related-posts h3 {
  color: var(--text, #f0ebe3);
}

html[data-site-theme="dark"] .hutts-related-posts li {
  border-bottom-color: var(--line, rgba(240, 235, 227, 0.1));
}

html[data-site-theme="dark"] .article-body .hutts-related-posts a,
html[data-site-theme="dark"] .post-body .hutts-related-posts a,
html[data-site-theme="dark"] .hutts-related-posts a,
html[data-site-theme="dark"] .hutts-related-posts a:visited {
  color: #9ec9ff !important;
}

html[data-site-theme="dark"] .hutts-related-posts a:hover {
  color: #c5e0ff !important;
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"] .hutts-related-posts {
    background: var(--card, #1c2430) !important;
    color: var(--text, #f0ebe3);
    border: 1px solid var(--line, rgba(240, 235, 227, 0.12));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  }
  html[data-site-theme="auto"] .hutts-related-posts h3 {
    color: var(--text, #f0ebe3);
  }
  html[data-site-theme="auto"] .hutts-related-posts li {
    border-bottom-color: var(--line, rgba(240, 235, 227, 0.1));
  }
  html[data-site-theme="auto"] .article-body .hutts-related-posts a,
  html[data-site-theme="auto"] .post-body .hutts-related-posts a,
  html[data-site-theme="auto"] .hutts-related-posts a,
  html[data-site-theme="auto"] .hutts-related-posts a:visited {
    color: #9ec9ff !important;
  }
  html[data-site-theme="auto"] .hutts-related-posts a:hover {
    color: #c5e0ff !important;
  }
}

/* ---- In-article newsletter CTA (hutts-signup-cta.css is light-only) ---- */
html[data-site-theme="dark"] .hutts-signup-cta__inner {
  background: linear-gradient(180deg, #1c2430 0%, #171e28 100%) !important;
  border-color: var(--line, rgba(240, 235, 227, 0.14)) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  color: var(--text, #f0ebe3);
}

html[data-site-theme="dark"] .hutts-signup-cta__headline {
  color: var(--text, #f0ebe3) !important;
}

html[data-site-theme="dark"] .hutts-signup-cta__subtext {
  color: var(--muted, #a8b0ba) !important;
}

html[data-site-theme="dark"] .hutts-signup-cta__form label {
  color: color-mix(in srgb, var(--text, #f0ebe3) 88%, transparent);
}

html[data-site-theme="dark"] .hutts-signup-cta__form input[type="text"],
html[data-site-theme="dark"] .hutts-signup-cta__form input[type="email"] {
  background: #12171d;
  color: var(--text, #f0ebe3);
  border-color: var(--line, rgba(240, 235, 227, 0.18));
}

html[data-site-theme="dark"] .hutts-signup-cta__form input::placeholder {
  color: #c2c8d0;
  opacity: 1;
}

html[data-site-theme="dark"] .hutts-lm-message--success {
  background: #14352a;
  border-color: #2f8f6a;
  color: #d7f5e8;
}

html[data-site-theme="dark"] .hutts-lm-message--error {
  background: #3a1a1a;
  border-color: #a34b4b;
  color: #f5d7d7;
}

@media (prefers-color-scheme: dark) {
  html[data-site-theme="auto"] .hutts-signup-cta__inner {
    background: linear-gradient(180deg, #1c2430 0%, #171e28 100%) !important;
    border-color: var(--line, rgba(240, 235, 227, 0.14)) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    color: var(--text, #f0ebe3);
  }
  html[data-site-theme="auto"] .hutts-signup-cta__headline {
    color: var(--text, #f0ebe3) !important;
  }
  html[data-site-theme="auto"] .hutts-signup-cta__subtext {
    color: var(--muted, #a8b0ba) !important;
  }
  html[data-site-theme="auto"] .hutts-signup-cta__form label {
    color: color-mix(in srgb, var(--text, #f0ebe3) 88%, transparent);
  }
  html[data-site-theme="auto"] .hutts-signup-cta__form input[type="text"],
  html[data-site-theme="auto"] .hutts-signup-cta__form input[type="email"] {
    background: #12171d;
    color: var(--text, #f0ebe3);
    border-color: var(--line, rgba(240, 235, 227, 0.18));
  }
  html[data-site-theme="auto"] .hutts-signup-cta__form input::placeholder {
    color: #c2c8d0;
    opacity: 1;
  }
  html[data-site-theme="auto"] .hutts-lm-message--success {
    background: #14352a;
    border-color: #2f8f6a;
    color: #d7f5e8;
  }
  html[data-site-theme="auto"] .hutts-lm-message--error {
    background: #3a1a1a;
    border-color: #a34b4b;
    color: #f5d7d7;
  }
}
