/*
Theme Name: Cross Country Home Inspections
Author: Cross Country Home Inspections
Version: 1.2 (hero-local fluid type)
*/

/* ---------------------------------- */
/* Root Variables (Colors, Fonts, etc.) */
/* ---------------------------------- */

:root {
  /* Brand Colors */
  --red: #c1121f;
  --blue: #003f88;
  --white: #ffffff;
  --gray: #f5f5f5;
  --ink: #1a1a1a;
  --muted: #555;

  /* Typography */
  --font-serif: "Lora", "Georgia", serif;
  --font-sans: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --lh-tight: 1.15;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* Layout */
  --max-width: 1200px;
  --radius: 8px;
  --shadow: 0 4px 14px rgba(0,0,0,.08);
  --transition: all .3s ease;

  /* Spacing */
  --space-xs: .5rem;
  --space-sm: .875rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
}

/* ---------------------------------- */
/* Global Smooth Scroll Behavior       */
/* ---------------------------------- */
.site-footer {
    text-align: center;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* adjust if header overlaps anchors */
}


/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root { --transition: none; }
}

/* ---------------------------------- */
/* Global Reset & Base Styles */
/* ---------------------------------- */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--white);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--white); }

/* ---------------------------------- */
/* Typography (stable, non-fluid globals) */
/* ---------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--blue);
  line-height: var(--lh-tight);
  margin-bottom: .5em;
}

h1 { font-size: 2.5rem; }   /* ~40px */
h2 { font-size: 2rem; }     /* ~32px */
h3 { font-size: 1.5rem; }   /* ~24px */
h4 { font-size: 1.25rem; }  /* ~20px */
h5 { font-size: 1.125rem; } /* ~18px */
h6 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }

p { margin-bottom: 1em; color: var(--muted); font-size: 1rem; }

.lead { font-size: 1.125rem; line-height: var(--lh-relaxed); color: var(--ink); }
.eyebrow { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }

/* ---------------------------------- */
/* Layout Utilities */
/* ---------------------------------- */

.container {
  width: min(90%, var(--max-width));
  margin-inline: auto;
}

.section { padding: var(--space-2xl) 0; }
.section--tight { padding: var(--space-xl) 0; }

.stack > * + * { margin-top: var(--space-md); }

.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(12, 1fr);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 992px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

/* ---------------------------------- */
/* Buttons */
/* ---------------------------------- */

.btn {
  display: inline-block;
  padding: .75em 1.5em;
  border-radius: var(--radius);
  border: none;
  background-color: var(--blue);
  color: var(--white);
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  transition: var(--transition);
  will-change: transform;
}
.btn:hover { transform: scale(1.05); }
.btn--red { background: var(--red); }
.btn--outline {
  background: transparent;
  color: var(--blue);
  box-shadow: inset 0 0 0 2px var(--blue);
}
.btn--block { display: inline-flex; width: 100%; justify-content: center; }




/* ---------------------------------- */
/* Top Header                         */
/* ---------------------------------- */

.top-header{
  background: var(--blue);
  color: var(--white);
}

