/* ==========================================================================
   components.css — ALL reusable visual styling: header/nav, footer, hero base,
   contact form, and the cross-page card primitives. Page-*.css should only do
   layout/placement. Depends on tokens.css + base.css.

   Frozen state classes (JS + CSS + component-reference agree byte-for-byte):
     .has-js .has-hero  (on <html>/<body>)
     .site-header.is-scrolled   .site-header.is-nav-open
     .reveal.is-visible
     .stepper__node.is-active   .stepper__panel.is-active
   Frozen hooks: [data-stepper] [data-step="i"] [data-panel="i"]
   ========================================================================== */

/* =========================================================================
   SITE HEADER + NAV
   Header is position:fixed. Transparent (white text) over a dark hero on pages
   flagged .has-hero; solid white + dark text everywhere else and once scrolled.
   ========================================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: var(--header-h);
  padding-block: var(--space-3);
}

/* Non-hero pages have no full-bleed hero under the fixed header, so offset the
   content by the header height. Hero pages let the hero sit under it. */
body:not(.has-hero) #main { padding-top: var(--header-h); }

/* The header is a solid white bar on every page at every scroll position
   (matches the original site). Hero pages still flag .has-hero — it drives the
   #main offset above and lets the hero's own padding-top clear the fixed bar. */

/* Brand / logo */
.brand {
  display: inline-flex;
  align-items: center;
  margin-right: auto;          /* pushes nav + cta to the right */
  line-height: 0;
}
.brand img,
.brand .custom-logo {
  height: 40px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

/* Primary nav (horizontal) */
.primary-nav { display: flex; align-items: center; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu li { margin: 0; }
.nav-menu a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--ink);
  font-weight: var(--fw-medium);
  position: relative;
  transition: color var(--dur) var(--ease);
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--brand);
  transition: right var(--dur) var(--ease);
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a { color: var(--brand); }
.nav-menu a:hover::after,
.nav-menu .current-menu-item > a::after,
.nav-menu .current_page_item > a::after { right: 0; }

/* Header CTA pill */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7em 1.35em;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-weight: var(--fw-semibold);
  line-height: 1;
  border: 2px solid var(--brand);
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.nav-cta:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
  transform: translateY(-2px);
}

/* Hamburger toggle (hidden until mobile) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease),
              opacity var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.nav-toggle__bar { position: relative; }
.nav-toggle__bar::before { position: absolute; top: -7px; }
.nav-toggle__bar::after  { position: absolute; top:  7px; }

/* Open (X) animation */
.site-header.is-nav-open .nav-toggle__bar { background: transparent; }
.site-header.is-nav-open .nav-toggle__bar::before { top: 0; transform: rotate(45deg); background: var(--ink); }
.site-header.is-nav-open .nav-toggle__bar::after  { top: 0; transform: rotate(-45deg); background: var(--ink); }

/* Mobile layout ----------------------------------------------------------- */
/* The open menu is an absolute full-width dropdown below the bar, so it never
   perturbs the header-bar flex layout. .nav-menu is the <ul id="nav-menu">. */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-cta { display: none; }          /* Contact still reachable via the menu */

  .nav-menu {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;      /* anchored to .site-header (positioned) */
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    box-shadow: var(--shadow);
    border-top: 1px solid var(--line);
    padding: var(--space-2) var(--gutter) var(--space-4);
  }
  .nav-menu a { color: var(--ink); padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .nav-menu li:last-child a { border-bottom: 0; }
  .nav-menu a::after { display: none; }

  /* When open, force the whole top bar solid so the hamburger X stays legible */
  .site-header.is-nav-open { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
  .site-header.is-nav-open .nav-menu { display: flex; }
  .site-header.is-nav-open .nav-toggle__bar::before,
  .site-header.is-nav-open .nav-toggle__bar::after { background: var(--ink); }
}

/* =========================================================================
   HERO (shared base — page-*.css only sets the background image)
   Full-bleed, dark gradient overlay, centered white content, top space so the
   fixed header sits over it. Home adds the overlapping .tiles negative margin
   from page-home.css.
   ========================================================================= */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 78vh, 780px);
  padding-top: calc(var(--header-h) + var(--space-7));
  padding-bottom: var(--space-9);
  background: var(--ink) center / cover no-repeat;
  color: #fff;
  overflow: hidden;
}
.hero--compact { min-height: clamp(380px, 52vh, 520px); }
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
              rgba(4, 19, 42, .55) 0%,
              rgba(4, 19, 42, .70) 55%,
              rgba(4, 19, 42, .82) 100%);
}
.hero__inner { max-width: 760px; }
.hero__inner--center { margin-inline: auto; text-align: center; }
.hero .eyebrow { color: #7CC0FF; }
.hero__title {
  color: #fff;
  font-size: var(--fs-display);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-display);
  margin-bottom: var(--space-4);
}
.hero__lead {
  font-size: var(--fs-lead);
  color: rgba(255,255,255,.86);
  max-width: 56ch;
  margin-bottom: var(--space-6);
}
.hero__inner--center .hero__lead { margin-inline: auto; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero__inner--center .hero__actions { justify-content: center; }

/* =========================================================================
   TILES — home service tiles (overlapping white card, one dark tile)
   ========================================================================= */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  /* Positioned so a negative margin-top (page-home.css) paints the card OVER
     the hero, not under it. z-index stays far below header (200). */
  position: relative;
  z-index: 2;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.tile__icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: var(--space-2);
}
.tile__title { font-size: 1.15rem; font-weight: var(--fw-bold); color: var(--ink); }
.tile__text { color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }

