/* ==========================================================================
   BYB Global — dark-mode.css
   Dark theme preview with a light/dark toggle (client request, Nov 2026, L47).

   Loaded ONLY on the pages that offer the toggle (byb_dark_mode_page() in
   functions.php: the homepage and Company Incorporation), after the page's
   own stylesheet. Every rule except the toggle's own look is scoped under
   html[data-theme="dark"], so the light theme, the approved design, renders
   exactly as before until a visitor switches.

   What changes in dark mode, and only in dark mode:
   - White and paper grounds become warm charcoal (--dk-* tokens, tokens.css);
     never flat black (L24). Sections that already use the dark gold gradient,
     the heroes, the gold CTA band and the footer are untouched.
   - The header becomes a solid dark bar (L25 keeps its "solid, no blur"
     behaviour) and shows the transparent footer logo, because the header
     logo file has a white ground baked in.
   - Gold accents, hairline grids, typography and the two 12px buttons stay
     as they are (the secondary keeps its white ground, as it already does on
     dark sections).
   ========================================================================== */

/* ==========================================================================
   TOGGLE (both themes)
   An icon control like the menu toggle, not a third button style: 12px curve
   (interactive controls are curved), gold hairline edge, moon/sun line icon.
   Two instances share one state: --nav sits beside the header buttons on
   desktop, --bar sits beside the menu icon on tablets and phones.
   ========================================================================== */