.top-header__inner{
  max-width: var(--max-width);
  margin-inline: auto;
  padding: .5rem 1rem;               /* base spacing */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Message text: fluid, readable */
.top-header__msg{
  font-family: var(--font-sans);
  font-size: clamp(.9rem, .82rem + .5vw, 1.05rem);
  line-height: 1.35;
  letter-spacing: .2px;
  text-wrap: balance;
}

/* Phone link */
.top-header__phone{
  color: currentColor;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.top-header__phone:hover,
.top-header__phone:focus-visible{
  border-bottom-color: currentColor;
}

/* Small screens: tighter padding, show short tagline */
.show-sm{ display: none; }
.hide-sm{ display: inline; }

@media (max-width: 640px){
  .top-header__inner{ padding: .45rem .9rem; }
  .top-header__msg{ font-size: clamp(.9rem, .85rem + .8vw, 1rem); }
  .hide-sm{ display: none; }
  .show-sm{ display: inline; }
}

/* Very small screens: prevent overflow */
@media (max-width: 380px){
  .top-header__inner{ padding: .4rem .75rem; }
  .top-header__msg{ line-height: 1.3; }
}

/* Larger screens: add a touch more breathing room */
@media (min-width: 1024px){
  .top-header__inner{ padding: .6rem 1.25rem; }
}



/* ---------------------------------- */
/* Header: Logo left, Group right     */
/* ---------------------------------- */

.site-header-wrap { position: sticky; top: 0; z-index: 100; }
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .25rem 0;
  position: relative;
}

/* Logo left */
.site-logo img {
  height: auto;
  width: 128px;
  display: block;
}

/* Right group sits on the right on ALL viewports */
.header-right {
  margin-left: auto;                 /* pushes group to the right */
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;                /* for the mobile drawer positioning */
}

/* Phone icon button — minimalist black stroke */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
}

.btn--call {
  background: transparent;     /* no background */
  color: #000000;              /* sets stroke color for SVG */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: none;            /* remove any shadow */
  padding: 0;
}

.btn--call svg {
  width: 22px;
  height: 22px;
  stroke: #000000;             /* black outline */
  stroke-width: 2;
  fill: none;
}

.btn--call:hover svg {
  opacity: 0.7;                /* optional slight dim on hover */
}

.btn--call:hover {
  transform: translateY(-1px);
}


/* Burger control */
.nav-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle {
  display: none; /* hidden on desktop */
  background: transparent;
  border: 0;
  padding: .5rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.nav-toggle .bar {
  display: block;
  width: 26px; height: 2px;
  background: var(--ink);
  margin: 6px 0;
  transition: var(--transition);
}

/* Nav links */
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin: 0;
  padding: 0;
}
.site-nav a {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: 12px;
  transition: var(--transition);
  font-size: 22px;
}
.site-nav a:hover { color: var(--ink); }

/* Active page highlight */
.site-nav a[aria-current="page"], .site-nav a.is-active {
  background: var(--blue);
  color: var(--white);
}

/* Desktop: show nav inline; add vertical dividers */
@media (min-width: 901px) {
  .site-nav { order: 1; }  /* Nav first in the right group */
  .btn--call { display: none; } /* Phone after nav */
  .nav-toggle { display: none; }

  .site-nav ul li + li { position: relative; }
  .site-nav ul li + li::before {
    content: "";
    position: absolute;
    left: -0.625rem;
    top: 50%;
    transform: translateY(-50%);
    height: 18px; width: 1px;
    background: #e5e7eb;
  }
}

/* Mobile: keep group on the right (phone + burger), nav is a drawer */
@media (max-width: 900px) {
  .btn--call { order: 1; }
  .nav-toggle { display: inline-block; order: 2; }
  .site-nav    { order: 3; }

  /* Drawer styles */
  .site-nav {
    position: absolute;
    top: 100%; right: 0; left: 0;   /* full-width sheet from under header */
    background: var(--white);
    box-shadow: var(--shadow);
    transform-origin: top center;
    transform: scaleY(0);
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
  }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem;
  }
  .site-nav li a {
    display: block;
    padding: .9rem 1rem;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    color: var(--ink);
  }
  .site-nav li:last-child a { border-bottom: 0; }

  /* Open drawer */
  .nav-checkbox:checked ~ .site-nav { transform: scaleY(1); opacity: 1; }

  /* Animate burger into X */
  .nav-checkbox:checked ~ .nav-toggle .bar:nth-child(2) { opacity: 0; }
  .nav-checkbox:checked ~ .nav-toggle .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-checkbox:checked ~ .nav-toggle .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* A11y helper */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}



/* ---------------------------------- */
/* Hero Section (all fluid & responsive type lives here) */
/* ---------------------------------- */

