/*
Theme Name: Sillage
Description: Un carnet de bord aérospatial et cinématographique : lever de soleil en orbite, grands titres en italique, affichettes d'articles.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sillage
*/

/* Les couleurs, les polices et les tailles se règlent dans theme.json (et dans l'éditeur de site, « Styles »).
   Ce fichier dessine ce que l'éditeur ne sait pas faire : la scène de l'accueil, les affichettes, les détails d'article. */

/* ---------- 1. Bases ---------- */

:root {
	--s-nuit: var(--wp--preset--color--nuit, #090705);
	--s-cendre: var(--wp--preset--color--cendre, #120d09);
	--s-ivoire: var(--wp--preset--color--ivoire, #f3ebdf);
	--s-sable: var(--wp--preset--color--sable, #d9cdbd);
	--s-brume: var(--wp--preset--color--brume, #b9ab98);
	--s-aube: var(--wp--preset--color--aube, #ffb86b);
	--s-ligne: rgba(243, 235, 223, 0.16);
	--s-serif: var(--wp--preset--font-family--instrument-serif, Georgia, serif);
	--s-sans: var(--wp--preset--font-family--inter, system-ui, sans-serif);
	--s-marge: var(--wp--custom--marge, clamp(1.25rem, 6vw, 4.8rem));
}

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

::selection {
	background: var(--s-aube);
	color: var(--s-nuit);
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

:where(a, button, input, textarea, summary):focus-visible {
	outline: 2px solid var(--s-aube);
	outline-offset: 3px;
}

/* Le pied de page reste en bas de l'écran, même sur une page courte. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Les grandes bandes du site se touchent : pas d'espace automatique entre elles. */
.wp-site-blocks > *,
main.sillage-accueil > *,
main.sillage-page > * {
	margin-block-start: 0;
}

/* Petite étiquette en capitales espacées (rubrique d'un article, « Carnet de bord »). */
.sillage-etiquette {
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--s-aube);
}

.sillage-etiquette a {
	color: inherit;
	text-decoration: none;
}

.sillage-etiquette a:hover {
	color: var(--s-ivoire);
}

/* Lien précédé d'un trait : « —— Lire la dernière entrée ». */
.sillage-lien-trait a {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	min-height: 48px;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	text-decoration: none;
}

.sillage-lien-trait a::before {
	content: "";
	flex: none;
	width: 44px;
	height: 1px;
	background: var(--s-aube);
	transition: width 0.3s ease;
}

.sillage-lien-trait a:hover::before {
	width: 64px;
}

/* ---------- 2. Bande noire du haut : nom du blog et menu ---------- */

.sillage-barre {
	background: #000;
	padding: 8px var(--s-marge);
}

.sillage-barre.is-layout-flex {
	gap: 4px 32px;
}

.sillage-barre .wp-block-site-title {
	margin: 0;
	font-family: var(--s-serif);
	font-style: italic;
	font-size: 1.75rem;
	font-weight: 400;
	line-height: 1;
}

.sillage-barre .wp-block-site-title a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--s-ivoire);
	text-decoration: none;
}

.sillage-barre .wp-block-navigation {
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

.sillage-barre .wp-block-navigation .wp-block-navigation__container {
	gap: 4px 28px;
}

.sillage-barre .wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 13px;
	color: #cbbfae;
	text-decoration: none;
}

.sillage-barre .wp-block-navigation .wp-block-navigation-item__content:hover,
.sillage-barre .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--s-ivoire);
}

.sillage-barre .wp-block-navigation__responsive-container-open,
.sillage-barre .wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
	color: var(--s-ivoire);
}

.sillage-barre .wp-block-navigation__responsive-container.is-menu-open {
	padding: 20px var(--s-marge);
}

.sillage-barre .is-menu-open .wp-block-navigation-item__content {
	font-size: 1rem;
}

/* ---------- 3. Accueil : l'aube en orbite ---------- */

/* Tout le décor est dessiné en CSS, sans image :
   - le fond porte la traînée (le « sillage »), la raie de lumière horizontale et les étoiles ;
   - ::before est le soleil, ::after la planète qui le cache à moitié ;
   - le grain de pellicule est posé par-dessus (voir .sillage-hero__texte::after).
   --apex-x / --apex-y : le point de l'horizon où le soleil se lève. */
.sillage-hero {
	--apex-x: 73%;
	--apex-y: 110px;
	--raie-x: calc(73% + 253px);   /* place une raie de 1100 px centrée sur l'apex */
	--trainee-x: calc(73% + 146px); /* place la traînée de 200 px juste à droite de l'apex */
	--trainee-t: 200px;
	--etoiles-pos: right top;       /* les étoiles restent à droite, jamais derrière le texte */
	--etoiles-t: 48% 440px;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	padding: 88px var(--s-marge) 170px;
	background-color: var(--s-nuit);
	background-repeat: no-repeat;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='t' gradientUnits='userSpaceOnUse' x1='4' y1='196' x2='190' y2='12'%3E%3Cstop offset='0' stop-color='%23ffb86b' stop-opacity='0'/%3E%3Cstop offset='.65' stop-color='%23ffb86b' stop-opacity='.9'/%3E%3Cstop offset='1' stop-color='%23fff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M4 196C50 160 120 90 190 12' stroke='url(%23t)' stroke-width='1.4' stroke-linecap='round'/%3E%3Ccircle cx='190' cy='12' r='2.6' fill='%23fff'/%3E%3C/svg%3E"),
		linear-gradient(90deg, transparent, rgba(255, 222, 180, 0.95) 50%, transparent),
		radial-gradient(closest-side, rgba(255, 190, 120, 0.4), transparent),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 440' fill='%23fff4e6'%3E%3Ccircle cx='60' cy='40' r='0.9' fill-opacity='0.8'/%3E%3Ccircle cx='130' cy='150' r='0.7' fill-opacity='0.45'/%3E%3Ccircle cx='190' cy='30' r='0.7' fill-opacity='0.5'/%3E%3Ccircle cx='250' cy='210' r='0.7' fill-opacity='0.4'/%3E%3Ccircle cx='300' cy='70' r='1' fill-opacity='0.8'/%3E%3Ccircle cx='360' cy='180' r='0.7' fill-opacity='0.45'/%3E%3Ccircle cx='410' cy='25' r='0.7' fill-opacity='0.55'/%3E%3Ccircle cx='455' cy='120' r='1' fill-opacity='0.8'/%3E%3Ccircle cx='505' cy='60' r='0.7' fill-opacity='0.5'/%3E%3Ccircle cx='560' cy='200' r='0.7' fill-opacity='0.4'/%3E%3Ccircle cx='600' cy='95' r='0.9' fill-opacity='0.75'/%3E%3Ccircle cx='95' cy='260' r='0.7' fill-opacity='0.4'/%3E%3Ccircle cx='335' cy='300' r='0.7' fill-opacity='0.35'/%3E%3Ccircle cx='520' cy='330' r='0.7' fill-opacity='0.45'/%3E%3Ccircle cx='615' cy='270' r='0.7' fill-opacity='0.5'/%3E%3Ccircle cx='220' cy='100' r='0.7' fill-opacity='0.5'/%3E%3C/svg%3E");
	background-size:
		var(--trainee-t) var(--trainee-t),
		1100px 2px,
		1100px 26px,
		var(--etoiles-t);
	background-position:
		var(--trainee-x) calc(100% - var(--apex-y) - 8px),
		var(--raie-x) calc(100% - var(--apex-y) + 1px),
		var(--raie-x) calc(100% - var(--apex-y) + 13px),
		var(--etoiles-pos);
}

.sillage-hero::before {
	content: "";
	position: absolute;
	z-index: 0;
	left: var(--apex-x);
	bottom: var(--apex-y);
	width: 560px;
	height: 560px;
	transform: translate(-50%, 50%);
	border-radius: 50%;
	background: radial-gradient(circle, #fff 0, #ffe2b0 2.5%, rgba(255, 170, 80, 0.55) 9%, rgba(255, 110, 40, 0.18) 30%, transparent 62%);
	animation: sillage-lueur 7s ease-in-out infinite;
}

.sillage-hero::after {
	content: "";
	position: absolute;
	z-index: 1;
	left: var(--apex-x);
	bottom: calc(var(--apex-y) - 3000px);
	width: 3000px;
	height: 3000px;
	transform: translateX(-50%);
	border-radius: 50%;
	background: radial-gradient(circle at 50% 0%, #2a1408 0, #120a06 7%, #070504 20%);
	box-shadow:
		0 0 0 1px rgba(255, 222, 180, 0.85),
		0 -4px 18px 2px rgba(255, 170, 90, 0.6),
		0 -26px 90px 12px rgba(255, 110, 40, 0.28);
}

@keyframes sillage-lueur {
	50% { opacity: 0.75; }
}

.sillage-hero .sillage-hero__texte {
	max-width: 640px;
}

.sillage-hero .sillage-hero__texte > * {
	position: relative;
	z-index: 3;
	margin-block: 0;
}

.sillage-hero .sillage-hero__texte > * + * {
	margin-block-start: 22px;
}

/* Grain de pellicule sur toute la scène. */
.sillage-hero__texte::after {
	content: "";
	position: absolute;
	z-index: 4;
	inset: 0;
	pointer-events: none;
	opacity: 0.22;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.sillage-hero .sillage-hero__titre {
	font-family: var(--s-serif);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(5.5rem, 15vw, 11.875rem);
	line-height: 0.9;
	letter-spacing: -0.01em;
}

.sillage-hero .sillage-hero__titre a {
	color: inherit;
	text-decoration: none;
}

.sillage-hero .sillage-hero__texte > .sillage-hero__devise {
	margin-block-start: 30px;
}

.sillage-hero .sillage-hero__devise {
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: #e2d6c5;
}

.sillage-hero .sillage-hero__chapeau {
	max-width: 480px;
	font-family: var(--s-serif);
	font-size: 1.5rem;
	line-height: 1.35;
	color: var(--s-sable);
}

.sillage-hero .sillage-etiquette {
	letter-spacing: 0.4em;
}

/* Sous 800 px : le texte en haut, le lever de soleil en dessous, centré. */
@media (max-width: 800px) {
	.sillage-hero {
		--apex-x: 50%;
		--raie-x: 50%;
		--trainee-x: calc(50% + 75px);
		--trainee-t: 150px;
		--etoiles-pos: center bottom -90px;
		--etoiles-t: 640px 440px;
		padding-top: 56px;
		padding-bottom: 390px;
	}
}

/* Bande noire du bas de la scène, façon générique de film. */
.sillage-generique {
	background: #000;
	padding: 18px var(--s-marge);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--s-brume);
}

.sillage-generique.is-layout-flex {
	gap: 6px 24px;
}

.sillage-generique p {
	margin: 0;
}

/* ---------- 4. Les affichettes (liste des articles) ---------- */

.sillage-section {
	padding-block: 88px 96px;
}

.sillage-section .sillage-titre-section {
	margin-block: 0 40px;
	font-family: var(--s-serif);
	font-style: italic;
	font-weight: 400;
	font-size: 2.75rem;
	line-height: 1.1;
}

.sillage-section .sillage-sous-titre {
	margin-block: -24px 40px;
	color: var(--s-sable);
}

.sillage-section .sillage-sous-titre p {
	max-width: 40rem;
	margin: 0;
}

.sillage-affiches .wp-block-post-template.wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(13.75rem, 100%), 1fr));
	gap: 44px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sillage-affiches li.wp-block-post {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.sillage-affiches li.wp-block-post > * {
	margin-block: 0;
}

.sillage-affiches .wp-block-post-featured-image {
	overflow: hidden;
	border: 1px solid var(--s-ligne);
	background: var(--s-cendre);
}

.sillage-affiches .wp-block-post-featured-image img {
	transition: transform 0.7s ease;
}

.sillage-affiches li.wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.035);
}

