/*
 * Jordan Festival — "Be the First to Know" (template-parts/components/interest-form.php).
 * A navy panel with a faint keffiyeh lattice: the red-rule kicker, the
 * display serif title and a short line. On the homepage two paths side by
 * side, navy (volunteer) and warm ivory (updates, one button reveals the form
 * below them); on a festival page the sheet sits beside the invitation.
 * Fields follow the Contact form's material (square, warm outline, navy
 * focus ring).
 * Loaded only on pages that show it (inc/interest.php).
 */

/* Display serif (SIL OFL, self-hosted), as on the other pages. */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/playfair-display-600-0000.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.bf {
	--bf-ivory: #FBF8F2;
	--bf-ivory-line: #EAE3D7;
	--bf-line-strong: #CDBFA9;
	--bf-error: #B5161C;
	--bf-ok: #1E6B35;
	--bf-cream: #F3E6D3;
	--bf-cream-soft: #F7EFE3;
	padding: 96px 0;
	background: #fff;
}
/* On a festival page: an ivory band after the attend strip, closing the page. */
.bf--festival {
	padding: 72px 0 80px;
	background: var(--bf-ivory);
	border-top: 1px solid var(--bf-ivory-line);
}
[hidden].bf__reveal,
[hidden].bf__sheet { display: none; }

/* The panel ---------------------------------------------------------- */
/* Navy, a red thread along the top and a faint keffiyeh lattice fading in
   from the far side. */
.bf__panel {
	position: relative;
	isolation: isolate;
	overflow: clip;
	padding: 72px 72px 64px;
	background: var(--jf-navy);
	color: #fff;
	box-shadow: inset 0 4px 0 var(--jf-red);
}
.bf__panel :focus-visible { outline-color: #fff; }
.bf__lattice {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	z-index: -1;
	width: 52%;
	background:
		repeating-linear-gradient(45deg, rgba(243, 230, 211, .06) 0 1px, transparent 1px 30px),
		repeating-linear-gradient(-45deg, rgba(243, 230, 211, .06) 0 1px, transparent 1px 30px);
	-webkit-mask-image: linear-gradient(to left, #000 35%, transparent);
	mask-image: linear-gradient(to left, #000 35%, transparent);
	pointer-events: none;
}
[dir="rtl"] .bf__lattice {
	-webkit-mask-image: linear-gradient(to right, #000 35%, transparent);
	mask-image: linear-gradient(to right, #000 35%, transparent);
}
.bf__head {
	display: grid;
	gap: 48px 80px;
	align-items: center;
}
/* Festival page: the invitation beside the sheet. */
.bf--festival .bf__panel {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 40px 64px;
	align-items: start;
}
.bf--festival .bf__head { grid-template-columns: minmax(0, 1fr); }

/* Introduction ------------------------------------------------------- */
.bf__kicker {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--bf-cream);
}
.bf__rule { flex: none; width: 28px; height: 2px; background: var(--jf-red); }
.bf__title {
	font-family: var(--jf-serif);
	font-size: clamp(34px, 3.8vw, 52px);
	font-weight: 600;
	line-height: 1.08;
	color: #fff;
	text-wrap: balance;
}
.bf__text {
	max-width: 34em;
	margin-top: 20px;
	font-size: 17px;
	line-height: 1.7;
	color: #D5DBE8;
	text-wrap: pretty;
}

/* Festival page: the festival named on a small card with a keffiyeh
   selvedge, as on the festival pass, and an "updates only" note. */
.bf__festival {
	position: relative;
	margin-top: 26px;
	padding: 18px 22px 18px calc(22px + 10px);
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .14);
}
[dir="rtl"] .bf__festival { padding: 18px calc(22px + 10px) 18px 22px; }
.bf__festival::before {
	content: "";
	position: absolute;
	inset-block: -1px;
	inset-inline-start: -1px;
	width: 10px;
	background: url("../images/brand/keffiyeh-selvedge.svg") repeat 0 0 / 10px 10px;
}
.bf__festival-name {
	font-family: var(--jf-serif);
	font-size: clamp(22px, 2vw, 26px);
	font-weight: 600;
	line-height: 1.25;
	color: #fff;
	overflow-wrap: break-word;
}
.bf__festival-meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--bf-cream); }
.bf__festival-meta > * + *::before { content: "·"; margin-inline: 10px; color: var(--jf-red); }
.bf__note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	max-width: 34em;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px dashed rgba(255, 255, 255, .28);
	font-size: 14px;
	line-height: 1.6;
	color: var(--bf-cream);
}
.bf__note-icon { flex: none; margin-top: 2px; color: var(--jf-red); }
.bf__reveal {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	min-height: 56px;
	margin-top: auto;
	padding: 0 28px;
	border: 0;
	background: var(--jf-red);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .03em;
	cursor: pointer;
	transition: background-color .2s;
}
.bf__reveal:hover { background: var(--jf-red-dark); }
.bf__reveal:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.bf__reveal-icon { flex: none; transition: transform .25s ease; }
.bf__reveal[aria-expanded="true"] .bf__reveal-icon { transform: rotate(180deg); }

