/*
 * Rivas light colour variant
 *
 * This file is deliberately colour-only. Spacing, type, motion and media are
 * still owned by the production stylesheets. The attribute is installed on
 * <html> before paint; keeping `.rivas-site` in every selector prevents these
 * rules leaking into the rest of the application.
 */
html[data-rivas-variant="light"] .rivas-site {
  color-scheme: light;
  /* Foregrounds belong to the nearest surface, not the original utility name. */
  --rivas-light-ink: #194f80;
  --rivas-light-muted: #486078;
  --rivas-light-accent: #1d6664;
  --rivas-paper: #194f80;
  --rivas-cream: #ffffff;
  --rivas-muted: #486078;
  --rivas-muted-dark: #486078;
  --rivas-blue: #194f80;
  --rivas-accent: #287674;
  --rivas-accent-deep: #1d5e5c;
  --rivas-sub: #486078;
  --rivas-teal: #287674;
  --rivas-teal-dark: #1d5e5c;
  --rivas-accent-border: rgb(25 79 128 / 22%);
  --rivas-hairline: rgb(25 79 128 / 16%);
  --rivas-glow: rgb(40 118 116 / 24%);
  --rivas-glow-strong: rgb(40 118 116 / 48%);
  --rivas-glow-soft: rgb(40 118 116 / 10%);
  --rivas-wash-a: #f3f8fc;
  --rivas-wash-b: #e7f1f8;
  background: #ffffff;
  color: #194f80;
}

/* Several page shells set these tokens inline to select a dark-page accent.
   Rebind only their colour tokens; leave all non-colour inline styles intact. */
html[data-rivas-variant="light"] .rivas-site [style*="--rivas-accent"] {
  --rivas-accent: #287674 !important;
  --rivas-accent-deep: #1d5e5c !important;
  --rivas-accent-border: rgb(25 79 128 / 22%) !important;
}
html[data-rivas-variant="light"] .rivas-site [style*="--rivas-sub"] {
  --rivas-sub: #486078 !important;
}
html[data-rivas-variant="light"] .rivas-site [style*="--rivas-wash"] {
  --rivas-wash-a: #f3f8fc !important;
  --rivas-wash-b: #e7f1f8 !important;
}
html[data-rivas-variant="light"] .rivas-site [style*="--rivas-glow"] {
  --rivas-glow: rgb(40 118 116 / 24%) !important;
  --rivas-glow-strong: rgb(40 118 116 / 48%) !important;
  --rivas-glow-soft: rgb(40 118 116 / 10%) !important;
  --rivas-shimmer: rgb(40 118 116 / 46%) !important;
  --rivas-hairline: rgb(25 79 128 / 16%) !important;
}

/* Match the legacy internal-canvas rule's specificity without changing dark mode. */
html[data-rivas-variant="light"] body.rivas-site main {
  background-color: #ffffff !important;
}

/* Production pages primarily express their dark palette as exact utilities. */
html[data-rivas-variant="light"] body.rivas-site :where(
  [class~="bg-[#16150f]"],
  [class~="bg-[#11110e]"],
  [class~="bg-[#141010]"],
  [class~="bg-[#1c1b17]"],
  [class~="bg-[#1b1a16]"],
  [class~="bg-[#1b1d1b]"],
  [class~="bg-[#1F1E18]"],
  [class~="bg-[#1f1e18]"],
  [class~="bg-[#20221f]"],
  [class~="bg-[#22211b]"],
  [class~="bg-[#24231d]"],
  [class~="bg-[#25251e]"],
  [class~="bg-[#25251f]"],
  [class~="bg-[#26241d]"],
  [class~="bg-[#272621]"],
  [class~="bg-[#292923]"]
):not(:where([data-rivas-media], [data-rivas-media] *)) {
  background-color: #ffffff !important;
}

html[data-rivas-variant="light"] body.rivas-site :where(
  [class~="bg-[#2c2b24]"],
  [class~="bg-[#314b62]"],
  [class~="bg-[#34342e]"],
  [class~="bg-[#394552]"]
):not(:where([data-rivas-media], [data-rivas-media] *)) {
  background-color: #edf5fa !important;
}

