/*
 * Vie de l’école — the news list (`/actualites/`, `patterns/news-list.php`)
 * and the article (`patterns/article.php`), ported from the approved mockups
 * « vie-ecole » and « article »: `.mag`, `.arch`, `.artband`, `.strip`,
 * `.prose`, `.aussi`.
 *
 * Loaded after `theme.css`. Every rule is scoped to the two page classes the
 * templates put on `<main>` (`.news-page`, `.article-page`), so nothing here
 * reaches another page. Colours and fonts are read from the mockup tokens
 * (`--paper`, `--ivory`, `--line`, `--ink`, `--ink2`, `--bordeaux`) when the
 * shared stylesheet defines them, and from the theme's own presets otherwise,
 * so the page is right in light and dark with or without it.
 */

.news-page,
.article-page {
	--n-paper: var(--paper, var(--wp--preset--color--stone));
	--n-ivory: var(--ivory, var(--wp--preset--color--stone-2));
	--n-line: var(--line, var(--wp--preset--color--line));
	--n-ink: var(--ink, var(--wp--preset--color--ink));
	--n-ink2: var(--ink2, var(--wp--preset--color--ink-2));
	--n-accent: var(--bordeaux, var(--wp--preset--color--bordeaux));
	--n-serif: var(--wp--preset--font-family--newsreader);
	--n-arabic: var(--wp--preset--font-family--ibm-plex-sans-arabic);
	color: var(--n-ink);
	padding-block-end: 72px;
}

.news-page h1,
.news-page h2,
.article-page h1,
.article-page .aussi h2 {
	font-family: var(--n-serif);
	font-weight: 500;
	line-height: 1.08;
	text-wrap: balance;
	margin: 0;
	color: var(--n-ink);
}

.news-page a,
.article-page .aussi a {
	color: inherit;
}

/* ------------------------------------------------------------------
 * List — page head (`.phead2` in the mockup)
 * ------------------------------------------------------------------ */

.news-head {
	padding-block: 64px 24px;
}

.news-head h1 {
	margin-block-start: 0;
	font-size: clamp(38px, 5vw, 68px);
}

.news-ar {
	margin: 8px 0 0;
	font-family: var(--n-arabic);
	font-weight: 500;
	font-size: 28px;
	line-height: 1.6;
	color: var(--n-ink2);
	text-align: start;
}

.news-lede {
	max-width: 46ch;
	margin: 20px 0 0;
	font-size: 21px;
	line-height: 1.5;
}

.news-empty {
	margin-block-start: 28px;
	color: var(--n-ink2);
}

/* ------------------------------------------------------------------
 * List — magazine: the latest story large, the next three beside it
 * ------------------------------------------------------------------ */

.news-page .mag {
	display: grid;
	grid-template-columns: 7fr 5fr;
	gap: 44px;
	margin-block-start: 28px;
}

.news-page .mag a {
	text-decoration: none;
}

.news-page .mag h2 a:hover,
.news-page .mag h2 a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.news-page .lead-story .ph {
	display: block;
	margin-block-end: 14px;
}

.news-page .lead-story img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 2px;
	background: var(--n-ivory);
}

.news-page .lead-story h2 {
	margin: 8px 0;
	font-size: clamp(26px, 2.6vw, 36px);
}

.news-page .mag small {
	display: block;
	font-size: 14px;
	color: var(--n-ink2);
}

.news-page .mag p {
	margin: 0;
	font-size: 16px;
	color: var(--n-ink2);
}

.news-page .sidecol {
	display: grid;
	gap: 22px;
	align-content: start;
}

.news-page .st {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 16px;
	padding-block-start: 18px;
	border-block-start: 1px solid var(--n-line);
}

.news-page .st .ph {
	display: block;
	aspect-ratio: 1;
	border-radius: 2px;
	overflow: hidden;
	background: var(--n-ivory);
}

.news-page .st .ph img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.news-page .st h2 {
	margin: 4px 0;
	font-size: 19px;
}