/* Homepage: two paths ------------------------------------------------ */
/* Not a panel with a card inside: navy and warm ivory meet on a keffiyeh
   selvedge with the postmark on it. Clearly not the (navy) footer after it. */
.bf--home .bf__panel { padding: 0; background: none; box-shadow: none; overflow: visible; color: var(--jf-navy); }
.bf__paths {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	box-shadow: 0 24px 48px rgba(13, 30, 65, .14);
}
.bf__paths--single { grid-template-columns: minmax(0, 1fr); }
.bf__path {
	position: relative;
	isolation: isolate;
	overflow: clip;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	padding: clamp(48px, 5vw, 72px) clamp(56px, 5.4vw, 80px);
}
.bf__path--volunteer { background: var(--jf-navy); color: #fff; box-shadow: inset 0 4px 0 var(--jf-red); }
.bf__path--updates { background: var(--bf-cream-soft); color: var(--jf-navy); box-shadow: inset 0 4px 0 var(--jf-red); }
.bf__path .bf__title { font-size: clamp(30px, 2.9vw, 42px); }
.bf__path .bf__text { margin-bottom: 30px; }
.bf__path--updates .bf__kicker,
.bf__path--updates .bf__title { color: var(--jf-navy); }
.bf__path--updates .bf__text { color: var(--jf-ink-2); }
.bf__panel .bf__path--updates :focus-visible,
.bf__panel .bf-form :focus-visible { outline-color: var(--jf-navy); }
.bf__cta {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	margin-top: auto;
	padding: 0 28px;
	border: 1.5px solid rgba(255, 255, 255, .72);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .03em;
	transition: background-color .2s, color .2s, border-color .2s;
}
.bf__cta:hover { border-color: #fff; background: #fff; color: var(--jf-navy); }
.bf__cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.bf__seam {
	position: absolute;
	inset-block: 0;
	left: 50%;
	z-index: 1;
	width: 14px;
	margin-left: -7px;
	background: url("../images/brand/keffiyeh-selvedge.svg") repeat 0 0 / 14px 14px;
}
.bf__postmark {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 80px;
	height: 80px;
	margin: -40px 0 0 -40px;
	border-radius: 50%;
	background: var(--jf-red);
	box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(4, 12, 30, .3);
	outline: 1px dashed rgba(255, 255, 255, .7);
	outline-offset: -7px;
	transform: rotate(-12deg);
}
.bf__postmark img { width: 28px; height: auto; }
.bf--home .bf__sheet { margin-top: 0; }
.bf--home .bf-form { box-shadow: 0 24px 48px rgba(13, 30, 65, .14); }

/* The sheet ---------------------------------------------------------- */
.bf__sheet { position: relative; margin-top: 48px; }
.bf--festival .bf__sheet { margin-top: 0; }
.bf-form {
	position: relative;
	padding: 40px 44px 36px;
	background: var(--bf-ivory);
	border-top: 3px solid var(--jf-red);
	box-shadow: 0 24px 48px rgba(4, 12, 30, .35);
	color: var(--jf-navy);
}
.bf--home .bf-interests__list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bf--home .bf-interests__list > li { display: grid; }

.bf-form__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px 20px;
}
.bf-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bf-field__label { font-size: 15px; font-weight: 700; color: var(--jf-navy); }
.bf-field__optional { font-weight: 400; color: var(--jf-muted); }
.bf-field__input {
	width: 100%;
	min-height: 56px;
	padding: 14px 18px;
	border: 1px solid var(--bf-line-strong);
	border-radius: 0;
	background: #fff;
	font: inherit;
	font-size: 17px;
	line-height: 1.5;
	color: var(--jf-navy);
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.bf-field__input:hover { border-color: var(--jf-muted); }
.bf-field__input:focus { outline: none; border-color: var(--jf-navy); box-shadow: 0 0 0 1px var(--jf-navy), 0 0 0 5px rgba(13, 30, 65, .14); }
.bf-field__input[aria-invalid="true"] { border-color: var(--bf-error); box-shadow: inset 4px 0 0 var(--bf-error); }
[dir="rtl"] .bf-field__input[aria-invalid="true"] { box-shadow: inset -4px 0 0 var(--bf-error); }
.bf-field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--bf-error), 0 0 0 5px rgba(181, 22, 28, .16); }