/* Un article sans image reçoit une affichette dessinée : un petit lever de soleil. */
.sillage-affiches li.wp-block-post:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 4 / 5;
	border: 1px solid var(--s-ligne);
	background:
		radial-gradient(ellipse 140% 50% at 50% 122%, #080605 0, #080605 99.4%, transparent 100%),
		radial-gradient(circle at 50% 72%, #ffe2b0 0, rgba(255, 170, 80, 0.55) 5%, rgba(255, 110, 40, 0.16) 22%, transparent 46%),
		var(--s-cendre);
}

.sillage-affiches .wp-block-post-title {
	font-family: var(--s-serif);
	font-style: normal;
	font-weight: 400;
	font-size: 1.75rem;
	line-height: 1.15;
}

.sillage-affiches .wp-block-post-title a {
	text-decoration: none;
}

.sillage-affiches .wp-block-post-date {
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--s-brume);
}

.wp-block-query-pagination {
	margin-top: 56px;
	padding-top: 24px;
	border-top: 1px solid var(--s-ligne);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.wp-block-query-pagination a {
	color: var(--s-sable);
	text-decoration: none;
}

.wp-block-query-pagination .current {
	color: var(--s-aube);
}

/* ---------- 5. Un article, une page ---------- */

.sillage-article .sillage-article__tete {
	padding-block: 72px 44px;
}

.sillage-article .sillage-article__tete > * {
	margin-block: 0;
}

.sillage-article .sillage-article__tete > * + * {
	margin-block-start: 22px;
}

.sillage-article__tete .wp-block-post-title {
	font-size: clamp(2.75rem, 7vw, 5.5rem);
	line-height: 1;
	text-wrap: balance;
}

.sillage-article__tete .wp-block-post-date {
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	color: var(--s-brume);
}

/* L'image d'en-tête au format cinéma, dans une bande noire d'un bord à l'autre de l'écran. */
.sillage-article .sillage-article__image {
	width: min(100%, 1180px);
	margin: 0 auto;
	box-shadow: 0 0 0 100vmax #000;
	clip-path: inset(0 -100vmax);
}

.sillage-article .wp-block-post-content {
	padding-block: 56px 72px;
}

.wp-block-post-content :is(h2, h3, h4) {
	margin-block-start: 2.6rem;
}

.wp-block-post-content a:where(:not(.wp-element-button)) {
	text-decoration-color: var(--s-aube);
}

/* Style « Chapeau » : le paragraphe d'introduction, plus grand, en serif. */
p.is-style-chapeau {
	font-family: var(--s-serif);
	font-size: 1.625rem;
	line-height: 1.4;
	color: var(--s-sable);
}

.wp-block-quote {
	position: relative;
	margin-inline: 0;
	padding: 28px 0 0;
	border: 0;
	font-family: var(--s-serif);
	font-style: italic;
	font-size: 1.75rem;
	line-height: 1.35;
	color: var(--s-sable);
}

.wp-block-quote::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 44px;
	height: 1px;
	background: var(--s-aube);
}

