/*
 * Offer stage — "guide" (هوية بصرية): an open brand guidelines book.
 * One page shows what an identity is made of, each part named under it: the
 * mark on its construction grid (الشعار), the colour swatches (الألوان), the
 * type specimen (الخطوط). The facing page is the chosen chapter — the offer —
 * with its big number. The navigation is the book's table of contents: each
 * chapter with a dotted leader to its number (the same number its page
 * shows). Turning to a chapter sweeps a page shadow across.
 */

.gb-offer-stage--guide {
	--gb-paper: #FBFAF6;
	--gb-paper-edge: #ECE8DF;
	--gb-offer-enter: gb-guide-in;
	--gb-offer-enter-time: 0.6s;
}

/* ---------- Table of contents (tabs) ---------- */

.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer-stage__nav {
	padding: var(--gb-space-s);
	border: 1px solid var(--gb-paper-edge);
	border-radius: 0.4rem;
	background-color: var(--gb-paper);
	box-shadow: 0 1rem 2rem -1.5rem rgb(12 35 66 / 0.3);
}

.gb-offer-stage--guide .gb-os-panel-head {
	padding-inline: var(--gb-space-2xs);
	font-family: var(--gb-font-display);
	font-size: var(--gb-step-1);
	color: var(--gb-color-navy);
}

.gb-offer-stage--guide .gb-offer-tab {
	gap: 0.5rem;
	padding-inline: var(--gb-space-2xs);
	color: var(--gb-color-navy);
}

.gb-offer-stage--guide .gb-offer-tab__name {
	flex: 0 1 auto;
}

.gb-offer-stage--guide .gb-offer-tab__end {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 0.5rem;
}

/* Dotted leader between the chapter and its page number. */
.gb-os-leader {
	flex: 1 1 auto;
	block-size: 0;
	min-inline-size: 1.5rem;
	border-block-end: 2px dotted var(--gb-color-neutral-300);
}

.gb-os-page {
	font-size: 0.85rem;
	color: var(--gb-text-muted);
	font-variant-numeric: tabular-nums;
}

.gb-offer-stage--guide .gb-offer-tab:hover {
	background-color: rgb(12 35 66 / 0.04);
}

.gb-offer-stage--guide .gb-offer-tab[aria-selected="true"] {
	font-weight: var(--gb-weight-bold);
}

.gb-offer-stage--guide .gb-offer-tab[aria-selected="true"] .gb-os-page {
	color: var(--gb-accent);
	font-weight: var(--gb-weight-bold);
}

.gb-offer-stage--guide .gb-offer-tab[aria-selected="true"] .gb-os-leader {
	border-color: var(--gb-primary);
}

/* ---------- The spread ---------- */

.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer-stage__screen {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	min-block-size: clamp(20rem, 30vw, 25rem);
	border-radius: 0.5rem;
	background:
		linear-gradient(to right, transparent 46%, rgb(12 35 66 / 0.07) 49.6%, rgb(12 35 66 / 0.14) 50%, rgb(12 35 66 / 0.07) 50.4%, transparent 54%),
		var(--gb-paper);
	box-shadow:
		0 0 0 1px var(--gb-paper-edge),
		0 0.4rem 0 -0.15rem var(--gb-paper-edge),
		0 2rem 4rem -2rem rgb(12 35 66 / 0.45);
}

/* The chapter page at the reading start, the identity page facing it. */
.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer-stage__view {
	grid-column: 1;
	grid-row: 1;
	padding: var(--gb-space-l) var(--gb-space-l) var(--gb-space-xl);
}

.gb-offer-stage--guide .gb-offer-stage__chrome {
	grid-column: 2;
	grid-row: 1;
}

.gb-os-spread {
	display: grid;
	align-content: center;
	justify-items: center;
	gap: var(--gb-space-s);
	block-size: 100%;
	padding: var(--gb-space-l);
}

/* Each part of the identity with its name under it. */
.gb-os-spread__item {
	display: grid;
	justify-items: center;
	gap: 0.35rem;
}

.gb-os-spread__item small {
	font-size: 0.75rem;
	font-weight: var(--gb-weight-bold);
	letter-spacing: 0.02em;
	color: var(--gb-text-muted);
}

/* The mark on its construction grid. */
.gb-os-spread__item--mark {
	inline-size: min(9rem, 70%);
}

.gb-os-spread__mark {
	display: grid;
	place-items: center;
	inline-size: 100%;
	aspect-ratio: 1;
	border: 1px solid rgb(12 35 66 / 0.12);
	background-image:
		linear-gradient(rgb(12 35 66 / 0.08) 1px, transparent 1px),
		linear-gradient(to right, rgb(12 35 66 / 0.08) 1px, transparent 1px),
		radial-gradient(circle, transparent 69%, rgb(0 202 190 / 0.35) 69.5%, transparent 70.5%);
	background-size: 12.5% 12.5%, 12.5% 12.5%, 100% 100%;
}

.gb-os-spread__logo {
	--gb-mark-sheen: transparent;

	inline-size: 72%;
	block-size: 72%;
}

