/* Drone Site UK — dark mode. Palette-variable flip + targeted overrides. Reversible: deactivate child theme. */

/* Dark palette. Surfaces step clearly (base -> card -> raised) and text greys are lifted for legibility.
   base #0B0E12 (page) | card #1A212B | raised #232B36 | border #38414D — a clear ladder so competing greys read apart. */
:root[data-theme="dark"]{
  --global-palette1:#5A97DD;
  --global-palette2:#3A6FA8;
  --global-palette3:#F4F6F9;
  --global-palette4:#D6DBE1;
  --global-palette5:#AEB6C0;
  --global-palette6:#8E97A2;
  --global-palette7:#38414D;
  --global-palette8:#1A212B;
  --global-palette9:#0B0E12;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]){
  --global-palette1:#5A97DD;
  --global-palette2:#3A6FA8;
  --global-palette3:#F4F6F9;
  --global-palette4:#D6DBE1;
  --global-palette5:#AEB6C0;
  --global-palette6:#8E97A2;
  --global-palette7:#38414D;
  --global-palette8:#1A212B;
  --global-palette9:#0B0E12;
  color-scheme: dark;
}
}

/* ===== Shared dark overrides. Duplicated under the explicit toggle and the system-preference scopes. ===== */
:root[data-theme="dark"] #masthead,
:root[data-theme="dark"] .site-header-wrap,
:root[data-theme="dark"] .site-main-header-inner-wrap,
:root[data-theme="dark"] .site-top-header-wrap,
:root[data-theme="dark"] .site-header-row-container-inner{background-color:var(--global-palette9) !important;}
/* Give the header a defined edge so it separates from the page body */
:root[data-theme="dark"] #masthead{border-bottom:1px solid var(--global-palette7);}
:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .site-footer-wrap,
:root[data-theme="dark"] .site-footer-wrap .site-footer-row{background-color:var(--global-palette9) !important;}
:root[data-theme="dark"] .site-footer{border-top:1px solid var(--global-palette7);}
/* Keep "base" (white) text light where it sits on dark panels */
:root[data-theme="dark"] .has-base-color,
:root[data-theme="dark"] .has-base-color *{color:#F4F6F9 !important;}
/* Dark "contrast" CTA bands -> a branded dark instead of flipping to light */
:root[data-theme="dark"] .has-contrast-background-color{background-color:#14202e !important;}
:root[data-theme="dark"] .has-contrast-background-color .wp-block-heading,
:root[data-theme="dark"] .has-contrast-background-color p{color:#F4F6F9 !important;}
/* Cards / panels using palette8 as a background get a visible edge + lift so they read apart from the page */
:root[data-theme="dark"] .has-theme-palette8-background-color,
:root[data-theme="dark"] .wp-block-kadence-infobox .kt-blocks-info-box-link-wrap,
:root[data-theme="dark"] .wp-block-kadence-infobox .kt-info-box-content-container,
:root[data-theme="dark"] .kt-blocks-pricing-table-inner,
:root[data-theme="dark"] .wp-block-kadence-pricingtable .kt-pricing-table-container{border:1px solid var(--global-palette7);box-shadow:0 2px 10px rgba(0,0,0,.35);}
/* Dividers / rules visible against the base */
:root[data-theme="dark"] hr,
:root[data-theme="dark"] .wp-block-separator{border-color:var(--global-palette7) !important;background-color:var(--global-palette7) !important;opacity:1;}
/* Form fields */
:root[data-theme="dark"] input:not([type=submit]):not([type=button]),
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .kadence-blocks-form-field input,
:root[data-theme="dark"] .kadence-blocks-form-field textarea{background-color:#232B36 !important;color:var(--global-palette3) !important;border-color:var(--global-palette7) !important;}
/* Mobile menu / search drawers */
:root[data-theme="dark"] .mobile-navigation,
:root[data-theme="dark"] .header-navigation-dropdown-direction-right ul{background-color:var(--global-palette9) !important;}

@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]) #masthead,
:root:not([data-theme="light"]) .site-header-wrap,
:root:not([data-theme="light"]) .site-main-header-inner-wrap,
:root:not([data-theme="light"]) .site-top-header-wrap,
:root:not([data-theme="light"]) .site-header-row-container-inner{background-color:var(--global-palette9) !important;}
:root:not([data-theme="light"]) #masthead{border-bottom:1px solid var(--global-palette7);}
:root:not([data-theme="light"]) .site-footer,
:root:not([data-theme="light"]) .site-footer-wrap,
:root:not([data-theme="light"]) .site-footer-wrap .site-footer-row{background-color:var(--global-palette9) !important;}
:root:not([data-theme="light"]) .site-footer{border-top:1px solid var(--global-palette7);}
:root:not([data-theme="light"]) .has-base-color,
:root:not([data-theme="light"]) .has-base-color *{color:#F4F6F9 !important;}
:root:not([data-theme="light"]) .has-contrast-background-color{background-color:#14202e !important;}
:root:not([data-theme="light"]) .has-contrast-background-color .wp-block-heading,
:root:not([data-theme="light"]) .has-contrast-background-color p{color:#F4F6F9 !important;}
:root:not([data-theme="light"]) .has-theme-palette8-background-color,
:root:not([data-theme="light"]) .wp-block-kadence-infobox .kt-blocks-info-box-link-wrap,
:root:not([data-theme="light"]) .wp-block-kadence-infobox .kt-info-box-content-container,
:root:not([data-theme="light"]) .kt-blocks-pricing-table-inner,
:root:not([data-theme="light"]) .wp-block-kadence-pricingtable .kt-pricing-table-container{border:1px solid var(--global-palette7);box-shadow:0 2px 10px rgba(0,0,0,.35);}
:root:not([data-theme="light"]) hr,
:root:not([data-theme="light"]) .wp-block-separator{border-color:var(--global-palette7) !important;background-color:var(--global-palette7) !important;opacity:1;}
:root:not([data-theme="light"]) input:not([type=submit]):not([type=button]),
:root:not([data-theme="light"]) textarea,
:root:not([data-theme="light"]) select,
:root:not([data-theme="light"]) .kadence-blocks-form-field input,
:root:not([data-theme="light"]) .kadence-blocks-form-field textarea{background-color:#232B36 !important;color:var(--global-palette3) !important;border-color:var(--global-palette7) !important;}
:root:not([data-theme="light"]) .mobile-navigation,
:root:not([data-theme="light"]) .header-navigation-dropdown-direction-right ul{background-color:var(--global-palette9) !important;}
}

/* ===== Floating theme toggle (independent of the Kadence header) ===== */
.ds-theme-toggle{position:fixed;left:18px;bottom:18px;z-index:9999;width:46px;height:46px;border-radius:50%;
  border:1px solid rgba(127,127,127,.35);background:var(--global-palette9,#fff);color:var(--global-palette3,#222);
  cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:20px;line-height:1;
  box-shadow:0 4px 16px rgba(0,0,0,.18);transition:transform .15s ease, background .2s ease, color .2s ease;}
.ds-theme-toggle:hover{transform:scale(1.08);}
.ds-theme-toggle .ds-icon-sun{display:none;}
.ds-theme-toggle .ds-icon-moon{display:inline;}
:root[data-theme="dark"] .ds-theme-toggle .ds-icon-sun{display:inline;}
:root[data-theme="dark"] .ds-theme-toggle .ds-icon-moon{display:none;}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .ds-theme-toggle .ds-icon-sun{display:inline;}
  :root:not([data-theme="light"]) .ds-theme-toggle .ds-icon-moon{display:none;}
}
@media print{.ds-theme-toggle{display:none;}}

/* ===== Dark-mode logo swap (inverted logo supplied by Andrew, id 948) ===== */
:root[data-theme="dark"] .custom-logo,
:root[data-theme="dark"] img.custom-logo{content:url("https://dronesite.co.uk/wp-content/uploads/2026/07/DroneSite_Main_Dark_WBG-768x200.png");}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .custom-logo,
  :root:not([data-theme="light"]) img.custom-logo{content:url("https://dronesite.co.uk/wp-content/uploads/2026/07/DroneSite_Main_Dark_WBG-768x200.png");}
}

/* ===== Dark-mode footer logo swap (footer uses img.wp-image-734, not .custom-logo) ===== */
:root[data-theme="dark"] .site-footer img.wp-image-734{content:url("https://dronesite.co.uk/wp-content/uploads/2026/07/DroneSite_Main_Dark_WBG-300x78.png");}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .site-footer img.wp-image-734{content:url("https://dronesite.co.uk/wp-content/uploads/2026/07/DroneSite_Main_Dark_WBG-300x78.png");}
}
