/* ==========================================================================
   H20 Property Services — base layer
   --------------------------------------------------------------------------
   Reset, document defaults, typographic elements, and the handful of layout
   primitives every page in the app is built from. No component lives here.

   The layout primitives are deliberately few and composable: `.container` for
   width, `.section` for vertical rhythm, `.stack` / `.cluster` / `.grid` /
   `.split` for arrangement. Pages compose those instead of inventing padding.
   ========================================================================== */

/* ------------------------------------------------------------------- reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored headings must not land under the sticky header. */
  scroll-padding-top: calc(var(--header-h) + var(--sp-6));
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  /* A guard rail, not a fix: no element should be able to widen the document
     and shift every section to the left. `clip` rather than `hidden` because
     `hidden` would create a scroll container and break `position: sticky` on
     the header and the listing enquiry card. */
  overflow-x: clip;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* ----------------------------------------------------------------- headings */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-wrap: balance;
}

/* Display headings are light, not bold. A 3rem headline carries all the
   emphasis it needs from size alone, and lightening it keeps a page of them
   from feeling like it is shouting at an older reader. */
h1 {
  font-size: var(--step-5);
  font-weight: var(--weight-light);
}

h2 {
  font-size: var(--step-4);
  font-weight: var(--weight-light);
}

h3 {
  font-size: var(--step-2);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--step-1);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
}

h5,
h6 {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

/* A display heading that is allowed to run to two lines on a phone without
   dropping below a comfortable reading size. */
.display {
  font-size: var(--step-6);
  font-weight: var(--weight-light);
}

.lede {
  font-size: var(--step-1);
  line-height: var(--leading-relaxed);
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Upper-case, letter-spaced, and nothing else. An eyebrow is a label, so it
   gets no rule, no icon and no underline — the accent colour is enough. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-sans);
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow--plain::before {
  display: none;
}

small,
.text-sm {
  font-size: var(--step--1);
}

.text-xs {
  font-size: var(--step--2);
}

.text-muted {
  color: var(--ink-3);
}

.text-brand {
  color: var(--brand);
}

.text-accent {
  color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

/* Numbers that sit in columns (prices, counts) must not jitter. */
.tnum {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------- links */

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: var(--transition-colors);
}

a:hover {
  color: var(--brand-hover);
}

/* Body-copy links carry an underline; navigation and cards do not. */
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--brand-line);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.link-plain {
  color: inherit;
  text-decoration: none;
}

.link-plain:hover {
  color: var(--brand);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: var(--weight-semibold);
  color: var(--brand);
  text-decoration: none;
}

.link-arrow svg {
  width: 1em;
  height: 1em;
  flex: none;
  transition: transform var(--dur-2) var(--ease);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------- prose body */

.prose {
  max-width: var(--prose-max);
  line-height: var(--leading-relaxed);
  color: var(--ink-2);
}

.prose > * + * {
  margin-top: var(--sp-5);
}

.prose h2 {
  margin-top: var(--sp-10);
  color: var(--ink);
}

.prose h3 {
  margin-top: var(--sp-8);
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: var(--sp-2);
}

.prose strong {
  color: var(--ink);
  font-weight: var(--weight-semibold);
}

.prose blockquote {
  padding-left: var(--sp-5);
  border-left: 2px solid var(--brand);
  font-size: var(--step-1);
  color: var(--ink);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ layout */

.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--wide-max);
}

.container--narrow {
  max-width: var(--narrow-max);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section--flush-top {
  padding-top: 0;
}

/* Vertical rhythm. `.stack > * + *` is the only margin rule that should ever
   be needed inside a content block. */
.stack > * + * {
  margin-top: var(--sp-4);
}

.stack-sm > * + * {
  margin-top: var(--sp-2);
}

.stack-lg > * + * {
  margin-top: var(--sp-8);
}

/* A row that wraps. Used for button groups, meta lines, tag lists. */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.cluster--tight {
  gap: var(--sp-2);
}

.cluster--between {
  justify-content: space-between;
}

.cluster--end {
  justify-content: flex-end;
}

/* Two columns that collapse to one. The default split is text-then-aside. */
.split {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .split--wide-start {
    grid-template-columns: 1.3fr 0.7fr;
  }

  .split--wide-end {
    grid-template-columns: 0.7fr 1.3fr;
  }
}

/* Auto-fitting card grids. `--col-min` is the only knob a page sets. */
.grid {
  display: grid;
  /* Roomier than the first pass. At 16px the cards sat shoulder to shoulder
     and every grid read as one crowded block. */
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.grid--tight {
  gap: var(--sp-4);
}

/* --------------------------------------------------------------- utilities */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  font-weight: var(--weight-semibold);
  color: var(--on-brand);
  background: var(--brand);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-md);
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--on-brand);
}

.center {
  text-align: center;
}

.center-x {
  margin-inline: auto;
}

.balance {
  text-wrap: balance;
}

.pretty {
  text-wrap: pretty;
}

.nowrap {
  white-space: nowrap;
}

.full-bleed {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

/* A section divider. One hairline, full width — not a fade. */
.rule {
  height: 1px;
  border: 0;
  background: var(--line);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.surface--pad {
  padding: clamp(1.25rem, 3vw, 2rem);
}

/* ------------------------------------------------------------------- focus */

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Inputs draw their own ring in components.css, so suppress the duplicate. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

::selection {
  background: var(--brand-soft-2);
  color: var(--ink);
}

.on-deep ::selection {
  background: var(--brand);
  color: var(--on-brand);
}

/* --------------------------------------------------------------- scrollbar */

@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  ::-webkit-scrollbar-track {
    background: var(--bg-sunk);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--mist-300);
    border: 3px solid var(--bg-sunk);
    border-radius: var(--r-pill);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--mist-400);
  }
}

/* ------------------------------------------------------- scroll reveal
   Applied by js/site.js. The `no-js` class on <html> is removed by an inline
   script in the head, so a browser with JavaScript off never hides content. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-4) var(--ease), transform var(--dur-4) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------- print */

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    color: #444;
  }
}