@media (max-width: 900px) {
	.news-page .mag {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------------------
 * List — the archive: date and title
 * ------------------------------------------------------------------ */

.news-page .arch {
	margin-block-start: 56px;
	border-block-start: 2px solid var(--n-ink);
}

.news-page .arch > a {
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 24px;
	align-items: baseline;
	padding-block: 16px;
	border-block-end: 1px solid var(--n-line);
	text-decoration: none;
}

.news-page .arch > a:hover b,
.news-page .arch > a:focus-visible b {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.news-page .arch time {
	font-size: 15px;
	color: var(--n-ink2);
}

.news-page .arch b {
	font-family: var(--n-serif);
	font-weight: 500;
	font-size: 21px;
	line-height: 1.25;
}

.news-page .news-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-block-start: 28px;
	font-weight: 600;
}

@media (max-width: 700px) {
	.news-page .arch > a {
		grid-template-columns: 1fr;
		gap: 3px;
	}

	.news-page .arch .no-date {
		display: none;
	}
}

/* ------------------------------------------------------------------
 * Article — band: kicker, title, chapô
 * ------------------------------------------------------------------ */

.article-page .artband {
	padding-block: 56px 48px;
	background: var(--n-ivory);
	border-block-end: 1px solid var(--n-line);
}

.article-page .artband .kick {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--n-accent);
}

.article-page .artband h1 {
	max-width: 22ch;
	font-size: clamp(34px, 4.4vw, 60px);
}

.article-page .artband .chapo {
	max-width: 60ch;
	margin: 16px 0 0;
	font-size: 20px;
	line-height: 1.5;
	color: var(--n-ink2);
}

/* ------------------------------------------------------------------
 * Article — the photographs, one sliding band
 * ------------------------------------------------------------------ */

.article-page .strip-wrap {
	max-width: var(--wp--style--global--content-size, 1240px);
	margin-inline: auto;
	padding-inline: var(--ram-gutter, 32px);
}

.article-page .strip {
	display: flex;
	gap: 12px;
	margin-block-start: 26px;
	padding-inline: 28px;
	padding-block-end: 10px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	overscroll-behavior-x: contain;
}

.article-page .strip:focus-visible {
	outline: 2px solid var(--n-accent);
	outline-offset: 2px;
}

.article-page .strip figure {
	flex: 0 0 340px;
	margin: 0;
	scroll-snap-align: start;
}

.article-page .strip img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 2px;
	background: var(--n-ivory);
}

/* A post with one photograph: no band to slide, the image reads at the
   width of the text column above it. */
.article-page .strip.is-single {
	justify-content: center;
}

.article-page .strip.is-single figure {
	flex-basis: min(100%, 880px);
}

@media (max-width: 700px) {
	.article-page .strip-wrap {
		padding-inline: 0;
	}

	/* The band runs to the screen's edges; its first photograph starts on
	   the page gutter, under the title (passe du 20 octobre 2026, #14). */
	.article-page .strip {
		padding-inline: var(--ram-gutter, 20px);
	}

	.article-page .strip figure {
		flex-basis: 82%;
	}
}

/* ------------------------------------------------------------------
 * Article — the text column and « À lire aussi »
 * ------------------------------------------------------------------ */

.article-page .article-prose {
	max-width: calc(66ch + 2 * var(--ram-gutter, 32px));
	margin: 40px auto 0;
	padding-inline: var(--ram-gutter, 32px);
	padding-block-start: 0;
}

.article-page .article-prose > .entry-content > * {
	max-width: none;
}

.article-page .article-prose p {
	margin: 0 0 18px;
}

/* The closing social lines sit together (`theme.css`, « Voir la publication »). */
.article-page .article-prose p.post-social:has(+ p.post-social) {
	margin-block-end: 6px;
}

.article-page .aussi {
	margin-block-start: 64px;
	border-block-start: 2px solid var(--n-ink);
}

.article-page .aussi h2 {
	margin: 0 0 6px;
	padding-block-start: 14px;
	font-size: 24px;
}

.article-page .aussi > a {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 20px;
	align-items: baseline;
	padding-block: 16px;
	border-block-end: 1px solid var(--n-line);
	text-decoration: none;
}

.article-page .aussi > a:hover b,
.article-page .aussi > a:focus-visible b {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.article-page .aussi time {
	font-size: 15px;
	color: var(--n-ink2);
}

.article-page .aussi b {
	font-family: var(--n-serif);
	font-weight: 500;
	font-size: 20px;
	line-height: 1.25;
}

.article-page .aussi-toutes {
	margin: 18px 0 0;
	font-weight: 600;
}

.article-page .aussi-toutes a {
	color: var(--n-accent);
}

/* The article keeps the page gutter (`--ram-gutter`, 20px on a phone) at
   every width, as the heading band above it: a 16px override left the text
   4px off the title (passe du 20 octobre 2026, #14). */
@media (max-width: 700px) {
	.article-page .aussi > a {
		grid-template-columns: 1fr;
		gap: 3px;
	}

	.article-page .aussi .no-date {
		display: none;
	}
}
