/* About and Brand. Logical properties only; logos, letters and swatches are never mirrored. */

/* ---- Shared card grid (equal height cards, content pinned to the top) ---- */
.bsr-cards {
	display: grid;
	gap: var(--wp--preset--spacing--medium);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	align-items: stretch;
}

.bsr-cards > * {
	margin: 0 !important;
	height: 100%;
}

.bsr-cards > .is-style-card > :is(h2, h3) {
	margin-block-start: 0;
	margin-block-end: 12px;
	font-size: var(--wp--preset--font-size--medium);
}

.bsr-cards > .is-style-card > p {
	color: var(--wp--preset--color--secondary);
	margin-block: 0;
}

.bsr-two {
	display: grid;
	gap: var(--wp--preset--spacing--medium);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	align-items: stretch;
}

.bsr-two > .is-style-card {
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.bsr-two > .is-style-card > .wp-block-buttons {
	margin-block-start: auto;
	padding-block-start: var(--wp--preset--spacing--small);
}

.bsr-two > .is-style-card > p {
	color: var(--wp--preset--color--secondary);
	margin-block: 8px 0;
}

.bsr-two > .is-style-card > :is(h2, h3) {
	margin-block: 0;
}

.bsr-page-hero {
	padding-block: var(--wp--preset--spacing--x-large) var(--wp--preset--spacing--large);
}

.bsr-page-hero .bsr-hero__title {
	max-width: 24ch;
}

.bsr-page-hero .is-style-lead {
	max-width: 46rem;
}

.bsr-prose,
.bsr-muted {
	max-width: 46rem;
}

.bsr-muted {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
}

.bsr-section > .alignwide.bsr-prose > p,
.bsr-prose p {
	max-width: 46rem;
}

/* Closing cards: heading, text and button stacked, left-aligned in LTR and right-aligned in RTL. */
.bsr-closing-section .is-style-card > p,
.bsr-closing-section .is-style-band-brand > p {
	max-width: 40rem;
}

.bsr-closing-section .is-style-card > .wp-block-buttons,
.bsr-closing-section .is-style-band-brand > .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--small);
}

.bsr-closing-section .is-style-card > :is(h2, h3),
.bsr-closing-section .is-style-band-brand > :is(h2, h3) {
	margin-block-start: 0;
}

.bsr-name-card {
	max-width: 52rem;
}

/* ---- Light / dark image swap (logos) ---- */
.bsr-only-dark { display: none !important; }

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .bsr-only-light { display: none !important; }
	:root:not([data-theme="light"]) .bsr-only-dark { display: block !important; }
}

:root[data-theme="dark"] .bsr-only-light { display: none !important; }
:root[data-theme="dark"] .bsr-only-dark { display: block !important; }

/* ---- Brand: hero mark ---- */
.bsr-brand-hero__mark {
	margin-block-end: var(--wp--preset--spacing--medium);
}

.bsr-brand-mark {
	width: clamp(96px, 16vw, 148px);
	height: auto;
}

/* ---- Brand: name story ---- */
.bsr-flow {
	list-style: none;
	margin: var(--wp--preset--spacing--medium) 0 0;
	padding: 0;
	display: grid;
	gap: var(--wp--preset--spacing--small);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
	counter-reset: none;
}

.bsr-flow__step {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: var(--wp--preset--spacing--small) var(--wp--preset--spacing--medium);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--bsr-radius-card);
}

/* Ollie removes the top padding of a list's first item; keep all four steps the same. */
ol.bsr-flow > li.bsr-flow__step:nth-child(n) {
	padding-block: var(--wp--preset--spacing--small);
}

.bsr-flow__step::after {
	content: "→";
	position: absolute;
	inset-inline-end: -1.35rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--wp--preset--color--accent-strong);
	font-weight: 800;
	z-index: 1;
}

[dir="rtl"] .bsr-flow__step:not(.bsr-flow__step--last)::after {
	content: "←";
}

.bsr-flow__step--last::after {
	content: none;
}

.bsr-flow__step--last {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--on-brand);
	border-color: transparent;
}

