/* ============================================================
   RateCarriers dark mode: hand-written part.
   The theme (Astra), page-builder text, maps, forms and the
   toggle button. RateCarriers' own components are covered by the
   generated assets/ratecarriers-dark.css.
   Everything is scoped to html[data-rc-theme="dark"], which the
   head script sets before the page paints.
   ============================================================ */

/* ---------- toggle button (both modes) ---------- */
.rc-theme-toggle.rc-theme-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    padding: 0 !important;
    margin: 0 8px !important;
    border-radius: 50% !important;
    border: 1px solid #E5E7EB !important;
    background: #F9FAFB !important;
    color: #374151 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1 !important;
    box-shadow: none !important;
    vertical-align: middle;
    flex: 0 0 auto;
    transition: border-color .12s ease, color .12s ease;
}
.rc-theme-toggle.rc-theme-toggle:hover,
.rc-theme-toggle.rc-theme-toggle:focus-visible {
    border-color: #4F46E5 !important;
    color: #4F46E5 !important;
    outline: none;
}
.rc-theme-toggle svg {
    width: 17px;
    height: 17px;
    display: block;
    pointer-events: none;
}
.rc-theme-toggle .rc-tt-sun { display: none; }
html[data-rc-theme="dark"] .rc-theme-toggle .rc-tt-sun { display: block; }
html[data-rc-theme="dark"] .rc-theme-toggle .rc-tt-moon { display: none; }
li.rc-theme-toggle-li {
    display: flex !important;
    align-items: center;
    list-style: none;
}
.rc-theme-toggle.rc-theme-toggle--float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9990;
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.15) !important;
}
html[data-rc-theme="dark"] .rc-theme-toggle.rc-theme-toggle {
    border-color: #2A2D38 !important;
    background: #1D2028 !important;
    color: #C4C7D0 !important;
}
html[data-rc-theme="dark"] .rc-theme-toggle.rc-theme-toggle:hover,
html[data-rc-theme="dark"] .rc-theme-toggle.rc-theme-toggle:focus-visible {
    border-color: #818CF8 !important;
    color: #A5B4FC !important;
}

/* ---------- base ---------- */
html[data-rc-theme="dark"] {
    color-scheme: dark;
    background: #0E0F13;
    /* Astra's global palette: headings, text, backgrounds */
    --ast-global-color-2: #ECEDF2;
    --ast-global-color-3: #C4C7D0;
    --ast-global-color-4: #0E0F13;
    --ast-global-color-5: #171920;
    --ast-global-color-6: #1D2028;
    --ast-global-color-7: #22252E;
}
html[data-rc-theme="dark"] body,
html[data-rc-theme="dark"] #page,
html[data-rc-theme="dark"] .site,
html[data-rc-theme="dark"] .site-content,
html[data-rc-theme="dark"] .ast-separate-container,
html[data-rc-theme="dark"] .ast-plain-container,
html[data-rc-theme="dark"] .ast-page-builder-template,
html[data-rc-theme="dark"] .ast-plain-container .site-content,
html[data-rc-theme="dark"] .ast-page-builder-template .site-content {
    background-color: #0E0F13 !important;
}
html[data-rc-theme="dark"] body {
    color: #C4C7D0;
}
/* Astra's boxed content cards */
html[data-rc-theme="dark"] .ast-separate-container .ast-article-single:not(.ast-related-post),
html[data-rc-theme="dark"] .ast-separate-container .ast-article-post,
html[data-rc-theme="dark"] .ast-separate-container .comments-area,
html[data-rc-theme="dark"] .ast-separate-container .ast-author-box,
html[data-rc-theme="dark"] .ast-separate-container .ast-woocommerce-container,
html[data-rc-theme="dark"] .ast-separate-container .site-main > .ast-row,
html[data-rc-theme="dark"] .ast-separate-container .ast-archive-description,
html[data-rc-theme="dark"] .ast-separate-container .widget {
    background-color: #171920 !important;
}
html[data-rc-theme="dark"] h1,
html[data-rc-theme="dark"] h2,
html[data-rc-theme="dark"] h3,
html[data-rc-theme="dark"] h4,
html[data-rc-theme="dark"] h5,
html[data-rc-theme="dark"] h6,
html[data-rc-theme="dark"] .entry-title,
html[data-rc-theme="dark"] .entry-title a,
html[data-rc-theme="dark"] .ast-archive-title,
html[data-rc-theme="dark"] .site-title a {
    color: #ECEDF2;
}
html[data-rc-theme="dark"] .entry-content,
html[data-rc-theme="dark"] .entry-content p,
html[data-rc-theme="dark"] .entry-meta,
html[data-rc-theme="dark"] .entry-meta * {
    color: #C4C7D0;
}
html[data-rc-theme="dark"] .entry-content a:not([class]),
html[data-rc-theme="dark"] .ast-single-post .entry-content a:not([class]) {
    color: #A5B4FC;
}
html[data-rc-theme="dark"] hr {
    border-color: #2A2D38;
    background-color: #2A2D38;
}

