/* =========================================================
   Uniteds Grit - Hero Slider
   ========================================================= */

.ug-hero-slider {
	--ug-hero-height: 600px;
	--ug-hero-radius: 0px;
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
}

.ug-hero-slider *,
.ug-hero-slider *::before,
.ug-hero-slider *::after {
	box-sizing: border-box;
}

/* When the shortcode is rendered inside a Shortcode block, WordPress wraps
   it in <div class="wp-block-shortcode">. That wrapper inherits the theme's
   max-width, which can prevent "full" from reaching the viewport edges.
   Neutralize the wrapper when it directly contains our slider. */
.wp-block-shortcode:has(> .ug-hero-slider.ug-hero-width-full),
.wp-block-shortcode:has(> .ug-hero-slider.ug-hero-width-parent) {
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* ---------- Width modes (from Page Header plugin) ----------
   Uses !important to win against theme rules like
   .entry-content > *:not(.alignwide):not(.alignfull) that set max-width.
*/

.ug-hero-slider.ug-hero-width-full {
	width: 100vw !important;
	max-width: none !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
}

.ug-hero-slider.ug-hero-width-parent {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.ug-hero-slider.ug-hero-width-wide {
	width: 100% !important;
	max-width: 1400px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.ug-hero-slider.ug-hero-width-boxed {
	width: 100% !important;
	max-width: 1200px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ---------- Viewport / Track ---------- */

.ug-hero-viewport {
	position: relative;
	width: 100%;
	height: var(--ug-hero-height);
	overflow: hidden;
	border-radius: var(--ug-hero-radius);
}

.ug-hero-track {
	position: relative;
	width: 100%;
	height: 100%;
}

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

.ug-hero-slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.ug-hero-slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.ug-hero-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	user-select: none;
	-webkit-user-drag: none;
}

.ug-hero-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* ---------- Transition: fade ---------- */

.ug-hero-transition-fade .ug-hero-slide {
	transition: opacity 600ms ease, visibility 600ms ease;
}

@media (prefers-reduced-motion: reduce) {
	.ug-hero-transition-fade .ug-hero-slide {
		transition: opacity 200ms ease, visibility 200ms ease;
	}
}

/* ---------- Transition: slide ---------- */

.ug-hero-transition-slide .ug-hero-track {
	display: flex;
	transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.ug-hero-transition-slide .ug-hero-slide {
	position: relative;
	flex: 0 0 100%;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	.ug-hero-transition-slide .ug-hero-track {
		transition: transform 200ms ease;
	}
}

/* ---------- Content ---------- */

.ug-hero-content {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: 32px 48px;
	z-index: 2;
}

.ug-hero-align-left .ug-hero-content    { justify-content: flex-start; text-align: left; }
.ug-hero-align-center .ug-hero-content  { justify-content: center; text-align: center; }
.ug-hero-align-right .ug-hero-content   { justify-content: flex-end; text-align: right; }

.ug-hero-content-inner {
	max-width: 800px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ug-hero-align-center .ug-hero-content-inner {
	align-items: center;
}

.ug-hero-align-left .ug-hero-content-inner {
	align-items: flex-start;
}

.ug-hero-align-right .ug-hero-content-inner {
	align-items: flex-end;
}

.ug-hero-frase {
	margin: 0;
	font-size: clamp(14px, 1.2vw, 18px);
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.4;
	opacity: 0.95;
}

.ug-hero-big-text {
	margin: 0;
	font-size: clamp(28px, 4.5vw, 56px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: inherit;
}

.ug-hero-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	background: #ffffff;
	color: #111111;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 999px;
	transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
	margin-top: 8px;
	border: none;
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
}

.ug-hero-button:hover,
.ug-hero-button:focus-visible {
	background: #f3f3f3;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	color: #111111;
}

.ug-hero-button:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 3px;
}

/* ---------- Arrows ---------- */

.ug-hero-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.85);
	color: #111111;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
	transition: background 150ms ease, transform 150ms ease;
	padding: 0;
}

.ug-hero-arrow:hover {
	background: #ffffff;
}

.ug-hero-arrow:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.ug-hero-arrow svg {
	width: 22px;
	height: 22px;
}

.ug-hero-arrow-prev { left: 16px; }
.ug-hero-arrow-next { right: 16px; }

/* ---------- Dots ---------- */

.ug-hero-dots {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 10px;
	z-index: 3;
	padding: 8px 12px;
	border-radius: 999px;
}

.ug-hero-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.9);
	background: transparent;
	padding: 0;
	cursor: pointer;
	transition: background 150ms ease, transform 150ms ease;
}

.ug-hero-dot.is-active {
	background: #ffffff;
	transform: scale(1.15);
}

.ug-hero-dot:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* ---------- Empty state ---------- */

.ug-hero-empty {
	padding: 24px;
	border: 1px dashed #ccc;
	background: #fafafa;
	text-align: center;
	color: #666;
	border-radius: 4px;
}

/* ---------- Mobile responsive ---------- */

@media (max-width: 768px) {
	.ug-hero-slider {
		--ug-hero-height: min(70vh, 500px);
	}

	.ug-hero-content {
		padding: 24px 20px;
	}

	.ug-hero-content-inner {
		gap: 12px;
		max-width: 100%;
	}

	.ug-hero-arrow {
		width: 36px;
		height: 36px;
	}

	.ug-hero-arrow svg {
		width: 18px;
		height: 18px;
	}

	.ug-hero-arrow-prev { left: 8px; }
	.ug-hero-arrow-next { right: 8px; }

	.ug-hero-dots {
		bottom: 12px;
		gap: 8px;
	}

	.ug-hero-dot {
		width: 8px;
		height: 8px;
	}

	.ug-hero-button {
		padding: 10px 22px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.ug-hero-slider {
		--ug-hero-height: min(80vh, 420px);
	}

	.ug-hero-content {
		padding: 20px 16px;
	}

	.ug-hero-frase {
		font-size: 13px;
	}
}
