/* ==========================================================================
   FIRST PRO — Base: document, typography rhythm, accessibility primitives
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
html.fp-nav-open { overflow: hidden; }

body {
	margin: 0;
	background: var(--fp-bg);
	color: var(--fp-fg);
	font-family: var(--fp-font-sans);
	font-size: var(--fp-text-md);
	line-height: var(--fp-leading-body);
	font-feature-settings: "kern", "liga", "calt", "ss01";
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}
[dir="rtl"] body { font-feature-settings: "kern", "liga", "calt"; }

/* WP root padding is applied by theme.json; main regions use our own containers. */
.fp-main { display: block; }
.fp-main--page { padding-block: var(--fp-space-5) var(--fp-space-6); }
.fp-page-title { font-size: var(--fp-text-3xl); letter-spacing: var(--fp-tracking-tight); line-height: var(--fp-leading-tight); margin: 0 0 var(--fp-space-4); }

h1, h2, h3, h4 {
	margin: 0;
	font-weight: 600;
	letter-spacing: var(--fp-tracking-tight);
	line-height: var(--fp-leading-snug);
	text-wrap: balance;
	overflow-wrap: break-word;
}
h1 { font-size: var(--fp-text-3xl); line-height: var(--fp-leading-tight); }
h2 { font-size: var(--fp-text-2xl); }
h3 { font-size: var(--fp-text-xl); }
p { margin: 0; }
p + p { margin-top: 1em; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--fp-fg-faint); }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--fp-fg); color: var(--fp-bg); }

/* Focus: never removed, always a visible ring independent of colour. */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--fp-focus); border-radius: var(--fp-radius-sm); }

/* Skip link (WordPress core renders #wp-skip-link for block themes; we style it) */
.fp-skip,
.skip-link.screen-reader-text:focus-visible {
	position: absolute; inset-inline-start: var(--fp-gutter); top: -100%;
	z-index: var(--fp-z-skip);
	padding: 0.75rem 1rem; background: var(--fp-inverse-bg); color: var(--fp-inverse-fg);
	border-radius: var(--fp-radius-sm); text-decoration: none; font-weight: 600;
	transition: top var(--fp-dur-fast) var(--fp-ease);
}
.fp-skip:focus-visible, .skip-link.screen-reader-text:focus-visible { top: var(--fp-space-2); clip: auto; clip-path: none; width: auto; height: auto; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* The language switcher label is the only foreign-script text on a page: render it with the system
   font so an English page never downloads the Arabic webfont (and vice-versa). */
html[dir="ltr"] [lang="ar"], html[dir="rtl"] [lang="en"] { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

/* Layout primitives */
.fp-container { width: min(100% - 2 * var(--fp-gutter), var(--fp-content)); margin-inline: auto; }
.fp-container--wide { width: min(100% - 2 * var(--fp-gutter), var(--fp-wide)); margin-inline: auto; }
.fp-section { padding-block: var(--fp-space-6); }
.fp-section--tight { padding-block: var(--fp-space-5); }
.fp-section__head { display: grid; gap: var(--fp-space-2); max-width: 46rem; margin-bottom: var(--fp-space-5); }
.fp-section__head .wp-block-heading { font-size: var(--fp-text-2xl); }
.fp-section__lead { font-size: var(--fp-text-lg); color: var(--fp-fg-muted); max-width: 38ch; }

.fp-eyebrow {
	display: inline-flex; align-items: center; gap: 0.6em;
	font-size: var(--fp-text-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--fp-fg-muted); font-feature-settings: "tnum";
}
[dir="rtl"] .fp-eyebrow { letter-spacing: 0.04em; text-transform: none; font-size: var(--fp-text-sm); }
.fp-eyebrow::before { content: ""; width: 1.5rem; height: 1px; background: currentColor; opacity: 0.6; }

.fp-rule { height: 1px; background: var(--fp-rule); border: 0; margin: 0; }
.fp-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.fp-icon { width: 1.25em; height: 1.25em; flex: none; }
[dir="rtl"] .fp-icon--flip-rtl { transform: scaleX(-1); }

/* Honest-state helpers (never fake content) */
.fp-pending {
	display: inline-flex; align-items: center; gap: 0.5em; padding: 0.35em 0.8em;
	border: 1px dashed var(--fp-fg-faint); border-radius: var(--fp-radius-pill);
	font-size: var(--fp-text-xs); color: var(--fp-fg-muted); letter-spacing: 0.04em;
}

/* Print: the Builder brief prints cleanly; chrome is hidden. */
@media print {
	.fp-header, .fp-footer, .fp-builder__form, .fp-brief__actions, .fp-scene, .fp-hero__actions { display: none !important; }
	body { background: #fff; color: #000; }
	.fp-brief { display: block !important; }
	.fp-brief__card { break-inside: avoid; border: 1px solid #ccc; }
}

/* Honest status notes (unfinished features, drafts) */
.fp-status-note { padding: 0.9rem 1.1rem; border: 1px dashed var(--fp-fg-faint); border-radius: var(--fp-radius-md); background: var(--fp-surface-2); font-size: var(--fp-text-sm); color: var(--fp-fg-muted); margin-bottom: var(--fp-space-3); }
