/**
 * cpt-hero.css
 *
 * Shared CPT single hero. Replaces the per-CPT __hero blocks
 * (mvc-location__hero, mvc-service__hero, mvc-sl__hero, mvc-project__hero,
 * mvc-property__hero, mvc-post__hero).
 *
 * Structural only — colors and typography come from tokens/presets.
 * Each CPT can layer on extras via .mvc-cpt-hero--{variant} {...}.
 */

.mvc-cpt-hero {
	position: relative;
	margin-block-end: var(--space-12);
}

.mvc-cpt-hero__img-wrap {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 7;
	margin-block-end: var(--space-8);
	background: var(--color-bg-alt);
}

.mvc-cpt-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* When there's no image, give the content area a bit of top breathing room
   so the breadcrumbs don't collide with the header. */
.mvc-cpt-hero:not(:has(.mvc-cpt-hero__img-wrap)) .mvc-cpt-hero__content {
	padding-block-start: var(--space-10);
}

.mvc-cpt-hero__content {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.mvc-cpt-hero__title {
	margin: 0;
}

.mvc-cpt-hero__desc {
	margin: 0;
	font-size: var(--font-size-lg);
	color: var(--color-text-muted);
	max-width: 65ch;
}

.mvc-cpt-hero__cta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-block-start: var(--space-4);
}

/* ── Dark-image hero variant ──────────────────────────────────────────── */
/* Optional modifier when the CPT template knows the hero image is dark and
   the content sits over it. Currently only single-location uses this for
   inverse geo-badges. The selectors below preserve the prior behavior from
   layout5.css that targeted .mvc-location__hero--dark. */
.mvc-cpt-hero--dark .mvc-location__region a,
.mvc-cpt-hero--dark .mvc-location__region span {
	background-color: rgb(255 255 255 / 0.1);
	border-color: rgb(255 255 255 / 0.3);
	color: var(--color-text-inverse);
}

.mvc-cpt-hero--dark .mvc-location__city a,
.mvc-cpt-hero--dark .mvc-location__city span {
	background-color: rgb(255 255 255 / 0.2);
	border-color: rgb(255 255 255 / 0.3);
	color: var(--color-text-inverse);
}

/* ── Overlay variant — image full-bleed, header overlays the hero ───────── */
/* Opt-in by passing 'overlay' => true to mvc_get_component('cpt-hero', ...).
   Must be paired with a body-class rule that forces the site header into
   fixed/transparent mode over this hero (see single-service.php and
   single-location.php which add .mvc-cpt-hero-overlay to body_class). */
.mvc-cpt-hero--overlay {
	position: relative;
	margin-block-end: clamp(2rem, 5vw, 3.5rem);
	color: #ffffff;
	background: #0c0f14;
	overflow: hidden;
	isolation: isolate;
}

/* Pull hero up under the fixed transparent header so the photo extends
   behind the menu band. Top padding inside __content adds the height back
   so the title still sits below the visible menu. */
body.mvc-cpt-hero-overlay .mvc-cpt-hero--overlay {
	margin-top: calc(var(--header-height, 72px) * -1);
}

.mvc-cpt-hero--overlay .mvc-cpt-hero__img-wrap {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
	aspect-ratio: auto;
	height: 100%;
	background: none;
}

.mvc-cpt-hero--overlay .mvc-cpt-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.mvc-cpt-hero--overlay .mvc-cpt-hero__veil {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.7) 75%, rgba(0,0,0,0.85) 100%),
		linear-gradient(90deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 65%);
	pointer-events: none;
}

.mvc-cpt-hero--overlay .mvc-cpt-hero__content {
	position: relative;
	z-index: 2;
	padding-top: calc(var(--header-height, 72px) + clamp(2rem, 6vw, 4rem));
	padding-bottom: clamp(3rem, 8vw, 5.5rem);
	max-width: 80ch;
	gap: var(--space-4);
}

.mvc-cpt-hero--overlay .mvc-cpt-hero__title {
	color: #ffffff;
	text-wrap: balance;
}

.mvc-cpt-hero--overlay .mvc-cpt-hero__desc {
	color: rgba(255, 255, 255, 0.88);
	max-width: 65ch;
}

/* Breadcrumbs inside the dark overlay — force light treatment to defeat
   the light-theme tokens in layout5.css's .mvc-breadcrumbs rules. */