/* Interests and consent --------------------------------------------- */
.bf-interests { margin: 28px 0 0; padding: 0; border: 0; min-width: 0; }
.bf-interests .bf-field__label { display: block; margin-bottom: 12px; padding: 0; }
.bf-interests__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.bf-check {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--bf-ivory-line);
	background: #fff;
	cursor: pointer;
	transition: border-color .15s;
}
.bf-check:hover { border-color: var(--bf-line-strong); }
.bf-check:has(.bf-check__box:checked) { border-color: var(--jf-navy); }
.bf-check--plain,
.bf-check--consent {
	padding: 0;
	border: 0;
	background: none;
}
.bf-check--plain { margin-top: 24px; }
.bf-check--consent { margin-top: 24px; }
.bf-check__box {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--jf-red);
	cursor: pointer;
}
.bf-check__text { font-size: 16px; line-height: 1.55; color: var(--jf-navy); white-space: normal; }
.bf-check__meta { display: block; margin-top: 2px; font-size: 14px; color: var(--jf-muted); }
.bf-check--consent .bf-check__text { font-size: 14px; line-height: 1.6; color: var(--jf-ink-2); }
.bf-check--consent a { color: var(--jf-navy); text-decoration: underline; text-underline-offset: 3px; white-space: normal; }
.bf-check--consent a:hover { color: var(--jf-red); }
.bf-interests[aria-invalid="true"] .bf-check,
.bf-check__box[aria-invalid="true"] { outline: 2px solid var(--bf-error); outline-offset: 2px; }
.bf-interests[aria-invalid="true"] .bf-check { outline-offset: -1px; }

/* Submit and messages ------------------------------------------------ */
.bf-form__foot { margin-top: 28px; }
.bf-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 56px;
	padding: 0 32px;
	border: 0;
	background: var(--jf-red);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .03em;
	cursor: pointer;
	transition: background-color .2s, opacity .2s;
}
.bf-form__submit:hover { background: var(--jf-red-dark); }
.bf-form__submit:focus-visible { outline: 2px solid var(--jf-navy); outline-offset: 3px; }
.bf-form__arrow { transition: transform .2s ease; }
.bf-form__submit:hover .bf-form__arrow { transform: translateX(3px); }
[dir="rtl"] .bf-form__arrow { transform: scaleX(-1); }
[dir="rtl"] .bf-form__submit:hover .bf-form__arrow { transform: scaleX(-1) translateX(3px); }
.bf-form.is-sending .bf-form__submit { opacity: .7; cursor: progress; }

