/* TOTOKÉ — V2-2 : galerie (page /galerie/, page d'un album, photos d'une mission, visionneuse).
   Chargé seulement sur ces pages (inc/v2/galerie.php). Couleurs : variables de totoke.css. */

/* ---------- Page « Galerie » : filtre et cartes d'albums ---------- */
.tk-galerie-intro p { margin: 0; font-size: 18px; }
.tk-galerie-intro p + p { margin-top: .8em; }
.tk-filtre ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tk-filtre a {
	overflow-wrap: anywhere; max-width: 100%;
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
	border: 1px solid var(--tk-trait-fort); background: var(--tk-blanc); color: var(--tk-encre);
	font-weight: 600; text-decoration: none;
}
.tk-filtre a:hover { border-color: var(--tk-rouge-fonce); color: var(--tk-rouge-fonce); }
.tk-filtre a[aria-current="page"] { background: var(--tk-encre); border-color: var(--tk-encre); color: var(--tk-blanc); }

.tk-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px; }
.tk-carte-album {
	position: relative; display: flex; flex-direction: column;
	background: var(--tk-blanc); border: 1px solid var(--tk-trait); border-radius: 18px; overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease;
}
.tk-carte-album:hover { box-shadow: 0 12px 30px rgba(21, 23, 28, .10); transform: translateY(-2px); }
.tk-carte-album:focus-within { outline: 3px solid var(--tk-rouge-fonce); outline-offset: 3px; }
.tk-carte-album-photo { position: relative; }
.tk-carte-album-photo .tk-photo { border-radius: 0; }
.tk-carte-album-compte {
	position: absolute; right: 12px; bottom: 12px; padding: 5px 12px; border-radius: 999px;
	background: rgba(21, 23, 28, .82); color: var(--tk-blanc); font-size: 13px; font-weight: 700;
}
.tk-carte-album-texte { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 20px; }
.tk-carte-album-reperes { margin: 0; font-size: 14px; font-weight: 700; color: var(--tk-rouge-fonce); }
.tk-carte-album-titre { margin: 0; font-family: var(--tk-police-titre); font-size: 21px; line-height: 1.25; }
.tk-carte-album-titre a { color: var(--tk-encre); text-decoration: none; }
.tk-carte-album-titre a:focus { outline: none; }
.tk-carte-album-titre a::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }

/* ---------- Page d'un album ---------- */
.tk-album-entete { display: flex; flex-direction: column; gap: 12px; }
.tk-album-retour { align-self: flex-start; font-weight: 700; color: var(--tk-rouge-fonce); min-height: 44px; display: inline-flex; align-items: center; }
.tk-album-titre { overflow-wrap: anywhere; hyphens: auto; }
.tk-album-reperes { margin: 0; font-size: 17px; font-weight: 600; color: var(--tk-texte); }
.tk-album-reperes a { color: var(--tk-rouge-fonce); }

/* ---------- Grille de photos ---------- */
.tk-galerie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr)); gap: 10px; }
.tk-galerie-element { margin: 0; min-width: 0; }
.tk-galerie-lien { position: relative; display: block; border-radius: 12px; overflow: hidden; background: var(--tk-sable); }
.tk-galerie-lien:focus-visible { outline: 3px solid var(--tk-rouge-fonce); outline-offset: 3px; }
.tk-galerie-vignette { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform .25s ease; }
.tk-galerie-lien:hover .tk-galerie-vignette { transform: scale(1.04); }
.tk-galerie-vignette-vide { background: linear-gradient(135deg, var(--tk-encre) 0%, var(--tk-marine) 100%); }
.tk-galerie-play {
	position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
	background: var(--tk-rouge); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.tk-galerie-play::after {
	content: ""; position: absolute; top: 50%; left: 50%; margin: -10px 0 0 -6px;
	border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff;
}
.tk-galerie-video-titre {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .78)); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.3;
	overflow-wrap: anywhere;
}

/* ---------- Photos d'une mission ---------- */
.tk-mission-photos { padding-top: 0; padding-bottom: 56px; }
.tk-mission-photos-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.tk-mission-photos-tete .tk-lien-fort { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; }
.tk-mission-albums { margin: 16px 0 0; color: var(--tk-texte); }
.tk-mission-albums a { color: var(--tk-rouge-fonce); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Visionneuse ---------- */
.tk-vis-ouverte { overflow: hidden; }
.tk-visionneuse {
	width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
	background: #0B0C0F; color: #fff;
	display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: 100%;
}
.tk-visionneuse:not([open]) { display: none; }
.tk-visionneuse::backdrop { background: #0B0C0F; }
.tk-vis-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.tk-vis-position { margin: 0; font-weight: 700; font-size: 15px; color: #E6E6E6; }
.tk-vis-fermer {
	display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px;
	border: 2px solid #fff; background: #fff; color: #0B0C0F; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
}
.tk-vis-fermer:hover { background: #E6E6E6; }
.tk-vis-fermer:focus-visible, .tk-vis-nav:focus-visible { outline: 3px solid #FFB4AE; outline-offset: 3px; }
.tk-vis-scene {
	position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 72px;
	touch-action: pan-y pinch-zoom; user-select: none;
}
.tk-vis-image, .tk-vis-video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.tk-vis-video { width: min(100%, 1280px); background: #000; }
.tk-vis-scene .tk-youtube { width: min(100%, 1100px); }
.tk-vis-scene .tk-youtube-avis { color: #C9CDD3; }
.tk-vis-chargement::before {
	content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: tk-vis-tourne .8s linear infinite;
}
@keyframes tk-vis-tourne { to { transform: rotate(360deg); } }
.tk-vis-legende { margin: 0; padding: 12px 16px 18px; text-align: center; color: #E6E6E6; font-size: 16px; min-height: 24px; overflow-wrap: anywhere; }
.tk-vis-nav {
	position: fixed; top: 50%; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .7); background: rgba(0, 0, 0, .55); color: #fff;
	font-size: 34px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
}
.tk-vis-nav:hover { background: rgba(255, 255, 255, .2); }
.tk-vis-prec { left: 10px; }
.tk-vis-suiv { right: 10px; }
.tk-vis-seul .tk-vis-nav { display: none; }

@media (max-width: 760px) {
	.tk-albums { gap: 18px; }
	.tk-carte-album-texte { padding: 14px 16px 18px; }
	.tk-carte-album-titre { font-size: 19px; }
	.tk-galerie { gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tk-galerie-lien { border-radius: 8px; }
	.tk-galerie-play { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
	.tk-galerie-video-titre { font-size: 13px; }
	.tk-vis-scene { padding: 0; }
	.tk-vis-image { border-radius: 0; }
	/* Téléphone : flèches en bas, de part et d'autre de la légende, pour ne pas cacher la photo. */
	.tk-vis-nav { top: auto; bottom: 14px; margin-top: 0; width: 52px; height: 52px; }
	.tk-vis-legende { padding: 12px 72px 22px; font-size: 15px; min-height: 66px; display: flex; align-items: center; justify-content: center; }
	.tk-vis-seul .tk-vis-legende { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 1121px) {
	.tk-galerie { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
	.tk-carte-album, .tk-galerie-vignette { transition: none; }
	.tk-carte-album:hover { transform: none; }
	.tk-galerie-lien:hover .tk-galerie-vignette { transform: none; }
	.tk-vis-chargement::before { animation: none; }
}