.mvc-cpt-hero--overlay .mvc-breadcrumbs,
.mvc-cpt-hero--overlay .mvc-breadcrumbs * {
	color: #ffffff;
}
.mvc-cpt-hero--overlay .mvc-breadcrumbs a,
.mvc-cpt-hero--overlay .mvc-breadcrumbs__link,
.mvc-cpt-hero--overlay .mvc-breadcrumbs__sep,
.mvc-cpt-hero--overlay .mvc-breadcrumbs [aria-current="page"],
.mvc-cpt-hero--overlay .mvc-breadcrumbs__current {
	color: #ffffff !important;
	opacity: 1;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.mvc-cpt-hero--overlay .mvc-breadcrumbs a:hover {
	color: #ffffff !important;
	text-decoration: underline;
}

/* Location-variant geo badges inside the overlay — same inverse treatment
   as the legacy .mvc-cpt-hero--dark rules above. */
.mvc-cpt-hero--overlay .mvc-location__region a,
.mvc-cpt-hero--overlay .mvc-location__region span,
.mvc-cpt-hero--overlay .mvc-location__city a,
.mvc-cpt-hero--overlay .mvc-location__city span,
.mvc-cpt-hero--overlay .mvc-location__neighborhood a,
.mvc-cpt-hero--overlay .mvc-location__neighborhood span {
	background-color: rgb(255 255 255 / 0.15);
	border-color: rgb(255 255 255 / 0.3);
	color: var(--color-text-inverse, #ffffff);
}

/* Service-variant category terms — match the inverse treatment.
   Base .mvc-term-list__link gives these a white pill background (from
   utilities.css). On the dark overlay that produced white-on-white. Override
   background + border AND color so the pills read as translucent chips. */
.mvc-cpt-hero--overlay .mvc-service__cats .mvc-term-list__link,
.mvc-cpt-hero--overlay .mvc-service__cats .mvc-term-list__label,
.mvc-cpt-hero--overlay .mvc-sl__cats .mvc-term-list__link,
.mvc-cpt-hero--overlay .mvc-sl__cats .mvc-term-list__label,
.mvc-cpt-hero--overlay .mvc-service__cats a,
.mvc-cpt-hero--overlay .mvc-service__cats span,
.mvc-cpt-hero--overlay .mvc-sl__cats a,
.mvc-cpt-hero--overlay .mvc-sl__cats span {
	background-color: rgb(255 255 255 / 0.15);
	border-color: rgb(255 255 255 / 0.3);
	color: #ffffff;
}
.mvc-cpt-hero--overlay .mvc-service__cats .mvc-term-list__link:hover,
.mvc-cpt-hero--overlay .mvc-sl__cats .mvc-term-list__link:hover {
	background-color: rgb(255 255 255 / 0.25);
	border-color: rgb(255 255 255 / 0.5);
	color: #ffffff;
}

/* Secondary (phone) CTA inside the overlay — base .mvc-btn--outline class
   isn't defined in utilities.css so the phone button falls back to the
   primary-navy colour, which is invisible on a dark hero image. Scope an
   inverse outline treatment here so it reads as a translucent ghost button. */
.mvc-cpt-hero--overlay .mvc-cpt-hero__phone,
.mvc-cpt-hero--overlay .mvc-btn--outline {
	background-color: transparent;
	border: 1px solid rgb(255 255 255 / 0.6);
	color: #ffffff;
}
.mvc-cpt-hero--overlay .mvc-cpt-hero__phone:hover,
.mvc-cpt-hero--overlay .mvc-cpt-hero__phone:focus-visible,
.mvc-cpt-hero--overlay .mvc-btn--outline:hover,
.mvc-cpt-hero--overlay .mvc-btn--outline:focus-visible {
	background-color: rgb(255 255 255 / 0.12);
	border-color: #ffffff;
	color: #ffffff;
}

/* SL parent-link breadcrumbs (linked Service / Location) — readable on dark. */
.mvc-cpt-hero--overlay .mvc-sl__parent-links,
.mvc-cpt-hero--overlay .mvc-sl__parent-link {
	color: rgba(255, 255, 255, 0.88);
}
.mvc-cpt-hero--overlay .mvc-sl__parent-link {
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, 0.5);
}
.mvc-cpt-hero--overlay .mvc-sl__parent-link:hover {
	color: #ffffff;
	text-decoration-color: #ffffff;
}

/* ── Force header transparent over the overlay hero ─────────────────────── */
/* Mirrors the body.mvc-project-layout--editorial rules in the editorial
   layout CSS, but driven by the single-service / single-location body
   class so it kicks in regardless of the site-wide header_transparent
   ACF option. */
body.mvc-cpt-hero-overlay .mvc-header {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	background: transparent !important;
	border-bottom-color: transparent !important;
	box-shadow: none !important;
	transition: background 0.35s ease,
	            border-bottom-color 0.35s ease,
	            box-shadow 0.35s ease;
}

/* Unscrolled (still over the hero): white chrome with a soft text shadow. */
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-nav__link,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .menu-item > a,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__phone,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__phone-number,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__phone-icon,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__logo-text,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__menu-toggle {
	color: #ffffff !important;
}
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-nav__link,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .menu-item > a,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__phone,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__phone-number,
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__logo-text {
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
body.mvc-cpt-hero-overlay .mvc-header:not(.is-scrolled) .mvc-header__menu-icon span {
	background: #ffffff !important;
}

/* Scrolled past the hero: header gains the Design Settings → Header
   Scrolled BG color (or --header-bg as fallback), plus the shadow. Chrome
   flips per the dashboard's Header Scrolled Text option. */
body.mvc-cpt-hero-overlay .mvc-header.is-scrolled {
	background: var(--header-scrolled-bg, var(--header-bg, #ffffff)) !important;
	border-bottom-color: var(--header-border) !important;
	box-shadow: var(--shadow-md) !important;
}
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-nav__link,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .menu-item > a,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-header__phone,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-header__phone-number,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-header__phone-icon,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-header__logo-text,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-header__menu-toggle {
	color: var(--color-text) !important;
	text-shadow: none !important;
}
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-dark.is-scrolled .mvc-header__menu-icon span {
	background: var(--color-text) !important;
}
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-nav__link,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .menu-item > a,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-header__phone,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-header__phone-number,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-header__phone-icon,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-header__logo-text,
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-header__menu-toggle {
	color: #ffffff !important;
	text-shadow: none !important;
}
body.mvc-cpt-hero-overlay .mvc-header.mvc-header--scrolled-text-light.is-scrolled .mvc-header__menu-icon span {
	background: #ffffff !important;
}
