/*
 * Faiha homepage hero (Checkpoint F).
 *
 * Content is ordinary block content on the Home page (core Group
 * "faiha-hero": eyebrow paragraph, H1, phrase list, text, buttons);
 * functions.php turns the H1 + phrase list into the rotator markup at
 * render time and hero.js only swaps classes on it.
 *
 * Permanently dark brand surface: raw navy/red/on-dark tokens only, never
 * the light/dark semantic tokens, so the theme toggle does not affect it
 * (same approach as header.css and preloader.css).
 *
 * The header sits over the hero (Kadence transparent header on the front
 * page), so the hero reserves the header height at the top.
 */

.faiha-hero.wp-block-group {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 43.75rem; /* 700px incl. the 80px header, within the approved 680-720px */
	margin-block: 0;
	padding: calc(var(--faiha-header-offset) + var(--faiha-header-height) + var(--faiha-space-2xl)) var(--faiha-container-padding) var(--faiha-space-2xl);
	/*
	 * Ajman skyline/waterfront (existing Media Library asset #114) under a
	 * strong navy overlay, so the typography stays the focus. Layers, top
	 * to bottom: fade to solid navy at the bottom edge (blends into the
	 * trust band) · uniform ~80% navy overlay · the photo. No parallax.
	 */
	--hero-photo: url("/wp-content/uploads/2026/07/faiha-typing-services-ajman-visa-services-2048x1152.webp");
	background-color: var(--faiha-navy-900);
	background-image:
		linear-gradient(to bottom, transparent 55%, var(--faiha-navy-900) 100%),
		radial-gradient(ellipse 62% 58% at 50% 45%, rgba(4, 17, 26, 0.85), transparent 100%),
		linear-gradient(rgba(4, 17, 26, 0.82), rgba(4, 17, 26, 0.82)),
		var(--hero-photo);
	background-position: center, center, center, center 62%;
	background-size: cover, cover, cover, cover;
	background-repeat: no-repeat;
	color: var(--faiha-text-on-dark);
	text-align: center;
}

@media (max-width: 1536px) {
	.faiha-hero.wp-block-group {
		--hero-photo: url("/wp-content/uploads/2026/07/faiha-typing-services-ajman-visa-services-1536x864.webp");
	}
}

@media (max-width: 767px) {
	.faiha-hero.wp-block-group {
		--hero-photo: url("/wp-content/uploads/2026/07/faiha-typing-services-ajman-visa-services-1024x576.webp");
	}
}

.faiha-hero.wp-block-group > * {
	width: 100%;
	max-width: 62rem;
	margin-inline: auto;
}

/* Eyebrow */

.faiha-hero .faiha-hero__eyebrow {
	width: auto;
	margin-block: 0 var(--faiha-space-md);
	padding: 0.5rem 1rem;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	color: var(--faiha-text-on-dark-secondary);
	font-family: var(--faiha-font-heading);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-wrap: balance;
}

/* Heading: fixed lead line + rotating phrase line, one H1 */

.faiha-hero .faiha-hero__title {
	margin-block: 0;
	color: var(--faiha-text-on-dark);
	font-family: var(--faiha-font-heading);
	font-size: var(--faiha-text-hero-h1);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.faiha-hero .faiha-hero__lead {
	display: block;
}

/*
 * All phrases share one grid cell, so the line is always as wide/tall as
 * the longest phrase: switching phrases never shifts the layout.
 */
.faiha-hero .faiha-hero__rotator {
	display: grid;
	justify-items: center;
	align-items: center;
	margin-top: 0.12em;
	font-size: var(--faiha-text-hero-rotating);
	line-height: 1.08;
	color: var(--faiha-color-brand);
}

/*
 * Invisible sizers: the two longest phrases (data attributes from
 * functions.php) as CSS generated content, not text, so they reserve the
 * line from the first paint without ever being part of the H1.
 */
.faiha-hero .faiha-hero__rotator::before,
.faiha-hero .faiha-hero__rotator::after {
	content: attr(data-sizer-1);
	grid-area: 1 / 1;
	max-width: 100%;
	text-wrap: balance;
	visibility: hidden;
	pointer-events: none;
}

.faiha-hero .faiha-hero__rotator::after {
	content: attr(data-sizer-2);
}

/* Phrases added by hero.js draw their text as generated content (aria-hidden, not H1 text). */
.faiha-hero .faiha-hero__phrase[data-text]::before {
	content: attr(data-text);
}

.faiha-hero .faiha-hero__phrase {
	grid-area: 1 / 1;
	max-width: 100%;
	text-wrap: balance;
	opacity: 0;
	transform: translateY(0.3em);
	transition:
		opacity 500ms var(--faiha-ease-standard),
		transform 500ms var(--faiha-ease-standard);
}

.faiha-hero .faiha-hero__phrase.is-active {
	opacity: 1;
	transform: none;
}

.faiha-hero .faiha-hero__phrase.is-leaving {
	opacity: 0;
	transform: translateY(-0.3em);
}

/* Supporting text */

.faiha-hero .faiha-hero__text {
	max-width: 40rem;
	margin-block: var(--faiha-space-md) 0;
	color: var(--faiha-text-on-dark-secondary);
	font-family: var(--faiha-font-primary);
	font-size: clamp(1rem, calc(0.94rem + 0.25vw), 1.1875rem);
	line-height: 1.6;
	text-wrap: pretty;
}

/* Calls to action */

.faiha-hero .faiha-hero__actions {
	gap: var(--faiha-space-xs);
	margin-block: var(--faiha-space-xl) 0;
}

.faiha-hero .faiha-hero__cta .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 3rem;
	padding: 0.75rem 1.5rem;
	border: 1px solid transparent;
	border-radius: var(--faiha-radius-button);
	font-family: var(--faiha-font-heading);
	font-size: 1rem;
	font-weight: var(--faiha-weight-button);
	line-height: 1.2;
	text-decoration: none;
	transition:
		background-color var(--faiha-duration-fast) var(--faiha-ease-standard),
		border-color var(--faiha-duration-fast) var(--faiha-ease-standard);
}