.gb-os-swatches {
	display: flex;
	gap: 0.5rem;
}

.gb-os-swatches i {
	inline-size: 2.2rem;
	aspect-ratio: 1;
	border-radius: 0.4rem;
	background-color: var(--gb-primary);
	box-shadow: inset 0 0 0 1px rgb(12 35 66 / 0.1);
}

.gb-os-swatches i:nth-child(2) {
	background-color: var(--gb-color-navy);
}

.gb-os-swatches i:nth-child(3) {
	background-color: var(--gb-accent);
}

.gb-os-swatches i:nth-child(4) {
	background-color: var(--gb-color-neutral-0);
}

.gb-os-specimen {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	color: var(--gb-color-navy);
}

.gb-os-specimen b {
	font-family: var(--gb-font-display);
	font-size: var(--gb-step-4);
	line-height: 1;
}

.gb-os-specimen span {
	font-size: var(--gb-step-3);
	font-weight: var(--gb-weight-bold);
	line-height: 1;
	color: var(--gb-primary);
}

/* ---------- The chapter (panel) ---------- */

.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer {
	position: static;
	align-content: center;
}

.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer__body {
	gap: var(--gb-space-xs);
}

.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer__number {
	font-family: var(--gb-font-display);
	font-size: clamp(3.5rem, 7vw, 5.5rem);
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 1.5px var(--gb-primary);
}

.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer__title {
	font-size: var(--gb-step-3);
	padding-block-end: var(--gb-space-2xs);
	border-block-end: 2px solid var(--gb-accent);
	justify-self: start;
}

/* The shadow of a turning page sweeps across the chapter. */
.gb-os-turn {
	position: absolute;
	inset: 0;
	background: linear-gradient(to var(--gb-turn-to, left), transparent 0%, rgb(12 35 66 / 0.12) 45%, rgb(255 255 255 / 0.6) 52%, transparent 60%);
	background-size: 250% 100%;
	background-position: 100% 0;
	opacity: 0;
}

[dir="rtl"] .gb-offer-stage--guide {
	--gb-turn-to: right;
	--gb-guide-from: inset(0 100% 0 0);
}

/* ---------- Motion ---------- */

/* The new chapter is revealed from the spine outward. */
@keyframes gb-guide-in {
	0% {
		opacity: 0;
		clip-path: var(--gb-guide-from, inset(0 0 0 100%));
	}

	100% {
		opacity: 1;
		clip-path: inset(0);
	}
}

@keyframes gb-guide-sweep {
	0% {
		opacity: 1;
		background-position: 100% 0;
	}

	100% {
		opacity: 1;
		background-position: -50% 0;
	}
}

@media (prefers-reduced-motion: no-preference) {
	:root:not([data-gb-experience="STATIC_ACCESSIBLE"]) .gb-offer-stage--guide[data-gb-switch] .gb-os-turn {
		animation: gb-guide-sweep 0.7s var(--gb-ease-in-out) both;
	}
}

/* ---------- Phones: one page at a time (the chapter), identity page as a strip ---------- */

@media (max-width: 47.99rem) {
	.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer-stage__screen {
		grid-template-columns: minmax(0, 1fr);
		min-block-size: 0;
		background: var(--gb-paper);
	}

	.gb-offer-stage--guide .gb-offer-stage__chrome {
		grid-column: 1;
		grid-row: 1;
	}

	.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer-stage__view {
		grid-row: 2;
		padding: var(--gb-space-m) var(--gb-space-m) var(--gb-space-l);
	}

	.gb-os-spread {
		grid-template-columns: auto 1fr;
		align-items: center;
		justify-items: start;
		gap: var(--gb-space-s);
		padding: var(--gb-space-s) var(--gb-space-m);
		border-block-end: 1px solid var(--gb-paper-edge);
	}

	.gb-os-spread__item--mark {
		inline-size: 4.5rem;
		grid-row: span 2;
	}

	.gb-os-spread__item {
		justify-items: start;
	}

	.gb-os-swatches i {
		inline-size: 1.6rem;
	}

	.gb-os-specimen b {
		font-size: var(--gb-step-2);
	}

	.gb-os-specimen span {
		font-size: var(--gb-step-1);
	}

	.gb-offer-stage--guide .gb-offer-tab__end {
		flex: 0 0 auto;
	}

	.gb-os-leader {
		min-inline-size: 0.75rem;
		inline-size: 0.75rem;
	}
}

/* ---------- Revision 4: an identity the company made, on the book's page ---------- */

.gb-offer-stage--guide[data-gb-offer-ready] .gb-os-plate {
	max-block-size: 9.5rem;
	aspect-ratio: 16 / 9;
	margin-block-end: var(--gb-space-xs);
	object-fit: cover;
	border-radius: 0.35rem;
	box-shadow: 0 0.75rem 1.5rem -1rem rgb(12 35 66 / 0.5);
}

/* With a picture on the page, the big number gives it room. */
.gb-offer-stage--guide[data-gb-offer-ready] .gb-offer:has(.gb-os-plate) .gb-offer__number {
	font-size: clamp(2.2rem, 4vw, 3rem);
}
