/* Collectif Commune — styles du site */

/* ==========================================================================
   1. RÉGLAGES — tout ce qui se modifie facilement est ici
   ========================================================================== */

/*
 * TYPOGRAPHIE
 * Pour utiliser la même typo que le site de référence :
 * 1. déposer les fichiers .woff2 dans /assets/fonts/
 * 2. décommenter le bloc @font-face ci-dessous et ajuster les noms de fichiers
 * 3. remplacer "MaTypo" en tête de --font
 */
/*
@font-face {
	font-family: "MaTypo";
	src: url("fonts/MaTypo-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
*/

:root {
	--font: "MaTypo", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--ink: #000;
	--paper: #fff;

	--weight: 700;                             /* graisse du texte (700 = gras, comme la maquette) */
	--gutter: clamp(16px, 2.2vw, 36px);        /* marge autour du header */
	--nav-size: 20px;                          /* taille de « info » */
	--logo-height: 58px;                       /* hauteur du logo */

	--slide-pad-y: 7vh;                        /* blanc au-dessus / au-dessous des images */
	--slide-pad-x: 160px;                      /* blanc minimum à gauche / à droite (dégage le logo) */
	--fade: 0ms;                               /* fondu entre images (0ms = coupe sèche, ex. 400ms) */

	--caption-size: 12px;                      /* légendes des photos, en bas à droite */

	/* Panneau info */
	--panel-bg: #e6e4db;                       /* beige de la maquette */
	--panel-width: 48vw;                       /* largeur du panneau */
	--panel-speed: 500ms;                      /* vitesse d'ouverture */
	--panel-pad: 24px;                         /* marges intérieures */
	--panel-top: 140px;                        /* début du texte sous le header */
	--panel-text-size: 20px;                   /* texte principal + « Contact » / « links » */
	--panel-small-size: 13px;                  /* adresse, liens */
	--panel-label-col: 115px;                  /* largeur de la colonne « Contact » / « links » */
	--picto-size: 55px;                        /* taille des pictogrammes */

	/* Autres pages éventuelles */
	--info-size: clamp(28px, 4.4vw, 68px);
	--info-leading: 1.15;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */

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

html, body {
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-weight: var(--weight);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ==========================================================================
   3. HEADER — logo à gauche, « info » à droite
   ========================================================================== */

.site-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 20;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: var(--gutter);
	pointer-events: none;           /* laisse passer les clics vers le diaporama… */
}
.site-header > * { pointer-events: auto; }   /* …sauf sur le logo et le lien */

.site-logo img,
.custom-logo {
	height: var(--logo-height);
	width: auto;
	max-width: 40vw;
	object-fit: contain;
}
.site-title { font-size: var(--nav-size); line-height: 1; }

.site-nav a {
	display: inline-block;
	font-size: var(--nav-size);
	line-height: 1;
	transition: opacity .2s;
}
.site-nav a:hover { opacity: .45; }

/* ==========================================================================
   4. DIAPORAMA (page d'accueil)
   ========================================================================== */

body.home { overflow: hidden; }

.slideshow {
	position: relative;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	background: var(--paper);
}

.slides { list-style: none; position: absolute; inset: 0; }

.slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--slide-pad-y) var(--slide-pad-x) max(var(--slide-pad-y), 60px);   /* bas : place pour la légende */
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--fade) ease, visibility 0s linear var(--fade);
}
.slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity var(--fade) ease, visibility 0s;
}

