/* ============================================================
   dark-mode.css  (pilot)
   Everything is scoped to html.dm-dark, so the light site is
   untouched when the class is off.  js/dark-mode.js handles
   the toggle and recolors the page's inline light styles.

   Palette
     page bg #141414   cards/menus #262626   borders #3a3a3a
     header/footer #0f0f0f   text #e6e6e6   secondary #b3b3b3
     headings #fff   buttons #c0201b   red text/links #ff3333
     highlight #F8CA00
   ============================================================ */

/* ---------- Toggle button (shows in light and dark) ---------- */
.navbar-social-icons li.dm-toggle-item {
    vertical-align: middle;
    margin-left: 0.5em;
}
.navbar-social-icons .dm-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #c8c8c8;
    background: #fff;
    color: #333;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color .2s, color .2s, border-color .2s;
}
.navbar-social-icons .dm-toggle-btn:hover,
.navbar-social-icons .dm-toggle-btn:focus { border-color: #c0201b; color: #c0201b; outline: none; }
.navbar-social-icons .dm-toggle-btn:focus-visible { box-shadow: 0 0 0 3px rgba(192,32,27,.35); }
@media (max-width: 576px) {
    .navbar-social-icons .dm-toggle-btn { width: 32px; height: 32px; font-size: 14px; }
}
html.dm-dark .navbar-social-icons .dm-toggle-btn {
    background: #262626; border-color: #3a3a3a; color: #F8CA00;
}
html.dm-dark .navbar-social-icons .dm-toggle-btn:hover,
html.dm-dark .navbar-social-icons .dm-toggle-btn:focus { border-color: #F8CA00; color: #F8CA00; }

/* ---------- Base ---------- */
html.dm-dark { color-scheme: dark; background: #141414; }
html.dm-dark body,
html.dm-dark .wrapper { background-color: #141414 !important; color: #e6e6e6; }
/* Heading and text colors come from the automatic pass in dark-mode.js,
   so colored accents (like the yellow hero subtitles) keep their color */
/* Link colors come from the automatic pass in dark-mode.js, so styled
   buttons keep their own colors */
html.dm-dark hr { border-color: #3a3a3a; }
html.dm-dark ::selection { background: #c0201b; color: #fff; }

/* ---------- Header and menus ---------- */
html.dm-dark .header,
html.dm-dark .header.header-fixed-shrink,
html.dm-dark .header .navbar,
html.dm-dark .header .navbar-collapse,
html.dm-dark .header .topbar { background-color: #0f0f0f !important; border-color: #262626 !important; }
html.dm-dark .header { box-shadow: 0 1px 0 #262626; }
html.dm-dark .header .navbar-nav > li > a,
html.dm-dark .header .navbar-nav > li > a:focus { color: #e6e6e6 !important; background: transparent !important; }
html.dm-dark .header .navbar-nav > li > a:hover,
html.dm-dark .header .navbar-nav > .active > a,
html.dm-dark .header .navbar-nav > .open > a { color: #ff3333 !important; }
html.dm-dark .header .dropdown-menu {
    background-color: #262626 !important;
    border-color: #3a3a3a !important;
    border-top-color: #c0201b !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
html.dm-dark .header .dropdown-menu li a,
html.dm-dark .header .dropdown-menu li > a { color: #e6e6e6 !important; border-color: #3a3a3a !important; background: transparent; }
html.dm-dark .header .dropdown-menu li a:hover,
html.dm-dark .header .dropdown-menu li > a:hover,
html.dm-dark .header .dropdown-menu .active > a { background-color: #333 !important; color: #fff !important; }
html.dm-dark .header .dropdown-menu .dropdown-header,
html.dm-dark .header .mega-menu h3 { color: #fff !important; }
html.dm-dark .header .navbar-toggle { border-color: #3a3a3a; }
html.dm-dark .header .navbar-toggle,
html.dm-dark .header .navbar-toggle:hover,
html.dm-dark .header .navbar-toggle:focus { background-color: #c0201b !important; }
html.dm-dark .header .navbar-social-icons li a,
html.dm-dark .header .navbar-social-icons li a i { color: #fff !important; }
html.dm-dark .header .navbar-social-icons li a:hover i { color: #ff3333 !important; }
html.dm-dark .navbar-social-icons li.navbar-search-item { border-left-color: #3a3a3a; }
html.dm-dark .header .navbar-social-icons li a.navbar-search-btn { background-color: #c0201b; }
html.dm-dark .header .navbar-social-icons li a.navbar-search-btn:hover i { color: #fff !important; }
/* Logo: red wordmark on a transparent PNG, lifted slightly for contrast */
html.dm-dark .header .logo img { filter: brightness(1.25) saturate(1.1); }

/* ---------- Footer ---------- */
html.dm-dark .footer-v1 .footer,
html.dm-dark .footer-v1 .copyright,
html.dm-dark .footer-v1 { background-color: #0f0f0f !important; }
html.dm-dark .footer-v1 .copyright { border-top: 1px solid #262626; }

/* ---------- Buttons ---------- */
html.dm-dark .btn-u:not([class*="btn-u-"]),
html.dm-dark .btn-primary,
html.dm-dark .btn-danger { background-color: #c0201b; border-color: #c0201b; }
html.dm-dark .btn-u, html.dm-dark .btn-primary, html.dm-dark .btn-danger { color: #fff !important; }
html.dm-dark .btn-u:not([class*="btn-u-"]):hover,
html.dm-dark .btn-primary:hover,
html.dm-dark .btn-danger:hover { background-color: #a51b17; border-color: #a51b17; }
/* Outline ("ghost") hero buttons become solid red in dark mode */
html.dm-dark .hero-buttons .btn-hero-ghost {
    background-color: #c0392b !important;
    border-color: #c0392b !important;
    color: #fff !important;
}
html.dm-dark .hero-buttons .btn-hero-ghost:hover,
html.dm-dark .hero-buttons .btn-hero-ghost:focus {
    background-color: #a93226 !important;
    border-color: #a93226 !important;
}
/* Dark gray Unify buttons would look disabled on a dark page, so they go red */
html.dm-dark .btn-u.btn-u-dark {
    background-color: #c0201b !important;
    border-color: #c0201b !important;
    color: #fff !important;
}
html.dm-dark .btn-u.btn-u-dark:hover,
html.dm-dark .btn-u.btn-u-dark:focus { background-color: #a51b17 !important; border-color: #a51b17 !important; }
html.dm-dark .btn-default { background: #262626; border-color: #3a3a3a; color: #e6e6e6; }

/* ---------- Generic Bootstrap / Unify parts ---------- */
html.dm-dark .panel, html.dm-dark .well, html.dm-dark .thumbnail,
html.dm-dark .list-group-item, html.dm-dark .modal-content,
html.dm-dark .table > tbody > tr > td, html.dm-dark .table > thead > tr > th {
    background-color: #262626; border-color: #3a3a3a; color: #e6e6e6;
}
html.dm-dark .table-striped > tbody > tr:nth-of-type(odd) > td { background-color: #1d1d1d; }
html.dm-dark .breadcrumb, html.dm-dark .cnc-breadcrumb { background: transparent; color: #b3b3b3; }
html.dm-dark small, html.dm-dark .text-muted, html.dm-dark figcaption,
html.dm-dark .caption { color: #b3b3b3 !important; }
html.dm-dark input, html.dm-dark select, html.dm-dark textarea {
    background-color: #1d1d1d; color: #e6e6e6; border-color: #3a3a3a;
}
html.dm-dark input::placeholder, html.dm-dark textarea::placeholder { color: #8a8a8a; }
html.dm-dark details summary { color: #fff; }

/* ---------- Images ---------- */
/* Photos dim a touch so white backgrounds don't glare */
html.dm-dark .wrapper img { filter: brightness(.92); }
html.dm-dark .header img,
html.dm-dark .footer-v1 img,
html.dm-dark img[data-dm-keep] { filter: none; }
html.dm-dark .header .logo img { filter: brightness(1.25) saturate(1.1); }
/* Images that must sit on white (diagrams, black-ink logos, text-in-image) */
html.dm-dark .dm-light-panel,
html.dm-dark img[src*="LineUp_LSAMrv421"] {
    background: #fff !important;
    border-radius: 6px;
    padding: 8px;
    filter: none !important;
}

/* ---------- Search page (Pagefind UI variables) ---------- */
html.dm-dark .pagefind-ui {
    --pagefind-ui-primary: #ff3333;
    --pagefind-ui-text: #e6e6e6;
    --pagefind-ui-background: #1d1d1d;
    --pagefind-ui-border: #3a3a3a;
    --pagefind-ui-tag: #262626;
}
html.dm-dark .pagefind-ui__search-input { background: #1d1d1d !important; color: #fff !important; }
html.dm-dark .pagefind-ui__result-link { color: #ff3333 !important; }
html.dm-dark .pagefind-ui__result-excerpt,
html.dm-dark .pagefind-ui__message { color: #e6e6e6 !important; }
html.dm-dark .pagefind-ui__result-excerpt mark,
html.dm-dark .pagefind-ui mark { background: #F8CA00; color: #141414; }
html.dm-dark .pagefind-ui__search-input::placeholder { color: #8a8a8a !important; opacity: 1; }
html.dm-dark .pagefind-ui__search-clear { border-color: #3a3a3a !important; }
html.dm-dark .pagefind-ui__button { background: #262626 !important; color: #e6e6e6 !important; border-color: #3a3a3a !important; }
html.dm-dark .search-type-btn { background: #262626; color: #e6e6e6; border-color: #3a3a3a; }
html.dm-dark .search-type-btn:hover { border-color: #ff3333; color: #fff; }
html.dm-dark .search-type-btn.active,
html.dm-dark .search-type-btn.is-active { background: #c0201b; border-color: #c0201b; color: #fff; }
html.dm-dark .search-correction { color: #b3b3b3; }
html.dm-dark .search-correction a { color: #ff3333; }




/* ---------- FAQ accordions (thm-faq) ---------- */
html.dm-dark .thm-faq-item summary:hover,
html.dm-dark .thm-faq-item summary:focus-visible,
html.dm-dark .thm-faq-item summary:hover::after { color: #ff3333 !important; }
html.dm-dark .thm-faq-item summary::after { color: #b3b3b3; }

/* ---------- Menu headings ("All CNC Routers", "All Applications"...) ---------- */
html.dm-dark .header .dropdown-menu h1, html.dm-dark .header .dropdown-menu h2,
html.dm-dark .header .dropdown-menu h3, html.dm-dark .header .dropdown-menu h4,
html.dm-dark .header .dropdown-menu h5, html.dm-dark .header .dropdown-menu h6,
html.dm-dark .header .dropdown-menu h4 strong { color: #fff !important; }
html.dm-dark .header .dropdown-menu h1:hover, html.dm-dark .header .dropdown-menu h2:hover,
html.dm-dark .header .dropdown-menu h3:hover, html.dm-dark .header .dropdown-menu h4:hover,
html.dm-dark .header .dropdown-menu h4:hover strong,
html.dm-dark .header .dropdown-menu li a:hover,
html.dm-dark .header .dropdown-menu li > a:hover { color: #ff3333 !important; }
html.dm-dark .header .dropdown-menu .mega-menu-content *,
html.dm-dark .header .dropdown-menu [class*="col-"] { border-color: #3a3a3a !important; }

/* ---------- HubSpot embedded forms ---------- */
html.dm-dark .hbspt-form label,
html.dm-dark .hbspt-form label span,
html.dm-dark .hbspt-form legend { color: #e6e6e6 !important; }
html.dm-dark .hbspt-form .hs-form-required { color: #ff3333 !important; }
html.dm-dark .hbspt-form .hs-richtext,
html.dm-dark .hbspt-form .hs-richtext p,
html.dm-dark .hbspt-form .hs-richtext strong,
html.dm-dark .hbspt-form .hs-field-desc,
html.dm-dark .hbspt-form p { color: #b3b3b3 !important; }
html.dm-dark .hbspt-form a { color: #ff3333 !important; }
html.dm-dark .hbspt-form .hs-input {
    background-color: #1d1d1d !important;
    color: #e6e6e6 !important;
    border-color: #3a3a3a !important;
}
html.dm-dark .hbspt-form .hs-input:focus { border-color: #ff3333 !important; outline: none; }
html.dm-dark .hbspt-form select.hs-input option { background: #1d1d1d; color: #e6e6e6; }
html.dm-dark .hbspt-form .hs-error-msg,
html.dm-dark .hbspt-form .hs-error-msgs label { color: #ff6b61 !important; }
html.dm-dark .hbspt-form .submitted-message { color: #e6e6e6; }

/* ---------- Model page spec tables (.thm-spec-table, e.g. model-43.htm) ---------- */
html.dm-dark .thm-spec-table { background: #262626; border-color: #3a3a3a; }
html.dm-dark .thm-spec-table th,
html.dm-dark .thm-spec-table td { background: #262626; color: #e6e6e6; border-color: #3a3a3a; }
html.dm-dark .thm-spec-table thead th { background: #0f0f0f; color: #fff; }
html.dm-dark .thm-spec-table tbody th { background: #1d1d1d; color: #fff; }
html.dm-dark .thm-spec-table tr.thm-spec-group th { background: #141414; color: #ff3333; }
