/**
 * BB Hero Slider — Frontend Styles
 *
 * Styles for the [wpr_hero_slider] shortcode output.
 * All design tokens are overridable via inline CSS custom properties
 * output by FrontendAssets::inline_styles().
 *
 * @package WPR\HeroSlider
 */

/* ==========================================================================
   CSS Custom Properties — Defaults
   Overridden at runtime by inline <style> from admin settings.
   ========================================================================== */

.wpr-chs-hero {
	/* Typography */
	--wpr-chs-heading-font: 'FormataMedium', sans-serif;
	--wpr-chs-subtitle-font: 'Amatic SC', cursive;
	--wpr-chs-heading-size: 2.5rem;
	--wpr-chs-subtitle-size: 1.5rem;
	--wpr-chs-heading-color: #000000;
	--wpr-chs-subtitle-color: #000000;
	--wpr-chs-subtitle-font-style: italic;
	--wpr-chs-subtitle-max-width: 110%;
	/* Button */
	--wpr-chs-btn-font: 'FormataItalic', sans-serif;
	--wpr-chs-btn-font-style: italic;
	--wpr-chs-btn-bg: #68039a;
	--wpr-chs-btn-color: #ffffff;
	--wpr-chs-btn-hover-bg: #520278;
	--wpr-chs-btn-hover-color: #ffffff;
	--wpr-chs-btn-radius: 10px;
	--wpr-chs-btn-padding: 14px 32px;
	--wpr-chs-btn-font-size: 1rem;
	--wpr-chs-btn-text-decoration: none;
	/* Curve */
	--wpr-chs-curve-color: #ffffff;
	/* Layout */
	--wpr-chs-content-width: 59%;
	--wpr-chs-hero-height: 800px;
}

/* ==========================================================================
   Hero Section — Outer Container
   ========================================================================== */

.wpr-chs-hero {
	position: relative;
	width: 100%;
	max-width: 100vw;
	height: var(--wpr-chs-hero-height);
	background-color: transparent;
	overflow: hidden;
	/* Drop shadow applied to the slider as a single unit. The shadow is
	   drawn outside the border-box, so the element's own overflow: hidden
	   does not clip it. Values chosen to match the design reference: a
	   soft, prominent shadow with most of the weight beneath the slider. */
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   Swiper Container
   ========================================================================== */

.wpr-chs-swiper {
	width: 100%;
	height: 100%;
	position: relative;
}

.wpr-chs-swiper .swiper-wrapper {
	height: 100%;
}

/* ==========================================================================
   Individual Slide
   ========================================================================== */

.wpr-chs-slide {
	height: 100%;
	overflow: hidden;
}

.wpr-chs-slide-inner {
	position: relative;
	height: 100%;
	width: 100%;
}

/* ==========================================================================
   Slide Image — Full Background Layer
   ========================================================================== */

.wpr-chs-slide-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	overflow: hidden;
}

.wpr-chs-slide-image img {
	/* Pure-CSS focal-point cropping. The image always fills the container
	   (object-fit: cover guarantees no white space). object-position is set
	   inline per-slide; transform: scale() applies the zoom on top. */
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	object-position: 50% 50%;
	transform-origin: center center;
	will-change: transform;
}

/* ==========================================================================
   SVG Curve Divider
   The signature concave arc between text content and image.
   Positioned over the image, drawing a filled shape on the left side.
   ========================================================================== */

.wpr-chs-curve-svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	pointer-events: none;
	color: var(--wpr-chs-curve-color);
}

/* ==========================================================================
   Slide Content — Text Area (Left Side, on top of curve)
   ========================================================================== */

.wpr-chs-slide-content {
	position: relative;
	z-index: 3;
	width: var(--wpr-chs-content-width);
	height: 100%;
	padding-left: 8%;
	padding-right: 4%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	box-sizing: border-box;
	overflow: visible;
}

.wpr-chs-text-selectable .wpr-chs-slide-content {
	-webkit-user-select: text;
	user-select: text;
	cursor: default;
}

/* Heading — !important so theme defaults can't override plugin settings,
   which keeps the live site in sync with the admin preview. */
.wpr-chs-hero .wpr-chs-slide-heading,
.wpr-chs-slide-heading {
	font-family: var(--wpr-chs-heading-font) !important;
	font-size: var(--wpr-chs-heading-size) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: var(--wpr-chs-heading-color) !important;
	margin: 0 0 0.5rem !important;
	padding: 0 !important;
	letter-spacing: -0.01em !important;
	text-transform: none !important;
	text-shadow: none !important;
	background: none !important;
	border: none !important;
}

