/* Time-of-day theming, ported from the Maharaja site and retuned to this
   site's blue / black / white palette. Daytime is the base design in
   styles.css; the other five states re-point the same variables.
   In the dark states --cream is the card surface and --ink is the text. */

html[data-theme="daytime"] {
  --wash: linear-gradient(180deg, rgba(190, 215, 255, 0.55), rgba(255, 255, 255, 0) 50%);
  --wash-opacity: 0.18;
}

/* Pre-dawn is charcoal, not navy: a navy ground with navy cards read as
   "a lot of blue". Blue is kept for links and buttons only. */
html[data-theme="pre-dawn"] {
  --oat: #15171c; --oat-deep: #0f1014; --cream: #1e2128;
  --ink: #eef1f6; --ink-soft: #a9afbb; --slate: #8a909d;
  --timber: #6c9ff5; --timber-deep: #8fb6fa; --timber-soft: #b9d0fb;
  --olive: #9db9ee; --olive-deep: #bdd0f5;
  --wash: linear-gradient(180deg, rgba(60, 68, 88, 0.5), rgba(10, 11, 16, 0.3) 60%);
  --wash-opacity: 0.2;
}

html[data-theme="sunrise"] {
  --oat: #0e1f3d; --oat-deep: #0a1730; --cream: #162b52;
  --ink: #f5f8fd; --ink-soft: #b3c1da; --slate: #94a4c2;
  --timber: #7db2ff; --timber-deep: #a0c7ff; --timber-soft: #c6dcff;
  --olive: #a3c6ff; --olive-deep: #c4daff;
  --wash: linear-gradient(180deg, rgba(120, 175, 255, 0.5), rgba(40, 90, 200, 0.16) 45%, rgba(10, 20, 50, 0.3));
  --wash-opacity: 0.24;
}

html[data-theme="dusk"] {
  --oat: #0b1533; --oat-deep: #080f26; --cream: #131f45;
  --ink: #eef1fb; --ink-soft: #a6b0d0; --slate: #8a95b8;
  --timber: #6f95ff; --timber-deep: #92afff; --timber-soft: #bccbff;
  --olive: #93adf7; --olive-deep: #b7c8fb;
  --wash: linear-gradient(180deg, rgba(60, 80, 210, 0.55), rgba(20, 30, 110, 0.25) 60%);
  --wash-opacity: 0.28;
}

html[data-theme="sunset"] {
  --oat: #0c1626; --oat-deep: #08101c; --cream: #142238;
  --ink: #f2f6fb; --ink-soft: #a9b6c9; --slate: #8c9ab0;
  --timber: #58a6f0; --timber-deep: #7cbcf6; --timber-soft: #b3d6f8;
  --olive: #86bdf2; --olive-deep: #add3f8;
  --wash: linear-gradient(180deg, rgba(60, 140, 235, 0.5), rgba(20, 60, 150, 0.28) 50%, rgba(6, 12, 34, 0.4));
  --wash-opacity: 0.28;
}

html[data-theme="night"] {
  --oat: #06080c; --oat-deep: #020305; --cream: #10141c;
  --ink: #f4f6fa; --ink-soft: #a9b1c0; --slate: #8791a3;
  --timber: #5b9bff; --timber-deep: #82b3ff; --timber-soft: #b5d0ff;
  --olive: #8ab4f8; --olive-deep: #b0cbfa;
  --wash: linear-gradient(180deg, rgba(14, 34, 96, 0.6), rgba(2, 4, 12, 0.5));
  --wash-opacity: 0.3;
}

/* White and Blue: plain looks, chosen by hand only. Both are light states.
   Blue is a soft blue ground with white cards and navy text; a solid blue
   ground with blue cards was tried and read as far too much blue. */
html[data-theme="white"] {
  --oat: #ffffff; --oat-deep: #f2f4f8; --cream: #ffffff;
}

html[data-theme="blue"] {
  --oat: #dce8fa; --oat-deep: #c5d8f5; --cream: #ffffff;
  --ink: #0b2a66; --ink-soft: #2f4a7d; --slate: #4c6596;
  --line: rgba(11, 42, 102, 0.14);
}

/* Timber: a light, warm brown alternative. Chosen by hand only; Auto stays on
   the blue, black and white states above. */
