/*
 * Light version of dmdnavigation.com (DMD Ops #3741).
 *
 * Linked by head.php on every page, for every visitor (DMD Ops #3757). Every
 * rule hangs off html[data-dmd-theme=light] (head.php's first script sets it
 * before anything paints), so it can do nothing on a dark page; the one
 * exception is the logo pair below, which shows the dark page's logo there.
 *
 * The pages draw their dark "Expedition" look from one token set on their
 * wrapper (#xph home, #xdn DMD2 app + iOS, #xpr product pages, #xab about,
 * #xct contact, #xnl news, #xna news article, #xlp lineup, #xrs resellers,
 * #xlegal legal pages). Light swaps those tokens for a warm paper palette;
 * the rest below are the few places that do not go through the tokens.
 */

/* ---- Tokens ------------------------------------------------------------ */
html[data-dmd-theme=light] :is(#xph, #xdn, #xpr, #xab, #xct, #xnl, #xna, #xlp, #xrs, #xlegal) {
  --ink: #f3f0e9;            /* page: warm paper */
  --ink-rgb: 243, 240, 233;
  --panel: #ffffff;
  --panel-rgb: 255, 255, 255;
  --panel-2: #e9e5dc;
  --bone: #16191d;           /* text */
  --bone-rgb: 22, 25, 29;
  --dim: #4f4a42;
  --faint: #67625a;
  --accent: #006ca6;         /* DMD blue, deep enough to read on paper */
  --accent-ink: #ffffff;     /* text on blue */
  --green: #0e7340;
  --amber: #8f5b00;
  --coral: #c03b28;
  --violet: #5b47d1;
  --line: rgba(22, 25, 29, .13);
}

html[data-dmd-theme=light],
html[data-dmd-theme=light] body,
html[data-dmd-theme=light] main.page-wrapper {
  background-color: #f3f0e9 !important;
  color: #16191d;
}

