/*
 * RamboAbe base: token aliases, resets, desk and paper surfaces, type,
 * buttons and focus. Values come from theme.json presets so a palette or
 * shadow change there reaches every object.
 */

:root {
	/* The three shadow tokens from the concept B kit. */
	--shadow-paper: var(--wp--preset--shadow--paper);
	--shadow-lift: var(--wp--preset--shadow--lift);
	--shadow-desk: var(--wp--preset--shadow--desk);

	/* Desk is one token: change the "desk" palette entry in theme.json
	   to an alternate in settings.custom.desk-alternates. */
	--rab-desk: var(--wp--preset--color--desk);
	--rab-ink: var(--wp--preset--color--ink);
	--rab-page: var(--wp--preset--color--page);
	--rab-sheet: var(--wp--preset--color--sheet);
	--rab-manila: var(--wp--preset--color--manila);
	--rab-manila-tab: var(--wp--preset--color--manila-tab);
	--rab-manila-edge: var(--wp--preset--color--manila-edge);
	--rab-steel: var(--wp--preset--color--steel);
	--rab-steel-light: var(--wp--preset--color--steel-light);
	--rab-cork: var(--wp--preset--color--cork);
	--rab-orange: var(--wp--preset--color--safety-orange);
	--rab-burnt: var(--wp--preset--color--burnt-orange);
	--rab-yellow: var(--wp--preset--color--key-tag-yellow);
	--rab-slate: var(--wp--preset--color--slate);
	--rab-index-blue: var(--wp--preset--color--index-blue);
	--rab-index-red: var(--wp--preset--color--index-red);

	--rab-ink-soft: var(--wp--custom--color--ink-soft);
	--rab-on-desk: var(--wp--custom--color--on-desk);
	--rab-on-desk-muted: var(--wp--custom--color--on-desk-muted);
	--rab-on-desk-label: var(--wp--custom--color--on-desk-label);
	--rab-rule: var(--wp--custom--color--rule);
	--rab-red-pen: var(--wp--custom--color--red-pen);

	--rab-sans: var(--wp--preset--font-family--archivo);
	--rab-serif: var(--wp--preset--font-family--source-serif);
	--rab-mono: var(--wp--preset--font-family--plex-mono);
	--rab-marker: var(--wp--preset--font-family--marker);

	--rab-gutter: var(--wp--custom--gutter);
	--rab-max: 1240px;

	/* Desk grain, the same noise the mockups draw with an inline SVG filter. */
	--rab-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--rab-cork-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Resets ---------- */

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

img,
svg {
	max-width: 100%;
}

/* The theme spaces everything with flex and grid gaps, so flow-layout
   margins from global styles are switched off. The story body keeps its own. */
/* Specificity (0,1,0): beats the global flow rule, loses to component rules. */
.wp-site-blocks > *,
:where(.wp-site-blocks) .is-layout-flow > * {
	margin-block: 0;
}

.wp-site-blocks .alignfull {
	max-width: none;
	margin-inline: 0;
}

/* Theme blocks only wrap their own markup. */
.wp-block-ramboabe-link,
.wp-block-ramboabe-prop,
.wp-block-ramboabe-folder-card,
.wp-block-ramboabe-unfiled,
.wp-block-ramboabe-tags {
	min-width: 0;
}

.rab-wrap {
	width: 100%;
	max-width: calc(var(--rab-max) + 2 * var(--rab-gutter));
	margin-inline: auto;
	padding-inline: var(--rab-gutter);
}

/* ---------- Surfaces ---------- */

.rab-desk {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background-color: var(--rab-desk);
	color: var(--rab-page);
}

.rab-desk::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--rab-grain);
	opacity: 0.2;
	mix-blend-mode: overlay;
	pointer-events: none;
}

