/*
 * Café Nuage Atelier — foundations.
 *
 * Base rules of the validated design system (cafe-nuage-design-system/,
 * components/bundle.css): page, type, buttons, coloured sections, cards,
 * header and footer. Colours, families, spacing and radii come from
 * tokens.css, generated from the design system's tokens.json; only the
 * fluid values (vw, clamp) are declared here, as the design system does.
 *
 * Contrast, settled on 2026-10-21: small text takes --vermilion-text and
 * --olive-text; titles of 24px and more, and the wordmark, keep the bright
 * tints. See the design system README, "Contraste".
 *
 * Component skins live in assets/css/components/, one file per component.
 */

@font-face {
	font-family: "Fredoka";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/fredoka-700-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Fredoka";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/fredoka-700-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	/* Fluid values, as declared by the design system's bundle.css. */
	--gutter: 3vw;
	--gutter-mobile: 6vw;
	--section: clamp(2.5rem, 1.5rem + 4vw, 5rem);
	--radius-section: clamp(20px, 2vw, 36px);

	/*
	 * Type scale, revised on 2026-11-11 (design system README, Typographie).
	 * Fluid sizes run from 360px to 1440px wide and always mix rem with vw:
	 * a size in vw alone does not grow with the browser's zoom (WCAG 1.4.4),
	 * while the rem part does. The largest title stays about 3.5 times the
	 * running text, against 4.5 before, which read as zoomed in on a laptop
	 * at 1280x720.
	 */
	--fs-h1: clamp(2.25rem, 1.75rem + 2.222vw, 3.75rem);
	--fs-h2: clamp(1.75rem, 1.5rem + 1.111vw, 2.5rem);
	--fs-h3: clamp(1.2rem, 1.133rem + 0.296vw, 1.4rem);
	--fs-lede: clamp(1.0625rem, 1.017rem + 0.204vw, 1.2rem);
	--fs-body: 1rem;
}

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

html {
	scroll-behavior: smooth;
	/* Anchors and keyboard focus land below the fixed header (WCAG 2.4.11). */
	scroll-padding-top: 6rem;
}

body {
	margin: 0;
	background: var(--ivory);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

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

a {
	color: inherit;
}

/* Titles are in colour, never black: Léa's rule. */
h1,
h2,
h3 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.1;
	text-wrap: balance;
	color: var(--vermilion);
}

h1,
h2 {
	font-family: var(--font-wordmark);
	letter-spacing: -0.01em;
	line-height: 1.05;
}

h1 {
	font-size: var(--fs-h1);
}

h2 {
	font-size: var(--fs-h2);
}

h3 {
	font-size: var(--fs-h3);
	letter-spacing: -0.02em;
}

.wrap {
	max-width: var(--max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.entry-content {
	max-width: 68ch;
}

.eyebrow {
	margin: 0 0 0.9rem;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--vermilion-text);
}

.lede {
	max-width: 56ch;
	font-size: var(--fs-lede);
	color: var(--muted);
}

/* Read by screen readers, not shown: WordPress's standard class. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Keyboard users land here first; it stays out of the way until focused. */
.skip-link {
	position: absolute;
	left: -9999px;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--paper);
	border-radius: var(--radius-pill);
	outline: 3px solid var(--gold);
}

/* Button — the template's pill. */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85rem 1.4rem; /* about 48px tall: above every target-size rule */
	border: 2px solid transparent;
	border-radius: var(--radius-pill);
	background: transparent;
	color: inherit;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}

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

.btn:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 3px;
}

.btn-primary {
	background: var(--vermilion);
	color: var(--on-accent);
}

.btn-ink {
	background: var(--steel);
	color: var(--on-accent);
}

.btn-ghost {
	background: transparent;
	border-color: currentColor;
	color: var(--navy); /* Léa's ink, as in the header (2026-11-11) */
}

.btn-sm {
	padding: 0.6rem 1rem;
	font-size: 0.92rem;
}

.btn[aria-disabled="true"] {
	background: transparent;
	color: var(--muted);
	border-color: var(--line);
	pointer-events: none;
}

/* SectionHead — eyebrow and h2 on the left, one sentence on the right. */
.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-bottom: var(--head-gap);
}

