/**
 * SDC Hero Block Styles
 *
 * Hero section styles based on Figma design specifications
 *
 * @package SDC_Theme
 * @since 0.1.0
 */

/* ========================================
   HERO CONTAINER
   ======================================== */

.sdc-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 400px;
	overflow: hidden;
	color: var(--color-white);
	/* Account for fixed header (~88px) + generous spacing (~72px) */
	padding-top: calc(var(--header-height, 88px) + var(--space-6xl));
}

@media (max-width: 768px) {
	.sdc-hero {
		/* Smaller spacing for mobile */
		padding-top: calc(var(--header-height, 88px) + var(--space-xl));
	}
}

/* Full width alignment */
.sdc-hero.alignfull {
	width: 100vw;
	margin-left: calc(-1 * var(--wp--style--root--padding-right, 1.5rem));
	margin-right: calc(-1 * var(--wp--style--root--padding-right, 1.5rem));
}

/* Wide alignment */
.sdc-hero.alignwide {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-left: auto;
	margin-right: auto;
}

/* ========================================
   BACKGROUND LAYERS
   ======================================== */

.sdc-hero__background {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
}

.sdc-hero__color-bg,
.sdc-hero__image,
.sdc-hero__video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sdc-hero__color-bg {
	background-color: var(--color-tertiary);
}

/* ========================================
   OVERLAY (for image/video backgrounds)
   ======================================== */

.sdc-hero__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

/* ========================================
   CONTENT CONTAINER
   ======================================== */

.sdc-hero__container {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--container-max, 1440px);
	margin-left: auto;
	margin-right: auto;
	padding: var(--space-6xl) var(--site-padding);
}

/* Figma padding: 160px left, 240px right on desktop */
@media (min-width: 1024px) {
	.sdc-hero__container {
		padding-left: var(--space-8xl);
		padding-right: var(--space-9xl);
	}
}

@media (max-width: 1023px) {
	.sdc-hero__container {
		padding-left: var(--site-padding);
		padding-right: var(--site-padding);
	}
}

@media (max-width: 768px) {
	.sdc-hero__container {
		padding-top: var(--space-4xl);
		padding-bottom: var(--space-4xl);
	}
}

/* ========================================
   CONTENT WRAPPER
   ======================================== */

.sdc-hero__content {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xl);
	max-width: 100%;
}

/* ========================================
   PRE-HEADER (Date & Author)
   ======================================== */

.sdc-hero__pre-header {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	font-family: var(--font-primary);
	font-size: var(--text-body);
	font-weight: var(--font-weight-regular);
	line-height: var(--leading-loose);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
}

.sdc-hero__date {
	color: var(--color-white);
}

.sdc-hero__separator {
	width: 1px;
	height: 1em;
	background-color: var(--color-primary);
}

.sdc-hero__author {
	color: var(--color-white);
}

/* Responsive pre-header */
@media (max-width: 768px) {
	.sdc-hero__pre-header {
		letter-spacing: var(--tracking-normal);
	}
}

/* ========================================
   HEADLINES (Title & Subheading)
   ======================================== */

.sdc-hero__headlines {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

/* Title - H1 styles from Figma */
.sdc-hero__title {
	font-family: var(--font-primary);
	font-size: var(--text-h1);
	font-weight: var(--font-weight-bold);
	font-style: var(--font-style-normal);
	line-height: var(--leading-normal);
	letter-spacing: var(--tracking-tight);
	text-transform: none;
	color: var(--color-white);
	margin: 0;
}

/* Allow rich text styling within title */
.sdc-hero__title strong,
.sdc-hero__title b {
	font-weight: var(--font-weight-bold);
}

.sdc-hero__title em,
.sdc-hero__title i {
	font-style: var(--font-style-italic);
}

/* Highlight color support in title - ensures cyan highlights use theme primary color */
.sdc-hero__title [style*="color"] {
	color: var(--color-primary) !important;
}

/* Responsive title */
@media (max-width: 1024px) {
	.sdc-hero__title {
		font-size: clamp(48px, 8vw, var(--text-h1));
	}
}

@media (max-width: 768px) {
	.sdc-hero__title {
		font-size: clamp(36px, 10vw, 48px);
		line-height: var(--leading-snug);
	}
}

/* Subheading - Body Medium from Figma */
.sdc-hero__subheading {
	font-family: var(--font-primary);
	font-size: var(--text-body-medium);
	font-weight: var(--font-weight-regular);
	font-style: var(--font-style-normal);
	line-height: var(--leading-loose);
	letter-spacing: var(--tracking-normal);
	color: var(--color-white);
	margin: 0;
	max-width: var(--container-narrow, 800px);
}

@media (max-width: 768px) {
	.sdc-hero__subheading {
		font-size: var(--text-body);
	}
}

/* ========================================
   TAGS
   ======================================== */

.sdc-hero__tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-md);
}