.byb-head .byb-theme-toggle {
	display:inline-flex; align-items:center; justify-content:center; flex:none;
	width:44px; height:44px; margin:0; padding:0;
	background:#fff; color:var(--gold-dark);
	border:1px solid var(--gold); border-radius:var(--btn-radius);
	box-shadow:none; cursor:pointer; line-height:0;
	transition:background .25s ease, color .25s ease, border-color .25s ease;
}
.byb-head .byb-theme-toggle:hover { background:var(--gold); border-color:var(--gold); color:#fff; }
.byb-theme-toggle svg { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.byb-theme-toggle__sun { display:none !important; }
.byb-head .byb-theme-toggle--bar { display:none; }

/* Same squeeze as the header buttons between 981 and 1440px (base.css). */
@media (min-width: 981px) and (max-width: 1440px) {
	.byb-head .byb-theme-toggle--nav { width:40px; height:40px; }
}
/* Below 1200px the header has no slack, so the toggle (36px + 8px gap) would
   come out of the logo. Take exactly that 44px from the gaps instead: nav
   links 16 -> 10px (5 gaps), nav-to-buttons 18 -> 12px, bar 16 -> 8px. The
   logo then renders at the same width as on every other page. */
@media (min-width: 981px) and (max-width: 1200px) {
	.byb-head .byb-theme-toggle--nav { width:36px; height:36px; }
	.byb-head:has(.byb-theme-toggle) .byb-head__bar { gap:8px; }
	.byb-head:has(.byb-theme-toggle) .byb-nav { gap:12px; }
	.byb-head:has(.byb-theme-toggle) .byb-nav__list { gap:10px; }
}
@media (max-width: 980px) {
	.byb-head .byb-theme-toggle--nav { display:none; }
	.byb-head .byb-theme-toggle--bar { display:inline-flex; }
}

/* Header logo for the dark bar: hidden until dark mode is on. Sized to the
   same width as the header logo it replaces (the live header logo is the
   Customizer's 480x88 file, capped at 56/46/36px tall; this file is 5:1). */
.byb-head__logo-dark { display:none; }
.byb-head__brand .byb-head__logo-dark .byb-logo-link img { max-height:61px; }
@media (max-width: 980px) {
	.byb-head__brand .byb-head__logo-dark .byb-logo-link img { max-height:50px; }
}
@media (max-width: 600px) {
	.byb-head__brand .byb-head__logo-dark .byb-logo-link img { max-height:39px; }
}

/* ==========================================================================
   DARK THEME
   ========================================================================== */

/* No colour transitions for the one frame the theme switches in (toggle
   script), so the page changes at once instead of cross-fading piecemeal. */
.byb-theme-switching *,
.byb-theme-switching *::before,
.byb-theme-switching *::after { transition:none !important; }

/* Token flip: everything already drawn with --text, --muted and --paper
   follows on its own (body copy, nav links, menu icon, paper bands). */
html[data-theme="dark"] {
	color-scheme:dark;
	--text:var(--dk-text);
	--muted:var(--dk-muted);
	--paper:var(--dk-band);
}
html[data-theme="dark"] body { background:var(--dk-canvas); }

/* ---------- Toggle on the dark bar ---------- */
html[data-theme="dark"] .byb-head .byb-theme-toggle { background:transparent; color:var(--gold-light); border-color:var(--gold); }
html[data-theme="dark"] .byb-head .byb-theme-toggle:hover { background:var(--gold); border-color:var(--gold); color:#fff; }
html[data-theme="dark"] .byb-theme-toggle__moon { display:none !important; }
html[data-theme="dark"] .byb-theme-toggle__sun { display:block !important; }

/* ---------- Header + mega menus ---------- */
html[data-theme="dark"] .byb-head { background:var(--dk-canvas); border-bottom-color:var(--hairline); }
html[data-theme="dark"] .byb-head.is-floating { box-shadow:0 10px 30px -18px rgba(0,0,0,0.9); }
html[data-theme="dark"] .byb-head__brand > :not(.byb-head__logo-dark) { display:none; }
html[data-theme="dark"] .byb-head__logo-dark { display:inline-flex; }
html[data-theme="dark"] .byb-mega__inner { background:var(--dk-card); border:1px solid var(--hairline); box-shadow:0 30px 64px -26px rgba(0,0,0,0.85); }
html[data-theme="dark"] .byb-mega__label { color:var(--dk-muted); }

@media (max-width: 980px) {
	html[data-theme="dark"] .byb-nav { background:var(--dk-canvas); border-bottom:1px solid var(--hairline); box-shadow:0 24px 40px -22px rgba(0,0,0,0.85); }
	html[data-theme="dark"] .byb-nav__item { border-bottom-color:var(--line-dark); }
	html[data-theme="dark"] .byb-mega__inner { background:none; border:0; box-shadow:none; }
}

/* ---------- Entity lifecycle (shared component, light variant) ---------- */
html[data-theme="dark"] .byb-lifecycle--light .byb-lifecycle__stage { background:var(--dk-cell, var(--dk-canvas)); }
html[data-theme="dark"] .byb-lifecycle--light a.byb-lifecycle__stage:hover,
html[data-theme="dark"] .byb-lifecycle--light a.byb-lifecycle__stage:focus-visible { background:var(--dk-cell-hover, var(--dk-band)); border-color:var(--gold); }

/* ==========================================================================
   HOMEPAGE (.byb2-home)
   White sections -> canvas with canvas cells; paper sections (--off/--paper,
   already flipped) -> band with raised cards. Dark-gradient sections,
   the hero and the gold CTA band are unchanged.
   ========================================================================== */
html[data-theme="dark"] .byb2-home,
html[data-theme="dark"] .byb2-stats,
html[data-theme="dark"] .byb2-services,
html[data-theme="dark"] .byb2-how,
html[data-theme="dark"] .byb2-why,
html[data-theme="dark"] .byb2-faq,
html[data-theme="dark"] .byb2-lifecycle { background:var(--dk-canvas); }

html[data-theme="dark"] .byb2-svc:not(.byb2-svc--dark),
html[data-theme="dark"] .byb2-step,
html[data-theme="dark"] .byb2-pillar,
html[data-theme="dark"] .byb2-faq-item { background:var(--dk-canvas); }
html[data-theme="dark"] .byb2-svc:not(.byb2-svc--dark):hover,
html[data-theme="dark"] .byb2-pillar:hover,
html[data-theme="dark"] .byb2-faq-item[open] { background:var(--dk-band); }
html[data-theme="dark"] .byb2-testi { background:var(--dk-card); }
html[data-theme="dark"] .byb2-testi:hover { box-shadow:0 24px 46px -30px rgba(0,0,0,0.9); }

html[data-theme="dark"] .byb2-h:not(.byb2-h--light),
html[data-theme="dark"] .byb2-trust__item h3,
html[data-theme="dark"] .byb2-svc:not(.byb2-svc--dark) .byb2-svc__title,
html[data-theme="dark"] .byb2-step__title,
html[data-theme="dark"] .byb2-pillar__title,
html[data-theme="dark"] .byb2-testi__author,
html[data-theme="dark"] .byb2-faq-item summary { color:var(--dk-heading); }
html[data-theme="dark"] .byb2-check li { color:var(--dk-text); }

/* ==========================================================================
   SERVICE DETAIL (.sd-page)
   Cells take --dk-cell: canvas in a plain section, raised card in a paper
   band, mirroring white-on-white and white-on-paper in the light theme.
   ========================================================================== */
html[data-theme="dark"] .sd-page { background:var(--dk-canvas); --dk-cell:var(--dk-canvas); --dk-cell-hover:var(--dk-band); }
html[data-theme="dark"] .sd-section--paper { --dk-cell:var(--dk-card); --dk-cell-hover:var(--dk-card); }
html[data-theme="dark"] .sd-crumbs,
html[data-theme="dark"] .sd-section:not(.sd-section--paper) { background:var(--dk-canvas); }

html[data-theme="dark"] .sd-cover,
html[data-theme="dark"] .sd-step,
html[data-theme="dark"] .sd-card,
html[data-theme="dark"] .sd-compare__col,
html[data-theme="dark"] .sd-checklist li,
html[data-theme="dark"] .sd-rel,
html[data-theme="dark"] .sd-faq { background:var(--dk-cell); }
html[data-theme="dark"] .sd-cover:hover,
html[data-theme="dark"] .sd-card:hover,
html[data-theme="dark"] .sd-rel:hover,
html[data-theme="dark"] .sd-faq[open] { background:var(--dk-cell-hover); }

html[data-theme="dark"] .sd-h:not(.sd-h--light),
html[data-theme="dark"] .sd-step__title,
html[data-theme="dark"] .sd-card__title,
html[data-theme="dark"] .sd-compare__title,
html[data-theme="dark"] .sd-rel__title,
html[data-theme="dark"] .sd-faq summary { color:var(--dk-heading); }