.hero {
  color: var(--white);
  text-align: left;
  padding: 3.5rem 1rem;
  background-position: 75% 25%;
  background-size: cover;

  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Hero text */
.hero .eyebrow {
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  /* local fluid scale (eyebrow) */
  font-size: clamp(.78rem, .72rem + .25vw, .9rem);
  color: #e7edf8;
  margin-bottom: .75rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  letter-spacing: .5px;
  /* local fluid scale (hero headline) */
  font-size: clamp(3.35rem, 1.2rem + 4.2vw, 4.5rem);
  line-height: 1.05;
  color: #ffffff;
  max-width: 22ch;
  margin-bottom: 1rem;
}

.hero p {
  /* local fluid scale (hero subcopy) */
  font-size: clamp(1rem, .9rem + .9vw, 1.375rem);
  line-height: var(--lh-relaxed);
  max-width: 62ch;
  color: #fffffff6;
  margin-bottom: var(--space-lg);
}

/* Hero CTA group spacing */
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Hero height & padding adjustments (local only) */
@media (max-width: 1200px) {
  .hero { min-height: 75vh; }
}
@media (max-width: 992px) {
  .hero { min-height: 75vh; padding: 1.25rem 2rem; }
}
@media (max-width: 768px) {
  .hero { min-height: 75vh; padding: 1.25rem .775rem; }
  .hero h1 { max-width: 20ch; }
}

/* Optional hero overlay helper */
.hero--overlay { position: relative; isolation: isolate; }
.hero--overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(450deg, rgba(0, 0, 0, 0.932), rgba(0,0,0,.315));
  z-index: 0;
}
.hero--overlay > * { position: relative; z-index: 1; }

/* ---------------------------------- */
/* Hero CTA Buttons (local-only) */
/* ---------------------------------- */

.hero .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform .25s ease,
    background-color .25s ease,
    box-shadow .25s ease;

  /* Default hero button size (desktop baseline) */
  padding: 0.775rem 1.75rem;
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1.10rem);
  line-height: 1.1;
}

/* Hover lift */
.hero .btn:hover {
  transform: translateY(-2px) scale(0.98);
}

/* Press-down interaction (active state) */
.hero .btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25) inset;
}



/* Responsive scaling for hero buttons */
@media (max-width: 992px) {
  .hero .btn {
    padding: .775rem 2rem;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .hero .btn {
    padding: .795rem 2.25rem;
    font-size: 0.95rem;
  }
}

/* ---------------------------------- */
/* Hero Intro: Gradient Sweep (L → R) */
/* ---------------------------------- */

/* 1) Final dark overlay (fades in quickly) */
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
.hero--overlay::before {
  /* your existing gradient is fine; this just fades it in */
  animation: overlayFadeIn .35s ease-out forwards;
}

/* 2) Sweeping gradient pass that moves across and disappears */
@keyframes overlaySweep {
  0%   { transform: translateX(-100%); opacity: 1; }
  100% { transform: translateX(0%);    opacity: 0; }
}
.hero--overlay { position: relative; isolation: isolate; }
.hero--overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1; /* above bg, below text */
  /* Soft moving veil: darker lead → lighter tail → vanish */
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.6) 35%,
    rgba(0,0,0,.35) 60%,
    rgba(0,0,0,0) 85%
  );
  transform: translateX(-100%);
  animation: overlaySweep .5s cubic-bezier(.2,.7,.2,1) .05s forwards;
}

/* 3) Text wipe-in (L → R) with soft motion */
@keyframes textWipe {
  0% {
    opacity: 0;
    transform: translateX(-8px);
    clip-path: inset(0 100% 0 0); /* hidden from right */
  }
  100% {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0); /* fully revealed */
  }
}



/* Base for all hero children */
.hero > * {
  position: relative;
  z-index: 2;            /* above overlay sweep */
  opacity: 0;
  animation: textWipe .55s ease-out forwards;
  animation-delay: .55s; /* starts after the overlay begins */
}