.bsr-flow__step--last .bsr-flow__note {
	color: inherit;
	opacity: 0.85;
}

.bsr-flow__name {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 800;
	line-height: 1.3;
}

.bsr-flow__note {
	color: var(--wp--preset--color--secondary);
}

@media (max-width: 781px) {
	.bsr-flow__step:not(.bsr-flow__step--last)::after {
		content: "↓";
		inset-inline-end: auto;
		inset-inline-start: 50%;
		top: auto;
		bottom: -1.3rem;
		transform: translateX(-50%);
	}
	[dir="rtl"] .bsr-flow__step:not(.bsr-flow__step--last)::after {
		content: "↓";
		transform: translateX(50%);
	}
	.bsr-flow {
		gap: 1.6rem;
	}
}

/* ---- Brand: logo versions ---- */
.bsr-logo-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--small);
	margin: 0;
	text-align: center;
}

.bsr-logo-card > img,
.bsr-logo-card > .bsr-brand-logo {
	max-width: 100%;
	height: 72px;
	width: auto;
	margin-block: auto;
}

.bsr-logo-card .bsr-brand-logo--icon {
	height: 72px;
}

.bsr-logo-card figcaption {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.bsr-brand-logos .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--medium);
}

/* ---- Brand: colours ---- */
.bsr-swatches {
	display: grid;
	gap: var(--wp--preset--spacing--medium);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
	margin-block-start: var(--wp--preset--spacing--medium);
}

.bsr-swatch {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--bsr-radius-card);
	overflow: hidden;
}

.bsr-swatch__chip {
	display: grid;
	place-items: center;
	height: 96px;
	font-size: 1.75rem;
	font-weight: 800;
	border-block-end: 1px solid var(--wp--preset--color--border-light);
}

.bsr-swatch p {
	margin: 0;
	padding-inline: var(--wp--preset--spacing--small);
}

.bsr-swatch__name {
	padding-block-start: var(--wp--preset--spacing--small) !important;
	font-weight: 800;
}

.bsr-swatch__code {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
	direction: ltr;
	unicode-bidi: isolate;
	text-align: start;
}

[dir="rtl"] .bsr-swatch__code {
	text-align: right;
}

.bsr-swatch__use {
	padding-block: 4px var(--wp--preset--spacing--small) !important;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

/* ---- Brand: type ---- */
.bsr-type-card .bsr-type-sample {
	margin: 0 0 var(--wp--preset--spacing--small);
	font-size: clamp(2.5rem, 6vw, 3.75rem);
	line-height: 1.2;
	color: var(--wp--preset--color--primary);
}

.bsr-type-sample--en {
	font-family: var(--wp--preset--font-family--primary, "Manrope", sans-serif);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.bsr-type-sample--ar {
	font-family: var(--wp--preset--font-family--arabic-display, "El Messiri", sans-serif);
	font-weight: 700;
}

.bsr-type-label {
	margin: 0;
	font-weight: 800;
}

.bsr-type-card p:last-child {
	color: var(--wp--preset--color--secondary);
	margin-block: 4px 0;
}

/* ---- Brand: rules ---- */
.bsr-do,
.bsr-dont {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bsr-do li,
.bsr-dont li {
	position: relative;
	padding-inline-start: 1.75rem;
	margin-block-end: 0.75rem;
}

.bsr-do li::before,
.bsr-dont li::before {
	position: absolute;
	inset-inline-start: 0;
	font-weight: 800;
}

.bsr-do li::before { content: "✓"; color: var(--wp--preset--color--primary); }
.bsr-dont li::before { content: "✕"; color: var(--wp--preset--color--accent-strong); }

/* ---- Section children share the wide column's start edge (the constrained layout would centre narrow ones). ----
   Not on single posts, which keep their own 720px reading column. */
.bsr-section:not(.bsr-post) > :is(p, div, ol, ul, figure):not(.alignwide):not(.alignfull) {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-inline-start: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
	margin-inline-end: auto !important;
}

.bsr-section > .is-style-lead {
	max-width: 46rem !important;
}