html[data-rivas-variant="light"] .rivas-site :where(
  [class~="bg-white/[.025]"],
  [class~="bg-white/[.03]"],
  [class~="bg-white/[0.03]"],
  [class~="bg-white/[.04]"],
  [class~="bg-white/[0.04]"],
  [class~="bg-white/[.05]"],
  [class~="bg-white/[0.05]"],
  [class~="bg-white/[.06]"],
  [class~="bg-white/[0.06]"],
  [class~="bg-white/[.08]"],
  [class~="bg-white/[0.08]"],
  [class~="bg-[#f4f1ea]"],
  [class~="bg-[#f6f6f6]"],
  [class~="bg-[#eceadf]"],
  [class~="bg-[#e8e4d9]"]
):not(:where([data-rivas-media], [data-rivas-media] *)) {
  background-color: #edf5fa !important;
}

html[data-rivas-variant="light"] .rivas-site :where(
  [class~="text-white"],
  [class~="text-[#f4f1ea]"],
  [class~="text-[#d8d3c7]"],
  [class~="text-[#d6d1c4]"]
) {
  color: var(--rivas-light-ink) !important;
}

/* Dark ink on explicitly light controls must not inherit white media copy. */
html[data-rivas-variant="light"] .rivas-site :where(
  [class~="text-[#1c1b17]"],
  [class~="text-[#16150f]"]
) {
  color: #194f80 !important;
}

html[data-rivas-variant="light"] .rivas-site :where(
  [class~="text-white/90"],
  [class~="text-white/85"],
  [class~="text-white/80"],
  [class~="text-white/75"],
  [class~="text-white/72"],
  [class~="text-white/70"],
  [class~="text-white/65"],
  [class~="text-white/60"],
  [class~="text-white/55"],
  [class~="text-white/50"],
  [class~="text-white/45"],
  [class~="text-white/40"],
  [class~="text-[#f4f1ea]/70"],
  [class~="text-[#1c1b17]/70"],
  [class~="text-[#b6b0a2]"],
  [class~="text-[#b8c8d5]"],
  [class~="text-[#b8c8d6]"],
  [class~="text-[#969083]"],
  [class~="text-[#aaa497]"],
  [class~="text-[#aaa599]"],
  [class~="text-[#8b8578]"],
  [class~="text-[#8b8a80]"],
  [class~="text-[#6e685c]"],
  [class~="text-[#6f6d61]"],
  [class~="text-[#625f57]"],
  [class~="text-[#777267]"],
  [class~="text-[#5f5d56]"],
  [class~="text-[#56616a]"],
  [class~="text-[#4c4b42]"]
) {
  color: var(--rivas-light-muted) !important;
}

html[data-rivas-variant="light"] .rivas-site :where(
  [class~="text-[#91a6ba]"],
  [class~="text-[#b9cfdf]"],
  [class~="text-[var(--rivas-teal)]"]
) {
  color: var(--rivas-light-accent) !important;
}

html[data-rivas-variant="light"] .rivas-site :where(
  [class*="border-white/"],
  [class~="border-[#16150f]"],
  [class~="border-[#1c1b17]"]
):not(:where([data-rivas-media], [data-rivas-media] *)) {
  border-color: rgb(25 79 128 / 20%) !important;
}

html[data-rivas-variant="light"] .rivas-site :where(
  [class~="border-[#91a6ba]"],
  [class~="accent-[var(--rivas-teal)]"]
) {
  border-color: #287674 !important;
  accent-color: #287674 !important;
}

html[data-rivas-variant="light"] .rivas-site :where(hr) {
  border-color: rgb(25 79 128 / 18%);
}

/* Native logo art is dark; dark mode makes it white with an inline filter. */
html[data-rivas-variant="light"] .rivas-site img[src*="rivas-logo"] {
  filter: none !important;
}

/* Shared calls to action, including the inline custom-property palette. */
html[data-rivas-variant="light"] .rivas-site .rivas-primary-cta:not([data-rivas-media] *) {
  --cta-focus: #287674 !important;
  --cta-fill: #287674 !important;
  --cta-ink: #ffffff !important;
  --cta-chip: #287674 !important;
  --cta-chip-hover: #ffffff !important;
  --cta-arrow: #ffffff !important;
  --cta-arrow-hover: #287674 !important;
  color: #ffffff !important;
  background-color: #194f80 !important;
  border-color: #194f80 !important;
}
html[data-rivas-variant="light"] .rivas-site :where(
  button[class~="bg-[#1c1b17]"],
  button[class~="bg-[#141010]"],
  a[class~="bg-[#1c1b17]"],
  a[class~="bg-[#141010]"]
) {
  color: #ffffff !important;
  background-color: #194f80 !important;
}

