/*
 * Shareef base primitives — ported from design/prototype/assets/css/styles.css
 * (lines 1-135 and the ghost-navy button added later in the same file), with
 * every value sourced from theme.json presets/custom properties instead of a
 * local :root block, so palette/font/spacing edits in Site Editor → Styles
 * apply here too. Logical properties only (RTL-first).
 */

/* stylelint-disable selector-class-pattern -- class names are ported 1:1 from
   the approved prototype (design/prototype/assets/css/styles.css) and reused
   by patterns/blocks in other lanes; renaming would break parity. */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--wp--custom--header-h) + 64px);
	scrollbar-color: var(--wp--preset--color--navy-lit) var(--wp--preset--color--seam);
}

body {
	margin: 0;
	font-family: var(--wp--preset--font-family--camel);
	font-size: var(--wp--preset--font-size--fs-1);
	line-height: 1.7;
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--seam);
	text-rendering: optimizelegibility;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-underline-offset: 0.3em;
	text-decoration-thickness: 1px;
}

button {
	font: inherit;
	color: inherit;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol,
dl,
dd {
	margin: 0;
}

ul,
ol {
	padding: 0;
	list-style: none;
}

h1,
h2,
h3 {
	font-weight: 800;
	line-height: 1.3;
	text-wrap: balance;
}

::selection {
	background: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
}

:focus-visible {
	outline: 3px solid var(--wp--preset--color--white);
	outline-offset: 3px;
	border-radius: 4px;
	box-shadow: 0 0 0 6px var(--wp--preset--color--red);
}

::-webkit-scrollbar {
	width: 12px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: var(--wp--preset--color--seam);
}

::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--navy-lit);
	border-radius: 8px;
	border: 3px solid var(--wp--preset--color--seam);
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip {
	position: absolute;
	inset-inline-start: 1rem;
	inset-block-start: -4rem;
	z-index: 100;
	background: var(--wp--preset--color--red-ink);
	color: var(--wp--preset--color--white);
	padding: 0.75rem 1rem;
	border-radius: var(--wp--custom--radius);
	font-weight: 700;
}

.skip:focus {
	inset-block-start: 1rem;
}

.num {
	font-variant-numeric: tabular-nums lining-nums;
	unicode-bidi: isolate;
	direction: ltr;
	display: inline-block;
}

.wrap {
	width: min(100% - 2 * var(--wp--preset--spacing--gutter), var(--wp--style--global--wide-size));
	margin-inline: auto;
}

.icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	fill: none;
	stroke: currentcolor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon--fill {
	fill: currentcolor;
	stroke: none;
}

/* sections butt together like the prototype (their own padding spaces them);
   the root blockGap otherwise leaves 40px bands that the reveal art and the
   section backgrounds do not cover */
.wp-block-post-content > *,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* ---------- panels: the backlit acrylic ---------- */

.board {
	display: grid;
	gap: var(--wp--custom--seam-w);
	padding: var(--wp--custom--seam-w);
	background: var(--wp--preset--color--seam);
	border-radius: calc(var(--wp--custom--radius) + var(--wp--custom--seam-w));
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.04);
}

/* hero-board grid slots for dynamic blocks with no span/gridArea attribute
   of their own (patterns-src/hero.php via shareef_pb_grid_slot()). They are
   grids so the dish cycler and call panel stretch to the full height of
   their board cells, level with the neighbouring panels. */
.board--hero > .slot-dish {
	display: grid;
	grid-area: dish;
}

.board--hero > .slot-dish > * {
	margin-block: 0;
}

.board--hero > .slot-call {
	display: grid;
	grid-area: call;
}

.board--hero > .slot-cats {
	grid-area: cats;
}

/* the mobile call dock replaces the hero call panel (prototype .p-call) */
@media (max-width: 860px) {

	.board--hero > .slot-call {
		display: none;
	}
}

.panel {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--wp--custom--radius);
	background: radial-gradient(130% 95% at 50% -10%, var(--wp--preset--color--navy-lit), var(--wp--preset--color--navy) 52%, var(--wp--preset--color--navy-deep));
	box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), inset 0 -24px 40px -30px rgb(0 0 0 / 0.5);
	padding: clamp(1.25rem, 0.8rem + 1.6vw, 2.25rem);
}

/* the printed ش backing */
.panel::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: var(--wp--preset--color--white);
	opacity: 0.055;
	-webkit-mask: url(../brand/pattern-mask.webp) 0 0 / 720px auto repeat;
	mask: url(../brand/pattern-mask.webp) 0 0 / 720px auto repeat;
}

.panel--red {
	background: radial-gradient(130% 95% at 50% -10%, var(--wp--preset--color--red), var(--wp--preset--color--red-ink) 45%, var(--wp--preset--color--red-deep));
}

.panel--red::before {
	opacity: 0.09;
}

.panel--stone {
	background: radial-gradient(130% 95% at 50% -10%, var(--wp--preset--color--stone-soft), var(--wp--preset--color--stone) 70%);
	color: var(--wp--preset--color--navy);
}

.panel--stone::before {
	background: var(--wp--preset--color--navy);
	opacity: 0.07;
}

.panel--white {
	background: radial-gradient(130% 95% at 50% -10%, var(--wp--preset--color--white), color-mix(in oklab, var(--wp--preset--color--white) 92%, var(--wp--preset--color--navy)));
	color: var(--wp--preset--color--navy);
}

