/* Hi-Res Homes — dark mode (preview drop-in).
   Inspired by TP Builders (tpbuilders.uzlogic.net): CSS-variable theme swap,
   circular sun/moon icon button, temporary html theme-anim class so color
   fades only during a toggle. Default remains the current light look.
   All appearance rules are scoped to html[data-theme="dark"] so light mode
   is unchanged. Remove this file (and the script/snippet) to fully revert. */

/* -------------------------------------------------------------------------- */
/* Toggle button (works in both themes; sits in the header action cluster)     */
/* -------------------------------------------------------------------------- */

.hrh-theme-toggle {
  box-sizing: border-box;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--color-line, #e4e0d6);
  background: transparent;
  color: var(--color-tide, #234786);
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.hrh-theme-toggle:hover {
  background: color-mix(in srgb, var(--color-tide, #234786) 8%, transparent);
}

.hrh-theme-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--color-tide, #234786);
}

.hrh-theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Light mode: show moon (action: switch to dark). Dark mode: show sun (action: switch to light). */
.hrh-theme-toggle .hrh-theme-sun { display: none; }
.hrh-theme-toggle .hrh-theme-moon { display: block; }
html[data-theme="dark"] .hrh-theme-toggle .hrh-theme-sun { display: block; }
html[data-theme="dark"] .hrh-theme-toggle .hrh-theme-moon { display: none; }

html[data-theme="dark"] .hrh-theme-toggle {
  color: #9eb6e0;
  border-color: #3a4254;
}

html[data-theme="dark"] .hrh-theme-toggle:hover {
  background: color-mix(in srgb, #9eb6e0 12%, transparent);
}

/* Entry screen has no site header — a header-height bar, toggle right-aligned. */
.hrh-theme-entrybar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 80;
  height: var(--header-h, 4.5rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1rem;
  pointer-events: none;
  background: transparent;
}

@media (min-width: 768px) {
  .hrh-theme-entrybar { padding: 0 2rem; }
}

.hrh-theme-entrybar .hrh-theme-toggle { pointer-events: auto; }

/* Keep the header from wrapping or overflowing when the 44px control is added. */
header.sticky .hrh-theme-toggle,
.price-sheet header .hrh-theme-toggle,
#mobile-nav .hrh-theme-toggle {
  flex-shrink: 0;
}

@media (max-width: 379px) {
  .hrh-theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Toggle-only color fade (~700ms ease). Not applied on load or to hovers.     */
/* -------------------------------------------------------------------------- */

html.hrh-theme-animating,
html.hrh-theme-animating *:not(img, video, canvas, picture, iframe) {
  transition:
    background-color 700ms ease,
    color 700ms ease,
    border-color 700ms ease,
    box-shadow 700ms ease,
    outline-color 700ms ease,
    fill 700ms ease,
    stroke 700ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
  html.hrh-theme-animating,
  html.hrh-theme-animating * {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Dark theme                                                                  */
/* -------------------------------------------------------------------------- */

html[data-theme="dark"] {
  color-scheme: dark;
  background: #121821;
  /* Safe token remaps: ink/muted/line are text and hairlines, not dual-use
     surfaces. Do NOT remap ivory/white/navy/tide/blue — those are used both
     as page surfaces and as text/buttons on the opposite surface. */
  --color-ink: #f4f1ea;
  --color-muted: #c5c0b4;
  --color-line: #3a4254;
  /* Portfolio galleries (rentals-galleries.css) */
  --hrg-ivory: #121821;
  --hrg-sand: #181f2c;
  --hrg-sage: #1a2333;
  --hrg-ink: #f4f1ea;
  --hrg-muted: #c5c0b4;
  --hrg-line: #3a4254;
  --hrg-tide: #9eb6e0;
}

html[data-theme="dark"] body {
  background: #121821;
  color: var(--color-ink);
}

/* Surfaces that are ivory / sand / sage / white in light mode. */
html[data-theme="dark"] .bg-ivory { background-color: #121821; }
html[data-theme="dark"] .bg-sand { background-color: #181f2c; }
html[data-theme="dark"] .bg-sage { background-color: #1a2333; }
html[data-theme="dark"] .bg-white { background-color: #1c2433; }
html[data-theme="dark"] .bg-\[\#fbf9f4\] { background-color: #1c2433; }
html[data-theme="dark"] .bg-\[\#f6f3ec\] { background-color: #181f2c; }

/* Entry-screen ivory veil over the twilight photo — keep the photo visible,
   but shift the wash to a dark navy so the first view is already dark. */
html[data-theme="dark"] .bg-ivory\/70 {
  background-color: rgba(18, 24, 33, 0.72);
}

html[data-theme="dark"] .bg-sand\/40 {
  background-color: color-mix(in srgb, #181f2c 40%, transparent);
}

/* Brand navy/blue body text fails WCAG on the dark page (≈1.4–2.0:1).
   Lighten those text utilities; leave .bg-blue / .bg-navy / .bg-tide alone
   so buttons and navy bands stay on-brand. */
html[data-theme="dark"] .text-tide,
html[data-theme="dark"] .text-blue,
html[data-theme="dark"] .text-navy,
html[data-theme="dark"] .text-\[\#1d2f55\],
html[data-theme="dark"] .text-\[\#234786\] {
  color: #9eb6e0;
}

html[data-theme="dark"] .text-tide\/80 { color: color-mix(in srgb, #9eb6e0 80%, transparent); }
html[data-theme="dark"] .text-tide\/70 { color: color-mix(in srgb, #9eb6e0 70%, transparent); }
html[data-theme="dark"] .text-tide\/35 { color: color-mix(in srgb, #9eb6e0 35%, transparent); }
html[data-theme="dark"] .text-tide\/20 { color: color-mix(in srgb, #9eb6e0 20%, transparent); }

/* Gold chips keep navy type — yellow-on-light-blue would lose the brochure look
   and can drop contrast. */
html[data-theme="dark"] .bg-gold,
html[data-theme="dark"] .bg-coral,
html[data-theme="dark"] .eyebrow.text-gold,
html[data-theme="dark"] .eyebrow.text-coral,
html[data-theme="dark"] :is(.bg-gold, .bg-coral) :is(.text-navy, .text-tide, .text-blue, .text-ink) {
  color: #1d2f55;
}

/* Headings that use a gold marker underline behind navy type. */
html[data-theme="dark"] h2 em,
html[data-theme="dark"] h3 em {
  color: #f4f1ea;
}

html[data-theme="dark"] :is(.bg-tide, .bg-navy, .bg-tide-deep, .bg-\[\#1d2f55\], .bg-\[\#234786\]) :is(h2, h3) em,
html[data-theme="dark"] h2 em.booked {
  color: #f4f000;
  background-image: none;
}

/* Intro wordmarks on the house/hero screen. */
html[data-theme="dark"] .intro-l1,
html[data-theme="dark"] .intro-l2 {
  color: #9eb6e0;
}

/* Forms. Use background-color (not the shorthand) so select chevrons keep
   their background-image / position. Property size is a select.field. */
html[data-theme="dark"] .field {
  background-color: #1c2433;
  color: #f4f1ea;
  border-color: #3a4254;
  color-scheme: dark;
  caret-color: #f4f1ea;
}

html[data-theme="dark"] .field:focus {
  border-color: #9eb6e0;
  outline: 2px solid color-mix(in srgb, #9eb6e0 45%, transparent);
  outline-offset: 1px;
}

html[data-theme="dark"] .field::placeholder {
  color: #c5c0b4;
  opacity: 1;
}

html[data-theme="dark"] select.field {
  appearance: none;
  -webkit-appearance: none;
  background-color: #1c2433;
  background-image:
    linear-gradient(45deg, transparent 50%, #9eb6e0 50%),
    linear-gradient(135deg, #9eb6e0 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  color: #f4f1ea;
  color-scheme: dark;
}

html[data-theme="dark"] select.field option,
html[data-theme="dark"] option {
  background-color: #1c2433;
  color: #f4f1ea;
}

html[data-theme="dark"] input[type="date"].field,
html[data-theme="dark"] input[type="datetime-local"].field,
html[data-theme="dark"] input[type="number"].field,
html[data-theme="dark"] input[type="number"] {
  background-color: #1c2433;
  color: #f4f1ea;
  border-color: #3a4254;
  color-scheme: dark;
}

html[data-theme="dark"] input[type="date"].field::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"].field::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.9;
  filter: invert(1) brightness(1.35);
}

html[data-theme="dark"] .field[aria-invalid="true"] {
  border-color: #f3a3b5;
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill {
  -webkit-text-fill-color: #f4f1ea;
  caret-color: #f4f1ea;
  box-shadow: 0 0 0 1000px #1c2433 inset;
  transition: background-color 9999s ease-out;
}

/* Chat widget (hardcoded hex utilities in ChatWidget.tsx). Navy header
   and user bubbles stay brand blue with light type. */
html[data-theme="dark"] [role="dialog"] .ring-\[\#234786\]\/10,
html[data-theme="dark"] [class*="ring-[#234786]"] {
  --tw-ring-color: color-mix(in srgb, #9eb6e0 16%, transparent);
}

html[data-theme="dark"] [role="dialog"] .border-\[\#234786\]\/10,
html[data-theme="dark"] [role="dialog"] .border-\[\#234786\]\/15,
html[data-theme="dark"] [class*="border-[#234786]"] {
  border-color: #3a4254;
}

/* Selection already uses tide + ivory; bump the highlight slightly for dark. */
html[data-theme="dark"] ::selection {
  background: #234786;
  color: #f4f1ea;
}

/* Stats bar: only the outer ivory page chrome needs to follow the page. The
   inner navy panel and glass cards already read as dark. */
html[data-theme="dark"] .hrh-stats {
  background: #121821;
}

/* Team rotating badge: keep the ivory disc and black letters (requested).
   It reads as a bright coin on the dark page. */
html[data-theme="dark"] .hrh-since-badge {
  background: rgba(253, 252, 248, 0.96);
  color: #111;
  border-color: rgba(253, 252, 248, 0.4);
}
/* Ring labels sit outside the ivory disc; they must be white on the dark page. */
html[data-theme="dark"] .hrh-since-badge .hrh-since-ring text,
html[data-theme="dark"] .hrh-since-badge .hrh-since-ring textPath {
  fill: #fff !important;
}

/* Reviews / process injected accents that hardcode brand blue type. */
html[data-theme="dark"] #google-reviews[data-hrh-rev] .hrh-rev-count {
  color: #9eb6e0;
}

/* "Questions? Call us" / April Rojas — injected #234786, plus portfolio
   !important overrides in rentals-galleries.css. */
html[data-theme="dark"] #contact aside [style*="#234786"],
html[data-theme="dark"] #contact aside .font-bold,
html[data-theme="dark"].hrh-page-portfolio #contact aside .eyebrow,
html[data-theme="dark"] #contact[data-hrh-variant="book"] aside .eyebrow,
html[data-theme="dark"] #contact[data-hrh-variant="book"] aside .text-coral,
html[data-theme="dark"].hrh-page-portfolio #contact aside .text-coral,
html[data-theme="dark"] #contact[data-hrh-variant="book"] aside h3 em,
html[data-theme="dark"].hrh-page-portfolio #contact aside h3 em {
  color: #9eb6e0 !important;
}

html[data-theme="dark"] #contact aside p .hrh-april-name,
html[data-theme="dark"] #contact aside p span.font-display,
html[data-theme="dark"] #contact[data-hrh-variant="book"] aside p span.font-display,
html[data-theme="dark"].hrh-page-portfolio #contact aside p span.font-display {
  color: #c5c0b4 !important;
}

/* Coverage map section (1125i). Process type already follows utilities.
   These overrides beat the ivory/navy/muted hardcodes in coverage-map.js. */
html[data-theme="dark"] #hrh-coverage,
html[data-theme="dark"] .hrh-coverage {
  background: #121821;
}
html[data-theme="dark"] #hrh-coverage h2,
html[data-theme="dark"] .hrh-coverage h2 {
  color: #9eb6e0;
}
html[data-theme="dark"] #hrh-coverage .hrh-coverage-copy,
html[data-theme="dark"] .hrh-coverage-copy {
  color: #c5c0b4;
}
html[data-theme="dark"] #hrh-coverage .hrh-coverage-frame,
html[data-theme="dark"] #hrh-coverage[data-hrh-map-anim] .hrh-coverage-frame,
html[data-theme="dark"] .hrh-coverage-frame {
  border-color: #3a4254;
  background: #1a2333;
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, 0.65);
}
html[data-theme="dark"] #hrh-coverage .hrh-coverage-caption,
html[data-theme="dark"] .hrh-coverage-caption {
  background: rgba(18, 24, 33, 0.92);
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.6);
  outline: 1px solid rgba(158, 182, 224, 0.28);
}
html[data-theme="dark"] #hrh-coverage .hrh-coverage-kicker,
html[data-theme="dark"] #hrh-coverage .hrh-coverage-title {
  color: #9eb6e0;
}
html[data-theme="dark"] #hrh-coverage .hrh-coverage-title em {
  color: #f4f1ea;
}
html[data-theme="dark"] #hrh-coverage .hrh-coverage-sub {
  color: #c5c0b4;
}


/* Before/after chrome in the galleries that hardcodes #fff handles. */
html[data-theme="dark"] .hrg-ba-handle,
html[data-theme="dark"] .hrg-ba-btn {
  /* leave white handles — they sit on photos */
}

/* Logo is a royal-blue tile with a white mark, so it stays visible on both
   the ivory header and the dark header. No invert filter. */

/* Photos, videos, and map imagery are not recolored. */
html[data-theme="dark"] img,
html[data-theme="dark"] video,
html[data-theme="dark"] iframe,
html[data-theme="dark"] picture {
  /* no filters */
}

/* Footer is already navy + ivory type + yellow twilight line. Leave it.
   Slightly separate it from the near-navy page with a hairline. */
html[data-theme="dark"] footer.bg-tide-deep,
html[data-theme="dark"] footer {
  border-top: 1px solid rgba(244, 241, 234, 0.08);
}

/* Mobile full-screen menu uses .bg-ivory — covered by the utility override. */

/* Price sheet and print: on screen, follow dark; print stays light via the
   existing @media print rules in the main stylesheet. */
@media print {
  html[data-theme="dark"] body,
  html[data-theme="dark"] .price-sheet {
    background: #fff !important;
    color: #2b2b2b !important;
  }
}

/* Native form controls that do not use .field, plus option menus. */
html[data-theme="dark"] select,
html[data-theme="dark"] option,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) {
  background-color: #1c2433;
  color: #f4f1ea;
  border-color: #3a4254;
  color-scheme: dark;
}

/* 1125p25 — Vrbo wordmark is navy #0E214B and disappears on dark grounds.
   A white fill in the SVG’s transparent area lifts the mark; no layout shift.
   Same treatment on the Optimized-for strip and the listings row. */
html[data-theme="dark"] img[src*="platform-vrbo.svg"] {
  background-color: #fff;
  border-radius: 4px;
}


/* 1125p39 — Google reviews section contrast in dark mode.
   The "Google reviews" eyebrow is .eyebrow.text-coral; a global dark-mode
   rule paints those eyebrows navy (#1d2f55) for gold/coral chips, which
   fails WCAG on the dark page (~1.35:1). The "What our clients say"
   heading is .text-tide (brand blue) and stays hard to read if it does
   not remap. Light mode is unchanged. */
html[data-theme="dark"] #google-reviews #google-reviews-heading,
html[data-theme="dark"] #google-reviews #google-reviews-heading .hrh-word,
html[data-theme="dark"] #google-reviews #google-reviews-heading em,
html[data-theme="dark"] #google-reviews h2,
html[data-theme="dark"] #google-reviews h2 em,
html[data-theme="dark"] #google-reviews .eyebrow,
html[data-theme="dark"] #google-reviews .eyebrow.text-coral,
html[data-theme="dark"] #google-reviews .eyebrow.text-gold {
  color: #f4f1ea;
  -webkit-text-fill-color: #f4f1ea;
}

/* 5.0 / 121 count: reviews-lively hardcodes #234786 (~1.97:1 on the dark
   page). Keep the existing light-blue token, which passes AA. */
html[data-theme="dark"] #google-reviews .hrh-rev-count {
  color: #9eb6e0;
}

/* Names, links, unselected filters, carousel arrows — ensure .text-tide /
   .text-blue actually lighten inside this section. */
html[data-theme="dark"] #google-reviews .text-tide,
html[data-theme="dark"] #google-reviews .text-blue,
html[data-theme="dark"] #google-reviews a {
  color: #9eb6e0;
}

html[data-theme="dark"] #google-reviews .text-muted,
html[data-theme="dark"] #google-reviews .text-ink {
  color: #c5c0b4;
}
html[data-theme="dark"] #google-reviews .text-ink {
  color: #f4f1ea;
}

/* Selected office filter keeps ivory type on the solid tide pill. */
html[data-theme="dark"] #google-reviews [role="tab"][aria-selected="true"],
html[data-theme="dark"] #google-reviews .bg-tide.text-ivory {
  color: #f4f1ea;
}