.tile--dark {
  background: var(--tile-dark);
  border-color: var(--tile-dark);
}
.tile--dark .tile__title { color: #fff; }
.tile--dark .tile__text { color: rgba(255,255,255,.72); }

@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

/* =========================================================================
   STEPPER — "Why Choose Us?" connected 3-node control + swapping panels
   ========================================================================= */
.stepper { display: block; }

.stepper__track {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: 760px;
  margin: 0 auto var(--space-8);
}
/* The connecting line behind the nodes */
.stepper__track::before {
  content: "";
  position: absolute;
  top: 15px;                 /* centered on the 30px dots */
  left: 8%; right: 8%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.stepper__node {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-align: center;
  transition: color var(--dur) var(--ease);
}
.stepper__dot {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 2px solid var(--line);
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.stepper__dot::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--line);
  transition: background var(--dur) var(--ease);
}
.stepper__node:hover { color: var(--ink); }
.stepper__node:hover .stepper__dot { border-color: var(--brand); }
.stepper__node.is-active { color: var(--brand); }
.stepper__node.is-active .stepper__dot {
  border-color: var(--brand);
  background: var(--brand);
  transform: scale(1.06);
}
.stepper__node.is-active .stepper__dot::after { background: #fff; }
.stepper__label { display: block; max-width: 14ch; }

/* Panels: only the .is-active one shows (also the no-JS server-rendered state) */
.stepper__panel { display: none; }
.stepper__panel.is-active {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.stepper__media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.stepper__copy { color: var(--text); }
.stepper__copy p { color: var(--muted); font-size: var(--fs-lead); }

@media (max-width: 760px) {
  .stepper__panel.is-active { grid-template-columns: 1fr; }
  .stepper__label { font-size: 0.75rem; }
}

/* =========================================================================
   SVC-CARD — services page: icon + title + copy + "Learn More"
   ========================================================================= */
.svc-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-7) var(--space-6);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.svc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.svc-card__icon {
  width: 64px; height: 64px;
  object-fit: contain;
  margin-bottom: var(--space-2);
}
.svc-card__title { font-size: 1.3rem; font-weight: var(--fw-bold); color: var(--ink); }
.svc-card__text { color: var(--muted); line-height: 1.65; flex: 1; }
.svc-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-3);
  font-weight: var(--fw-semibold);
  color: var(--brand);
}
.svc-card__link::after {
  content: "\2192"; /* → */
  transition: transform var(--dur) var(--ease);
}
.svc-card__link:hover::after { transform: translateX(4px); }

/* =========================================================================
   VALUE-CARD — about page core values: inline-SVG icon + title + desc
   ========================================================================= */
.value-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-6);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.value-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.value-card__icon {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(0, 123, 255, .10);
  color: var(--brand);
}
.value-card__icon svg { width: 28px; height: 28px; display: block; }
.value-card__title { font-size: 1.2rem; font-weight: var(--fw-bold); color: var(--ink); }
.value-card__text { color: var(--muted); line-height: 1.65; }