/* Stagger for sequence (eyebrow → h1 → p → actions) */
.hero .eyebrow { animation-delay: .55s; }
.hero h1       { animation-delay: .65s; }
.hero p        { animation-delay: .75s; }
.hero .actions { animation-delay: .85s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero--overlay::before,
  .hero--overlay::after,
  .hero > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}


/* ---------------------------------- */
/* Cards (e.g., services/features) */
/* ---------------------------------- */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-lg);
  transition: var(--transition);
}
.card:hover { transform: translateY(-2px); }

/* ---------------------------------- */
/* Footer */
/* ---------------------------------- */

.site-footer {
  padding: var(--space-xl) 0;
  background: var(--gray);
  color: var(--muted);
  font-size: .9rem;
}

/* ---------------------------------- */
/* Utilities */
/* ---------------------------------- */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.max-w-prose { max-width: 65ch; }
.hide-on-mobile { display: block; }
.show-on-mobile { display: none; }
@media (max-width: 768px) {
  .hide-on-mobile { display: none; }
  .show-on-mobile { display: block; }
}

/* Quick spacing helpers */
.mt-0{margin-top:0}.mt-xs{margin-top:var(--space-xs)}.mt-sm{margin-top:var(--space-sm)}
.mt-md{margin-top:var(--space-md)}.mt-lg{margin-top:var(--space-lg)}.mt-xl{margin-top:var(--space-xl)}
.mb-0{margin-bottom:0}.mb-xs{margin-bottom:var(--space-xs)}.mb-sm{margin-bottom:var(--space-sm)}
.mb-md{margin-bottom:var(--space-md)}.mb-lg{margin-bottom:var(--space-lg)}.mb-xl{margin-bottom:var(--space-xl)}

/* ======================================
   UI System — Reusable Sections / Cards
   (self-contained; no collisions)
   ====================================== */

/* ---------- Section Base + Variants ---------- */

.ui-section {
  /* local theming */
  --accent: var(--blue);
  --surface: #ffffff;

  position: relative;
  isolation: isolate;
  padding: clamp(3rem, 4vw + 2rem, 5rem) 1.45rem;
  background: var(--surface);
  content-visibility: auto;
  contain-intrinsic-size: 640px;
}

.ui-section--solid {
  background: var(--gray);
}

.ui-section--split {
  background: linear-gradient(115deg, var(--gray) 0%, #ffffff 65%) fixed;
}

.ui-section--contrast {
  background: linear-gradient(115deg, #ffffff 0%, var(--gray) 65%) fixed;
}

/* optional subtle texture overlay */
.ui-section--texture::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      415deg,
      rgba(0,0,0,0.041) 0 1px,
      transparent 1px 32px
    );
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}

/* density controls */
.ui-pad--tight { padding-block: clamp(2rem, 3vw + 1rem, 3rem); }
.ui-pad--roomy { padding-block: clamp(4rem, 5vw + 2rem, 6rem); }
.ui-pad--xl    { padding-block: clamp(5rem, 6vw + 2.5rem, 8rem); }

/* per-section color themes (override --accent / --surface) */
.ui-section[data-theme="blue"]  { --accent: var(--blue);  }
.ui-section[data-theme="red"]   { --accent: var(--red);   }
.ui-section[data-theme="ink"]   { --accent: var(--ink);   }

/* container */
.ui-container {
  width: min(92%, var(--max-width));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ---------- Intro / Headings ---------- */

.ui-intro {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.ui-intro--left   { text-align: left; }
.ui-intro--compact .ui-lead { max-width: 60ch; }

.ui-eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--accent);
  font-size: clamp(.78rem, .6rem + .6vw, .95rem);
  margin-bottom: .5rem;
}

.ui-title {
  font-family: var(--font-serif);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.08;
  font-size: clamp(1.9rem, 1.2rem + 2.2vw, 2.6rem);
  margin-bottom: .75rem;
}