/* Subtitle — same rationale: plugin-owned, theme-proof. */
.wpr-chs-hero .wpr-chs-slide-subtitle,
.wpr-chs-slide-subtitle {
	font-family: var(--wpr-chs-subtitle-font) !important;
	font-size: var(--wpr-chs-subtitle-size) !important;
	font-style: var(--wpr-chs-subtitle-font-style) !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	color: var(--wpr-chs-subtitle-color) !important;
	margin: 0 !important;
	padding: 0 !important;
	max-width: var(--wpr-chs-subtitle-max-width);
	width: max-content;
	overflow-wrap: break-word;
	word-break: break-word;
	background: none !important;
	border: none !important;
}

/* ==========================================================================
   CTA Button
   ========================================================================== */

a.wpr-chs-slide-btn,
a.wpr-chs-slide-btn:link,
a.wpr-chs-slide-btn:visited {
	display: inline-block;
	margin-top: 1.5rem;
	padding: var(--wpr-chs-btn-padding);
	background-color: var(--wpr-chs-btn-bg);
	color: var(--wpr-chs-btn-color) !important;
	font-family: var(--wpr-chs-btn-font);
	font-style: var(--wpr-chs-btn-font-style);
	font-size: var(--wpr-chs-btn-font-size);
	font-weight: 600;
	line-height: 1.4;
	text-decoration: var(--wpr-chs-btn-text-decoration) !important;
	border: none;
	border-radius: var(--wpr-chs-btn-radius);
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease;
	align-self: flex-start;
}

a.wpr-chs-slide-btn:hover,
a.wpr-chs-slide-btn:focus,
a.wpr-chs-slide-btn:active {
	background-color: var(--wpr-chs-btn-hover-bg);
	color: var(--wpr-chs-btn-hover-color) !important;
	text-decoration: var(--wpr-chs-btn-text-decoration) !important;
}

a.wpr-chs-slide-btn:focus-visible {
	outline: 2px solid var(--wpr-chs-btn-bg);
	outline-offset: 2px;
}

/* ==========================================================================
   Swiper Navigation Arrows
   ========================================================================== */

.wpr-chs-swiper .swiper-button-prev,
.wpr-chs-swiper .swiper-button-next {
	color: var(--wpr-chs-btn-bg);
	--swiper-navigation-size: 30px;
	transition: opacity 0.3s ease;
	z-index: 10;
}

.wpr-chs-swiper .swiper-button-prev:hover,
.wpr-chs-swiper .swiper-button-next:hover {
	opacity: 0.7;
}

.wpr-chs-nav-prev {
	left: 2%;
}

.wpr-chs-nav-next {
	right: 2%;
}

/* ==========================================================================
   Swiper Pagination
   ========================================================================== */

.wpr-chs-pagination {
	z-index: 10;
}

.wpr-chs-swiper .swiper-pagination-bullet {
	width: 10px;
	height: 10px;
	background-color: var(--wpr-chs-btn-bg);
	opacity: 0.35;
	transition: opacity 0.3s ease, background-color 0.3s ease;
}

.wpr-chs-swiper .swiper-pagination-bullet-active {
	background-color: var(--wpr-chs-btn-bg);
	opacity: 1;
}

.wpr-chs-swiper .swiper-pagination-fraction {
	color: var(--wpr-chs-heading-color);
	font-weight: 600;
}

.wpr-chs-swiper .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
	background-color: var(--wpr-chs-btn-bg);
}

/* ==========================================================================
   Slide Entrance Animation
   ========================================================================== */