/* ---------- header ---------- */
html[data-rc-theme="dark"] body:not(.ast-theme-transparent-header) .site-header,
html[data-rc-theme="dark"] body:not(.ast-theme-transparent-header) .main-header-bar,
html[data-rc-theme="dark"] body:not(.ast-theme-transparent-header) .ast-primary-header-bar,
html[data-rc-theme="dark"] body:not(.ast-theme-transparent-header) .ast-above-header-bar,
html[data-rc-theme="dark"] body:not(.ast-theme-transparent-header) .ast-below-header-bar,
html[data-rc-theme="dark"] .ast-mobile-header-wrap .ast-primary-header-bar,
html[data-rc-theme="dark"] .ast-header-break-point .main-header-bar,
html[data-rc-theme="dark"] .ast-sticky-active,
html[data-rc-theme="dark"] .ast-header-sticked {
    background-color: #13151B !important;
    border-bottom-color: #2A2D38 !important;
}
html[data-rc-theme="dark"] .main-header-menu .menu-link,
html[data-rc-theme="dark"] .ast-builder-menu .main-navigation .menu-item > .menu-link,
html[data-rc-theme="dark"] .main-header-menu > .menu-item > .menu-link,
html[data-rc-theme="dark"] .ast-header-account-wrap,
html[data-rc-theme="dark"] .site-header .ast-builder-html-element,
html[data-rc-theme="dark"] .site-header .ast-builder-html-element * {
    color: #C4C7D0;
}
html[data-rc-theme="dark"] .main-header-menu .menu-item:hover > .menu-link,
html[data-rc-theme="dark"] .main-header-menu .current-menu-item > .menu-link,
html[data-rc-theme="dark"] .main-header-menu .current-menu-ancestor > .menu-link,
html[data-rc-theme="dark"] .ast-builder-menu .main-navigation .menu-item.current-menu-item > .menu-link {
    color: #A5B4FC;
}
html[data-rc-theme="dark"] .main-header-menu .sub-menu,
html[data-rc-theme="dark"] .ast-desktop .main-header-menu .sub-menu {
    background-color: #171920 !important;
    border-color: #2A2D38 !important;
}
/* mobile menu */
html[data-rc-theme="dark"] .ast-mobile-popup-drawer .ast-mobile-popup-inner,
html[data-rc-theme="dark"] .ast-mobile-header-content,
html[data-rc-theme="dark"] .ast-mobile-popup-content,
html[data-rc-theme="dark"] .ast-mobile-header-wrap .ast-mobile-header-content {
    background-color: #171920 !important;
}
html[data-rc-theme="dark"] .ast-mobile-popup-drawer .menu-link,
html[data-rc-theme="dark"] .ast-mobile-header-content .menu-link,
html[data-rc-theme="dark"] .ast-mobile-popup-drawer .menu-toggle-close,
html[data-rc-theme="dark"] .ast-mobile-popup-drawer .ast-mobile-svg {
    color: #ECEDF2 !important;
    fill: #ECEDF2 !important;
}
html[data-rc-theme="dark"] .ast-mobile-popup-drawer .menu-item,
html[data-rc-theme="dark"] .ast-mobile-header-content .menu-item {
    border-color: #2A2D38 !important;
}
html[data-rc-theme="dark"] .ast-mobile-menu-trigger-minimal,
html[data-rc-theme="dark"] .ast-mobile-menu-trigger-fill,
html[data-rc-theme="dark"] .ast-mobile-menu-trigger-outline,
html[data-rc-theme="dark"] .menu-toggle {
    color: #ECEDF2 !important;
}
html[data-rc-theme="dark"] .ast-mobile-menu-trigger-minimal .ast-mobile-svg,
html[data-rc-theme="dark"] .ast-mobile-menu-trigger-fill .ast-mobile-svg,
html[data-rc-theme="dark"] .ast-mobile-menu-trigger-outline .ast-mobile-svg {
    fill: #ECEDF2 !important;
}