.ui-title--rule {
  position: relative;
  padding-bottom: .5rem;
}
.ui-title--rule::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  background: var(--accent);
  margin: .6rem auto 0;
}

.ui-lead {
  max-width: 72ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, .9rem + .4vw, 1.125rem);
}

/* ---------- Grid System ---------- */

.ui-grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.ui-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ui-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ui-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

@media (max-width: 992px) {
  .ui-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ui-grid--3, .ui-grid--2 { grid-template-columns: 1fr; }
}

/* ---------- Card System + Variants (fixed: no empty rules) ---------- */

.ui-card {
  background: #fff;                          /* plain by default */
  border: 1px solid rgba(0,0,0,.08);         /* soft neutral border */
  border-radius: calc(var(--radius) + 2px);
  overflow: clip;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

/* elevation levels (stackable) */
.ui-card--elev1 { box-shadow: var(--shadow); }
.ui-card--elev2 { box-shadow: 0 10px 26px rgba(0,0,0,.12); }
.ui-card--elev3 { box-shadow: 0 18px 42px rgba(0,0,0,.18); }

/* hover behaviors (stackable) */
.ui-card--hover-lift:hover { transform: translateY(-4px); }
.ui-card--hover-zoom:hover .ui-card__media img { transform: scale(1.04); }

/* bordered vs ghost */
.ui-card--bordered {
  /* gradient border via dual backgrounds */
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg,
      color-mix(in oklab, var(--accent) 18%, transparent),
      color-mix(in oklab, var(--red) 18%, transparent)
    ) border-box;
  border: 1px solid transparent; /* let the gradient show through */
}

.ui-card--ghost {
  background: transparent;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: none;
}

/* card parts */
.ui-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.ui-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}

.ui-card__body {
  padding: clamp(1rem, 1rem + .8vw, 1.25rem);
}
.ui-card__title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  color: var(--ink);
  margin-bottom: .35rem;
  line-height: 1.15;
}
.ui-card__text {
  color: var(--muted);
  font-size: clamp(.95rem, .9rem + .2vw, 1rem);
}

/* size densities */
.ui-card--sm .ui-card__body { padding: .9rem; }
.ui-card--lg .ui-card__body { padding: 1.35rem; }


/* ---------- Chips / Badges ---------- */

.ui-chip {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: .375rem .6rem;
  margin-bottom: .6rem;
}
.ui-chip--accent {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, transparent);
}
.ui-chip--muted {
  color: var(--muted);
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.08);
}

/* ---------- CTA ---------- */

.ui-cta-row {
  text-align: center;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.ui-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .875rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: .4px;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
  will-change: transform;
}

.ui-cta--primary {
  background: var(--accent);
  color: var(--white);
}
.ui-cta--secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.ui-cta--arrow::after {
  content: "→";
  transform: translateX(0);
  transition: transform .25s ease;
}
.ui-cta--arrow:hover::after { transform: translateX(3px); }
.ui-cta:hover { transform: translateY(-1px); }

/* ---------- Reveal Utilities ---------- */

@keyframes ui-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal-up { opacity: 0; animation: ui-fade-up .6s ease forwards; }

.reveal-stagger > * { opacity: 0; animation: ui-fade-up .6s ease forwards; }
.reveal-stagger > *:nth-child(1) { animation-delay: .05s; }
.reveal-stagger > *:nth-child(2) { animation-delay: .12s; }
.reveal-stagger > *:nth-child(3) { animation-delay: .19s; }
.reveal-stagger > *:nth-child(4) { animation-delay: .26s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .reveal-stagger > * { animation: none !important; opacity: 1 !important; transform: none !important; }
  .ui-card,
  .ui-card__media img,
  .ui-cta { transition: none !important; transform: none !important; }
}

/* ---------- Aspect helpers (optional) ---------- */
.ui-aspect-4x3 { aspect-ratio: 4 / 3; }
.ui-aspect-16x9 { aspect-ratio: 16 / 9; }
.ui-aspect-1x1 { aspect-ratio: 1 / 1; }