.wp-block-quote cite {
	display: block;
	margin-top: 14px;
	font-family: var(--s-sans);
	font-style: normal;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--s-brume);
}

/* Le séparateur est une raie de lumière, comme l'horizon de l'accueil. */
.wp-block-separator {
	height: 2px;
	margin-block: 3rem;
	border: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 222, 180, 0.9) 50%, transparent);
	box-shadow: 0 0 22px 3px rgba(255, 150, 70, 0.28);
}

code,
kbd,
pre {
	font-family: var(--wp--preset--font-family--mono);
}

:not(pre) > code {
	padding: 0.12em 0.4em;
	background: rgba(243, 235, 223, 0.08);
	font-size: 0.9em;
}

kbd {
	padding: 0.05em 0.4em;
	border: 1px solid var(--s-ligne);
	border-bottom-width: 2px;
	font-size: 0.9em;
}

.wp-block-code,
.wp-block-preformatted {
	padding: 20px 24px;
	overflow-x: auto;
	border: 1px solid var(--s-ligne);
	background: var(--s-cendre);
	font-size: 0.9375rem;
	line-height: 1.6;
}

.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.wp-block-table :is(td, th) {
	padding: 0.7rem 0.8rem;
	border: 0;
	border-bottom: 1px solid var(--s-ligne);
	text-align: left;
}

