/* GCHS Hero Slider — split-screen rotating hero. */

/* ── Root container & track ─────────────────────────────── */
.gchs-hero-slider {
	--gchs-hs-content-bg: var(--wp--preset--color--base, #ffffff);
	--gchs-hs-content-bg-donate: var(--wp--preset--color--neutral-light, #e4e5ed);
	--gchs-hs-accent: var(--wp--preset--color--primary, #709dcc);
	--gchs-hs-accent-dark: var(--wp--preset--color--primary-dark, #34577c);
	--gchs-hs-text: var(--wp--preset--color--contrast, #1a1a1a);
	--gchs-hs-text-muted: var(--wp--preset--color--neutral-mid, #686868);

	position: relative;
	width: 100%;
	/*
	 * Use an EXPLICIT height (not min-height) so CSS Grid's `1fr` row inside
	 * resolves against a definite parent. Without this, the height chain is
	 * indefinite and `1fr` collapses to content size — causing the photo cell
	 * to shrink because the absolute-positioned image contributes 0 height.
	 *
	 * min(80vh, 720px) keeps 80vh proportional on small viewports and caps at
	 * 720px on tall ones so the hero never feels cinematic on big monitors.
	 */
	height: min(80vh, 720px);
	overflow: hidden;
	padding: 24px 16px;
	background: var(--gchs-hs-accent-dark);
	color: var(--gchs-hs-text);
	/* Reserve vertical scroll for the browser; capture horizontal pan for our touch handler. */
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	/*
	 * Graceful entrance: slider starts invisible, fades in once JS has signaled
	 * that the first image has loaded (or after a 1.5s safety timeout). Prevents
	 * the photo from popping in on top of a gray placeholder during page load.
	 */
	opacity: 0;
	transition: opacity 0.5s ease;
}

.gchs-hero-slider.is-ready {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.gchs-hero-slider {
		opacity: 1;
		transition: none;
	}
}

/* Prevent native drag behavior on the photo so horizontal swipes go to our handler. */
.gchs-hero-slider__image {
	-webkit-user-drag: none;
	user-drag: none;
}

.gchs-hero-slider__track {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: inherit;
	border-radius: 8px;
	overflow: hidden;
}

/* ── Slide layout: split 55/45 ──────────────────────────── */
.gchs-hero-slider__slide {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: 55% 45%;
	grid-template-rows: 1fr;
	min-height: inherit;
	opacity: 0;
	transition: opacity 400ms ease;
	pointer-events: none;
}

.gchs-hero-slider__slide.is-active {
	opacity: 1;
	pointer-events: auto;
	position: relative; /* the active slide drives the track's height */
	height: 100%; /* Force full track height so the 1fr row resolves definitively */
}

@media (prefers-reduced-motion: reduce) {
	.gchs-hero-slider__slide { transition: none; }
}

@media (max-width: 1023px) {
	.gchs-hero-slider__slide { grid-template-columns: 50% 50%; }
}

@media (max-width: 767px) {
	.gchs-hero-slider {
		height: auto; /* let stacked mobile content drive height */
		padding: 12px 8px;
	}
	.gchs-hero-slider__slide {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}
}

/* ── Media side ─────────────────────────────────────────── */
.gchs-hero-slider__media {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 100%; /* Defensive: photo cell must fill the row even when the grid track sizing is shaky */
	align-self: stretch;
	overflow: hidden;
	background: #eee;
}

/*
 * Position image absolutely so its intrinsic dimensions don't dictate the
 * grid row height. With `inset: 0` + `object-fit: cover`, the image fills
 * the media box, but the media box's height is driven by the grid row
 * (which is driven by the slide's height), not by the image.
 *
 * The two-class selector below (`.gchs-hero-slider .gchs-hero-slider__image`)
 * is intentional: Elementor's frontend.min.css ships `.elementor img { height: auto; }`
 * with specificity (0,1,1) — higher than our single-class (0,1,0). On an
 * <img> element, `height: auto` resolves to the image's intrinsic natural
 * height (NOT "fill container"), so `inset: 0` alone can't rescue us.
 * Two classes (0,2,0) beats Elementor's rule and lets our `height: 100%` win.
 */
.gchs-hero-slider .gchs-hero-slider__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Subtle inner-edge gradient blending photo into content side. */
.gchs-hero-slider__media::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 80px;
	background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--gchs-hs-content-bg) 100%);
	pointer-events: none;
}

@media (max-width: 767px) {
	.gchs-hero-slider__media {
		/* Explicit height so width is free to fill 100% of the stacked slide.
		 * Using aspect-ratio + max-height caused the browser to shrink the
		 * width to preserve aspect when max-height clamped, leaving empty
		 * space to the right of the photo. */
		height: 240px;
	}
	.gchs-hero-slider__media::after {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		height: 60px;
		background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--gchs-hs-content-bg) 100%);
	}
}

/* Donate slide swaps to neutral-light. */
.gchs-hero-slider__slide--donate .gchs-hero-slider__media::after {
	background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--gchs-hs-content-bg-donate) 100%);
}

