/*
Theme Name: Sahara 2009
Description: Thème du récit « À pied dans l'erg Mehedjebat » (Sahara algérien, janvier 2009), dans le WordPress unique de sans-avion.net. Une seule page, maquette validée par l'auteur le 2 décembre 2026 : grande photo d'ouverture, titre posé dessus, couleurs sable et ocre des peintures rupestres, photos seules ou par 2 à la même hauteur. Album photos (page « album », 3 décembre 2026) : panorama en bandeau, photos jour par jour, agrandissement.
Version: 1.1.0
Author: sans-avion.net
Text Domain: sahara
*/

/* Polices : Literata (dossier fonts), Bodoni Moda et Josefin Sans (dossier fonts du thème sans-avion) */
@font-face { font-family: "Sahara Literata"; src: url("fonts/literata-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Sahara Literata"; src: url("fonts/literata-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Sahara Bodoni"; src: url("../sans-avion/fonts/bodoni-moda-italic.woff2") format("woff2"); font-weight: 500 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Sahara Josefin"; src: url("../sans-avion/fonts/josefin-sans.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
	--sable: #f5eee2;
	--encre: #2a1e16;
	--ocre: #a2401f;
	--doux: #7a6553;
	--trait: #e3d5bf;
	--f-texte: "Sahara Literata", Georgia, "Times New Roman", serif;
	--f-titre: "Sahara Bodoni", Didot, "Times New Roman", serif;
	--f-caps: "Sahara Josefin", "Century Gothic", sans-serif;
	color-scheme: light;
}
html { background: var(--sable); }
body { background: var(--sable); color: var(--encre); font: 18px/1.7 var(--f-texte); margin: 0; }
a { color: var(--ocre); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--ocre); outline-offset: 2px; }

/* Grande photo d'ouverture, puis le titre posé dessus en bas */
.s-une { display: block; width: 100%; max-width: 100%; height: clamp(240px, 58vh, 620px); object-fit: cover; object-position: 50% 70%; }
main { max-width: 42rem; margin: 0 auto; padding-block: 0 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.s-titre { position: relative; margin: -96px -28px 0; padding: 26px 28px 2px; background: var(--sable); border-radius: 4px 4px 0 0; }
.r-surtitre { font-family: var(--f-caps); font-weight: 600; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--ocre); margin: 0 0 10px; }
h1 { font-family: var(--f-titre); font-style: italic; font-weight: 700; font-size: clamp(2.1rem, 6.4vw, 3.3rem); line-height: 1.08; margin: 0 0 18px; text-wrap: balance; }
.r-chapo { font-style: italic; font-size: 1.12em; line-height: 1.6; margin: 0 0 8px; padding-bottom: 26px; border-bottom: 1px solid var(--trait); }

/* Texte */
h2 { font-family: var(--f-caps); font-weight: 600; font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4; margin: 2.4em 0 .8em; text-wrap: balance; scroll-margin-top: 16px; }
h2::before { content: ""; display: block; width: 40px; height: 3px; background: var(--ocre); margin-bottom: 14px; }
p { margin: 0 0 1em; }

/* Photos : seules sur toute la largeur, ou 2 côte à côte à la même hauteur (--r : largeur / hauteur de chaque photo) */
.s-photos { display: flex; gap: 6px; margin: 1.6em 0; }
.s-photos figure { flex: var(--r) 1 0; min-width: 0; margin: 0; }
.s-photos img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* Carte du trajet (travaux/recits-a-ecrire/sahara-2009/genere-carte.py) : dessin SVG, légende en dessous */
.s-carte { margin: 1.6em 0; }
.s-carte-svg { display: block; width: 100%; height: auto; border: 1px solid var(--trait); border-radius: 2px; }
.s-carte-fond { fill: #efe4cf; }
.s-carte text { font-family: var(--f-caps); font-size: 19px; fill: var(--encre); paint-order: stroke; stroke: #efe4cf; stroke-width: 5px; stroke-linejoin: round; }
.s-carte text.grand { font-size: 23px; font-weight: 600; }
.s-carte text.relief { font-family: var(--f-texte); font-style: italic; font-size: 19px; fill: var(--doux); }
.s-carte text.erg { font-family: var(--f-titre); font-style: italic; font-weight: 700; font-size: 27px; fill: var(--ocre); }
.s-carte text.route { font-size: 16px; fill: var(--doux); }
.s-carte-n1 { fill: none; stroke: #ab9d8a; stroke-width: 3; }
.s-carte-4x4 { fill: none; stroke: var(--ocre); stroke-width: 3.5; stroke-linecap: round; }
.s-carte-pied { fill: none; stroke: var(--ocre); stroke-width: 5.5; stroke-linecap: round; stroke-dasharray: 0 10; }
.s-carte-ville { fill: #fff; stroke: var(--encre); stroke-width: 2.5; }
.s-carte-lieu { fill: var(--ocre); }
.s-carte-dunes path { fill: none; stroke: #d9b88f; stroke-width: 2.5; stroke-linecap: round; }
.s-carte-echelle path { fill: none; stroke: var(--encre); stroke-width: 2; }
.s-carte .s-carte-echelle text { font-size: 15px; }
.s-carte-nord path { fill: var(--encre); }
.s-carte-vignette rect:first-child { fill: var(--sable); stroke: var(--trait); }
.s-carte-vignette path { fill: #e6d6ba; stroke: var(--doux); stroke-width: 1; stroke-linejoin: round; }
.s-carte-vignette .s-carte-zone { fill: var(--ocre); stroke: var(--ocre); stroke-width: 1.5; }
.s-carte .s-carte-vignette text { font-size: 16px; stroke: #e6d6ba; fill: var(--doux); }
.s-carte figcaption { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--doux); }
.s-carte figcaption small { font-size: 13px; }
.s-carte-l4x4, .s-carte-lpied { display: inline-block; width: 30px; margin-right: 8px; vertical-align: middle; border-top: 3px solid var(--ocre); }
.s-carte-lpied { border-top: 4px dotted var(--ocre); }

/* Lien vers l'album, à la fin du récit : 4 vignettes carrées, puis le texte */
.s-album-lien { margin: 2.6em 0 0; }
.s-album-lien a { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--trait); border-radius: 4px; background: #efe4cf; color: var(--encre); text-decoration: none; }
.s-album-vignettes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.s-album-vignettes img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.s-album-sur { display: block; font: 600 13px/1.4 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--ocre); }
.s-album-titre { display: block; margin: 4px 0 2px; font: italic 700 1.9rem/1.15 var(--f-titre); text-underline-offset: 5px; }
.s-album-detail { display: block; font-size: 15px; line-height: 1.6; color: var(--doux); }
.s-album-lien a:hover .s-album-titre, .s-album-lien a:focus-visible .s-album-titre { color: var(--ocre); text-decoration: underline; text-decoration-thickness: 1px; }

/* Album photos (page-album.php) : panorama en bandeau, à faire défiler */
.s-pano { margin: 0; }
.s-pano-defile { overflow-x: auto; overscroll-behavior-x: contain; background: var(--encre); scrollbar-color: var(--ocre) var(--trait); }
.s-pano-defile:focus-visible { outline: 2px solid var(--ocre); outline-offset: -2px; }
.s-pano img { display: block; width: auto; max-width: none; height: clamp(200px, 42vh, 380px); }
.s-pano figcaption { padding: 8px 16px 0; text-align: center; font-size: 14px; color: var(--doux); }
.s-pano figcaption span { font-size: 13px; }
@media (pointer: fine) {
	.s-pano-defile { cursor: grab; }
	.s-pano-defile.s-tire { cursor: grabbing; }
}

/* Album : titre, puis un groupe de photos par jour, à la même hauteur sur chaque ligne (--r : largeur / hauteur) */
main.s-album { max-width: 72rem; }
.s-album .s-titre { max-width: 42rem; margin: 0; padding: 28px 0 0; background: none; }
.s-album-recit { max-width: 42rem; font-size: 16px; color: var(--doux); }
.s-jour { margin-top: 2.6em; }
.s-jour h2 { margin: 0 0 .5em; scroll-margin-top: 16px; }
.s-date { display: block; margin-bottom: 4px; font: italic 700 1.6rem/1.2 var(--f-titre); letter-spacing: 0; text-transform: none; color: var(--ocre); }
.s-renvoi { margin: 0 0 14px; font-size: 15px; color: var(--doux); }
.s-album-grille { display: flex; flex-wrap: wrap; gap: 6px; }
.s-album-grille::after { content: ""; flex-grow: 1000000; }
.s-album-grille a { display: block; flex: calc(var(--r) * 100) 1 calc(var(--r) * 210px); scroll-margin: 16px; }
.s-album-grille img { display: block; width: 100%; height: auto; border-radius: 2px; background: var(--trait); transition: filter .2s; }
.s-album-grille a:hover img { filter: brightness(1.08); }
.s-album-fin { margin: 2.6em 0 0; padding-top: 14px; border-top: 1px solid var(--trait); font-size: 16px; }

/* Album : photo agrandie (album.js), sur fond nuit */
html:has(.s-visio[open]) { overflow: hidden; }
.s-visio { box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #140d09; color: var(--sable); overscroll-behavior: contain; touch-action: pinch-zoom; }
.s-visio[open] { display: flex; align-items: center; justify-content: center; }
.s-visio::backdrop { background: #140d09; }
.s-visio figure { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; }
.s-visio img { display: block; aspect-ratio: var(--r); width: min(1600px, calc(100vw - 32px), calc((100vh - 112px) * var(--r))); width: min(1600px, calc(100vw - 32px), calc((100dvh - 112px) * var(--r))); height: auto; }
.s-visio figcaption { max-width: min(42rem, calc(100vw - 32px)); text-align: center; font-size: 16px; line-height: 1.5; }
.s-visio-info { display: block; margin-top: 2px; font: 12px/1.4 var(--f-caps); letter-spacing: .14em; text-transform: uppercase; color: #c9b79f; }
.s-visio button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(245, 238, 226, .14); color: var(--sable); cursor: pointer; }
.s-visio button:hover { background: rgba(245, 238, 226, .26); }
.s-visio button:focus-visible { outline: 2px solid var(--sable); outline-offset: 2px; }
.s-visio-prec { top: 50%; left: max(12px, env(safe-area-inset-left, 0px)); transform: translateY(-50%); }
.s-visio-suiv { top: 50%; right: max(12px, env(safe-area-inset-right, 0px)); transform: translateY(-50%); }
.s-visio-fermer { top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) {
	.s-visio img { width: min(1600px, calc(100vw - 160px), calc((100vh - 112px) * var(--r))); width: min(1600px, calc(100vw - 160px), calc((100dvh - 112px) * var(--r))); }
}

/* Mots-clés de la page (moyens de transport), vers les pages des mots-clés de tous les récits */
.s-mots { margin: 2.4em 0 0; padding-top: 14px; border-top: 1px solid var(--trait); font-size: 15px; color: var(--doux); }

/* Publicité (zones B et C) : mention « Publicité », invisible tant que Google n'a rien mis */
.sa-pub { clear: both; margin: 0; text-align: center; }
.sa-pub ins.adsbygoogle { background: transparent; }
.sa-pub:has(ins[data-ad-status="filled"]) { margin: 2em 0; }
.sa-pub-mention { display: none; margin-bottom: 6px; font: 11px/1.4 var(--f-caps); letter-spacing: .14em; text-transform: uppercase; color: var(--doux); }
.sa-pub:has(ins[data-ad-status="filled"]) .sa-pub-mention { display: block; }
.sa-pub:has(ins[data-ad-status="unfilled"]) { display: none; }

@media (max-width: 560px) {
	body { font-size: 16.5px; }
	.s-titre { margin: -56px -12px 0; padding: 20px 12px 2px; }
	.s-photos { gap: 4px; }
	.s-album-grille { gap: 4px; }
	.s-album-grille a { flex-basis: calc(var(--r) * 100px); }
	.s-date { font-size: 1.4rem; }
	.s-album-titre { font-size: 1.6rem; }
	.s-visio-prec, .s-visio-suiv { top: auto; bottom: max(12px, env(safe-area-inset-bottom, 0px)); transform: none; }
	.s-visio img { width: min(calc(100vw - 16px), calc((100vh - 190px) * var(--r))); width: min(calc(100vw - 16px), calc((100dvh - 190px) * var(--r))); }
	.s-carte text { font-size: 22px; }
	.s-carte text.grand { font-size: 25px; }
	.s-carte text.relief { font-size: 21px; }
	.s-carte text.route, .s-carte .s-carte-echelle text { font-size: 19px; }
	.s-carte .s-carte-vignette text { font-size: 20px; }
}
