/* Activity details share the homepage preference and Wayfinding palette.
   Load after operator styles; photographs and commercial choices stay intact. */
:root {
  color-scheme: light;
  --on-signal: #17363b;
}

.bw-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--slate-deep);
  cursor: pointer;
}
.bw-theme-toggle[hidden] { display: none; }
.bw-theme-toggle:hover { background: var(--paper); }
.bw-theme-toggle svg { width: 20px; height: 20px; }
.bw-theme-toggle [data-theme-icon="moon"],
:root[data-theme="dark"] .bw-theme-toggle [data-theme-icon="sun"] { display: none; }
:root[data-theme="dark"] .bw-theme-toggle [data-theme-icon="moon"] { display: block; }
.bw-header .bw-header-actions { gap: 12px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #17363b;
  --paper: #193d42;
  --slate-deep: #ecefeb;
  --steel: #536d71;
  --muted: #b9cbcd;
  --owner-error: #ffb5a3;
  --activity-inverse: #112c30;
}

/* Inverse sections keep a dark ground instead of following the text token. */
:root[data-theme="dark"] :is(
  .activity-facts, .activity-preparation, .activity-booking .fare-panel,
  .surya-river-facts, .surya-preparation, .surya-summary
) {
  background: var(--activity-inverse);
  color: var(--slate-deep);
}

/* Orange always carries the brand's deep teal ink. */
:root[data-theme="dark"] :is(
  .activity-booking .ride-option[data-selected="true"],
  .activity-booking .ride-option[data-selected="true"] small,
  .surya-package:has(input:checked), .surya-time:has(input:checked),
  .surya-action, .surya-mobile-book, .activity-mobile-book,
  .activity-booking .booking-preview-link,
  .activity-related-lead .activity-related-action,
  .surya-related-lead .surya-related-action, .bw-footer-contact
) { color: var(--on-signal); }

:root[data-theme="dark"] :is(.activity-mobile-book, .surya-mobile-book):hover {
  background: #f9864d;
  color: var(--on-signal);
}
:root[data-theme="dark"] .surya-page .surya-action:active {
  background: #f9864d;
}
:root[data-theme="dark"] :is(.surya-package, .surya-time):has(input:checked) input {
  accent-color: var(--on-signal);
}
:root[data-theme="dark"] :is(.surya-package, .surya-time):has(input:checked):has(input:focus-visible) {
  outline-color: var(--on-signal);
}

/* Native date pickers, option menus and the existing inset chevron follow theme. */
:root[data-theme="dark"] :is(.activity-booking, .surya-booking) select {
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='m1 1 7 7 7-7' fill='none' stroke='%23ecefeb' stroke-width='2'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] :is(input, textarea) {
  caret-color: var(--slate-deep);
}
:root[data-theme="dark"] :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
:root[data-theme="dark"] .surya-error { color: var(--owner-error); }
:root[data-theme="dark"] .surya-page [aria-invalid="true"] {
  border-color: var(--owner-error);
}
:root[data-theme="dark"] .activity-booking .ride-quantity {
  border-color: var(--slate-deep);
  color: var(--slate-deep);
}
:root[data-theme="dark"] .jeep-page .ride-quantity button:hover:not(:disabled) {
  background: var(--ground);
}
:root[data-theme="dark"] :is(.activity-page, .surya-page) ::selection {
  background: var(--orange);
  color: var(--on-signal);
}
:root[data-theme="dark"] :is(.bw-header, .bw-footer) .bw-brand {
  background: transparent;
}
:root[data-theme="dark"] :is(.bw-header, .bw-footer) .bw-brand img {
  filter: grayscale(1) invert(1) contrast(2);
  mix-blend-mode: screen;
}

@media (forced-colors: active) {
  :root[data-theme="dark"] :is(.activity-booking, .surya-booking) select {
    background-image: none;
  }
  :root[data-theme="dark"] :is(.bw-header, .bw-footer) .bw-brand img {
    filter: none;
    mix-blend-mode: normal;
  }
}