.wp-block-table :is(thead, tfoot) {
	border: 0;
}

.wp-block-table th {
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--s-brume);
}

.wp-element-caption {
	margin-top: 0.8em;
	text-align: center;
}

.sillage-article .sillage-article__pied {
	padding-bottom: 96px;
}

.sillage-mots-cles {
	font-size: 0.875rem;
	color: var(--s-brume);
}

.sillage-article__voisins {
	padding-top: 28px;
	border-top: 1px solid var(--s-ligne);
}

.sillage-article__voisins.is-layout-flex {
	align-items: flex-start;
	gap: 24px 40px;
}

.wp-block-post-navigation-link {
	max-width: 22rem;
	font-family: var(--s-serif);
	font-size: 1.5rem;
	line-height: 1.25;
}

.wp-block-post-navigation-link a {
	text-decoration: none;
}

.wp-block-post-navigation-link .post-navigation-link__label {
	display: block;
	margin-bottom: 8px;
	font-family: var(--s-sans);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--s-brume);
}

.wp-block-post-navigation-link.post-navigation-link-next {
	margin-left: auto;
	text-align: right;
}

/* ---------- 6. Recherche, page introuvable, pied de page ---------- */

.wp-block-search__input {
	min-height: 48px;
	padding: 0 16px;
	border: 1px solid rgba(243, 235, 223, 0.4);
	border-radius: 0;
	background: transparent;
	color: var(--s-ivoire);
	font: inherit;
}

.sillage-perdu {
	padding-block: 120px 140px;
}

.sillage-pied {
	padding: 28px var(--s-marge);
	border-top: 1px solid rgba(243, 235, 223, 0.12);
	font-size: 0.8125rem;
	line-height: 1.5;
	letter-spacing: 0.14em;
	color: var(--s-brume);
}

.sillage-pied.is-layout-flex {
	gap: 8px 24px;
}

.sillage-pied :is(p, .wp-block-site-title, .wp-block-site-tagline) {
	margin: 0;
	font-size: inherit;
	font-weight: 400;
}

.sillage-pied a {
	color: inherit;
	text-decoration: none;
}

.sillage-pied a:hover {
	color: var(--s-ivoire);
}

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