/* ------------------------------------------------------------------
   Minsterley Motors: automatic dark mode
   Applies ONLY when the visitor's device prefers dark. No toggle, no JS.
   Light appearance is completely untouched.
   ------------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {

    html { color-scheme: dark; background-color: #121417; }

    /* ---- base ---- */
    .topbar { background-color: #1b1e23; }
    body {
        background-color: #121417;
        color: #cfd3d8;
    }
    h1, h2, h3, h4, h5, h6 { color: #f2f4f6; }

    /* ---- header / shell ---- */
    .header-main {
        background-color: #1b1e23;
        box-shadow: 0 1px 0 #2c313a;
    }
    .site-header,
    .header-sticky.header-v1 .site-header.minimized,
    .header-sticky.header-transparent .site-header.minimized { background-color: #1b1e23; }

    /* On header-transparent pages (home + interiors) the bars must stay
       transparent over the photo, exactly as in light mode. Solid dark is
       only for the scrolled (minimized) sticky state, which the more
       specific .minimized rules above still win. */
    .header-transparent .topbar,
    .header-transparent .site-header,
    .header-transparent .header-main { background-color: transparent; box-shadow: none; }
    .site-header .main-nav > ul > li > a,
    .main-nav .menu > li > a { color: #e6e9ec; }
    .fh-header-minimized { background-color: #1b1e23; }

    /* page header keeps the photo but dims it so the title reads */
    .page-header .header-title {
        background: linear-gradient(rgba(10, 12, 14, 0.55), rgba(10, 12, 14, 0.55)),
                    url(../images/bg/page-header-bg.jpg);
        background-size: cover;
        background-position: center;
    }

    .page-header .breadcrumb-area {
        background-color: #1b1e23;
        border-bottom: 1px solid #2c313a;
    }
    .page-header .breadcrumb-area nav,
    .page-header .breadcrumb-area nav a,
    .page-header .breadcrumb-area nav a span { color: #b8bdc4; }

    /* ---- content sections ---- */
    .blogpage, .secpadd, .secpaddbig { background-color: #121417; }
    .graybg { background: #15181c; }
    /* brand-blue bands keep their identity as deep navy (must come after the
       generic section rule above so it wins on .bluebg.secpadd sections) */
    .bluebg { background-color: #0a2743; }

    /* ---- home page: enquiry panel + features band accent card ---- */
    .whychoose-1 .quofrm1 { background: #1b1e23; }
    .features-1 .borderboth { background: #0d4a7a; }
    .welcomesec { background-color: #121417; }

    /* ---- customer-pasted PMP content: neutralise pasted inline styling ----
       Content editors paste from Word/websites with inline white backgrounds
       and near-black text colours; both break on a dark page. */
    .welcomesec [style*="background"],
    .linkred [style*="background"],
    .abotinforgt [style*="background"],
    .welcomesec table, .welcomesec th, .welcomesec td,
    .linkred table, .linkred th, .linkred td,
    .abotinforgt table, .abotinforgt th, .abotinforgt td { background-color: transparent !important; }
    .welcomesec [style*="#000"], .welcomesec [style*="black"],
    .welcomesec [style*="#111"], .welcomesec [style*="#222"], .welcomesec [style*="#333"],
    .linkred [style*="#000"], .linkred [style*="black"],
    .linkred [style*="#111"], .linkred [style*="#222"], .linkred [style*="#333"],
    .abotinforgt [style*="#000"], .abotinforgt [style*="black"],
    .abotinforgt [style*="#111"], .abotinforgt [style*="#222"], .abotinforgt [style*="#333"] { color: #cfd3d8 !important; }

    /* ---- links in content ---- */
    a { color: #ff8092; }
    .linkred a { color: #ff4d5e; }

    /* ---- forms (contact page + home quote form) ---- */
    .fh-form textarea,
    .fh-form input[type="text"],
    .fh-form input[type="email"],
    .fh-form select {
        background-color: #1e2126;
        color: #e6e9ec;
        border-color: #3a3f46;
    }
    .fh-form textarea:focus,
    .fh-form input[type="text"]:focus,
    .fh-form input[type="email"]:focus,
    .fh-form select:focus { border-color: #6b7480; }
    .fh-form ::placeholder { color: #8a9099; opacity: 1; }
    .fh-form label { color: #d6d9dd; }

    /* ---- timetable tables ---- */
    .table-scroll { border-color: #454b54; }
    .table-scroll th, .table-scroll td {
        border-color: #454b54;
        background: #1e2126;
        color: #e6e9ec;
    }
    .table-scroll thead, .table-scroll tfoot { background: #2c313a; }
    .tablepress .odd td  { background-color: #1e2126; }
    .tablepress .even td { background-color: #262a31; }
    .tablepress thead th { background-color: #2c313a; color: #f2f4f6; }
    .clone .fixed-side {
        border-color: #454b54;
        background: #2c313a;
        color: #f2f4f6;
    }
    .greyed { color: #7d848d; }

    /* ---- right-hand timetable list widget ---- */
    .widget_categories li a,
    .widget_pages li a,
    .widget_nav_menu li a { color: #cfd3d8; }
    .widget_categories li.CurTT { background: #262a31; }
    .widget .widget-title, .widget-title { color: #f2f4f6; }

    /* ---- buttons: brand red stays, it works on dark ---- */
    .fh-btn, .fh-btn.btn { color: #fff; }

    .navbar-icon .navbars-line,
    .navbar-icon .navbars-line:before,
    .navbar-icon .navbars-line:after,
    .header-sticky .site-header.minimized .navbar-icon .navbars-line,
    .header-sticky .site-header.minimized .navbar-icon .navbars-line:before,
    .header-sticky .site-header.minimized .navbar-icon .navbars-line:after { background-color: #e6e9ec; }

    /* ---- desktop dropdown menu ---- */
    .nav ul ul { background-color: #1b1e23; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); }
    .nav li li > a,
    .header-v1 .nav li li > a { color: #e6e9ec; }
    /* hover keeps the brand blue row + white text from the light theme */

    /* ---- sticky (minimized) header nav: light theme forces #222 at this
       specificity, which vanishes on the dark bar ---- */
    .header-sticky .site-header.minimized .nav .menu > li a { color: #e6e9ec; }

    /* ---- mobile slide-out nav + drill-down sub-panel ---- */
    .primary-mobile-nav { background-color: #1b1e23; color: #b8bdc4; border-color: #2c313a; }
    .primary-mobile-nav .menu > li > a { color: #e6e9ec; }
    .primary-mobile-nav ul.menu li a { color: #e6e9ec; }
    .primary-mobile-nav ul.menu li > ul { background-color: #1b1e23; }
    .primary-mobile-nav ul.menu li > ul .menu-parent-items { background-color: #262a31; color: #f2f4f6; }
    .primary-mobile-nav ul.menu li.menu-back { color: #e6e9ec; }
    .primary-mobile-nav .close-canvas-mobile-panel { color: #e6e9ec; }

    /* ---- preloader ---- */
    .preloader { background-color: #121417; }
}