.bf-form__msg { margin-top: 18px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.bf-form__msg:empty { display: none; }
.bf-form__msg:focus { outline: none; }
.bf-form.is-error .bf-form__msg { color: var(--bf-error); }

/* Registered: the sheet shows the thank-you line only. */
.bf-form.is-done .bf-form__body { display: none; }
.bf-form.is-done .bf-form__msg {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	font-family: var(--jf-serif);
	font-size: 22px;
	font-weight: 600;
	color: var(--jf-navy);
}
.bf-form.is-done .bf-form__msg::before {
	content: "";
	flex: none;
	width: 28px;
	height: 2px;
	background: var(--jf-red);
}

/* Arabic ------------------------------------------------------------- */
[dir="rtl"] .bf__kicker { letter-spacing: 0; font-size: 15px; }
[dir="rtl"] .bf__title,
[dir="rtl"] .bf-form.is-done .bf-form__msg { font-family: var(--jf-arabic); font-weight: 700; line-height: 1.3; }
[dir="rtl"] .bf__text { font-size: 18px; line-height: 1.85; }
[dir="rtl"] .bf__festival-name { font-family: var(--jf-arabic); font-weight: 700; line-height: 1.45; }
[dir="rtl"] .bf__festival-meta { font-size: 16px; }
[dir="rtl"] .bf__note { font-size: 15px; line-height: 1.8; }
[dir="rtl"] .bf__reveal,
[dir="rtl"] .bf__cta { letter-spacing: 0; font-size: 17px; }
[dir="rtl"] .bf-field__label,
[dir="rtl"] .bf-check__text { font-size: 17px; }
[dir="rtl"] .bf-check--consent .bf-check__text { font-size: 15px; line-height: 1.75; }
[dir="rtl"] .bf-form__submit { letter-spacing: 0; font-size: 17px; }

/* Smaller screens ---------------------------------------------------- */
@media (max-width: 1100px) {
	.bf__panel { padding: 56px 48px 48px; }
	.bf--home .bf__panel { padding: 0; }
	.bf--festival .bf__panel { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.bf__head { gap: 40px 48px; }
	.bf__text { max-width: 40em; }
}
@media (max-width: 860px) {
	.bf__lattice { width: 100%; }
	/* Stacked: the selvedge runs across, the postmark on it. */
	.bf__paths { grid-template-columns: minmax(0, 1fr); }
	.bf__path { padding: 48px 40px; }
	.bf__seam { position: relative; inset: auto; width: auto; height: 14px; margin: 0; }
	.bf__postmark { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
	.bf__postmark img { width: 22px; }
}
@media (max-width: 640px) {
	.bf { padding: 56px 0 64px; }
	.bf--festival { padding: 48px 0 56px; }
	.bf__panel { padding: 40px 22px 24px; }
	.bf--home .bf__panel { padding: 0; }
	.bf__path { padding: 44px 22px 40px; }
	.bf__title, [dir="rtl"] .bf__title { font-size: 32px; }
	.bf__path .bf__title, [dir="rtl"] .bf__path .bf__title { font-size: 28px; }
	.bf__reveal,
	.bf__cta { width: 100%; justify-content: space-between; }
	.bf__sheet { margin-top: 32px; }
	.bf-form { padding: 28px 20px 24px; }
	.bf-form__fields { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.bf-check { padding: 12px 14px; gap: 12px; }
	.bf-check--plain,
	.bf-check--consent { padding: 0; }
	.bf-form__submit { width: 100%; }
}
@media (max-width: 360px) {
	.bf__panel { padding: 32px 16px 18px; }
	.bf--home .bf__panel { padding: 0; }
	.bf__path { padding: 40px 16px 36px; }
	.bf-form { padding: 24px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.bf__reveal,
	.bf__cta,
	.bf__reveal-icon,
	.bf-form__arrow,
	.bf-form__submit,
	.bf-field__input,
	.bf-check { transition: none; }
}