/* ---------------------------------- */
/* Scoped Background Image with Dark Overlay for Specific Section */
/* ---------------------------------- */

.ui-section.ui-section--contrast {
  position: relative; /* Ensure the overlay can be positioned over this specific section */
  background-image: url('assets/home-kitchen-island.jpg'); /* Placeholder image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll; 
  padding: 50px 0; /* Adjust top/bottom padding as needed */
}

.ui-section.ui-section--contrast::before {
  content: ""; /* Empty content for the overlay */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.822); /* Dark overlay with no gradient */
  z-index: 1; /* Ensure the overlay sits on top of the image */
}

.ui-section.ui-section--contrast .ui-container {
  position: relative;
  z-index: 2; /* Ensure the text and cards stay on top of the overlay */
}

.ui-section.ui-section--contrast .ui-intro {
  color: #fff !important; /* Force the text color to white */
}

.ui-section.ui-section--contrast .ui-title,
.ui-section.ui-section--contrast .ui-lead {
  color: #fff !important; /* Ensure both title and lead text are white */
}



/* ---------------------------------- */
/* Horizontal 5-box Grid Layout */
/* ---------------------------------- */

.ui-grid--icon-row {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(5, 1fr); /* 5 items per row on desktop */
  text-align: center;
}

.ui-icon-card {
  display: flex;
  flex-direction: column; /* Stack icon, title, and bio vertically */
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm);
  background-color: var(--white);
  border: 1px solid var(--gray);
  border-radius: 8px;
  text-align: center;
  z-index: 2; /* Ensure cards stay on top of the overlay */
}

.ui-icon-card__icon {
  margin-bottom: var(--space-sm);
}

.ui-icon-card__icon img {
  max-width: 64px; /* Icon size */
  height: auto;
}

.ui-icon-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ui-icon-card__bio {
  color: var(--muted);
  font-size: 1rem;
  line-height: var(--lh-normal);
  margin: 0;
  padding-top: .5rem;
}

/* Mobile: Keep the layout in a single column without stacking */
@media (max-width: 768px) {
  .ui-grid--icon-row {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--space-md); /* Increase gap between cards */
  }

  .ui-icon-card {
    width: 100%; /* Full width on mobile */
    margin-bottom: var(--space-lg);
  }
}

/* =======================================================
   Scoped Styles — Schedule Appointment Section
   Integrates seamlessly with existing .ui-section system
   ======================================================= */

.schedule-appointment-section {
  --accent: var(--blue);
  --surface: var(--white);
  background: var(--surface);
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 4vw + 2rem, 5rem);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  content-visibility: auto;
  contain-intrinsic-size: 640px;
}

.schedule-appointment-container {
  width: min(92%, var(--max-width));
  margin-inline: auto;
  position: relative;
  z-index: 2;
  text-align: center;
}

/* ---------- Intro / Headings ---------- */
.schedule-appointment-intro {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.schedule-appointment-eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
  font-size: clamp(0.78rem, 0.6rem + 0.6vw, 0.95rem);
  margin-bottom: 0.5rem;
}

.schedule-appointment-title {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  font-size: clamp(2rem, 1.25rem + 3vw, 2.8rem);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.schedule-appointment-title--rule {
  position: relative;
  padding-bottom: 0.5rem;
}
.schedule-appointment-title--rule::after {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  background: var(--accent);
  margin: 0.6rem auto 0;
}

.schedule-appointment-lead {
  max-width: 68ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  line-height: var(--lh-normal);
}

/* ---------- CTA Button (reuses system styles) ---------- */
.schedule-appointment-cta {
  margin-top: clamp(2rem, 4vw, 3rem);
}
.schedule-appointment-cta .ui-cta {
  --accent: var(--blue);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
  .schedule-appointment-title {
    font-size: clamp(1.5rem, 1rem + 2vw, 2rem);
  }
  .schedule-appointment-lead {
    font-size: 1rem;
  }
}