.rab-grid-paper {
	background-color: var(--rab-page);
	background-image:
		linear-gradient(rgba(22, 24, 29, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(22, 24, 29, 0.05) 1px, transparent 1px);
	background-size: 32px 32px;
	border-top: 2px solid var(--rab-ink);
}

/* ---------- Type ---------- */

h1,
h2,
h3,
h4,
.rab-display {
	font-stretch: 70%;
}

.rab-hero__title,
.rab-spread__title,
.rab-cover__title,
.rab-drawer-head__title {
	text-wrap: balance;
}

/* Rotated paper near the edge never makes the page scroll sideways. */
.wp-site-blocks {
	overflow-x: clip;
}

/* Kickers are typed in capitals so "No." keeps its small o. */
.rab-eyebrow,
.rab-kicker {
	font-family: var(--rab-mono);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 2.5px;
	color: var(--rab-slate);
}

.rab-eyebrow {
	text-transform: uppercase;
	display: flex;
	align-items: center;
	gap: 12px;
}

.rab-eyebrow::before {
	content: "";
	flex: none;
	width: 40px;
	height: 4px;
	background: var(--rab-orange);
}

.rab-desk .rab-eyebrow,
.rab-desk .rab-kicker {
	color: var(--rab-on-desk-label);
}

.rab-section-title {
	font-size: var(--wp--preset--font-size--section);
	line-height: 0.9;
	font-weight: 900;
	text-transform: uppercase;
}

.rab-section-title--sm {
	font-size: clamp(44px, 5.4vw, 68px);
}

.rab-card-title {
	font-size: var(--wp--preset--font-size--card-title);
	line-height: 0.92;
}

.rab-lead {
	max-width: 32rem;
	font-family: var(--rab-serif);
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.5;
	color: var(--rab-on-desk);
}

.rab-lead--paper {
	max-width: 30rem;
	color: var(--rab-ink-soft);
}

.rab-prose {
	font-family: var(--rab-serif);
	font-size: var(--wp--preset--font-size--story);
	line-height: 1.55;
	color: var(--rab-ink-soft);
}

.rab-muted {
	color: var(--rab-slate);
}

.rab-desk .rab-muted {
	color: var(--rab-on-desk-label);
}

/* ---------- Links, buttons, focus ---------- */

a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible {
	outline: 3px solid var(--rab-orange);
	outline-offset: 3px;
}

.rab-button,
.wp-site-blocks .rab-button {
	display: inline-flex;
	align-items: center;
	min-height: 54px;
	padding: 0 26px;
	border: 0;
	border-radius: 999px;
	background: var(--rab-orange);
	color: var(--rab-ink);
	font-family: var(--rab-sans);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
}

.rab-button:hover {
	background: var(--rab-ink);
	color: var(--rab-page);
}

.rab-desk .rab-button:hover {
	background: var(--rab-page);
	color: var(--rab-ink);
}

.rab-button--outline,
.wp-site-blocks .rab-button--outline {
	min-height: 48px;
	padding: 0 22px;
	background: transparent;
	border: 2px solid currentColor;
	color: var(--rab-ink);
}

.rab-desk .rab-button--outline {
	min-height: 54px;
	padding: 0 26px;
	color: var(--rab-page);
}

.rab-button--outline:hover,
.rab-desk .rab-button--outline:hover {
	background: var(--rab-orange);
	border-color: var(--rab-orange);
	color: var(--rab-ink);
}

.rab-button-lg .rab-button {
	min-height: 56px;
	padding: 0 28px;
	font-size: 18px;
}

.rab-button-xl .rab-button {
	min-height: 60px;
	padding: 0 30px;
	font-size: 19px;
	box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.6);
}

.rab-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.rab-actions--note {
	gap: 14px 20px;
}

/* ---------- Chips and labels ---------- */

.rab-chip {
	align-self: flex-start;
	display: inline-block;
	padding: 5px 10px;
	background: var(--rab-sheet);
	border: 1.5px solid var(--rab-ink);
	color: var(--rab-ink);
	font-family: var(--rab-mono);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 2px;
	text-transform: uppercase;
	transform: rotate(-1.5deg);
}

.is-style-rab-label,
p.is-style-rab-label {
	font-family: var(--rab-mono);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
}

/* ---------- Screen readers ---------- */

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

.skip-link.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 18px;
	clip: auto;
	clip-path: none;
	background: var(--rab-sheet);
	color: var(--rab-ink);
	font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}
