/**
 * Intro overlay
 *
 * Self-contained styles for the optional full-screen page intro, ported from the
 * Vacation Kids Club landing page. Deliberately independent of the landing-page
 * Tailwind build (landing-pages/common/app.css + kidsclub.css) so the overlay
 * renders correctly on templates that never load it — i.e. any normal page.
 *
 * All sizes are in px on purpose. The landing pages set
 * `html { font-size: 62.5% !important }` (common/app.css), so a rem there is 10px,
 * while a normal page uses the 16px default — identical rem values would render
 * 1.6x larger here. px keeps this overlay's type matching the landing page's
 * regardless of the host page's root font size. The comments below give the
 * Tailwind class each value comes from.
 *
 * Everything is scoped under .intro-overlay so it cannot leak into page content.
 * Rendered by mmn_render_intro_overlay(); see functions.php.
 */

/* Fonts. Same family names, files, and (absent) font-display as the landing-page
   CSS, so the two overlays load and render identical type. */
@font-face {
	font-family: 'GTAmerica-Bold';
	src: url('../../landing-pages/kidsclub/assets/fonts/GT-America-Standard-Bold.otf') format('opentype');
}

@font-face {
	font-family: 'Kalista-Bold';
	src: url('../../landing-pages/kidsclub/assets/fonts/Kalista%20Script%20Bold.otf') format('opentype');
}

@font-face {
	font-family: 'Editorial-Medium';
	src: url('../../landing-pages/kidsclub/assets/fonts/PPEditorialNew-Medium.otf') format('opentype');
}

/* Scroll lock. Added server-side via body_class so the page never flashes as
   scrollable before the JS runs; removed by the JS when the overlay is closed. */
body.has-intro-overlay {
	overflow: hidden;
	height: 100%;
}

.intro-overlay {
	position: fixed;
	inset: 0;
	/* Above everything the theme stacks: .skip-to-content-link is 100000 and the
	   simpleview-form block goes to 99999992. */
	z-index: 999999999;
	overflow-y: auto;
	overscroll-behavior: none;
	opacity: 1;
	transition: opacity 1s ease-out;
}

/* The theme's skip link slides in on focus at z-index 100000 and is the first tab
   stop, so it would appear over the overlay. It targets #main, which is behind the
   overlay anyway, so hide it until the overlay is dismissed. */
body.has-intro-overlay .skip-to-content-link {
	display: none;
}

.intro-overlay *,
.intro-overlay *::before,
.intro-overlay *::after {
	box-sizing: border-box;
}

.intro-overlay__frame {
	min-height: 100vh;
	background-color: #242e40;
	background-image: url('../../landing-pages/kidsclub/assets/images/argyle.svg');
	background-repeat: repeat;
	background-size: 70px;
}

.intro-overlay__panel {
	position: relative;
	min-height: 100vh;
	background-color: #f2ebe6;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* px-0 md:px-[3rem] — 3rem at a 10px root. Leaves the patterned frame visible
   down each side of the panel on wider screens. */
@media (min-width: 768px) {
	.intro-overlay__frame {
		padding-left: 30px;
		padding-right: 30px;
	}
}

/* --- Intro state (image + call to action) --------------------------------- */

.intro-overlay__intro {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 90%;
	max-width: 720px;
	margin-inline: auto;
	text-align: center;
	opacity: 1;
	transition: opacity 1s ease;
}

/* w-[400px] md:w-[550px] */
.intro-overlay__image {
	display: block;
	width: 400px;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

/* text-6xl md:text-7xl, pt-8 pb-6 md:pt-12, tracking-wide, uppercase.
   font-weight matches the landing page's body weight, which these inherit. */
.intro-overlay__heading {
	margin: 0;
	padding-top: 20px;
	padding-bottom: 15px;
	color: #212e42;
	font-family: 'Editorial-Medium', serif;
	font-size: 37.5px;
	font-weight: 300;
	line-height: 1;
	letter-spacing: 0.025em;
	text-transform: uppercase;
	text-align: center;
}

@media (min-width: 768px) {
	.intro-overlay__image {
		width: 550px;
	}

	.intro-overlay__heading {
		padding-top: 30px;
		font-size: 45px;
	}
}

/* px-12 py-6 border-2 mt-12 text-3xl */
.intro-overlay__apply {
	display: block;
	margin: 30px auto 0;
	padding: 15px 30px;
	width: auto;
	border: 2px solid #212e42;
	border-radius: 0;
	background-color: transparent;
	color: #212e42;
	font-family: 'GTAmerica-Bold', Arial, Helvetica, sans-serif;
	font-size: 18.75px;
	font-weight: 300;
	line-height: 22.5px;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.intro-overlay__apply:hover,
.intro-overlay__apply:focus-visible {
	background-color: #212e42;
	color: #ffffff;
}

/* mt-20 border-b-2, with the landing page's inherited body type (1.4rem/1.4/300). */
.intro-overlay__skip {
	display: block;
	margin: 50px auto 0;
	padding: 0 0 1px;
	width: auto;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background-color: transparent;
	color: #212e42;
	font-family: 'GTAmerica-Bold', Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: border-color 0.3s ease;
}

.intro-overlay__skip:hover,
.intro-overlay__skip:focus-visible {
	border-bottom-color: #212e42;
	background-color: transparent;
	color: #212e42;
}

/* --- Form state ----------------------------------------------------------- */

/* w-5/6 lg:max-w-[900px] mt-10 */
.intro-overlay__form {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1;
	width: 83.3333%;
	margin-top: 25px;
	max-height: 90vh;
	overflow-y: auto;
	opacity: 0;
	/* Hidden but still in the DOM, so keep it from swallowing clicks. */
	pointer-events: none;
	transition: opacity 1s ease;
}

@media (min-width: 1024px) {
	.intro-overlay__form {
		max-width: 900px;
	}
}

/* py-24 */
.intro-overlay__form-header {
	padding: 60px 0;
	text-align: center;
}

/* text-8xl mb-10 */
.intro-overlay__form-title {
	margin: 0 0 25px;
	color: #212e42;
	font-family: 'Kalista-Bold', cursive;
	font-size: 60px;
	font-weight: 300;
	line-height: 1;
}

/* text-4xl */
.intro-overlay__form-meta {
	margin: 0;
	color: #212e42;
	font-family: 'GTAmerica-Bold', Arial, Helvetica, sans-serif;
	font-size: 22.5px;
	font-weight: 300;
	line-height: 25px;
}

/* text-5xl */
.intro-overlay__form-meta span {
	font-family: 'Kalista-Bold', cursive;
	font-size: 30px;
	line-height: 1;
}

/* --- State transitions ---------------------------------------------------- */

.intro-overlay.is-form-visible .intro-overlay__intro {
	opacity: 0;
	pointer-events: none;
}

.intro-overlay.is-form-visible .intro-overlay__form {
	opacity: 1;
	pointer-events: auto;
}

.intro-overlay.is-dismissed {
	opacity: 0;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.intro-overlay,
	.intro-overlay__intro,
	.intro-overlay__form,
	.intro-overlay__apply,
	.intro-overlay__skip {
		transition-duration: 0.01ms;
	}
}