.sdc-hero__tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-md);
	font-family: var(--font-primary);
	font-size: var(--text-label);
	font-weight: var(--font-weight-regular);
	line-height: var(--leading-tight);
	color: var(--color-muted);
	background-color: var(--color-glass);
	backdrop-filter: var(--backdrop-blur);
	-webkit-backdrop-filter: var(--backdrop-blur);
	border-radius: var(--radius-md);
}

/* ========================================
   CTA BUTTON
   ======================================== */

.sdc-hero__cta {
	display: flex;
	gap: var(--space-md);
}

/* ========================================
   CURVED WAVE
   ======================================== */

.sdc-hero__wave {
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 100%;
	z-index: 2;
	color: var(--color-white);
	pointer-events: none;
	line-height: 0;
	overflow: hidden;
}

.sdc-hero__wave svg {
	display: block;
	width: 100%;
	/* Scale proportionally: 64px at 1440px viewport, scales down for smaller screens */
	height: min(4.444vw, 64px);
}

/* Responsive wave - cap at 40px for smaller screens */
@media (max-width: 768px) {
	.sdc-hero__wave svg {
		height: min(5.333vw, 40px);
	}
}

/* Add padding when wave is present to prevent content overlap */
.sdc-hero:has(.sdc-hero__wave) {
	padding-bottom: min(4.444vw, 64px);
}

@media (max-width: 768px) {
	.sdc-hero:has(.sdc-hero__wave) {
		padding-bottom: min(5.333vw, 40px);
	}
}

/* ========================================
   BACKGROUND-SPECIFIC VARIATIONS
   ======================================== */

/* All backgrounds: ensure white text for contrast */
.sdc-hero .sdc-hero__title,
.sdc-hero .sdc-hero__subheading,
.sdc-hero .sdc-hero__date,
.sdc-hero .sdc-hero__author {
	color: var(--color-white);
}

/* Image/Video backgrounds: add text shadow for readability over busy backgrounds */
.sdc-hero--bg-image .sdc-hero__title,
.sdc-hero--bg-video .sdc-hero__title,
.sdc-hero--bg-image .sdc-hero__subheading,
.sdc-hero--bg-video .sdc-hero__subheading,
.sdc-hero--bg-image .sdc-hero__date,
.sdc-hero--bg-video .sdc-hero__date,
.sdc-hero--bg-image .sdc-hero__author,
.sdc-hero--bg-video .sdc-hero__author {
	text-shadow: var(--shadow-text, 0 1px 3px rgba(0, 0, 0, 0.3));
}

/* ========================================
   EDITOR MODE STYLES
   ======================================== */

/* Adjustments for when inside the block editor */
.wp-block-acf-hero .sdc-hero.alignfull {
	width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.sdc-hero__video {
		display: none;
	}
}

/* Focus styles */
.sdc-hero__cta .btn:focus {
	outline: none;
}

.sdc-hero__cta .btn:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

/* ========================================
   CONTENT ALIGNMENT VARIATIONS
   ======================================== */

/* Centered content variant */
.sdc-hero--centered .sdc-hero__content {
	align-items: center;
	text-align: center;
}

.sdc-hero--centered .sdc-hero__tags {
	justify-content: center;
}

.sdc-hero--centered .sdc-hero__pre-header {
	justify-content: center;
}