/* ---------- footer ---------- */
html[data-rc-theme="dark"] .site-footer,
html[data-rc-theme="dark"] .site-primary-footer-wrap,
html[data-rc-theme="dark"] .site-below-footer-wrap,
html[data-rc-theme="dark"] .site-above-footer-wrap,
html[data-rc-theme="dark"] .ast-small-footer,
html[data-rc-theme="dark"] .footer-adv {
    background-color: #13151B !important;
    border-top-color: #2A2D38 !important;
    color: #9A9EAB;
}

/* ---------- forms ---------- */
html[data-rc-theme="dark"] input[type="text"],
html[data-rc-theme="dark"] input[type="email"],
html[data-rc-theme="dark"] input[type="password"],
html[data-rc-theme="dark"] input[type="search"],
html[data-rc-theme="dark"] input[type="url"],
html[data-rc-theme="dark"] input[type="tel"],
html[data-rc-theme="dark"] input[type="number"],
html[data-rc-theme="dark"] textarea,
html[data-rc-theme="dark"] select {
    background-color: #1D2028;
    color: #ECEDF2;
    border-color: #2A2D38;
}
html[data-rc-theme="dark"] ::placeholder {
    color: #7D8190;
    opacity: 1;
}

/* ---------- page-builder surfaces (tagged by dark_mode.js) ---------- */
html[data-rc-theme="dark"] .rc-dm-bg { background-color: #171920 !important; }
html[data-rc-theme="dark"] .rc-dm-bg2 { background-color: #1D2028 !important; }
html[data-rc-theme="dark"] .rc-dm-ink { color: #ECEDF2 !important; }
html[data-rc-theme="dark"] .rc-dm-ink2 { color: #C4C7D0 !important; }
html[data-rc-theme="dark"] .rc-dm-muted { color: #9A9EAB !important; }
html[data-rc-theme="dark"] .rc-dm-line { border-color: #2A2D38 !important; }
/* hide page-builder sections for the few ms it takes to tag them, so they never flash white */
html[data-rc-theme="dark"].rc-dm-pending .elementor { visibility: hidden; }

/* ---------- maps ---------- */
html[data-rc-theme="dark"] .leaflet-container {
    background: #1B1E26 !important;
}
html[data-rc-theme="dark"] .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.88) saturate(.7);
}
html[data-rc-theme="dark"] .leaflet-popup-content-wrapper,
html[data-rc-theme="dark"] .leaflet-popup-tip {
    background: #171920;
    color: #ECEDF2;
    box-shadow: 0 3px 14px rgba(0,0,0,.6);
}
html[data-rc-theme="dark"] .leaflet-popup-close-button {
    color: #9A9EAB !important;
}
html[data-rc-theme="dark"] .leaflet-bar a,
html[data-rc-theme="dark"] .leaflet-bar a:hover {
    background-color: #1D2028;
    color: #ECEDF2;
    border-bottom-color: #2A2D38;
}
html[data-rc-theme="dark"] .leaflet-bar {
    border-color: #2A2D38 !important;
}
html[data-rc-theme="dark"] .leaflet-control-attribution {
    background: rgba(23,25,32,.8) !important;
    color: #7D8190 !important;
}
html[data-rc-theme="dark"] .leaflet-control-attribution a {
    color: #A5B4FC !important;
}

/* ---------- WordPress bits ---------- */
html[data-rc-theme="dark"] .wp-block-separator {
    border-color: #2A2D38;
}
html[data-rc-theme="dark"] code,
html[data-rc-theme="dark"] pre {
    background-color: #1D2028;
    color: #ECEDF2;
}
html[data-rc-theme="dark"] ::selection {
    background: rgba(129,140,248,.35);
}
