/**
 * RISE hero + home transparent/frosted header.
 * RTL Arabic site. Palette is the locked RISE film grade.
 */

.fg-rise {
	--rise-ink: #0E1116;
	--rise-vellum: #E8DFC8;
	--rise-amber: #C8902E;
	--rise-concrete: #9A8268;
	--rise-teal: #1B3A4B;
	--rise-glass: #F4F1EA;

	position: relative;
	background: var(--rise-ink);
}

.fg-rise__sticky {
	position: relative;
	width: 100%;
	height: 100vh;
	overflow: hidden;
}

.fg-rise__poster,
.fg-rise__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

/* Poster sits behind the (initially transparent) canvas for instant paint. */
.fg-rise__poster {
	background: var(--rise-ink);
	transition: opacity 0.6s ease;
}

/* Once the canvas has drawn its first frame, fade the poster out. */
.fg-rise--drawn .fg-rise__poster {
	opacity: 0;
}

/* Video is only used for the mobile / reduced-motion fallback. */
.fg-rise__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: none;
	background: var(--rise-ink);
}

.fg-rise__grade {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(to bottom, rgba(14, 17, 22, 0.45), rgba(14, 17, 22, 0) 16%),
		radial-gradient(120% 80% at 70% 20%, rgba(200, 144, 46, 0.10), transparent 60%),
		linear-gradient(to top, rgba(14, 17, 22, 0.72) 0%, rgba(14, 17, 22, 0.15) 38%, rgba(14, 17, 22, 0) 60%);
}