/* Forms and calculator controls. */
html[data-rivas-variant="light"] .rivas-site :where(input, select, textarea) {
  color: #194f80;
  background-color: #ffffff;
  border-color: rgb(25 79 128 / 28%);
}
html[data-rivas-variant="light"] .rivas-site :where(input, textarea)::placeholder {
  color: #486078 !important;
  opacity: 1;
}
html[data-rivas-variant="light"] .rivas-site :where(input, select, textarea):focus {
  border-color: #287674 !important;
  outline-color: #287674;
}
html[data-rivas-variant="light"] .rivas-site :where(
  [role="tab"][aria-selected="true"],
  button[aria-pressed="true"]
) {
  color: #ffffff !important;
  background-color: #194f80 !important;
  border-color: #194f80 !important;
}

/* Cards and accordions whose colors are utility-driven. Module-owned colors
   are overridden beside their local selectors in the source modules. */
html[data-rivas-variant="light"] .rivas-site :where(details, summary) {
  border-color: rgb(25 79 128 / 16%);
}
html[data-rivas-variant="light"] .rivas-site details {
  background-color: #f3f8fc;
}

html[data-rivas-variant="light"] .rivas-site .rivas-calculator-panel {
  color: #194f80 !important;
  background-color: #edf5fa !important;
}

/* Stable hook for non-media surfaces whose production palette is inline. */
html[data-rivas-variant="light"] .rivas-site .rivas-light-panel {
  color: #194f80 !important;
  background-color: #edf5fa !important;
  border-color: rgb(25 79 128 / 16%) !important;
}
html[data-rivas-variant="light"] .rivas-site .rivas-light-surface {
  color: #194f80 !important;
  background-color: #ffffff !important;
}

/* Remove stacked-section dividers without changing their reveal motion. */
html[data-rivas-variant="light"] .rivas-site [data-rivas-sheet-shadow] {
  background: none !important;
}