/* Normal-size label on red: the accessible red (see foundation.css). */
.faiha-hero .faiha-hero__cta--primary .wp-block-button__link {
	background-color: var(--faiha-color-brand-strong);
	color: var(--faiha-text-on-dark);
}

.faiha-hero .faiha-hero__cta--primary .wp-block-button__link:hover {
	background-color: color-mix(in srgb, var(--faiha-color-brand-strong) 86%, #000);
	color: var(--faiha-text-on-dark);
}

.faiha-hero .faiha-hero__cta--whatsapp .wp-block-button__link {
	background-color: transparent;
	border-color: rgba(255, 255, 255, 0.28);
	color: var(--faiha-text-on-dark);
}

.faiha-hero .faiha-hero__cta--whatsapp .wp-block-button__link:hover {
	background-color: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.5);
	color: var(--faiha-text-on-dark);
}

.faiha-hero .wp-block-button__link:focus-visible,
.faiha-hero button.faiha-hero__pause:focus-visible {
	/* Longhands: Chromium drops the outline shorthand when it contains var() (see foundation.css). */
	outline-width: 2px;
	outline-style: solid;
	outline-color: var(--faiha-text-on-dark);
	outline-offset: 3px;
}

/* Pause control (added by hero.js only while the phrase can rotate). */

.faiha-hero .faiha-hero__pause {
	position: absolute;
	right: var(--faiha-container-padding);
	bottom: var(--faiha-space-md);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	max-width: none;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 50%;
	background: transparent;
	color: var(--faiha-text-on-dark-secondary);
	cursor: pointer;
	/* Not Kadence's `transition: all` on buttons, so the focus ring appears instantly. */
	transition:
		border-color var(--faiha-duration-fast) var(--faiha-ease-standard),
		color var(--faiha-duration-fast) var(--faiha-ease-standard);
}

.faiha-hero .faiha-hero__pause:hover {
	border-color: rgba(255, 255, 255, 0.4);
	color: var(--faiha-text-on-dark);
}

.faiha-hero .faiha-hero__pause svg {
	width: 1rem;
	height: 1rem;
}

.faiha-hero .faiha-hero__pause [data-icon="play"],
.faiha-hero .faiha-hero__pause[data-state="paused"] [data-icon="pause"] {
	display: none;
}

.faiha-hero .faiha-hero__pause[data-state="paused"] [data-icon="play"] {
	display: block;
}

/* Tablet */

@media (max-width: 1024px) {
	.faiha-hero.wp-block-group {
		min-height: 38rem;
	}
}

/* Mobile */

@media (max-width: 600px) {
	.faiha-hero.wp-block-group {
		min-height: 0;
		padding-top: calc(var(--faiha-header-height) + var(--faiha-space-xl));
		padding-bottom: var(--faiha-space-lg);
	}

	/* Centred under the stacked full-width buttons, so it never overlaps them. */
	.faiha-hero .faiha-hero__pause {
		right: auto;
		bottom: var(--faiha-space-lg);
		left: 50%;
		transform: translateX(-50%);
	}
}

/*
 * Reserve the pause button's space from the first paint whenever hero.js
 * will add it (JavaScript on: Kadence removes .no-js in <head>; motion
 * allowed), so inserting it causes no layout shift.
 */
@media (max-width: 600px) and (prefers-reduced-motion: no-preference) {
	html:not(.no-js) .faiha-hero.wp-block-group {
		padding-bottom: calc(var(--faiha-space-lg) + 2.75rem + var(--faiha-space-md));
	}

	.faiha-hero .faiha-hero__eyebrow {
		font-size: 0.6875rem;
		letter-spacing: 0.08em;
	}

	.faiha-hero .faiha-hero__actions {
		flex-direction: column;
		align-items: stretch;
		max-width: 22rem;
	}

	.faiha-hero .faiha-hero__cta,
	.faiha-hero .faiha-hero__cta .wp-block-button__link {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.faiha-hero .faiha-hero__phrase,
	.faiha-hero .faiha-hero__cta .wp-block-button__link {
		transition: none;
	}
}