.panel--white::before {
	background: var(--wp--preset--color--navy);
	opacity: 0.05;
}

.panel--photo {
	padding: 0;
	background: var(--wp--preset--color--navy-deep);
}

.panel--photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tag-sample {
	position: absolute;
	inset-block-start: 0.75rem;
	inset-inline-end: 0.75rem;
	z-index: 3;
	font-size: 0.75rem;
	line-height: 1;
	padding: 0.4rem 0.6rem;
	border-radius: 99px;
	background: rgb(14 26 43 / 0.82);
	color: var(--wp--preset--color--white);
}

/* ---------- buttons (generic primitives for custom blocks) ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	padding: 0.6rem 1.25rem;
	border-radius: 99px;
	border: 0;
	text-decoration: none;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--fs-1);
	cursor: pointer;
	transition: transform 0.25s var(--wp--custom--ease-out), background-color 0.25s var(--wp--custom--ease-out), box-shadow 0.25s var(--wp--custom--ease-out);
}

.btn:hover {
	transform: translateY(-2px);
}

.btn:active {
	transform: translateY(0);
}

/* The Year of The Camel reserves a deep descender (0.42em vs 0.80em ascent),
   so labels sit ~0.1em above the icon's centre; nudge the text, not the icon. */
.btn > :not(svg),
.lang-btn > :not(svg),
.dock a > :not(svg) {
	position: relative;
	inset-block-start: 0.1em;
}

.btn--red {
	background: var(--wp--preset--color--red-ink);
	color: var(--wp--preset--color--white);
	box-shadow: 0 10px 22px -12px rgb(0 0 0 / 0.7);
}

.btn--red:hover {
	background: var(--wp--preset--color--red-deep);
}

.btn--white {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
}

.btn--white:hover {
	background: var(--wp--preset--color--stone-soft);
}

.btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--white);
	box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.5);
}

.btn--ghost:hover {
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--white);
	background: rgb(255 255 255 / 0.06);
}

.btn--navy {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.btn--navy:hover {
	background: var(--wp--preset--color--navy-lit);
}

.btn--ghost-navy {
	background: transparent;
	color: var(--wp--preset--color--navy);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--navy);
}

.btn--ghost-navy:hover {
	background: rgb(29 53 87 / 0.08);
}

.btn[aria-disabled="true"] {
	opacity: 0.72;
	cursor: not-allowed;
	transform: none;
}

/* ---------- badges (shared by branches and testimonials blocks) ---------- */

.badge {
	justify-self: start;
	align-self: flex-start;
	font-size: 0.8rem;
	font-weight: 700;
	padding: 0.25rem 0.65rem;
	border-radius: 99px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
}

.soon {
	color: var(--wp--preset--color--ink-2);
	font-style: normal;
}

/*
 * `.wp-block-button__link` (core's button element) never got the `.btn`
 * primitive's box model — WP core only ships inline-block padding, so
 * core/button instances rendered a different size/shape than `.btn` links
 * built by the custom blocks (call-button, contact-links). Give every
 * core/button the same box; the is-style-* rules below only add colour.
 */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	padding: calc(0.6rem + 0.1em) 1.25rem calc(0.6rem - 0.1em); /* same optical nudge as .btn labels */
	font-weight: 700;
	font-size: var(--wp--preset--font-size--fs-1);
	transition: transform 0.25s var(--wp--custom--ease-out), background-color 0.25s var(--wp--custom--ease-out), box-shadow 0.25s var(--wp--custom--ease-out);
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-block-button__link:active {
	transform: translateY(0);
}

/* ---------- core/button style variations (red|white|ghost|navy|ghost-navy) ---------- */

.wp-block-button.is-style-red .wp-block-button__link {
	background-color: var(--wp--preset--color--red-ink);
	color: var(--wp--preset--color--white);
	box-shadow: 0 10px 22px -12px rgb(0 0 0 / 0.7);
}

.wp-block-button.is-style-white .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
}

.wp-block-button.is-style-ghost .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--white);
	box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.5);
}

.wp-block-button.is-style-navy .wp-block-button__link {
	background-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-ghost-navy .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--navy);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--navy);
}

.wp-block-button.is-style-red .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--red-deep);
}

.wp-block-button.is-style-white .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--stone-soft);
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover {
	background-color: rgb(255 255 255 / 0.06);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--white);
}

.wp-block-button.is-style-navy .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--navy-lit);
}

.wp-block-button.is-style-ghost-navy .wp-block-button__link:hover {
	background-color: rgb(29 53 87 / 0.08);
}

/* ---------- power-on entrance: only once JS has confirmed motion is welcome ---------- */

.js.motion .power > * {
	animation: power-on .9s var(--wp--custom--ease-out) both;
	animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}

@keyframes power-on {

	0% {
		filter: brightness(.3) saturate(.4);
	}

	18% {
		filter: brightness(1.15);
	}

	26% {
		filter: brightness(.62);
	}

	44% {
		filter: brightness(1.08);
	}

	100% {
		filter: none;
	}
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

/* the prototype has no gap between the sticky header and <main>; drop the
   root blockGap WordPress adds between template parts */
.wp-site-blocks > main {
	margin-block-start: 0;
}