/*
 * Direct child only: bundle.css writes ".section-head p", which also greys
 * the eyebrow nested beside the h2, against its own rule that eyebrows are
 * vermilion.
 */
.section-head > p {
	max-width: 48ch;
	color: var(--muted);
}

/* Same gap below a grid as above it (bundle.css had 2rem, the head 2.2rem). */
.section-more {
	display: flex;
	justify-content: center;
	margin-top: var(--head-gap);
}

/*
 * Sections: one vertical rhythm for every block.
 *
 * Each section, plain or coloured, takes half of --section above and below,
 * and the main area adds the same half at its ends. Any two neighbours are
 * therefore exactly one --section apart, and so are the header and the
 * first block, and the last block and the footer.
 *
 * bundle.css gave plain sections a full --section on both sides and coloured
 * ones a gutter on top only, with ".inset + .inset { padding-top: 0 }": four
 * different gaps, and two coloured sections touching whenever the block
 * between them is hidden. Measured on 2026-10-24 at 1280px: 90, 128, 0 and
 * 0px. A coloured section keeps its gutter on the sides.
 */
.site-main {
	padding-block: calc(var(--section) / 2);
}

.site-main > section {
	padding-block: calc(var(--section) / 2);
}

.site-main > .inset {
	padding-inline: var(--gutter);
}

.inset > .wrap {
	/* The same on all four sides, so the title sits evenly in the corner. */
	padding: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);
	border-radius: var(--radius-section);
}

.tone-orange > .wrap { background: var(--orange); }
/*
 * Ivory, as if cut out of the orange: Adrien's choice on 2026-11-11. It is
 * 2.27:1, under WCAG's 3:1 for large text (design system README, Contraste).
 */
.tone-orange h2 { color: var(--ivory); }
.tone-orange .eyebrow { color: var(--ink); }
.tone-orange .section-head > p { color: rgba(29, 29, 29, 0.85); }

.tone-sky > .wrap { background: var(--sky); }
.tone-sky h2,
.tone-sky .eyebrow { color: var(--steel); }
.tone-sky .section-head > p { color: var(--ink); }

.tone-steel { color: var(--on-accent); }
.tone-steel > .wrap { background: var(--steel); }
.tone-steel .eyebrow { color: var(--gold); } /* olive was 3.4:1 on steel */
.tone-steel h2 { color: var(--gold); }
.tone-steel .section-head > p { color: rgba(255, 255, 255, 0.85); }

.tone-periwinkle > .wrap { background: var(--periwinkle); }
/*
 * Léa's navy ink, 10.6:1 (ivory, tried on 2026-11-11, was 1.45:1). The
 * section head only: the place list's own heading keeps its colour.
 */
.tone-periwinkle .section-head h2 { color: var(--navy); }

.tone-green { color: var(--on-accent); }
.tone-green > .wrap { background: var(--green); }
.tone-green .eyebrow { color: rgba(255, 255, 255, 0.8); } /* olive was 2.9:1 on green */
.tone-green h2 { color: var(--gold); }
.tone-green p { color: rgba(255, 255, 255, 0.8); }
.tone-green .btn-primary { background: var(--gold); color: var(--ink); }

/* Cards are paper whatever the section they sit on. */
.card {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	color: var(--ink);
	text-decoration: none;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--gap-grid);
}

.grid-lg {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: var(--gap-grid-lg);
}

/*
 * Chip — a filter in a pill, from bundle.css. Shared by the map's filter
 * (buttons) and the agenda's (links), hence the link rules.
 */
.chip {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0.45rem 0.8rem;
	border: 1.5px solid var(--ink);
	border-radius: var(--radius-round);
	background: transparent;
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.8rem;
	text-decoration: none;
	cursor: pointer;
}

.chip.on {
	background: var(--steel);
	border-color: var(--steel);
	color: var(--on-accent);
}

.chip:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 3px;
}

.filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.filter[hidden] {
	display: none;
}

