/* ==========================================================================
   Barloso: light / dark theme and the toggle

   The dark theme is the original look (navy heroes, .section--dark / .section--navy,
   the footer, the header). The light theme flips only those surfaces: it swaps tokens locally
   (--navy-*, --ivory, --gold-*, --line-light, --on-rgb), so the rest of the CSS stays as it is.
   Cream and paper sections look the same in both themes.
   This file is loaded last.
   ========================================================================== */

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ------------------------------------------------ Toggle (button) */

.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line-light);
  border-radius: 50%;
  background: transparent;
  color: var(--ivory);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.5s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease);
}

.theme-ico .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* The icon shows the action: a sun in the dark theme (switch to light), a moon in the light theme. */
:root:not([data-theme="light"]) .theme-ico--moon,
:root[data-theme="light"] .theme-ico--sun {
  opacity: 0;
  transform: rotate(-70deg) scale(0.5);
}

.theme-toggle--mobile {
  width: 3rem;
  height: 3rem;
}

/* In the mobile menu the toggle sits next to the language choice. */
.m-prefs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.m-prefs .lang-switch {
  margin: 0;
}

/* In the header the info bar disappears below 1100 px, so the toggle stays by the button. */
@media (max-width: 1100px) {
  .theme-toggle--bar {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* ------------------------------------------------ Smooth color change */

@media (prefers-reduced-motion: no-preference) {
  html.theme-anim body,
  html.theme-anim .section,
  html.theme-anim .hero,
  html.theme-anim .page-head,
  html.theme-anim .site-footer,
  html.theme-anim .site-header::after {
    transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
  }
}

/* ==========================================================================
   LIGHT THEME
   ========================================================================== */

/* Flipped surfaces: cream instead of navy, navy as the text color. */
:root[data-theme="light"]
  :is(
    .section--dark,
    .section--navy,
    .hero:where(:not(.hero-editorial)),
    .he-mast,
    .page-head,
    .art-head,
    .mobile-menu,
    .e404,
    .sep--marquee,
    .sep--photo,
    .sep--parallax,
    .fc-cta,
    .ba-news
  ) {
  --navy-950: #e7dcc4;
  --navy-900: #fbf7ef;
  --navy-800: #f3ead8;
  --navy-700: #e6d9c0;
  --navy-600: #c9b892;
  --ivory: #122033;
  --gold-300: #6a4e16;
  --gold-400: #5c4210;
  --on-rgb: 18 32 51;
  --line-light: rgb(18 32 51 / 0.2);
  --wash: 255 252 247;
}

/* Surfaces that stay dark in both themes: tiles and covers with a photo and text at the bottom, the lightbox, the player. */
:root[data-theme="light"]
  :is(.pp-tile, .pg-item, .g-item, .bcard--overlay, .tm-photo, .vd-frame, .lightbox, .cp-box, .fx-who, .hc-card, .sc-nav-demo, .sc-card--dark) {
  --navy-950: #050e1a;
  --navy-900: #071526;
  --navy-800: #0b1f3a;
  --navy-700: #143458;
  --navy-600: #1d4570;
  --ivory: #f6efdf;
  --gold-300: #ecd08e;
  --gold-400: #e0b85a;
  --on-rgb: 246 239 223;
  --line-light: rgb(246 239 223 / 0.2);
  --wash: 5 14 26;
}

/* ------------------------------------------------ Header and info bar */

:root[data-theme="light"] .topbar {
  background: transparent;
}

:root[data-theme="light"] .site-header::before {
  background: transparent;
}

/* ------------------------------------------------ Layers on photos (hero and bands) */

:root[data-theme="light"] .slide-shade {
  background:
    linear-gradient(102deg, rgb(var(--wash) / 0.98) 0%, rgb(var(--wash) / 0.94) 40%, rgb(var(--wash) / 0.55) 54%, rgb(var(--wash) / 0.1) 72%, rgb(var(--wash) / 0) 86%),
    linear-gradient(180deg, rgb(var(--wash) / 0.4) 0%, rgb(var(--wash) / 0) 14%),
    linear-gradient(0deg, rgb(var(--wash) / 0.98) 0%, rgb(var(--wash) / 0.9) 16%, rgb(var(--wash) / 0.15) 34%, rgb(var(--wash) / 0) 46%);
}

:root[data-theme="light"] .hero-slider .slider-bars .lbl {
  opacity: 1;
  color: rgb(18 32 51 / 0.78);
}

:root[data-theme="light"] .hero-slider .slider-bars li.is-current .lbl,
:root[data-theme="light"] .hero-slider .slider-bars button:hover .lbl {
  color: #122033;
}

:root[data-theme="light"] .hero-slider .slider-arrows .btn-round {
  background: rgb(255 252 247 / 0.86);
  border-color: rgb(18 32 51 / 0.55);
}

:root[data-theme="light"] .hs-photo::after {
  background: linear-gradient(180deg, rgb(var(--wash) / 0.6), rgb(var(--wash) / 0) 25%);
}

:root[data-theme="light"] .hv-shade {
  background:
    radial-gradient(ellipse at center, rgb(var(--wash) / 0.55), rgb(var(--wash) / 0.88) 80%),
    linear-gradient(180deg, rgb(var(--wash) / 0.7), rgb(var(--wash) / 0) 25%);
}

:root[data-theme="light"] .hc-shade {
  background:
    linear-gradient(95deg, rgb(var(--wash) / 0.95) 0%, rgb(var(--wash) / 0.82) 45%, rgb(var(--wash) / 0.4) 100%),
    linear-gradient(180deg, rgb(var(--wash) / 0.6), rgb(var(--wash) / 0) 25%);
}

:root[data-theme="light"] .page-head.has-img::after {
  background: linear-gradient(100deg, rgb(var(--wash) / 0.96) 0%, rgb(var(--wash) / 0.88) 36%, rgb(var(--wash) / 0.2) 68%);
}

:root[data-theme="light"] .art-shade {
  background: linear-gradient(100deg, rgb(var(--wash) / 0.96) 0%, rgb(var(--wash) / 0.86) 40%, rgb(var(--wash) / 0.28) 72%);
}

:root[data-theme="light"] .sep-shade {
  background: linear-gradient(0deg, rgb(var(--wash) / 0.8), rgb(var(--wash) / 0.5));
}

:root[data-theme="light"] .bc-shade {
  background: linear-gradient(100deg, rgb(var(--wash) / 0.95) 0%, rgb(var(--wash) / 0.78) 45%, rgb(var(--wash) / 0.15) 100%);
}

:root[data-theme="light"] .fc-cta::before {
  background: linear-gradient(180deg, rgb(var(--wash) / 0.9), rgb(var(--wash) / 0.7) 50%, rgb(var(--wash) / 0.9));
}

/* Italic in headings on photos: a darker brown for contrast. */
:root[data-theme="light"] :is(.slide-title, .hs-title, .hv-title, .hc-title, .ph-title, .art-title, .bc-title, .sep-quote) em {
  color: var(--gold-300);
}

/* Hero: the italic runs onto the photo, so it gets a darker gold and a light outline. */
:root[data-theme="light"] .slide-title em {
  color: #3e2b0b;
  text-shadow:
    0 0 16px rgb(255 252 247),
    0 0 3px rgb(255 252 247);
}

/* Photo under a testimonial: on a light background it has to stay only a background. */
:root[data-theme="light"] .ts-bg {
  opacity: 0.14;
}
