/* =====================================================================
   Homes by Villatel — Legal / Info page body styles
   Shared layout for FAQ, Privacy Policy, Terms of Service, and the
   Accessibility Statement. PAGE-BODY ONLY — all chrome (nav, footer,
   modal, search, cookie banner) is owned by the hbv/ kit.
   Design tokens come from hbv-chrome.css (:root). Mobile-first.
   ===================================================================== */

/* ---- Base ---------------------------------------------------------- */
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--soft-ivory);
  -webkit-font-smoothing: antialiased;
}

/* Base resets — the kit's chrome (nav links, hamburger button, dropdown
   triggers) inherits font/color and expects no default button chrome or
   link underline; each page must supply these. Mirrors hbv.css so the
   header/footer render identically to the rest of the site. */
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, select { font-family: inherit; }
img { max-width: 100%; }

/* ---- Local design tokens ------------------------------------------
   Declared locally (matching contact / our-story) so spacing + palette
   never depend on the kit :root resolving on the deployed platform. This
   keeps the hero gutter equal to the kit nav's gutter — without it the
   deployed hero collapsed toward the viewport edge (further left than the
   logo). Font tokens are intentionally NOT redeclared (single source of
   truth is hbv-chrome.css, per project rules). */
:root {
  color-scheme: light;
  --deep-teal:   #153442;
  --stone-taupe: #AFA085;
  --soft-ivory:  #FFFFFF;
  --mist-blue:   #98C1D8;
  --seafoam:     #D1DBD6;
  --teal-deep:    #061B29;
  --taupe-deep:   #7c6f5b;
  --ink:          #2A2A28;
  --ink-muted:    #6B6862;
  --hairline:       rgba(42, 42, 40, 0.12);
  --hairline-light: rgba(255, 255, 255, 0.22);
  --gutter:    clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(3rem, 6vw, 5.5rem);
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter, clamp(1.25rem, 4vw, 3rem));
}

/* Custom-element layout neutrality (per kit integration contract) */
hbv-legal-hero { display: block; }
hbv-book-modal { display: contents; }

/* ---- Compact hero header ------------------------------------------- */
.legal-hero {
  position: relative;
  background: var(--deep-teal);
  color: var(--soft-ivory);
  padding-top: clamp(130px, 14vh, 190px);
  padding-bottom: clamp(2.25rem, 5vw, 3.5rem);
  overflow: hidden;
}
/* Quiet architectural accent — a single hairline, no gradients */
.legal-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
/* Self-contained gutter geometry (mirrors the site's .hero__content) so the
   hero copy lines up with the nav logo at every width. Intentionally NOT the
   shared `.wrap` utility: on the deploy platform a global `.wrap` rule flattened
   this padding and shoved the hero to the viewport edge — left of the logo.
   A dedicated class name can't be clobbered that way. */
.legal-hero__inner {
  position: relative;
  z-index: 1;
  max-width: clamp(1440px, 90vw, 1920px);
  margin-inline: auto;
  padding-inline: var(--gutter, clamp(1.25rem, 4vw, 3rem));
}

.legal-hero__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.legal-hero__crumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.legal-hero__crumbs li:not(:last-child)::after {
  content: "/";
  color: rgba(255, 255, 255, 0.35);
  margin-left: 0.5rem;
}
.legal-hero__crumbs a { color: rgba(255, 255, 255, 0.72); transition: color 0.2s; }
.legal-hero__crumbs a:hover { color: #fff; }
.legal-hero__crumbs [aria-current] { color: var(--mist-blue); }

.legal-hero__eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--mist-blue);
  margin: 0 0 0.85rem;
}
.legal-hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--soft-ivory);
  text-wrap: balance;
}
.legal-hero__meta {
  margin: 1.15rem 0 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}
.legal-hero__lede {
  margin: 1.25rem 0 0;
  max-width: 62ch;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
}

/* ---- Main / layout ------------------------------------------------- */
.legal {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}
.legal__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
}

/* ---- Table of contents (sticky sidebar) ---------------------------- */
.legal__toc {
  position: relative;
}
.legal__toc-inner {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  background: var(--soft-ivory);
}
.legal__toc-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--taupe-deep);
  margin: 0 0 0.9rem;
}
.legal__toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.legal__toc li { margin: 0; }
.legal__toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.18s;
}
.legal__toc a:hover { color: var(--deep-teal); }
.legal__toc a.is-active { color: var(--deep-teal); font-weight: 500; }
.legal__toc--numbered a::before {
  counter-increment: toc;
  content: counter(toc);
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--stone-taupe);
  min-width: 1.4em;
}

/* ---- Document / prose ---------------------------------------------- */
.legal__doc { min-width: 0; max-width: 74ch; }
.legal__intro {
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.18rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.legal__section { margin: 0 0 2.75rem; scroll-margin-top: 100px; }
.legal__section:last-child { margin-bottom: 0; }

.legal__section h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--deep-teal);
  margin: 0 0 1rem;
  padding-top: 0.35rem;
  text-wrap: balance;
}
.legal__section h2 .legal__num {
  color: var(--stone-taupe);
  font-size: 0.72em;
  margin-right: 0.6rem;
}
.legal__section h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.3;
  color: var(--deep-teal);
  margin: 1.75rem 0 0.65rem;
}

