/* ==========================================================================
   Defender — גרסת "סינמה"
   הירו מסך מלא עם צילום, תוכן ממורכז, והדר שצף שקוף ומתהפך ללבן בגלילה.
   נטען רק בעמודים שמשתמשים בתבנית page-cinema. לא נוגע בשאר האתר.
   ========================================================================== */

/* מאפיין רשום — ניתן להנפשה, ומזין את כל מצב ההדר ממספר אחד.
   0 = צף על הווידאו, 1 = לבן מלא. */
@property --hdr {
	syntax: "<number>";
	inherits: true;
	initial-value: 0;
}

/* הדר גבוה יותר בגרסה הזו, כדי לתת ללוגו נוכחות. */
:root { --header-h: 76px; }
@media (min-width: 900px) {
	:root { --header-h: 96px; }
}

/* --------------------------------------------------------------------------
   ההדר הצף
   -------------------------------------------------------------------------- */

.site-header--overlay {
	--hdr: 0;
	position: fixed;
	inset-block-start: 0;
	inset-inline: 0;
	z-index: 60;
	background: rgb(255 255 255 / var(--hdr));
	border-block-end: 1px solid rgb(13 35 64 / calc(var(--hdr) * 0.12));
	-webkit-backdrop-filter: blur(calc(var(--hdr) * 12px));
	backdrop-filter: blur(calc(var(--hdr) * 12px));
	box-shadow: 0 10px 30px -24px rgb(13 35 64 / calc(var(--hdr) * 0.55));
}

/* ההיפוך מונע מציר הגלילה עצמו — CSS נייטיבי, בלי מאזין scroll ובלי JS. */
@supports (animation-timeline: scroll()) {
	@media (prefers-reduced-motion: no-preference) {
		.site-header--overlay {
			animation: hdr-flip linear both;
			animation-timeline: scroll();
			animation-range: 70px 220px;
		}
		@keyframes hdr-flip { to { --hdr: 1; } }
	}
}

