/*
 * Summer Hamptons Home — Official Brand & Semantic Design Tokens (Ruth Brand System)
 * Light (Sage & White) & Dark (Midnight Ink) Themes
 * Verified against WCAG 2.1 AA text (>= 4.5:1) and 1.4.11 non-text control/focus contrast (>= 3.0:1).
 *
 * Official Palette & Rules:
 *   Midnight ink #141B2B | Sage #D4DCD9 | White #FFFFFF | Sand #F4F0E6 (sparingly)
 *   Atlantic #7FA3B2 (Midnight ink text) | Harbor #2D5B70 (White text) | Driftwood #4F5B5E (body)
 *   Sunlit gold #DCC07A (Midnight backgrounds ONLY) | Gold line #B0904A (hairlines/icons ONLY, never text)
 */

:root,
html[data-theme="light"] {
  color-scheme: light;

  /* Surfaces */
  --bg-canvas: #FFFFFF;        /* White */
  --bg-subtle: #F4F0E6;        /* Sand — warm accent, used sparingly */
  --bg-elevated: #FFFFFF;      /* White */
  --bg-wash: #D4DCD9;          /* Sage — light sections, tags, brand wash */
  --bg-atlantic: #7FA3B2;      /* Atlantic — bolder color blocks (Midnight ink text: 6.4:1) */
  --bg-inverse: #141B2B;       /* Midnight ink */

  /* Text */
  --text-primary: #141B2B;     /* Midnight ink — 17.5:1 on White, 12.3:1 on Sage, 6.4:1 on Atlantic */
  --text-secondary: #4F5B5E;   /* Driftwood — 7.0:1 on White, 5.0:1 on Sage */
  --text-accent: #141B2B;      /* Midnight ink on light (never Sunlit gold or Gold line for text on light) */
  --text-link: #2D5B70;        /* Harbor — 7.4:1 on White */
  --brand-gold: #B0904A;       /* Gold line — hairlines, dividers, small icons on light ONLY (never text) */

  /* Controls & Interactive */
  --cta-bg: #141B2B;           /* Midnight ink */
  --cta-text: #FFFFFF;
  --btn-secondary-bg: #2D5B70; /* Harbor — 7.4:1 with White text */
  --btn-secondary-text: #FFFFFF;
  --border-subtle: #D4DCD9;    /* Sage dividers & card frames */
  --border-control: #6E7A7D;   /* >= 4.2:1 on White & Sand (WCAG 1.4.11) */
  --focus-ring: #2D5B70;       /* Harbor — 7.4:1 on White */

  /* Semantic Status */
  --status-ok: #1E6B45;
  --status-warn: #8A5600;
  --status-danger: #A92832;

  /* Map Basemap & Parcel Overlay */
  --map-water: #D4DCD9;        /* Sage coastal wash */
  --map-land: #F4F0E6;         /* Sand */
  --map-parcel: #B0904A;       /* Gold line */

  /* Typography & Geometry */
  --font-display: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", "Jost", system-ui, -apple-system, sans-serif;
  --radius-control: 2px;
  --radius-media: 0px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces ("Midnight") */
  --bg-canvas: #141B2B;        /* Midnight ink */
  --bg-subtle: #1B2438;
  --bg-elevated: #202B42;
  --bg-wash: #293852;
  --bg-atlantic: #2D5B70;      /* Harbor */
  --bg-inverse: #F4F0E6;       /* Sand */

  /* Text */
  --text-primary: #FFFFFF;     /* White on Midnight: 17.5:1 */
  --text-secondary: #D4DCD9;   /* Sage on Midnight: 12.3:1 */
  --text-accent: #DCC07A;      /* Sunlit gold — on Midnight ONLY (9.7:1 contrast) */
  --text-link: #7FA3B2;        /* Atlantic on Midnight: 6.4:1 */
  --brand-gold: #DCC07A;       /* Sunlit gold on Midnight */

  /* Controls & Interactive */
  --cta-bg: #DCC07A;           /* Sunlit gold CTA on Midnight */
  --cta-text: #141B2B;         /* Midnight ink text on Sunlit gold: 9.7:1 */
  --btn-secondary-bg: #2D5B70; /* Harbor */
  --btn-secondary-text: #FFFFFF;
  --border-subtle: #2B3954;
  --border-control: #7FA3B2;   /* Atlantic — >= 5.2:1 on elevated (WCAG 1.4.11) */
  --focus-ring: #DCC07A;       /* Sunlit gold — 9.7:1 on Midnight */

  /* Semantic Status */
  --status-ok: #7AD19D;
  --status-warn: #DCC07A;
  --status-danger: #F28B92;

  /* Map Basemap & Parcel Overlay */
  --map-water: #0E1420;
  --map-land: #1B2438;
  --map-parcel: #DCC07A;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
}

a {
  color: var(--text-link);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.shh-tabular {
  font-variant-numeric: tabular-nums;
}

.shh-skip-link {
  position: absolute;
  left: -9999px;
}

.shh-skip-link:focus {
  position: static;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--cta-bg);
  color: var(--cta-text);
}

.shh-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: 64px;
  padding: 0.45rem 1.5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.shh-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
}

.shh-header nav a,
.shh-header nav button {
  white-space: nowrap;
  flex-shrink: 0;
}

.shh-brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shh-brand-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.shh-brand-logo {
  height: 24px;
  width: auto;
  max-width: 100%;
}

.shh-doc-brand-logo {
  height: 20px;
  width: auto;
  margin-bottom: 0.45rem;
}

.shh-logo-light {
  display: block;
}

.shh-logo-dark {
  display: none;
}

html[data-theme="dark"] .shh-logo-light {
  display: none;
}

html[data-theme="dark"] .shh-logo-dark {
  display: block;
}

@media print {
  html[data-theme="dark"] .shh-logo-light {
    display: block;
  }

  html[data-theme="dark"] .shh-logo-dark {
    display: none;
  }
}

.shh-booklet-brand-mark {
  display: block;
  height: 58px;
  width: auto;
  margin-bottom: 0.5rem;
  border-radius: 2px;
}

.shh-brand-mark {
  display: inline-block;
  vertical-align: baseline;
  margin-left: 4px;
}

.shh-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.shh-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-accent);
}

.shh-display {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
}

.shh-lead {
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.shh-btn-outline {
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