@media (max-width: 767px) {
	.gchs-hero-slider__slide--donate .gchs-hero-slider__media::after {
		background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--gchs-hs-content-bg-donate) 100%);
	}
}

/* ── Content side ──────────────────────────────────────── */
.gchs-hero-slider__content {
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	grid-auto-rows: max-content;
	align-content: center;
	justify-items: stretch;
	height: 100%;
	min-height: 0; /* Defeat default min-height of grid items so the row doesn't grow with content */
	row-gap: 1rem;
	padding: clamp(1.5rem, 4vw, 3rem);
	background: var(--gchs-hs-content-bg);
	overflow: hidden; /* Clip the decoration if it extends past edges */
}

.gchs-hero-slider__slide--donate .gchs-hero-slider__content {
	background: var(--gchs-hs-content-bg-donate);
}

/* ── Decorative watermark (e.g. paw prints on dog slides) ── */
.gchs-hero-slider__decoration {
	position: absolute;
	pointer-events: none;
	user-select: none;
	z-index: 0;
}

.gchs-hero-slider__decoration--paws {
	top: -10px;
	right: -20px;
	width: clamp(160px, 22vw, 260px);
	height: auto;
	opacity: 0.10;
	transform: rotate(8deg);
}

/* Keep all real content above the decoration. */
.gchs-hero-slider__content > :not(.gchs-hero-slider__decoration) {
	position: relative;
	z-index: 1;
}

@media (max-width: 767px) {
	.gchs-hero-slider__decoration--paws {
		width: clamp(120px, 30vw, 180px);
		opacity: 0.08;
	}
}

.gchs-hero-slider__eyebrow {
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gchs-hs-accent);
}

.gchs-hero-slider__headline {
	margin: 0;
	font-size: clamp(1.85rem, 4.5vw, 3.25rem);
	line-height: 1.1;
	color: var(--gchs-hs-accent-dark);
	font-family: var(--wp--preset--font-family--display, inherit);
}

.gchs-hero-slider__body {
	margin: 0;
	max-width: 46ch;
	opacity: 0.85;
	font-size: clamp(0.95rem, 1.2vw, 1.05rem);
}

/* ── Meta variants ─────────────────────────────────────── */
.gchs-hero-slider__meta {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.gchs-hero-slider__pills {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.gchs-hero-slider__pill {
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--wp--preset--color--neutral-light, #e4e5ed);
	color: var(--gchs-hs-text);
	font-size: 0.8rem;
	font-weight: 600;
}

.gchs-hero-slider__date-row {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.gchs-hero-slider__date-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 60px;
	padding: 6px 8px;
	border-radius: 8px;
	background: var(--gchs-hs-accent-dark);
	color: #fff;
	line-height: 1.0;
}

.gchs-hero-slider__date-day {
	font-size: 1.8rem;
	font-weight: 800;
}

.gchs-hero-slider__date-month {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
}

.gchs-hero-slider__date-facts {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.9rem;
	color: var(--gchs-hs-text-muted);
}

.gchs-hero-slider__date-time {
	font-weight: 600;
	color: var(--gchs-hs-text);
}

.gchs-hero-slider__progress {
	max-width: 320px;
}

.gchs-hero-slider__progress-bar {
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.gchs-hero-slider__progress-fill {
	height: 100%;
	background: var(--gchs-hs-accent-dark);
	transition: width 250ms ease;
}

.gchs-hero-slider__progress-label {
	margin: 6px 0 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--gchs-hs-text-muted);
}

.gchs-hero-slider__attribution {
	margin: 0;
	font-size: 0.9rem;
	color: var(--gchs-hs-text-muted);
}

/* ── CTAs ──────────────────────────────────────────────── */
.gchs-hero-slider__ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

@media (max-width: 480px) {
	.gchs-hero-slider__ctas .gchs-hero-slider__cta {
		flex: 1 1 100%;
	}
}

/* ── Arrows ────────────────────────────────────────────── */
.gchs-hero-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--gchs-hs-text);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
	transition: background-color 120ms ease, transform 120ms ease;
	z-index: 5;
}

.gchs-hero-slider__arrow:hover,
.gchs-hero-slider__arrow:focus-visible {
	background: #ffffff;
	transform: translateY(-50%) scale(1.05);
	outline: none;
}

.gchs-hero-slider__arrow--prev { left: 1rem; }
.gchs-hero-slider__arrow--next { right: 1rem; }

@media (max-width: 1023px) {
	.gchs-hero-slider__arrow--next { left: calc(50% - 60px); }
}

@media (max-width: 767px) {
	.gchs-hero-slider__arrow { display: none; }
}