/* ---- Page loader ------------------------------------------------------- */
html[data-dmd-theme=light] .page-loading { background-color: #f3f0e9; }
html[data-dmd-theme=light] .page-loading::before { background: radial-gradient(46% 40% at 84% 6%, rgba(0, 108, 166, .12), transparent 62%); }
html[data-dmd-theme=light] .page-loading-inner > span { color: rgba(22, 25, 29, .5); }
html[data-dmd-theme=light] .ldr-ring { stroke: rgba(22, 25, 29, .25); }
html[data-dmd-theme=light] .ldr-card { fill: rgba(22, 25, 29, .45); }
html[data-dmd-theme=light] .ldr-card.n,
html[data-dmd-theme=light] .ldr-needle .nn { fill: #006ca6; }
html[data-dmd-theme=light] .ldr-needle .ns { fill: rgba(22, 25, 29, .45); }
html[data-dmd-theme=light] .ldr-hub { fill: #16191d; }

/* ---- Top menu ------------------------------------------------------------ */
/* menu.php renders one header, made for the dark page (navbar-dark, dropdown-menu-dark,
   bg-dark, btn-close-white, text-white headings). In light these put back what the
   Bootstrap theme gives a plain navbar, dropdown and close button. */
html:not([data-dmd-theme=light]) .dmd-logo-on-light,
html[data-dmd-theme=light] .dmd-logo-on-dark { display: none !important; }
html[data-dmd-theme=light] .header.navbar-dark {
  --si-navbar-color: #33354d; --si-navbar-hover-color: #6366f1; --si-navbar-disabled-color: #9397ad; --si-navbar-active-color: #6366f1;
  --si-navbar-brand-color: #0b0f19; --si-navbar-brand-hover-color: #0b0f19;
  --si-navbar-stuck-bg: #fff; --si-navbar-toggler-color: #33354d;
}
html[data-dmd-theme=light] .header .dropdown-menu-dark {
  --si-dropdown-color: var(--si-body-color); --si-dropdown-bg: #fff; --si-dropdown-border-color: #fff;
  --si-dropdown-box-shadow: 0 0.275rem 1.25rem rgba(11,15,25,.05),0 0.25rem 0.5625rem rgba(11,15,25,.03);
  --si-dropdown-link-color: #33354d; --si-dropdown-link-hover-color: #6366f1; --si-dropdown-link-hover-bg: transparent;
  --si-dropdown-link-active-color: #6366f1; --si-dropdown-link-active-bg: transparent; --si-dropdown-link-disabled-color: #9397ad;
  --si-dropdown-divider-bg: #e2e5f1; --si-dropdown-header-color: var(--si-gray-900);
}
html[data-dmd-theme=light] .header .btn-close-white { --si-btn-close-filter: none; }
html[data-dmd-theme=light] .header .text-white { color: var(--si-heading-color) !important; }
html[data-dmd-theme=light] .header .border-dark { border-color: hsla(0, 0%, 100%, .14) !important; }

html[data-dmd-theme=light] .header.navbar { --si-navbar-color: #2b2e33; --si-navbar-hover-color: #006ca6; --si-navbar-active-color: #006ca6; }
html[data-dmd-theme=light] .header.navbar.navbar-stuck { background-color: rgba(243, 240, 233, .94) !important; box-shadow: 0 1px 0 rgba(22, 25, 29, .1); }
html[data-dmd-theme=light] .navbar-nav .nav-link.active,
html[data-dmd-theme=light] .navbar-nav .nav-link.show { color: #006ca6; }
html[data-dmd-theme=light] .navbar-nav .nav-sep { background: rgba(22, 25, 29, .2); }
@media (max-width: 991.98px) {
  html[data-dmd-theme=light] .header .offcanvas.bg-dark { background-color: #f3f0e9 !important; }
}
@media (min-width: 992px) {
  html[data-dmd-theme=light] .header .offcanvas.bg-dark { background-color: transparent !important; }
}
html[data-dmd-theme=light] .header .navbar-nav .dropdown-menu, html[data-dmd-theme=light] .header .dmd-theme-menu .dropdown-menu { background-color: #ffffff; border-color: rgba(22, 25, 29, .1); box-shadow: 0 12px 32px -12px rgba(22, 25, 29, .25); }

/* The theme menu's own switch */
html[data-dmd-theme=light] .dmd-theme-switch { border-color: rgba(21, 24, 28, .22); color: #15181c; }
html[data-dmd-theme=light] .dmd-theme-switch:hover,
html[data-dmd-theme=light] .dmd-theme-switch:focus-visible,
html[data-dmd-theme=light] .dmd-theme-switch[aria-expanded=true] { border-color: #006ca6; color: #006ca6; }
html[data-dmd-theme=light] .dmd-theme-menu .dropdown-item.active,
html[data-dmd-theme=light] .dmd-theme-menu .dropdown-item:active { color: #006ca6; background-color: rgba(0, 108, 166, .08); }

/* Buttons and theme colours from head.php that assume a dark page */
html[data-dmd-theme=light] .btn-primary { --si-btn-color: #ffffff; --si-btn-bg: #006ca6; --si-btn-border-color: #006ca6; --si-btn-hover-color: #ffffff; --si-btn-hover-bg: #005a8a; --si-btn-hover-border-color: #005a8a; }
html[data-dmd-theme=light] .bg-gradient-primary { background: linear-gradient(90deg, #00639a, #006ca6 50%, #0076b3) !important; }
html[data-dmd-theme=light] .text-primary { color: #006ca6 !important; }
html[data-dmd-theme=light] .text-gradient-primary { background: linear-gradient(90deg, #00639a, #006ca6 50%, #0076b3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
html[data-dmd-theme=light] .btn-link { --si-btn-color: #006ca6; --si-btn-hover-color: #005a8a; --si-btn-active-color: #006ca6; }

/* ---- Footer ------------------------------------------------------------ */
html[data-dmd-theme=light] footer.footer { background-color: #e9e5dc !important; border-top: 1px solid rgba(22, 25, 29, .1); }
html[data-dmd-theme=light] footer.footer .text-light { color: #4f4a42 !important; }
html[data-dmd-theme=light] footer.footer .nav-link { color: #2b2e33; }
html[data-dmd-theme=light] footer.footer .nav-link:hover { color: #006ca6; }

/* Back to top */
html[data-dmd-theme=light] .btn-scroll-top { background-color: rgba(22, 25, 29, .12); }

/* ---- Page by page --------------------------------------------------------- */
/* Product pages: the hero lead's highlight was a light blue made for the dark page */
html[data-dmd-theme=light] #xpr .fh .lead .accent { color: var(--accent); }

/* DMD2 app page: the trip sharing mock-ups (live map, journal) are dark app screens, so they keep the dark tokens */
html[data-dmd-theme=light] #xdn :is(.ts-live, .ts-jr) {
  --ink: #0b0d10; --ink-rgb: 11, 13, 16; --panel: #14171b; --panel-rgb: 20, 23, 27; --panel-2: #191d22;
  --bone: #ede8df; --bone-rgb: 237, 232, 223; --dim: #a29b8e; --faint: #6b665c;
  --accent: #00a0f2; --accent-ink: #04121e; --line: rgba(237, 232, 223, .11);
  color: var(--bone);
}

/* "New" tags: white on the deeper green */
html[data-dmd-theme=light] #xdn .newtag { color: #ffffff; }

/* 404: its section carries the dark page colour inline */
html[data-dmd-theme=light] main.page-wrapper > section[style*="#151922"] { background-color: #f3f0e9 !important; }

/* Product specs: the certificates card is a light card on the dark page; keep it light (white) here */
html[data-dmd-theme=light] #xpr .cert { background: var(--panel); border: 1px solid var(--line); }

/* Shop (its own light look, shop_theme() = light): the muted grey was too light to read on white */
html[data-dmd-theme=light] .shop-wrap { --shop-mut: #5f667d; --shop-good: #10704a; --shop-warn: #875a0c; --shop-bad: #b23a2a; --shop-link: #0067a8; }
html[data-dmd-theme=light] .shop-wrap .text-muted,
html[data-dmd-theme=light] .shop-wrap .form-text { color: #5f667d !important; }
html[data-dmd-theme=light] .shop-st-ok { color: #10704a; }
html[data-dmd-theme=light] .shop-st-low { color: #875a0c; }
html[data-dmd-theme=light] .shop-st-out { color: #a83524; }
html[data-dmd-theme=light] .shop-st-mut { color: #545b6f; }
html[data-dmd-theme=light] .shop-st-proc { color: #145b93; }
html[data-dmd-theme=light] .shop-chip.on { color: #005f9c; }

/* Lineup hero: the blurred terrain photo is darkened for the dark page; on paper keep it light and wash the text side */
html[data-dmd-theme=light] #xlp .hero-bg { filter: blur(26px) brightness(1.12) saturate(.75); }
html[data-dmd-theme=light] #xlp .hero-scrim {
  background:
    linear-gradient(90deg, rgba(var(--ink-rgb), .9) 0%, rgba(var(--ink-rgb), .78) 50%, rgba(var(--ink-rgb), .5) 100%),
    linear-gradient(180deg, transparent 55%, var(--ink) 96%);
}
