/**
 * RJ4 Medspa — Page Sections
 *
 * Styles for editor-composed sections. Everything here consumes the tokens in
 * tokens.css and reuses the component vocabulary in components.css — no new
 * colours, type sizes, or spacing values are invented (CLAUDE.md §4). The
 * design system stays in code; editors supply content only.
 */

/* =========================================================
   Section media — shared by every layout
   ========================================================= */

/* Cover: full-bleed backdrop behind a section's own content. */
.sec-cover {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background-color: var(--color-ink);
}

.sec-cover img,
.sec-cover video,
.sec-cover iframe,
.sec-cover__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

/* A cover video only becomes visible once it is actually playing, so the
   poster underneath is never replaced by a black frame mid-load. */
.sec-cover video {
	opacity: 0;
	transition: opacity var(--duration-slow) var(--ease-default);
}

.sec-cover.is-playing video {
	opacity: 1;
}

/* Background embeds are sized to cover: 16:9 scaled up from the centre, so a
   YouTube/Vimeo frame fills the band the way a video file would. */
.sec-embed--bg iframe {
	width: 100vw;
	height: 56.25vw;
	min-height: 100%;
	min-width: 177.77vh;
	top: 50%;
	left: 50%;
	inset: auto;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

/* Inline media: sits in the flow (editorial splits, player frames). */
.sec-media {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.sec-media img,
.sec-media video,
.sec-media iframe {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

/* Inside an editorial split the media fills the frame absolutely, matching
   the existing .editorial__media img behaviour. */
.editorial__media .sec-media {
	position: absolute;
	inset: 0;
}

/* Play button for on-demand videos. */
.sec-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: var(--radius-full);
	background: rgba(35, 38, 31, 0.55);
	color: var(--color-white);
	cursor: pointer;
	transition: background var(--duration-default) var(--ease-default),
		transform var(--duration-default) var(--ease-default);
}

.sec-play:hover,
.sec-play:focus-visible {
	background: var(--color-deep-olive);
	transform: translate(-50%, -50%) scale(1.06);
}

.sec-play svg {
	width: 30px;
	height: 30px;
	margin-left: 4px; /* optical centring of the triangle */
}

.is-playing > .sec-play {
	display: none;
}

/* =========================================================
   Hero section
   ========================================================= */

.sec-hero {
	position: relative;
}

.sec-hero .sec-cover {
	z-index: 0;
}

/* Keep the hero's existing glaze above the media but below the copy. */
.sec-hero::before {
	z-index: 1;
}

.sec-hero .hero-slider__content {
	position: relative;
	z-index: 2;
}

/* =========================================================
   Full-width media band
   ========================================================= */

.sec-band {
	position: relative;
	min-height: 60vh;
	display: grid;
	align-items: center;
	overflow: hidden;
	background: var(--color-ink);
}

.sec-band--overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--glaze-flat);
}

.sec-band__inner {
	position: relative;
	z-index: 2;
	padding-block: var(--space-3xl);
	color: var(--color-white);
	text-align: center;
}

.sec-band__title {
	color: var(--color-white);
	font-size: var(--text-h2);
	margin-bottom: var(--space-md);
}

.sec-band .eyebrow {
	color: rgba(255, 255, 255, 0.7);
}

.sec-band__lede {
	color: rgba(255, 255, 255, 0.85);
	max-width: 52ch;
	margin-inline: auto;
}

.sec-band__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	justify-content: center;
	margin-top: var(--space-lg);
}

/* Bands with no overlay copy are pure imagery — give them a fixed ratio
   rather than a viewport height so they never dominate a short page. */
.sec-band:not(.sec-band--overlay) {
	min-height: 0;
	aspect-ratio: 21 / 9;
}

@media (max-width: 767px) {
	.sec-band:not(.sec-band--overlay) {
		aspect-ratio: 4 / 3;
	}
}

/* =========================================================
   Player frame (video presented as content)
   ========================================================= */

.sec-player__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--color-ink);
	box-shadow: var(--shadow-card);
}

.sec-player__frame .sec-media {
	position: absolute;
	inset: 0;
}

/* =========================================================
   Feature cards — banded variant + statistics + checklist
   ========================================================= */

.sec-cards--banded {
	position: relative;
	overflow: hidden;
}

.sec-cards--banded::before {
	z-index: 1;
}

.sec-cards--banded .benefits-band__inner {
	position: relative;
	z-index: 2;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-lg) var(--space-md);
	margin-top: var(--space-xl);
}

@media (min-width: 900px) {
	.stat-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.stat-card {
	text-align: center;
	padding: var(--space-md);
	border-top: 1px solid var(--color-hairline);
}

.stat-card__value {
	display: block;
	font-family: var(--font-serif);
	font-size: var(--text-h2);
	line-height: var(--leading-h2);
	color: var(--color-deep-olive);
}

.stat-card__label {
	font-size: var(--text-label);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-muted);
	margin-top: var(--space-xs);
}

.stat-card__body {
	font-size: var(--text-caption);
	color: var(--color-body);
	margin-top: var(--space-xs);
}

.feature-grid__body {
	display: block;
	font-size: var(--text-caption);
	color: var(--color-muted);
	margin-top: 4px;
}

/* =========================================================
   Testimonials — optional rating and context line
   ========================================================= */

.testimonial-card__stars {
	display: block;
	color: var(--color-warning);
	letter-spacing: 0.14em;
	margin-bottom: var(--space-xs);
}

.testimonial-card__context {
	display: block;
	font-size: var(--text-caption);
	color: var(--color-muted);
	font-style: normal;
	margin-top: 2px;
}