.wpr-chs-slide .wpr-chs-slide-heading,
.wpr-chs-slide .wpr-chs-slide-subtitle,
.wpr-chs-slide .wpr-chs-slide-btn {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.wpr-chs-slide .wpr-chs-slide-subtitle {
	transition-delay: 0.3s;
}

.wpr-chs-slide .wpr-chs-slide-btn {
	transition-delay: 0.4s;
}

.wpr-chs-slide.swiper-slide-active .wpr-chs-slide-heading,
.wpr-chs-slide.swiper-slide-active .wpr-chs-slide-subtitle,
.wpr-chs-slide.swiper-slide-active .wpr-chs-slide-btn {
	opacity: 1;
	transform: translateY(0);
}

/* ==========================================================================
   Responsive — Tablet (768px – 1023px)
   ========================================================================== */

@media screen and (min-width: 768px) and (max-width: 1023px) {

	.wpr-chs-hero {
		height: 600px;
	}

	.wpr-chs-slide-content {
		width: var(--wpr-chs-content-width);
		padding-left: 5%;
		padding-right: 3%;
	}

	.wpr-chs-slide-heading {
		font-size: calc(var(--wpr-chs-heading-size) * 0.8);
	}

	.wpr-chs-slide-subtitle {
		font-size: calc(var(--wpr-chs-subtitle-size) * 0.9);
	}

	.wpr-chs-slide-btn {
		font-size: calc(var(--wpr-chs-btn-font-size) * 0.95);
	}

	.wpr-chs-swiper .swiper-button-prev,
	.wpr-chs-swiper .swiper-button-next {
		--swiper-navigation-size: 26px;
	}
}

/* ==========================================================================
   Responsive — Mobile (< 768px)
   ========================================================================== */

@media screen and (max-width: 767px) {

	.wpr-chs-hero {
		--wpr-chs-hero-height: auto;
	}

	.wpr-chs-slide {
		height: auto;
	}

	.wpr-chs-slide-inner {
		position: relative;
		height: auto;
		min-height: 0;
		display: flex;
		flex-direction: column;
	}

	/* Hide the SVG curve on mobile */
	.wpr-chs-curve-svg {
		display: none;
	}

	/* Mobile layout — hero card pattern:
	   image fills a fixed-height area at the top of the slide,
	   text + button stack centered below. The whole stack is bounded
	   by the slider's drop shadow and reads as one cohesive card. */

	/* IMAGE — top of the card. Fixed height, full width, cover-fit so
	   the image always fills its area cleanly regardless of source aspect. */
	.wpr-chs-slide-image {
		position: relative;
		width: 100%;
		height: 320px;
		padding: 0;
		order: 1;
		overflow: hidden;
		box-sizing: border-box;
	}

	.wpr-chs-slide-image img {
		position: static !important;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		max-height: none !important;
		margin: 0 !important;
		display: block !important;
		top: auto !important;
		left: auto !important;
		object-fit: cover !important;
		object-position: 50% 50% !important;
		transform: none !important;
	}

	/* TEXT CONTENT — below image, centered, snug bottom padding so the
	   shadow visually closes the card. */
	.wpr-chs-slide-content {
		position: relative;
		width: 100%;
		height: auto;
		padding: 1.5rem 1.25rem 1.75rem;
		text-align: center;
		align-items: center;
		order: 2;
		background-color: transparent;
		box-sizing: border-box;
	}

	.wpr-chs-hero .wpr-chs-slide-heading,
	.wpr-chs-slide-heading {
		font-size: calc(var(--wpr-chs-heading-size) * 0.65) !important;
		max-width: 100% !important;
		text-align: center !important;
		overflow-wrap: break-word !important;
		word-break: break-word !important;
	}

	/* On desktop the subtitle uses `max-width: 110%` and `width: max-content`
	   so it can extend beyond the heading. On mobile that overflows the
	   viewport and cuts text off on the left/right edges. Force it to wrap
	   inside the container instead. */
	.wpr-chs-hero .wpr-chs-slide-subtitle,
	.wpr-chs-slide-subtitle {
		font-size: calc(var(--wpr-chs-subtitle-size) * 0.85) !important;
		max-width: 100% !important;
		width: auto !important;
		text-align: center !important;
		overflow-wrap: break-word !important;
		word-break: break-word !important;
	}

	/* Button — must override the desktop rule which uses the more-specific
	   `a.wpr-chs-slide-btn:link/:visited` selectors with `align-self: flex-start`.
	   Without !important here the button stays left-aligned on mobile. */
	a.wpr-chs-slide-btn,
	a.wpr-chs-slide-btn:link,
	a.wpr-chs-slide-btn:visited {
		align-self: center !important;
		margin-top: 1rem !important;
		font-size: calc(var(--wpr-chs-btn-font-size) * 0.95) !important;
	}

	/* Mobile nav arrows: no background, no shadow — just the arrow glyph. */
	.wpr-chs-swiper .swiper-button-prev,
	.wpr-chs-swiper .swiper-button-next {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		margin-top: 0;
		top: 160px; /* roughly vertical center of the 320px image area */
		background: transparent;
		border-radius: 0;
		--swiper-navigation-size: 22px;
		box-shadow: none;
	}

	.wpr-chs-nav-prev {
		left: 10px;
	}

	.wpr-chs-nav-next {
		right: 10px;
	}

	/* Disable entrance animation on mobile */
	.wpr-chs-slide .wpr-chs-slide-heading,
	.wpr-chs-slide .wpr-chs-slide-subtitle,
	.wpr-chs-slide .wpr-chs-slide-btn {
		opacity: 1;
		transform: translateY(0);
		transition: none;
	}

	/* Pagination spacing */
	.wpr-chs-pagination {
		position: relative;
		margin-top: 0.5rem;
		padding-bottom: 1rem;
	}
}