html[data-rivas-variant="light"] .rivas-site .rivas-light-gradient {
  background: radial-gradient(circle at 50% 45%, rgb(40 118 116 / 10%), transparent 35%),
    linear-gradient(135deg, #ffffff, #edf5fa) !important;
}

/* Older compact sections predate the semantic hook. Match only their exact
   inline dark surface declarations; color-only and intentionally !important. */
html[data-rivas-variant="light"] .rivas-site [style*="background-color: #1F1E18"],
html[data-rivas-variant="light"] .rivas-site [style*="background-color: #1f1e18"],
html[data-rivas-variant="light"] .rivas-site [style*="background-color:#1F1E18"],
html[data-rivas-variant="light"] .rivas-site [style*="background-color:#1f1e18"],
html[data-rivas-variant="light"] .rivas-site [style*="background-color: rgb(31, 30, 24)"],
html[data-rivas-variant="light"] .rivas-site [style*="background-color: #1b1a15"],
html[data-rivas-variant="light"] .rivas-site [style*="background-color: rgb(27, 26, 21)"] {
  color: #194f80 !important;
  background-color: #edf5fa !important;
  border-color: rgb(25 79 128 / 16%) !important;
}

/* Footer remains visually separate without returning to the dark palette. */
html[data-rivas-variant="light"] .rivas-site footer {
  color: #194f80 !important;
  background: #eaf3f9 !important;
}
html[data-rivas-variant="light"] .rivas-site footer :where(
  [class~="text-[#f4f1ea]"],
  [class~="text-[#d6d1c4]"]
) {
  color: #194f80 !important;
}
html[data-rivas-variant="light"] .rivas-site footer :where(
  [class~="text-[#b6b0a2]"],
  [class~="text-[#8b8578]"],
  [class~="text-[#6e685c]"]
) {
  color: #486078 !important;
}

/*
 * One context covers every mapped text utility, including opacity variants.
 * Headers nested inside a hero reset this context below. Media pixels, scrims,
 * and glass-panel backgrounds retain their original treatment.
 */
html[data-rivas-variant="light"] .rivas-site :where(
  [data-rivas-media],
  section:has([data-rivas-media="hero-background"]),
  section:has(> div > .rivas-internal-hero-image)
) {
  --rivas-light-ink: #ffffff;
  --rivas-light-muted: #e2e8ee;
  --rivas-light-accent: #9be1df;
  --rivas-paper: #f4f1ea;
  --rivas-muted: #b6b0a2;
  --rivas-muted-dark: #8b8578;
}
html[data-rivas-variant="light"] .rivas-site [data-rivas-media][class*="bg-[#"] {
  background-color: #16150f !important;
}
html[data-rivas-variant="light"] .rivas-site section:has([data-rivas-media="hero-background"]) > div,
html[data-rivas-variant="light"] .rivas-site section:has(> div > .rivas-internal-hero-image) > div {
  background-color: #16150f !important;
}
html[data-rivas-variant="light"] .rivas-site [data-rivas-media] .rivas-primary-cta:not(:where(.rivas-global-header *)),
html[data-rivas-variant="light"] .rivas-site section:has([data-rivas-media="hero-background"]) .rivas-primary-cta:not(:where(.rivas-global-header *)),
html[data-rivas-variant="light"] .rivas-site section:has(> div > .rivas-internal-hero-image) .rivas-primary-cta:not(:where(.rivas-global-header *)) {
  --cta-focus: #60c1bf !important;
  --cta-fill: #60c1bf !important;
  --cta-ink: #1c1b17 !important;
  --cta-chip: #60c1bf !important;
  --cta-chip-hover: #1c1b17 !important;
  --cta-arrow: #1c1b17 !important;
  --cta-arrow-hover: #60c1bf !important;
  color: #ffffff !important;
  background-color: transparent !important;
  border-color: rgb(255 255 255 / 50%) !important;
}

html[data-rivas-variant="light"] .rivas-site :where(a, button):focus-visible {
  outline-color: var(--rivas-light-accent);
}

/* Interactive boundaries and states remain distinct on white surfaces. */
html[data-rivas-variant="light"] .rivas-site [role="tab"][aria-selected="false"] {
  color: #486078 !important;
}
html[data-rivas-variant="light"] .rivas-site [role="tab"][aria-selected="true"] > span:first-child {
  background-color: #194f80 !important;
}
html[data-rivas-variant="light"] .rivas-site :where(input:not([type="range"]), select, textarea) {
  border-color: #718496 !important;
}
html[data-rivas-variant="light"] .rivas-site :where(input, select, textarea)[aria-invalid="true"] {
  border-color: #b42318 !important;
}
html[data-rivas-variant="light"] .rivas-site [class~="text-[#e8a8a1]"] {
  color: #b42318 !important;
}

html[data-rivas-variant="light"] .rivas-site .rivas-mobile-icon-control {
  color: #194f80 !important;
  border-color: #718496 !important;
}

html[data-rivas-variant="light"] .rivas-site .rivas-mobile-icon-control:not(:disabled):is(:hover, :focus-visible) {
  background-color: #60c1bf !important;
  border-color: #287674 !important;
  color: #16150f !important;
}

html[data-rivas-variant="light"] .rivas-site .rivas-text-link {
  --rivas-link-accent: var(--rivas-light-accent);
}
html[data-rivas-variant="light"] .rivas-site .rivas-text-link:is(:hover, :focus-visible) {
  color: var(--rivas-light-accent) !important;
}

/* Fixed navigation remains a light surface even when mounted inside a hero. */
html[data-rivas-variant="light"] body.rivas-site .rivas-global-header {
  --rivas-light-ink: #194f80;
  --rivas-light-muted: #486078;
  --rivas-light-accent: #1d6664;
  --rivas-paper: #194f80;
  --rivas-muted: #486078;
  --rivas-muted-dark: #486078;
}
html[data-rivas-variant="light"] body.rivas-site .rivas-global-header .rivas-primary-cta {
  --cta-focus: #287674 !important;
  --cta-fill: #287674 !important;
  --cta-ink: #ffffff !important;
  --cta-chip: #287674 !important;
  --cta-chip-hover: #ffffff !important;
  --cta-arrow: #ffffff !important;
  --cta-arrow-hover: #287674 !important;
  color: #ffffff !important;
  background-color: #194f80 !important;
  border-color: #194f80 !important;
}
/* The original hover fill still runs; its label must follow the fill's ink. */
html[data-rivas-variant="light"] body.rivas-site .rivas-primary-cta:hover .cta__label {
  color: var(--cta-ink);
}