html[data-theme="timber"] {
  --oat: #f1e9dd; --oat-deep: #e4d8c6; --cream: #fbf7f0;
  --ink: #2a211a; --ink-soft: #5c4f43; --slate: #7a6a5c;
  --timber: #8a5a2b; --timber-deep: #6f4520; --timber-soft: #d9bd98;
  --olive: #6b4a2a; --olive-deep: #4f3519;
  --line: rgba(42, 33, 26, 0.12);
  --shadow-soft: 0 28px 64px -28px rgba(68, 48, 28, 0.32);
  --shadow-card: 0 1px 2px rgba(68, 48, 28, 0.05), 0 16px 36px -22px rgba(68, 48, 28, 0.26);
  --wash: linear-gradient(180deg, rgba(214, 170, 112, 0.5), rgba(255, 255, 255, 0) 50%);
  --wash-opacity: 0.18;
}

/* styles.css gives the primary button a fixed blue glow. */
html[data-theme="timber"] .btn-primary {
  box-shadow: 0 10px 24px -14px rgba(111, 69, 32, 0.55);
}

html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) {
  color-scheme: dark;
  --line: rgba(226, 234, 248, 0.14);
  --shadow-soft: 0 28px 64px -28px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -22px rgba(0, 0, 0, 0.6);
}

/* Text that sits on photography or video stays light in every state. */
.hero,
.site-header:not(.is-scrolled):not(.nav-open) .brand,
.site-header:not(.is-scrolled):not(.nav-open) .nav-toggle,
.site-header:not(.is-scrolled):not(.nav-open) .site-tools {
  --cream: #ffffff;
}

/* Panels built as "ink ground, cream text" keep a dark ground at night. */
html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) .split,
html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) .service-band {
  background: var(--cream);
  color: var(--ink);
}

/* Surfaces that styles.css paints with fixed linen values. */
html[data-theme] .site-header.is-scrolled,
html[data-theme] .site-header.nav-open {
  background: color-mix(in srgb, var(--oat) 94%, transparent);
}

html[data-theme] .site-footer {
  background: color-mix(in srgb, var(--cream) 50%, transparent);
}

html[data-theme] .btn-ink {
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}

@media (max-width: 1240px) {
  html[data-theme] .site-nav {
    background: color-mix(in srgb, var(--oat) 98%, transparent);
  }
}

/* One fixed, non-interactive layer carrying the sky colour of the hour. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background: var(--wash, none);
  opacity: var(--wash-opacity, 0);
  transition: opacity 0.9s ease, background 0.9s ease;
}

/* Header tools: language select and time-of-day switcher */
.site-nav {
  margin-left: auto;
}

.site-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
  color: var(--cream);
  font-family: var(--font-display);
}

.site-header.is-scrolled .site-tools,
.site-header.nav-open .site-tools {
  color: var(--ink);
}

.tod-switch {
  position: relative;
  z-index: 10000;
}

.tod-trigger,
.lang-select {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.35rem;
  padding: 0 0.7rem;
  background: transparent;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  border-radius: var(--radius-sm);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.tod-trigger:hover,
.tod-trigger[aria-expanded="true"],
.lang-select:hover {
  border-color: currentColor;
}

.lang-select option {
  color: #0a0d14;
  background: #ffffff;
}

.tod-trigger svg,
.tod-option svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.tod-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 15rem;
  padding: 0.5rem;
  /* Opaque: the menu regularly opens over the hero video. */
  background: var(--oat);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tod-switch.open .tod-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.tod-heading {
  padding: 0.5rem 0.75rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
}

.tod-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.tod-option:hover,
.tod-option:focus-visible {
  background: color-mix(in srgb, var(--timber) 14%, transparent);
  outline: none;
}

.tod-option[aria-checked="true"] {
  color: var(--timber);
  font-weight: 600;
  background: color-mix(in srgb, var(--timber) 14%, transparent);
}

.tod-option .tod-now {
  margin-left: auto;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

.tod-sep {
  height: 1px;
  margin: 0.35rem 0.25rem;
  background: var(--line);
}

/* Google Translate adds a top banner and pushes the body down; the page has
   its own language control, so both are suppressed. */
.goog-te-banner-frame,
.skiptranslate > iframe,
#goog-gt-tt {
  display: none !important;
}

body {
  top: 0 !important;
}

@media (max-width: 1240px) {
  .site-tools {
    margin-left: auto;
  }

  .nav-toggle {
    order: 3;
  }

  .tod-trigger .tod-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .tod-menu {
    transition: none;
  }
}

/* Dark states use the light version of the logo. */
html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) .brand-logo:not(.brand-logo-light) {
  display: none;
}

html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) .brand-logo-light {
  display: block;
}

/* Dark states: the footer uses the light logo too. */
html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) .footer-logo:not(.footer-logo-light) {
  display: none;
}

html[data-theme]:not([data-theme="daytime"]):not([data-theme="timber"]):not([data-theme="white"]):not([data-theme="blue"]) .footer-logo-light {
  display: block;
}