/* בלי תמיכה — ההדר פשוט לבן מלא. אף פעם לא טקסט לבן על רקע לבן. */
@supports not (animation-timeline: scroll()) {
	.site-header--overlay { --hdr: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.site-header--overlay { --hdr: 1; }
}

/* הטקסט נע מלבן לאינק לפי אותו מספר. */
.site-header--overlay .site-nav a,
.site-header--overlay .menu-toggle > summary {
	color: color-mix(in oklab, #FFFFFF calc((1 - var(--hdr)) * 100%), var(--c-ink-900));
}

/* התפריט גדול יותר, ומעל הווידאו הוא מקבל הילה: צל כהה צמוד לחדות,
   וזוהר לבן רך לנוכחות. שניהם דועכים לאפס כשההדר נהיה לבן. */
.site-header--overlay .site-nav a {
	/* ‎-10%‎ — בקשת ג'וני (4.8 לילה). חל על ההדר בכל האתר. */
	font-size: 0.9rem;
	font-weight: 500;
}
.site-header--overlay .site-nav a,
.site-header--overlay .menu-toggle > summary {
	text-shadow:
		0 1px 10px rgb(8 23 41 / calc((1 - var(--hdr)) * 0.7)),
		0 0 26px rgb(255 255 255 / calc((1 - var(--hdr)) * 0.32));
}
.site-header--overlay .site-nav ul { gap: clamp(1.25rem, 2.4vw, 2.4rem); }
.site-header--overlay .site-nav a::after { background: var(--c-amber); block-size: 2px; }
.site-header--overlay .menu-toggle > summary {
	border-color: color-mix(in oklab, rgb(255 255 255 / 0.34) calc((1 - var(--hdr)) * 100%), rgb(13 35 64 / 0.24));
}

/* שני הלוגואים מוערמים ומתחלפים בהצלבה — אי אפשר להחליף src מ-CSS. */
.logo-swap { position: relative; display: block; }
.logo-swap img {
	display: block;
	block-size: clamp(30px, 3.4vw, 46px);
	inline-size: auto;
}
/* הלוגו הלבן יושב על צילום — בלי הצל הוא נבלע בבניינים הבהירים. */
.logo-swap .logo-light {
	filter: drop-shadow(0 2px 12px rgb(8 23 41 / 0.6)) drop-shadow(0 0 24px rgb(255 255 255 / 0.22));
}
.logo-swap .logo-dark {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
}
.logo-swap .logo-light { opacity: calc(1 - var(--hdr)); }
.logo-swap .logo-dark { opacity: var(--hdr); }

/* --------------------------------------------------------------------------
   כפתורים — מילוי שנשטף מלמטה, והתווית מתגלגלת
   -------------------------------------------------------------------------- */

.btn-x {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1.15rem 2.4rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	transition: color 320ms var(--ease), border-color 320ms var(--ease),
		box-shadow 380ms var(--ease), transform 220ms var(--ease);
}
.btn-x:hover { text-decoration: none; transform: translateY(-2px); }
.btn-x:active { transform: translateY(0); }

.btn-x::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	transform: translateY(101%);
	transition: transform 480ms var(--ease);
}
.btn-x:hover::before { transform: translateY(0); }

/* גלגול התווית: שני עותקים באותו תא גריד, אחד נכנס והשני יוצא. */
.btn-x__label {
	display: grid;
	overflow: hidden;
	line-height: 1.2;
}
.btn-x__label > span {
	grid-area: 1 / 1;
	transition: transform 460ms var(--ease);
}
.btn-x__label > span:nth-child(2) { transform: translateY(115%); }
.btn-x:hover .btn-x__label > span:nth-child(1) { transform: translateY(-115%); }
.btn-x:hover .btn-x__label > span:nth-child(2) { transform: translateY(0); }

/* גרדיאנט ולא צבע שטוח, עם הארה פנימית בקצה העליון וזוהר מתחת —
   זה מה שנותן לכפתור את התחושה שהוא מרים את עצמו מהמסך.

   4.8, בקשת ג'וני: הזהב הוחלף בכחולים בסגנון הלוגו — brand → blue-600 →
   blue-800 — והטקסט התהפך ללבן (לבן על ‎#4573B6‎ = ‎4.79:1‎ ✓ בסטופ
   הבהיר ביותר). הריחוף מכהה במקום להבהיר: כחול בהיר יותר מפיל את
   הלבן מתחת ל-AA. כל האפקטים — החלפת הלייבל, ההארה הפנימית, הזוהר —
   נשארו; רק הגוון של הזוהר עבר מענבר לכחול העמוק, באותה עוצמה. */
.btn-x--solid {
	background-image: linear-gradient(103deg, #4573B6 0%, #2F5794 50%, #1D3763 100%);
	color: var(--c-white);
	box-shadow:
		0 14px 32px -12px rgb(29 55 99 / 0.7),
		inset 0 1px 0 rgb(255 255 255 / 0.5);
}
.btn-x--solid::before {
	background-image: linear-gradient(103deg, #3E69AC 0%, #28497E 50%, #16294A 100%);
}
.btn-x--solid:hover {
	box-shadow:
		0 20px 44px -12px rgb(29 55 99 / 0.9),
		inset 0 1px 0 rgb(255 255 255 / 0.6);
}

/* על וידאו אי אפשר לסמוך על הפריים — טשטוש רקע נותן לכפתור בסיס יציב. */
.btn-x--line {
	background: rgb(255 255 255 / 0.1);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-color: rgb(255 255 255 / 0.55);
	color: var(--c-white);
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22);
}
.btn-x--line::before { background: var(--c-white); }
.btn-x--line:hover { color: var(--c-ink-900); border-color: var(--c-white); }

/* ה-CTA בהדר קטן יותר מזה שבהירו. */
.site-header--overlay .site-header__cta {
	display: none;
	padding: 0.7rem 1.25rem;
	font-size: var(--fs-micro);
}
@media (min-width: 900px) {
	.site-header--overlay .site-header__cta { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
	.btn-x::before,
	.btn-x__label > span { transition: none; }
}

/* --------------------------------------------------------------------------
   ההירו — מסך מלא, תוכן ממורכז
   -------------------------------------------------------------------------- */

/* בלוק ה-group של וורדפרס מוסיף margin עליון ל-main, וזה חשף רצועת
   רקע מעל הווידאו. ההירו חייב לגעת בקצה העליון. */
.site-main--cinema { margin-block-start: 0; }
.site-main--cinema > .hero--cinema:first-child { margin-block-start: 0; }

.hero--cinema {
	position: relative;
	display: grid;
	/* העמודה חייבת להיות מוגדרת. בלי זה נוצרת עמודה משתמעת בגודל auto
	   שמצטמצמת לרוחב התוכן, ואז אין שטח פנוי ש-margin-inline:auto יכול
	   למרכז בתוכו — הפריט נצמד לקצה ההתחלה. 1fr ממלא את הסקשן. */
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	min-block-size: 100svh;
	/* פדינג סימטרי — זה מה שממרכז באמת. פדינג עליון גדול מהתחתון דוחף
	   את התוכן למטה גם כש-place-items הוא center. הערך מנקה את ההדר
	   הצף גם כשהתוכן גבוה. */
	padding-block: calc(var(--header-h) + var(--s-4));
	overflow: hidden;
	background: var(--c-ink-900);
	text-align: center;
}

.cinema__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.cinema__poster,
.cinema__video {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	object-position: 50% 46%;
}
.cinema__video {
	opacity: 0;
	transition: opacity 1000ms var(--ease);
}
.cinema__video.is-playing { opacity: 1; }

/* החשכה. כהה בראש כדי שההדר הלבן ייקרא, כהה בתחתית כדי שהטקסט ייקרא,
   ופתוח באמצע כדי שהצילום יישאר גלוי.
   העדשה הרדיאלית (ג'וני 6.8): החשכה ממוקדת מאחורי בלוק הטקסט הממורכז —
   הטקסט קופץ בלי להקריב את הצילום בקצוות. לא להמיר לשכבה שטוחה. */
.cinema__scrim {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 72% 60% at 50% 46%, rgb(8 23 41 / 0.52), rgb(8 23 41 / 0) 74%),
		linear-gradient(to bottom, rgb(8 23 41 / 0.74) 0%, rgb(8 23 41 / 0.30) 26%, rgb(8 23 41 / 0.44) 58%, rgb(8 23 41 / 0.88) 100%),
		linear-gradient(to bottom, rgb(13 35 64 / 0.40), rgb(13 35 64 / 0.40));
}

.cinema__inner {
	position: relative;
	z-index: 2;
	inline-size: 100%;
	max-inline-size: 62rem;
	/* מפורש כאן ולא בהסתמכות על .shell — משהו בשרשרת אפס אותו ל-0. */
	margin-inline: auto;
	/* וורדפרס מוסיף margin אנכי לבלוקי group, וזה הסיט את המרכוז האנכי. */
	margin-block: 0;
}

.kicker--center { justify-content: center; color: var(--c-amber); }
.kicker--center::after {
	content: "";
	inline-size: 26px;
	block-size: 2px;
	background: currentColor;
	flex: none;
}

.hero--cinema h1 {
	font-size: clamp(2.2rem, 1.1rem + 4.4vw, 4.4rem);
	line-height: 1.04;
	color: var(--c-white);
	margin-block: var(--s-4);
	text-wrap: balance;
}
.hero--cinema h1 em { font-style: normal; color: var(--c-amber); }

.hero--cinema .lead {
	margin-inline: auto;
	max-inline-size: 44rem;
	color: rgb(255 255 255 / 0.84);
}

.proof--row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--s-3) var(--s-5);
	margin-block: var(--s-5);
	max-inline-size: none;
}
.hero--cinema .proof li { color: rgb(255 255 255 / 0.8); }

