/*
 * Featured Slides slider (gvbf-store) — homepage content carousel.
 *
 * Self-contained (theme-independent): brand colors are local custom properties so
 * the slider looks right regardless of which theme is active. Tweak the tokens
 * below to match the live palette exactly.
 *
 * Layout: each slide is a 2-column card (media | content). The image side
 * ALTERNATES per slide via the --media-left / --media-right modifier (set in PHP by
 * slide index). The carousel behavior (horizontal slide, one at a time) only applies
 * once the JS adds `.is-initialized`; without JS the slides simply stack and remain
 * readable (progressive enhancement).
 *
 * Background: the slider itself is TRANSPARENT — set the section background (the
 * pale-green band on the live site, or anything else) on the Beaver Builder ROW that
 * holds the [gvbf-featured-slider] shortcode. Use a full-width row for an edge-to-edge
 * band. The slider keeps its own padding so the content and arrows stay inset from the
 * band edges; adjust the row's padding to taste.
 */

.gvbf-slider {
	--gvbf-slide-green: #00853d;
	--gvbf-slide-green-dark: #004d26;
	--gvbf-slide-text: #1d1e25;
	--gvbf-slide-img-radius: 16px;
	--gvbf-slide-cta-radius: 6px;

	position: relative;
	padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 4vw, 3.5rem);
	box-sizing: border-box;
}

/* --- Slide card -------------------------------------------------------------- */

/* Self-contained box model + positioning context for the absolutely-placed arrows
   (centered on the slide area, NOT the whole padded section / dots). */
.gvbf-slider,
.gvbf-slider *,
.gvbf-slider *::before,
.gvbf-slider *::after {
	box-sizing: border-box;
}

.gvbf-slider__viewport {
	position: relative;
}

.gvbf-featured-slide {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-areas: "media content";
	align-items: center;
	gap: clamp(1.5rem, 4vw, 4rem);
	max-width: 1160px;
	margin: 0 auto;
}

.gvbf-featured-slide--media-right {
	grid-template-areas: "content media";
}

.gvbf-featured-slide__media {
	grid-area: media;
	text-align: center;
}

.gvbf-featured-slide__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--gvbf-slide-img-radius);
}

.gvbf-featured-slide__content {
	grid-area: content;
	min-width: 0;
}

/* Title = the big green heading. Font-family is left to inherit so it picks up the
   theme's heading font (Ainslie Sans on the live site). */
.gvbf-featured-slide__title {
	margin: 0 0 0.5rem;
	color: var(--gvbf-slide-green);
	font-weight: 900;
	font-size: clamp(1.9rem, 3.4vw, 3rem);
	line-height: 1.1;
}

/* Body holds the sub-head / blurb / price line, composed in the editor as
   h2/h3/h4 + paragraphs. Headings are green; paragraphs are body text. */
.gvbf-featured-slide__body {
	color: var(--gvbf-slide-text);
	overflow-wrap: anywhere; /* defend against long unbroken strings/URLs in author content */
}

.gvbf-featured-slide__body > :first-child {
	margin-top: 0;
}

.gvbf-featured-slide__body h2,
.gvbf-featured-slide__body h3,
.gvbf-featured-slide__body h4 {
	color: var(--gvbf-slide-green);
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 0.6rem;
}

.gvbf-featured-slide__body h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.gvbf-featured-slide__body h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); }
.gvbf-featured-slide__body h4 { font-size: 1.1rem; }

.gvbf-featured-slide__body p {
	margin: 0 0 1rem;
	font-size: clamp(1rem, 1.1vw, 1.125rem);
	line-height: 1.6;
}

/* CTA button — solid green, white text (matches the live "Read More" / "Shop Plush"). */
.gvbf-featured-slide__cta {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.7rem 1.6rem;
	background: var(--gvbf-slide-green);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	border-radius: var(--gvbf-slide-cta-radius);
	transition: background-color 0.2s ease;
}

.gvbf-featured-slide__cta:hover,
.gvbf-featured-slide__cta:focus {
	background: var(--gvbf-slide-green-dark);
	color: #fff;
}

/* --- Carousel chrome (only meaningful once JS initializes) ------------------- */

/* Before init / no-JS: stack slides so all content is visible & accessible. */
.gvbf-slider:not(.is-initialized) .gvbf-slider__slide + .gvbf-slider__slide {
	margin-top: clamp(2rem, 5vw, 4rem);
}
.gvbf-slider:not(.is-initialized) .gvbf-slider__arrow,
.gvbf-slider:not(.is-initialized) .gvbf-slider__dots {
	display: none;
}

/* Initialized: stack every slide in one grid cell and slide them horizontally.
   The track clips the off-screen slides; JS drives each slide's translateX so the
   incoming one enters from the right (next / autoplay) or left (prev) while the
   outgoing one exits the opposite way. Non-active slides stay in layout (so the grid
   keeps the height of the tallest slide) but are hidden until they animate. */
.gvbf-slider.is-initialized .gvbf-slider__track {
	display: grid;
	overflow: hidden;
}
.gvbf-slider.is-initialized .gvbf-slider__slide {
	grid-area: 1 / 1;
	visibility: hidden;
	pointer-events: none;
	transition: transform 0.55s ease;
}
.gvbf-slider.is-initialized .gvbf-slider__slide.is-active,
.gvbf-slider.is-initialized .gvbf-slider__slide.is-leaving {
	visibility: visible;
}
.gvbf-slider.is-initialized .gvbf-slider__slide.is-active {
	pointer-events: auto;
	transform: translateX(0);
}

/* Arrows */
.gvbf-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gvbf-slide-green);
	cursor: pointer;
	z-index: 2;
}
.gvbf-slider__arrow:hover,
.gvbf-slider__arrow:focus { color: var(--gvbf-slide-green-dark); }
.gvbf-slider__arrow--prev { left: clamp(0.25rem, 1.5vw, 1rem); }
.gvbf-slider__arrow--next { right: clamp(0.25rem, 1.5vw, 1rem); }

/* Dots */
.gvbf-slider__dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.gvbf-slider__dot {
	width: 11px;
	height: 11px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 133, 61, 0.3);
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.gvbf-slider__dot:hover { background: rgba(0, 133, 61, 0.55); }
.gvbf-slider__dot.is-active { background: var(--gvbf-slide-green); }

/* Visually-hidden live region (announces "Slide X of Y" on user navigation). */
.gvbf-slider__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Keyboard focus visibility */
.gvbf-slider__arrow:focus-visible,
.gvbf-slider__dot:focus-visible {
	outline: 2px solid var(--gvbf-slide-green-dark);
	outline-offset: 2px;
}

/* --- Responsive: stack image over text, drop arrows (dots only) -------------- */

@media (max-width: 768px) {
	.gvbf-featured-slide,
	.gvbf-featured-slide--media-right {
		grid-template-columns: 1fr;
		grid-template-areas: "media" "content";
		text-align: center;
		gap: 1.5rem;
	}
	.gvbf-featured-slide__img {
		max-width: 360px;
		margin: 0 auto;
	}
	.gvbf-slider__arrow { display: none; }
}

/* Respect reduced-motion: no slide transition (slides snap instantly). */
@media (prefers-reduced-motion: reduce) {
	.gvbf-slider.is-initialized .gvbf-slider__slide,
	.gvbf-featured-slide__cta,
	.gvbf-slider__arrow,
	.gvbf-slider__dot {
		transition: none;
	}
}
