﻿/**
 * Fullscreen WebGL hero slider — layout, preloader and overlay styling.
 * The shader/canvas visuals themselves live entirely in JS; this file
 * only positions things and handles the non-WebGL chrome (text,
 * arrows, indicators, preloader).
 */

body.ciseo-fullscreen-hero {
	overflow: hidden;
	height: 100vh;
	margin: 0;
}

html:has( body.ciseo-fullscreen-hero ) {
	overflow: hidden;
}

/* The header pattern overlays the hero instead of pushing it down. */
body.ciseo-fullscreen-hero header.wp-block-template-part {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
	background: transparent;
}

/* Hero text is always light — the WebGL background is always dark
   (neon-on-black images), so text must remain readable in both themes. */
.ciseo-hero,
.ciseo-hero__title,
.ciseo-hero__subtitle,
.ciseo-hero__number,
.ciseo-preloader {
	color: #ededed;
}

/* Strip every constrained-layout width/padding between <main> and the
   hero so the canvas truly runs edge-to-edge — no centered column, no
   side gutters. .ciseo-hero itself is fixed/inset:0 regardless, this
   just removes any doubt (and the padding a screen reader/no-JS
   fallback would otherwise sit inside). */
body.ciseo-fullscreen-hero main.wp-block-group,
body.ciseo-fullscreen-hero .wp-block-post-content {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* .ciseo-hero is a direct child of .wp-block-post-content (the Custom
   HTML block sits right inside it), which is a `layout:constrained`
   container. WordPress's own core CSS auto-applies
   `max-width: var(--wp--style--global--content-size)` (645px here) and
   `margin: 0 auto !important` to every direct child of that container
   — otherwise entirely invisible at narrow widths (which happen to sit
   under 645px) but pinning the hero to a centered 645px column on any
   wider screen. Both must be overridden here, on the element itself,
   not just on the ancestor. */
body.ciseo-fullscreen-hero .ciseo-hero {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	overflow: hidden;
	background-color: var( --wp--preset--color--anthracite, #2b2e33 );
}

.ciseo-hero__canvas-wrap,
.ciseo-hero__content {
	opacity: 0;
	transition: opacity 0.6s ease;
}

.ciseo-hero.is-ready .ciseo-hero__canvas-wrap,
.ciseo-hero.is-ready .ciseo-hero__content {
	opacity: 1;
}

.ciseo-hero__canvas-wrap {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.ciseo-hero__canvas-wrap canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.ciseo-hero__hit-area {
	position: absolute;
	inset: 0;
	z-index: 2;
	cursor: pointer;
}

.ciseo-hero__content {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.ciseo-hero__text {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	width: min( 90vw, 1000px );
	text-align: center;
}

/* Very soft, localized scrim behind the text only — never a global
   overlay on the image — purely for legibility over bright photos. */
.ciseo-hero__text::before {
	content: '';
	position: absolute;
	inset: -10% -15%;
	z-index: -1;
	background: radial-gradient( ellipse at center, rgba( 0, 0, 0, 0.32 ) 0%, rgba( 0, 0, 0, 0 ) 70% );
}

.ciseo-hero__number {
	display: block;
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 700;
	font-size: clamp( 0.9rem, 1.4vw, 1.1rem );
	letter-spacing: 0.3em;
	margin-bottom: 1rem;
}

.ciseo-hero__title {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 800;
	font-size: clamp( 56px, 6vw, 110px );
	line-height: 0.9;
	letter-spacing: -0.01em;
	margin: 0 0 1.25rem;
	color: var( --wp--preset--color--secondary, #ededed );
	white-space: pre-line;
}

.ciseo-hero__subtitle {
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: clamp( 1rem, 2vw, 1.375rem );
	font-weight: 400;
	margin: 0;
	color: var( --wp--preset--color--secondary, #ededed );
	opacity: 0.85;
}

.ciseo-hero__arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	pointer-events: auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba( 237, 237, 237, 0.25 );
	background: rgba( 43, 46, 51, 0.35 );
	color: var( --wp--preset--color--secondary, #ededed );
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ciseo-hero__arrow:hover {
	border-color: var( --wp--preset--color--primary, #8841e7 );
	background: rgba( 43, 46, 51, 0.6 );
}

.ciseo-hero__arrow svg {
	width: 18px;
	height: 18px;
}

.ciseo-hero__arrow--prev {
	left: clamp( 12px, 3vw, 32px );
}

.ciseo-hero__arrow--next {
	right: clamp( 12px, 3vw, 32px );
}

.ciseo-hero__indicators {
	position: absolute;
	right: clamp( 20px, 4vw, 48px );
	bottom: clamp( 20px, 4vw, 48px );
	display: flex;
	gap: 10px;
	pointer-events: auto;
}

.ciseo-hero__indicator {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 1px solid rgba( 237, 237, 237, 0.4 );
	background: transparent;
	padding: 0;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.ciseo-hero__indicator.is-active {
	background: var( --wp--preset--color--primary, #8841e7 );
	border-color: var( --wp--preset--color--primary, #8841e7 );
	transform: scale( 1.2 );
}

/* Preloader */

.ciseo-preloader {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: var( --wp--preset--color--anthracite, #2b2e33 );
	transition: opacity 0.5s ease, transform 0.5s ease;
}

.ciseo-preloader.is-instant {
	transition-duration: 0.15s;
}

.ciseo-preloader.is-hidden {
	opacity: 0;
	transform: scale( 1.02 );
	pointer-events: none;
}

.ciseo-preloader__logo {
	display: block;
	width: clamp( 120px, 20vw, 180px );
	height: auto;
	margin-bottom: 1.5rem;
}

.ciseo-preloader__bar-track {
	width: min( 220px, 60vw );
	height: 2px;
	background: rgba( 237, 237, 237, 0.15 );
	border-radius: 2px;
	overflow: hidden;
}

.ciseo-preloader__bar-fill {
	width: 0%;
	height: 100%;
	background: var( --wp--preset--color--primary, #8841e7 );
	transition: width 0.2s ease;
}

@media ( max-width: 600px ) {
	.ciseo-hero__arrow {
		width: 36px;
		height: 36px;
	}

	.ciseo-hero__title {
		font-size: clamp( 36px, 10vw, 56px );
		line-height: 0.95;
	}

	.ciseo-hero__subtitle {
		font-size: clamp( 0.85rem, 3.5vw, 1rem );
	}

	.ciseo-hero__text {
		width: min( 92vw, 1000px );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ciseo-hero__canvas-wrap,
	.ciseo-hero__content,
	.ciseo-preloader {
		transition-duration: 0.15s;
	}
}