/* =========================================================================
   TEAM-CARD — about page team: photo + name + role
   ========================================================================= */
.team-card {
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.team-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.team-card__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.team-card__name {
  margin-top: var(--space-4);
  font-size: 1.15rem;
  font-weight: var(--fw-bold);
  color: var(--ink);
}
.team-card__role {
  margin: 4px 0 var(--space-5);
  color: var(--brand);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

/* =========================================================================
   STAT — services credentials: big number + label
   ========================================================================= */
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat__num {
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand);
}
.stat__label { color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
/* Stat sitting on a dark band */
.section--ink .stat {
  background: rgba(255,255,255,.04);
  border-color: var(--on-dark-line);
}
.section--ink .stat__num { color: #7CC0FF; }
.section--ink .stat__label { color: var(--on-dark-muted); }

/* =========================================================================
   CHECKLIST — two-column list with check bullets
   ========================================================================= */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-6);
}
.checklist li {
  position: relative;
  padding-left: 34px;
  line-height: 1.5;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0, 123, 255, .12);
  /* check mark */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007BFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
/* Checklist on a dark band */
.section--ink .checklist li::before {
  background-color: rgba(255,255,255,.10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237CC0FF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
@media (max-width: 640px) { .checklist { grid-template-columns: 1fr; } }

/* =========================================================================
   SVC-LIST — home numbered service rows (01–05)
   ========================================================================= */
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
}
.svc-list__item:last-child { border-bottom: 1px solid var(--line); }
.svc-list__num {
  font-size: 1.4rem;
  font-weight: var(--fw-black);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  min-width: 2.2ch;
}
.svc-list__title { font-size: 1.2rem; font-weight: var(--fw-bold); color: var(--ink); }
.svc-list__text { margin-top: 4px; color: var(--muted); line-height: 1.6; }

/* =========================================================================
   CONTACT FORM — built-in wp_mail fallback (functions.php emits these classes;
   CF7 brings its own markup). Honeypot must be visually hidden, not display:none.
   ========================================================================= */
.contact-form { display: grid; gap: var(--space-4); }
.form-field { display: grid; gap: 6px; }
.form-field label {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-small);
  color: var(--ink);
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.8em 1em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-field textarea { min-height: 150px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, .16);
}
.contact-form .btn { justify-self: start; }

/* Honeypot: off-screen but focusable=false; NOT display:none so bots fill it */
.form-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Success / status notice */
.form-notice {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  background: rgba(0, 123, 255, .08);
  border: 1px solid rgba(0, 123, 255, .28);
  color: var(--ink);
  font-weight: var(--fw-medium);
}

/* =========================================================================
   SITE FOOTER (navy): brand/contact, explore links, newsletter, socials, bar
   ========================================================================= */
.site-footer {
  background: var(--footer-bg);
  color: var(--on-dark-muted);
}
.site-footer a { color: var(--on-dark-muted); }
.site-footer a:hover { color: #fff; }

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: clamp(32px, 5vw, 72px);
  padding-block: var(--space-9) var(--space-7);
}

.footer-brand__logo { height: 40px; width: auto; margin-bottom: var(--space-4); }
.footer-contact { display: grid; gap: 6px; font-size: var(--fs-small); line-height: 1.7; }
.footer-contact a { color: var(--on-dark-muted); }

.footer-col__title {
  color: #fff;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { font-weight: var(--fw-medium); }

/* Newsletter */
.footer-newsletter p { font-size: var(--fs-small); margin-bottom: var(--space-4); }
.newsletter-form {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.75em 1em;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.06);
  color: #fff;
}
.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,.55); }
.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: #7CC0FF;
  box-shadow: 0 0 0 3px rgba(124, 192, 255, .18);
}
.newsletter-form .btn { flex: 0 0 auto; }
.newsletter-note { font-size: var(--fs-small); color: rgba(255,255,255,.5); margin-top: var(--space-3); }

/* Social buttons */
.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.social-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--on-dark-line);
  color: #fff;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.social-btn:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }
.social-btn svg { width: 18px; height: 18px; display: block; }

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid var(--on-dark-line);
}
.footer-bottom__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: var(--space-5);
  font-size: var(--fs-small);
  color: rgba(255,255,255,.55);
  text-align: center;
}

@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .footer-newsletter { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}