.fg-rise__beats {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.fg-rise__beat {
	position: absolute;
	bottom: clamp(5rem, 15vh, 10rem);
	inset-inline-start: clamp(1.25rem, 6vw, 6rem);
	inset-inline-end: clamp(1.25rem, 6vw, 6rem);
	text-align: right;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fg-rise__beat.is-active {
	opacity: 1;
	transform: none;
}

.fg-rise__beat-title {
	margin: 0 0 0.75rem;
	font-family: 'Cairo', sans-serif;
	font-weight: 800;
	font-size: clamp(2rem, 1rem + 4.5vw, 5rem);
	line-height: 1.08;
	color: var(--rise-vellum);
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.fg-rise__beat-sub {
	margin: 0;
	max-width: 52ch;
	font-family: 'Tajawal', sans-serif;
	font-weight: 500;
	font-size: clamp(1rem, 0.9rem + 0.6vw, 1.4rem);
	color: rgba(244, 241, 234, 0.82);
}

.fg-rise__cta {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1.5rem;
	padding: 0.85rem 1.6rem;
	border-radius: 4px;
	background: var(--rise-amber);
	color: var(--rise-ink);
	font-family: 'Cairo', sans-serif;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.fg-rise__cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 30px rgba(200, 144, 46, 0.35);
	background: #d89c34;
}

.fg-rise__cta:focus-visible {
	outline: 2px solid var(--rise-teal);
	outline-offset: 3px;
}

.fg-rise__cue {
	position: absolute;
	inset-inline: 0;
	bottom: 1.5rem;
	margin: auto;
	width: 26px;
	height: 42px;
	border: 2px solid rgba(244, 241, 234, 0.6);
	border-radius: 14px;
}

.fg-rise__cue span {
	position: absolute;
	left: 50%;
	top: 8px;
	width: 4px;
	height: 8px;
	margin-left: -2px;
	border-radius: 2px;
	background: var(--rise-vellum);
	animation: fg-rise-cue 1.6s ease-in-out infinite;
}

@keyframes fg-rise-cue {
	0% { opacity: 0; transform: translateY(0); }
	30% { opacity: 1; }
	100% { opacity: 0; transform: translateY(14px); }
}

/* Static fallback (mobile / reduced motion): looping video + stacked beats. */
.fg-rise.is-static .fg-rise__sticky {
	height: auto;
	overflow: visible;
}

.fg-rise.is-static .fg-rise__poster,
.fg-rise.is-static .fg-rise__canvas,
.fg-rise.is-static .fg-rise__cue {
	display: none;
}

.fg-rise.is-static .fg-rise__video {
	display: block;
	position: relative;
	height: 60vh;
}

.fg-rise.is-static .fg-rise__grade {
	height: 60vh;
	bottom: auto;
}

.fg-rise.is-static .fg-rise__beats {
	position: static;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 2.5rem clamp(1.25rem, 6vw, 4rem);
	background: var(--rise-ink);
}

.fg-rise.is-static .fg-rise__beat {
	position: static;
	inset: auto;
	opacity: 1;
	transform: none;
}

/* ------------------------------------------------------------------ *
 * Home transparent header.
 * The header overlays the hero and stays fully transparent WHILE the hero
 * is in view (body.fg-hero-overlay — toggled by fg-hero-rise.js from the
 * hero's own scroll bounds, NOT the theme's 500px threshold). Once scrolled
 * PAST the hero it hands off to the theme's sticky bar, styled frosted here.
 * Scoped under body.fg-home-transparent so other pages are untouched.
 * ------------------------------------------------------------------ */
body.fg-home-transparent #fg-page {
	position: relative;
}

/* Overlay the header on the hero instead of taking layout space. */
body.fg-home-transparent .th-header {
	position: absolute;
	top: 0;
	inset-inline: 0;
	z-index: 41;
}

/* Slimmer header on the home page (was ~107px). */
body.fg-home-transparent .th-header .menu-area {
	padding-top: 10px !important;
	padding-bottom: 10px !important;
}

/* The theme's sticky state adds extra padding — keep the slim height in both
   states so the header doesn't grow when docked/scrolled. */
body.fg-home-transparent .sticky-wrapper.sticky {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* The theme balloons nav-link padding to ~41px when docked; keep it compact
   so the header height stays consistent in both states. */
body.fg-home-transparent .sticky-wrapper.sticky .main-menu > ul > li > a {
	padding-top: 6px !important;
	padding-bottom: 6px !important;
}

/* While over the hero: keep the header FIXED so the menu stays visible the
   whole time instead of scrolling away, and stop the theme's inner sticky
   bar from independently fixing/animating on top of the fixed header. */
body.fg-home-transparent.fg-hero-overlay .th-header {
	position: fixed !important;
}

body.fg-home-transparent.fg-hero-overlay .sticky-wrapper,
body.fg-home-transparent.fg-hero-overlay .sticky-wrapper.sticky {
	position: static !important;
	animation: none !important;
}

/* Menu text stays light on home while over the dark hero. */
body.fg-home-transparent .th-header .main-menu > ul > li > a,
body.fg-home-transparent .th-header .header-links a,
body.fg-home-transparent .th-header .header-links i {
	color: var(--rise-vellum, #E8DFC8);
}

body.fg-home-transparent:not(.fg-hero-overlay) .sticky-wrapper.sticky .main-menu > ul > li > a,
body.fg-home-transparent:not(.fg-hero-overlay) .sticky-wrapper.sticky .header-links a,
body.fg-home-transparent:not(.fg-hero-overlay) .sticky-wrapper.sticky .header-links i {
	color: var(--fg-color-text, #2d2d2d);
}

/* While over the hero: force everything transparent — even if the theme has
   already added its .sticky class during the pinned scroll. */
body.fg-home-transparent.fg-hero-overlay .th-header,
body.fg-home-transparent.fg-hero-overlay .th-header .header-top,
body.fg-home-transparent.fg-hero-overlay .th-header .menu-area,
body.fg-home-transparent.fg-hero-overlay .sticky-wrapper,
body.fg-home-transparent.fg-hero-overlay .sticky-wrapper.sticky {
	background: transparent !important;
	border-bottom: 0 !important;
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	box-shadow: none !important;
}

/* On the hero, keep the header minimal: nav links + logo only.
   The CTA button and any info/social bars are hidden while over the hero
   (they return on the frosted bar once scrolled past it). The mobile menu
   toggle is a <button>, not .th-btn, so it is unaffected. */
body.fg-home-transparent.fg-hero-overlay .th-header .th-btn,
body.fg-home-transparent.fg-hero-overlay .th-header .header-top,
body.fg-home-transparent.fg-hero-overlay .th-header .header-links,
body.fg-home-transparent.fg-hero-overlay .th-header .social-links {
	display: none !important;
}

/* Scrolled PAST the hero: theme's fixed sticky bar, frosted. */
body.fg-home-transparent:not(.fg-hero-overlay) .sticky-wrapper.sticky {
	background-color: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: blur(12px) saturate(1.1);
	backdrop-filter: blur(12px) saturate(1.1);
	box-shadow: 0 1px 0 rgba(13, 61, 71, 0.06), 0 10px 30px rgba(6, 42, 51, 0.12);
}

@media (prefers-reduced-motion: reduce) {
	.fg-rise__cue span {
		animation: none;
	}
}

/* Hide the floating WhatsApp + scroll-to-top buttons while over the hero. */
body.fg-home-transparent.fg-hero-overlay .fg-whatsapp-float,
body.fg-home-transparent.fg-hero-overlay .scroll-top {
	display: none !important;
}

/* Mobile: compact beats, full-width subtitle. */
@media (max-width: 768px) {
	.fg-rise__beat {
		bottom: clamp(4.5rem, 13vh, 8rem);
		inset-inline-start: 1.25rem;
		inset-inline-end: 1.25rem;
	}

	.fg-rise__beat-sub {
		max-width: none;
	}
}