.legal__doc p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 1.1rem;
}
.legal__doc p:last-child { margin-bottom: 0; }
.legal__doc strong { font-weight: 600; color: var(--deep-teal); }
.legal__doc a { color: var(--deep-teal); border-bottom: 1px solid var(--stone-taupe); transition: border-color 0.18s; }
.legal__doc a:hover { border-bottom-color: var(--deep-teal); }

.legal__doc ul, .legal__doc ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
.legal__doc li { font-size: 1rem; line-height: 1.7; margin-bottom: 0.5rem; }
.legal__doc li::marker { color: var(--stone-taupe); }

/* Definition-style fact lists (LLM-friendly, e.g. contact facts) */
.legal-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0.5rem 0 0;
}
.legal-facts dt {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--taupe-deep);
  padding-top: 0.15rem;
}
.legal-facts dd { margin: 0; font-size: 1rem; line-height: 1.6; }

/* ---- Data table (privacy categories) ------------------------------- */
.legal-table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--hairline); border-radius: 8px; }
.legal-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.legal-table caption {
  text-align: left;
  font-size: 0.82rem;
  color: var(--ink-muted);
  padding: 0.85rem 1rem 0;
  caption-side: top;
}
.legal-table th, .legal-table td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  line-height: 1.55;
}
.legal-table thead th {
  background: var(--seafoam);
  color: var(--deep-teal);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-table tbody th {
  font-weight: 600;
  color: var(--deep-teal);
  white-space: nowrap;
}
.legal-table tbody tr:last-child th,
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table tbody tr:nth-child(even) { background: rgba(209, 219, 214, 0.22); }

/* ---- Callout / note block ------------------------------------------ */
.legal-note {
  display: flex;
  gap: 0.9rem;
  background: var(--ivory-warm);
  border: 1px solid var(--ivory-warmer);
  border-left: 3px solid var(--stone-taupe);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
}
.legal-note p { margin: 0; font-size: 0.95rem; line-height: 1.65; }
.legal-note strong { color: var(--deep-teal); }

/* ---- Contact card -------------------------------------------------- */
.legal-contact {
  background: var(--deep-teal);
  color: var(--soft-ivory);
  border-radius: 10px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  margin-top: 1.25rem;
}
.legal-contact h2, .legal-contact h3 { color: var(--soft-ivory); margin-top: 0; }
.legal-contact p { color: rgba(255, 255, 255, 0.82); }
.legal-contact a { color: var(--mist-blue); border-bottom-color: rgba(152, 193, 216, 0.5); }
.legal-contact a:hover { border-bottom-color: var(--mist-blue); }
.legal-contact .legal-facts dt { color: rgba(255, 255, 255, 0.55); }
.legal-contact .legal-facts dd { color: rgba(255, 255, 255, 0.9); }
.legal-contact address { font-style: normal; line-height: 1.7; color: rgba(255, 255, 255, 0.82); }

/* ---- FAQ accordion (behavior wired by hbv.js) ---------------------- */
.faq-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 2.5rem;
}
.faq-nav a {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--deep-teal);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.faq-nav a:hover { background: var(--deep-teal); color: var(--soft-ivory); border-color: var(--deep-teal); }

.faq-cat { margin: 0 0 2.5rem; scroll-margin-top: 100px; }
.faq-cat__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.7rem);
  color: var(--deep-teal);
  margin: 0 0 0.35rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--hairline);
}

.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item__question {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 1.15rem 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.12rem);
  line-height: 1.4;
  color: var(--deep-teal);
}
.faq-item__question:hover { color: var(--taupe-deep); }
.faq-item__icon {
  flex: 0 0 auto;
  position: relative;
  width: 20px;
  height: 20px;
  margin-top: 0.2rem;
}
.faq-item__icon::before,
.faq-item__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  background: var(--stone-taupe);
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease;
}
.faq-item__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.is-open .faq-item__icon::after { transform: translate(-50%, -50%) rotate(0deg); }

.faq-item__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.faq-item.is-open .faq-item__answer { grid-template-rows: 1fr; }
.faq-item__answer-inner { overflow: hidden; }
.faq-item__answer p {
  margin: 0 0 1.1rem;
  padding-right: clamp(0, 4vw, 2.5rem);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
}

/* ---- Back to top --------------------------------------------------- */
.legal__toplink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.18s;
}
.legal__toplink:hover { color: var(--deep-teal); }

/* ---- Desktop layout ------------------------------------------------ */
@media (min-width: 900px) {
  .legal__layout--toc {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
  }
  .legal__toc-inner {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

/* ---- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .faq-item__answer,
  .faq-item__icon::before,
  .faq-item__icon::after { transition: none; }
}