/* =========================================================
   Contact section
   ========================================================= */

.sec-contact__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-xl);
	margin-bottom: var(--space-xl);
}

@media (min-width: 900px) {
	.sec-contact__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

/* =========================================================
   CTA band extras
   ========================================================= */

.booking-band {
	position: relative;
	overflow: hidden;
}

.booking-band .sec-cover {
	z-index: 0;
}

.booking-band::before {
	z-index: 1;
}

.booking-band > .rj4-container {
	position: relative;
	z-index: 2;
}

.booking-band__lede {
	color: rgba(255, 255, 255, 0.85);
	max-width: 46ch;
	margin-bottom: var(--space-md);
}

.booking-band__buttons,
.cta-section__actions,
.editorial__actions,
.fit-split__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
}

.cta-section__actions {
	justify-content: center;
	margin-top: var(--space-lg);
}

.cta-section__hours {
	margin-top: var(--space-md);
	font-size: var(--text-caption);
	color: rgba(255, 255, 255, 0.8);
}

.editorial__actions {
	margin-top: var(--space-sm);
}

/* =========================================================
   Dark section background option
   ========================================================= */

.section--dark {
	background: var(--color-ink);
	color: rgba(255, 255, 255, 0.85);
}

.section--dark h2,
.section--dark h3,
.section--dark .section-head h2 {
	color: var(--color-white);
}

.section--dark .eyebrow {
	color: rgba(255, 255, 255, 0.7);
}

.section--dark .section-intro,
.section--dark p {
	color: rgba(255, 255, 255, 0.85);
}

/* =========================================================
   Image marquee
   ========================================================= */

.sec-marquee {
	padding-block: var(--space-2xl);
	overflow: hidden;
}

.sec-marquee__viewport {
	display: flex;
	width: max-content;
	/* Without JS-driven animation support the strip stays swipeable. */
	overflow-x: auto;
	scrollbar-width: none;
}

.sec-marquee__viewport::-webkit-scrollbar {
	display: none;
}

.sec-marquee__track {
	display: flex;
	gap: var(--space-sm);
	padding-right: var(--space-sm);
	animation: rj4-marquee 60s linear infinite;
}

.sec-marquee[data-speed='medium'] .sec-marquee__track {
	animation-duration: 36s;
}

.sec-marquee:hover .sec-marquee__track {
	animation-play-state: paused;
}

.sec-marquee__item {
	flex: 0 0 auto;
	width: clamp(220px, 26vw, 380px);
	aspect-ratio: 4 / 5;
	margin: 0;
	overflow: hidden;
}

.sec-marquee__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@keyframes rj4-marquee {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(-100%, 0, 0); }
}

/* =========================================================
   Custom embed
   ========================================================= */

.sec-embed-block__body iframe {
	max-width: 100%;
	border: 0;
}

.sec-embed-block__full {
	width: 100%;
}

/* =========================================================
   Spacer
   ========================================================= */

.sec-spacer--small  { height: var(--space-lg); }
.sec-spacer--medium { height: var(--space-2xl); }
.sec-spacer--large  { height: var(--space-3xl); }

.sec-spacer .rule-dot {
	position: relative;
	top: 50%;
}

/* =========================================================
   Motion presets
   ========================================================= */

/* Cover images drift with the existing parallax variable; the scale keeps the
   frame filled while the image translates. */
html.js .sec-cover__img[data-parallax] {
	transform: translate3d(0, var(--py, 0), 0) scale(1.1);
}

/* Cinematic: a longer, softer entrance than the signature reveal. */
html.js [data-motion='cinematic'] .reveal,
html.js [data-motion='cinematic'] [data-reveal] {
	transition-duration: 1400ms;
	transition-timing-function: var(--ease-drift);
}

html.js [data-motion='cinematic'] .sec-cover__img {
	animation: rj4-cover-drift 24s var(--ease-default) infinite alternate;
}

@keyframes rj4-cover-drift {
	from { transform: scale(1.02); }
	to   { transform: scale(1.12); }
}

/* Gentle Rise: replace the mask wipe with a plain upward settle. */
html.js [data-reveal='rise'] {
	opacity: 0;
	transform: translate3d(0, 28px, 0);
	transition: opacity var(--duration-slow) var(--ease-drift),
		transform var(--duration-slow) var(--ease-drift);
}

html.js [data-reveal='rise'].is-inview {
	opacity: 1;
	transform: none;
}

/* =========================================================
   Reduced motion — cinematic effects collapse to static
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
	.sec-marquee__track {
		animation: none;
	}

	.sec-marquee__viewport {
		width: 100%;
	}

	/* The duplicate strip only exists to make the loop seamless. */
	.sec-marquee__viewport .sec-marquee__track:last-child {
		display: none;
	}

	html.js [data-motion='cinematic'] .sec-cover__img {
		animation: none;
	}

	.sec-cover video {
		opacity: 0;
	}

	html.js [data-reveal='rise'] {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.sec-cover__img[data-parallax] {
		transform: none;
	}
}

/* =========================================================
   Gallery video items
   ========================================================= */

.gallery-grid__item--video::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 54px;
	height: 54px;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: var(--radius-full);
	background: rgba(35, 38, 31, 0.5)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E")
		no-repeat center / 22px;
	pointer-events: none;
}

.gallery-lightbox__video {
	display: block;
	max-width: 90vw;
	max-height: 80vh;
	width: 960px;
	aspect-ratio: 16 / 9;
	border: 0;
	background: #000;
}