.slide figure {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Image centrée et calée sur la hauteur de l'écran
   (rétrécit seulement si elle est trop large pour l'écran) */
.slide-img {
	height: 100%;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.slide figcaption {
	position: absolute;
	right: var(--gutter);
	bottom: calc(var(--gutter) * .75);
	max-width: 46vw;
	font-size: var(--caption-size);
	font-weight: 400;
	line-height: 1.3;
	text-align: right;
	pointer-events: none;
}

/* Zone invisible sur toute la page : un clic = image suivante */
.slideshow-zone {
	position: absolute;
	inset: 0;
	z-index: 10;
	background: transparent;
	border: 0;
	cursor: pointer;
}
.slideshow-zone:focus-visible { outline: 1px solid var(--ink); outline-offset: -8px; }

.has-custom-cursor .slideshow-zone { cursor: none; }

.slide-counter {
	display: none;                  /* compteur « 3/12 » masqué (supprimer cette ligne pour l'afficher) */
	position: absolute;
	right: var(--gutter);
	bottom: var(--gutter);
	z-index: 11;
	font-size: var(--nav-size);
	line-height: 1;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}
.is-single .slide-counter,
.is-single .slideshow-zone { display: none; }

/* Curseur personnalisé (souris uniquement, masqué sur tactile) */
.cursor {
	position: fixed;
	top: 0; left: 0;
	z-index: 30;
	pointer-events: none;
	opacity: 0;
	transition: opacity .15s;
	will-change: transform;
}
.cursor.is-visible { opacity: 1; }
.cursor img {
	width: 48px;
	height: 20px;
	transform: translate(-50%, -50%);
}

.slideshow-empty {
	height: 100svh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--gutter);
	font-size: var(--nav-size);
	text-align: center;
}

/* ==========================================================================
   5. PAGE INFO — texte de présentation pleine page, en gros
   ========================================================================== */

.info {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	align-items: center;
	padding: calc(var(--gutter) * 2 + var(--logo-height)) var(--gutter) var(--gutter);
}

.info-text {
	font-size: var(--info-size);
	line-height: var(--info-leading);
	letter-spacing: -0.01em;
	width: 100%;
}
.info-text > * + * { margin-top: .6em; }
.info-text a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .12em;
}
.info-text a:hover { opacity: .45; }
.info-text img { margin: .5em 0; }

/* ==========================================================================
   5b. PANNEAU INFO — glisse depuis la droite par-dessus le diaporama
   ========================================================================== */

.info-panel {
	position: fixed;
	top: 0; right: 0; bottom: 0;
	z-index: 15;                    /* sous le header : « info » reste cliquable */
	width: var(--panel-width);
	background: var(--panel-bg);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(100%);
	visibility: hidden;
	transition: transform var(--panel-speed) cubic-bezier(.65, 0, .35, 1), visibility 0s linear var(--panel-speed);
	outline: none;
}
.info-open .info-panel {
	transform: none;
	visibility: visible;
	transition: transform var(--panel-speed) cubic-bezier(.65, 0, .35, 1), visibility 0s;
}

.info-panel__inner {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	padding: var(--panel-top) var(--panel-pad) var(--panel-pad);
}

.info-panel__text {
	font-size: var(--panel-text-size);
	line-height: 1.28;
}
.info-panel__text > * + * { margin-top: 1.28em; }
.info-panel__text a,
.info-panel__small a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: .15em;
}

.info-panel__row {
	display: grid;
	grid-template-columns: var(--panel-label-col) 1fr;
	align-items: baseline;
	margin-top: 44px;
}
.info-panel__text + .info-panel__row { margin-top: 84px; }

.info-panel__label {
	font-size: var(--panel-text-size);
	font-weight: var(--weight);
	line-height: 1;
}

.info-panel__small {
	list-style: none;
	font-size: var(--panel-small-size);
	font-weight: 400;
	line-height: 1.25;
}

.info-panel__pictos {
	margin-top: auto;               /* colle les pictogrammes en bas */
	padding-top: 60px;
	display: flex;
	justify-content: flex-end;
	gap: 14px;
}
.info-panel__picto {
	width: var(--picto-size);
	height: var(--picto-size);
	object-fit: contain;
}

/* ==========================================================================
   6. MOBILE & ACCESSIBILITÉ
   ========================================================================== */

@media (max-width: 700px) {
	:root {
		--slide-pad-y: 0;
		--slide-pad-x: var(--gutter);
		--logo-height: 40px;
		--nav-size: 17px;
		--panel-width: 100vw;
		--panel-top: calc(40px + var(--gutter) * 2.5);
		--panel-pad: var(--gutter);
		--panel-text-size: 17px;
		--panel-label-col: 90px;
		--picto-size: 44px;
	}
	.info-panel__pictos { justify-content: flex-start; flex-wrap: wrap; }
	/* Sur mobile, l'image prend la largeur et reste centrée verticalement */
	.slide { padding-top: calc(var(--logo-height) + var(--gutter) * 2); padding-bottom: calc(var(--logo-height) + var(--gutter) * 2); }
	.slide-img { height: auto; max-height: 100%; }
	.slide figcaption { max-width: none; left: var(--gutter); font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	.slide, .slide.is-active,
	.info-panel, .info-open .info-panel { transition: none; }
}

/* Panneau ouvert : curseur normal sur le diaporama (un clic referme le panneau) */
.info-open .cursor { display: none; }
.info-open .slideshow-zone { cursor: pointer; }
