/*
  File: css/services-hub.css
  Purpose: Page styles for the /services hub (Views/public/services.php) — the
           services photo hero (swaps the .wrapper2 band photo via
           [data-page="services"]), the centred Residential intro, the 2×2
           service cards (photo, teal icon badge, copy, arrow link), the dark
           whole-home band with a CSS blueprint grid + house-outline watermark,
           and the commercial / smaller-projects feature rows (photo on a
           hatched teal plate, copy beside it). Motion = the shared
           [data-reveal] scroll reveal (states in css/site-shell.css, driven by
           js/site-reveal.js). Loaded through layouts/public's
           renderSection('head') after bootstrap-4.4.1.css, main.css and
           site-shell.css, so every rule restates font/size/spacing and every
           class is prefixed hub- (the landing pages use service- in
           css/services.css). Design tokens (--band, --teal, --line, --display,
           --serif …) come from css/site-shell.css; the tall hero band itself is
           .banner3[data-hero="tall"] in css/main.css.
           Photos are existing site assets: images/home/hero-after.jpg (hero),
           images/porto1/… and uploads/projects/1/… (cards and rows).
  Used by: Views/public/services.php (via <?= $this->section('head') ?>)
*/

/* ── hero photo (the layout's .wrapper2 band, this page only) ── */
.wrapper2[data-page="services"] {
  background-image: url(../images/home/hero-after.jpg);
  background-attachment: scroll;   /* fixed would frame only the sky in a 430px band */
  background-position: center 58%;
}

/* ── page frame ───────────────────────────────────────── */
.hub-page {
  overflow-x: clip;            /* the reveal translate must not widen the page */
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.hub-page p {
  text-indent: 0;
  margin: 0 0 1.1rem;
}

.hub-page h2 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 1.1rem;
}

.hub-page h3 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 .8rem;
}

.hub-rule {
  width: 72px;
  height: 3px;
  border: 0;
  background: var(--teal);
  margin: 0 0 1.3rem;
}

.hub-eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin: 0 0 .9rem;
}

.hub-wrap {
  width: min(1180px, 92vw);
  margin-inline: auto;
}

/* arrow link used on every block */
.hub-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--teal-deep);
  padding: .7rem 0;
  border-bottom: 1.5px solid rgba(42, 139, 130, .35);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}

.hub-link svg {
  width: 14px;
  height: 14px;
  transition: transform .25s var(--ease);
}

.hub-link:hover,
.hub-link:focus {
  color: var(--teal-deep);
  border-bottom-color: var(--teal-deep);
  text-decoration: none;
}

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

/* ── intro column ─────────────────────────────────────── */
.hub-intro {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) 1.25rem 0;
  text-align: center;
}

.hub-intro .hub-rule {
  margin-inline: auto;
}

/* ── service cards ────────────────────────────────────── */
.hub-grid {
  width: min(1180px, 92vw);
  margin-inline: auto;
  padding-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.75rem, 4vw, 3rem);
}

.hub-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}

.hub-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 34px 60px -30px rgba(15, 26, 25, .45);
}

.hub-card-media {
  position: relative;
  margin: 0;
}

/* the photo clips its own hover zoom; the figure stays open so the badge can hang below it */
.hub-card-photo {
  overflow: hidden;
}

.hub-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.hub-card:hover .hub-card-media img {
  transform: scale(1.04);
}

/* teal icon badge riding the photo's bottom-left corner */
.hub-card-badge {
  position: absolute;
  z-index: 2;
  left: 1.4rem;
  bottom: -1.4rem;
  width: 3.6rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: var(--band);
  box-shadow: 0 10px 24px -10px rgba(15, 26, 25, .6), 0 0 0 5px var(--paper);
}

.hub-card-badge svg {
  width: 1.6rem;
  height: 1.6rem;
}

.hub-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 2.4rem 1.75rem 1.75rem;
}

.hub-card-body p {
  flex: 1;
  font-size: 1rem;
  line-height: 1.7;
}

.hub-card-body .hub-link {
  align-self: flex-start;
}

/* ── whole-home band (dark, CSS blueprint grid + house watermark) ── */
.hub-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(4rem, 8vw, 6.5rem);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  background-color: var(--band);
  background-image:
    radial-gradient(60% 80% at 85% 20%, rgba(87, 193, 182, .18), transparent 70%),
    linear-gradient(rgba(87, 193, 182, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 193, 182, .1) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-position: 0 0, -1px -1px, -1px -1px;
  color: rgba(255, 255, 255, .85);
}

.hub-band-mark {
  position: absolute;
  right: -6vw;
  top: 50%;
  width: clamp(360px, 42vw, 620px);
  height: auto;
  translate: 0 -50%;
  z-index: -1;
  color: var(--teal);
  opacity: .12;
  pointer-events: none;
}

.hub-band h3 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  color: #fff;
}

.hub-band .hub-eyebrow {
  color: var(--teal);
}

.hub-band p {
  color: rgba(255, 255, 255, .85);
}

.hub-band a.a2 {
  color: var(--teal);
}

.hub-band a.a2:hover,
.hub-band a.a2:focus {
  color: var(--teal-bright);
}

.hub-band .hub-link {
  color: var(--teal);
  border-bottom-color: rgba(87, 193, 182, .4);
}

.hub-band .hub-link:hover,
.hub-band .hub-link:focus {
  color: var(--teal-bright);
  border-bottom-color: var(--teal-bright);
}

/* ── feature rows (whole-home, commercial, smaller projects) ── */
.hub-section {
  padding-top: clamp(4rem, 8vw, 6.5rem);
}

.hub-feature {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.hub-feature-flip .hub-figure {
  order: 2;
}

.hub-figure {
  position: relative;
  margin: 0;
}

/* hatched teal plate offset behind the photo — a CSS "construction stripe" */
.hub-figure::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(45deg, var(--teal) 0 6px, transparent 6px 16px);
  translate: 20px 20px;
  z-index: 0;
}

.hub-figure img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: 0 30px 60px -24px rgba(15, 26, 25, .45);
}

.hub-figure figcaption {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-band .hub-figure figcaption {
  color: rgba(255, 255, 255, .6);
}

.hub-copy .hub-link {
  margin-top: .4rem;
}

.hub-page > .hub-section:last-child {
  /* the shared .site-cta band follows .hub-page and brings its own top margin */
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .hub-feature,
  .hub-feature-flip {
    grid-template-columns: 1fr;
  }

  .hub-feature-flip .hub-figure {
    order: 0;
  }

  .hub-figure {
    max-width: 560px;
  }

  .hub-band-mark {
    right: -30vw;
    top: auto;
    bottom: -8vw;
    translate: none;
    width: 70vw;
    opacity: .08;
  }
}

@media (max-width: 760px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hub-figure::before {
    translate: 12px 12px;
  }
}