.btn-row--center { justify-content: center; }

/* הגילוי הנאות. `text-align: center` יורש מ-`.hero--cinema`, אבל התיבה
   הייתה צמודה לכפתורים: ‎--s-5‎ הוא 32px וזוהר הכפתור הראשי אוכל ממנו
   כ-12px, כך שנשארו פחות מ-20px נראים והשורה נקראה כהערת שוליים של
   הכפתור. הועלה למדרגה הבאה בסקאלה. */
.cinema__disclosure {
	margin-block-start: var(--s-6);
	margin-inline: auto;
	max-inline-size: 58ch;
	text-align: center;
	color: rgb(255 255 255 / 0.5);
}

@media (max-width: 599px) {
	.btn-row--center .btn-x { inline-size: 100%; }
}

/* --------------------------------------------------------------------------
   כניסה
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.cinema__inner > * { animation: cine-in 760ms var(--ease) both; }
	.cinema__inner > .kicker { animation-delay: 60ms; }
	.cinema__inner > h1 { animation-delay: 120ms; }
	.cinema__inner > .lead { animation-delay: 240ms; }
	.cinema__inner > .proof { animation-delay: 340ms; }
	.cinema__inner > .btn-row { animation-delay: 440ms; }
	.cinema__inner > .cinema__disclosure { animation-delay: 540ms; }

	@keyframes cine-in {
		from { opacity: 0; transform: translateY(20px); }
		to { opacity: 1; transform: none; }
	}

	/* הצילום נסחף לאט כלפי מעלה בגלילה. */
	@supports (animation-timeline: view()) {
		.cinema__media {
			animation: cine-drift linear both;
			animation-timeline: view();
			animation-range: entry 0% exit 100%;
		}
		/* ההגדלה חייבת להיות גדולה מההזזה, אחרת נחשפת רצועה בקצה. */
		@keyframes cine-drift {
			from { transform: scale(1.14) translateY(1.5%); }
			to { transform: scale(1.14) translateY(-4.5%); }
		}
	}
}