/* StateBadge — the only two states a session shows. */
.state {
	display: inline-block;
	padding: 0.3rem 0.6rem;
	border-radius: var(--radius-round);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.state-full {
	background: var(--steel);
	color: var(--on-accent);
}

.state-cancel {
	background: transparent;
	color: var(--ink);
	border: 1.5px solid var(--ink);
}

/*
 * Placeholder — marks an image Léa has not supplied yet. Grey and dashed so
 * nobody mistakes it for content. Printed outside production only, by
 * cna_placeholder() in inc/placeholders.php. Values from bundle.css.
 */
.ph {
	display: grid;
	place-items: center;
	padding: 1rem;
	border: 2px dashed var(--ph-border);
	border-radius: var(--radius-card);
	background: repeating-linear-gradient(135deg, var(--ph-a) 0 10px, var(--ph-b) 10px 20px);
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	text-align: center;
	text-transform: uppercase;
}

.inset .ph {
	border-radius: var(--radius-section);
}

/* SiteHeader */
.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--ivory);
	border-bottom: 1px solid var(--line);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 4.5rem;
}

.brand {
	font-family: var(--font-wordmark);
	font-weight: 700;
	font-size: 1.4rem;
	line-height: 1.1;
	color: var(--vermilion);
	text-decoration: none;
}

.brand span {
	color: var(--olive);
}

.nav {
	display: flex;
	gap: 1.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.98rem;
}

.nav a {
	color: var(--vermilion-text);
	text-decoration: none;
}

.nav a:hover {
	color: var(--ink);
}

.cart {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--vermilion-text);
	text-decoration: none;
}

.cart b {
	padding: 0.1rem 0.5rem;
	border-radius: var(--radius-round);
	background: var(--steel);
	color: var(--on-accent);
	font-size: 0.8rem;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* Shown on mobile only, and only when the script can work it. */
.menu-toggle {
	display: none;
	align-items: center;
	min-height: 44px;
	padding: 0 1rem;
	border: 1.5px solid currentColor;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--vermilion-text);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
}

.menu-toggle:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 3px;
}

.menu-toggle__close,
.menu-toggle[aria-expanded="true"] .menu-toggle__open {
	display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
	display: inline;
}

/* SiteFooter */
.site-footer {
	padding-block: 2.5rem;
	background: var(--ivory);
	border-top: 1px solid var(--line);
	font-size: 0.92rem;
}

.site-footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem 2rem;
}

.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1.2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	text-decoration: none;
}

.site-footer .legal {
	margin: 0;
	color: var(--muted);
}

/* Posts and pages until their own templates exist. */
.teaser {
	padding-block: 2rem;
	border-bottom: 1px solid var(--line);
}

.teaser__title {
	margin-block: 0 0.5rem;
}

.teaser__date,
.entry-date {
	color: var(--muted);
	font-size: 0.875rem;
}

@media (max-width: 900px) {
	.wrap {
		padding-inline: var(--gutter-mobile);
	}

	.site-main > .inset {
		padding-inline: var(--gutter-mobile);
	}

	/*
	 * Mobile menu. The design system leaves it "à concevoir"; this composes
	 * its rules: a pill button beside the cart, links one per row of at
	 * least 48px, thin line separators. Without JavaScript the links simply
	 * wrap under the wordmark, so the site stays navigable.
	 */
	.site-header .wrap {
		flex-wrap: wrap;
		row-gap: 0;
	}

	/*
	 * The first row keeps the header's height whether the menu is open or
	 * not. Only the actions carry it: making the wordmark a flex box would
	 * drop the space between "Café Nuage" and "Atelier".
	 */
	.site-header__actions {
		min-height: 4.5rem;
	}

	.site-nav {
		order: 3;
		width: 100%;
	}

	.nav {
		flex-wrap: wrap;
		gap: 0 1.2rem;
		padding-bottom: 0.6rem;
	}

	/* A finger-sized target even when the links just wrap, without script. */
	.nav a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.js .site-nav {
		display: none;
	}

	.js .site-header.is-open .site-nav {
		display: block;
	}

	.js .site-header.is-open .nav {
		flex-direction: column;
		gap: 0;
		padding-bottom: 0.6rem;
		font-size: 1.1rem;
	}

	.js .site-header.is-open .nav a {
		display: flex;
		align-items: center;
		min-height: 48px;
		border-top: 1px solid var(--line);
	}

	.js .menu-toggle {
		display: inline-flex;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