/* ── Dots ──────────────────────────────────────────────── */
.gchs-hero-slider__dots {
	position: absolute;
	bottom: 2rem;
	left: calc(55% + clamp(1.5rem, 4vw, 3rem));
	display: flex;
	gap: 8px;
	z-index: 5;
}

@media (max-width: 1023px) {
	.gchs-hero-slider__dots { left: calc(50% + clamp(1.5rem, 4vw, 3rem)); }
}

@media (max-width: 767px) {
	.gchs-hero-slider__dots {
		position: static;
		justify-content: center;
		padding: 0.5rem 0 1rem;
	}
}

.gchs-hero-slider__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--gchs-hs-text-muted);
	opacity: 0.45;
	cursor: pointer;
	transition: background-color 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.gchs-hero-slider__dot:hover,
.gchs-hero-slider__dot:focus-visible {
	opacity: 0.85;
	transform: scale(1.15);
	outline: none;
}

.gchs-hero-slider__dot.is-active {
	background: var(--gchs-hs-accent-dark);
	opacity: 1;
	transform: scale(1.15);
}

/* On mobile the dots sit in the brand-colored frame band below the content
 * card. Use white (high contrast against any colored frame) instead of gray. */
@media (max-width: 767px) {
	.gchs-hero-slider__dot {
		background: #ffffff;
		opacity: 0.55;
	}
	.gchs-hero-slider__dot.is-active {
		background: #ffffff;
		opacity: 1;
	}
}

/* ── Screen-reader-only live region ────────────────────── */
.gchs-hero-slider__live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ── Empty / editor-only state ─────────────────────────── */
.gchs-hero-slider__empty {
	padding: 2rem;
	text-align: center;
	background: #f5f5f5;
	color: #555;
	border-radius: 8px;
}

/* Sold-out badge on a Camp Happy Tails slide (set when the camp is full). */
.gchs-hero-slider__soldout {
	display: inline-block;
	margin-left: 0.6em;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font-size: 0.72em;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	vertical-align: middle;
	line-height: 1.4;
}

/* Brand logo shown in the slide content (e.g. Full Bellies drive-through).
   Extra ancestor class beats Elementor's `.elementor img{max-width:100%}`
   (0,1,1), which otherwise blows the logo up to full width. */
.gchs-hero-slider__content .gchs-hero-slider__logo {
	display: block;
	max-width: 180px;
	height: auto;
	margin-bottom: 1rem;
}

/* Clinic slide: the media is the clinic logo, not a photo — contain it on a
   white tile so the whole logo shows instead of being cropped. */
.gchs-hero-slider__slide--clinic .gchs-hero-slider__media {
	background: #fff;
}

.gchs-hero-slider__slide--clinic .gchs-hero-slider__image {
	object-fit: contain;
	padding: 2rem;
	height: 100%;
}

/* Scroll-down cue — a distinct "mouse scroll" indicator + label. Sits BELOW
   the hero (in the gap above the next section), centered, not overlaying the
   slider, and styled to not look like the round prev/next nav arrows. */
.gchs-hero-slider__scroll-cue {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0.25rem auto -0.5rem;
	border: none;
	background: none;
	cursor: pointer;
	padding: 2px 8px;
}

.gchs-hero-slider__scroll-mouse {
	display: block;
	width: 22px;
	height: 34px;
	border: 2px solid var(--wp--preset--color--primary, #245493);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.75);
	position: relative;
}

.gchs-hero-slider__scroll-wheel {
	position: absolute;
	left: 50%;
	top: 6px;
	width: 4px;
	height: 7px;
	border-radius: 2px;
	background: var(--wp--preset--color--primary, #245493);
	transform: translateX(-50%);
	animation: gchs-hs-scroll-wheel 1.6s ease-in-out infinite;
}

.gchs-hero-slider__scroll-label {
	font-family: var(--wp--preset--font-family--subheading, sans-serif);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--primary, #245493);
	background: rgba(255, 255, 255, 0.85);
	padding: 2px 8px;
	border-radius: 999px;
	white-space: nowrap;
}

@keyframes gchs-hs-scroll-wheel {
	0%   { opacity: 1; transform: translate(-50%, 0); }
	60%  { opacity: 0; transform: translate(-50%, 10px); }
	100% { opacity: 0; transform: translate(-50%, 10px); }
}

@media (prefers-reduced-motion: reduce) {
	.gchs-hero-slider__scroll-wheel { animation: none; }
}

/* Event slide: show the whole flyer/graphic (often a poster) instead of
   cropping it — fit it within the pane on a solid backdrop so it's readable. */
.gchs-hero-slider .gchs-hero-slider__slide--event .gchs-hero-slider__image {
	object-fit: contain;
}
.gchs-hero-slider__slide--event .gchs-hero-slider__media {
	background: #1e3550;
}
