/* Galerie Commentée — affichage sur le site */

.gc-wrap {
	--gc-c: var(--gc-cols, 3);
	position: relative;
	margin: 0 auto 1.5em;
	box-sizing: border-box;
}
@media (max-width: 900px) { .gc-wrap { --gc-c: var(--gc-cols-t, 2); } }
@media (max-width: 560px) { .gc-wrap { --gc-c: var(--gc-cols-m, 2); } }

.gc-wrap *, .gc-lightbox * { box-sizing: border-box; }
.gc-wrap [hidden], .gc-lightbox [hidden] { display: none !important; }

/* Filtres */
.gc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.gc-wrap .gc-filter, .gc-wrap .gc-more {
	margin: 0; padding: 7px 16px; font: inherit; font-size: .9em; line-height: 1.3;
	color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 999px;
	cursor: pointer; opacity: .75; transition: opacity .15s, background-color .15s, color .15s;
}
.gc-wrap .gc-filter:hover, .gc-wrap .gc-more:hover { opacity: 1; }
.gc-wrap .gc-filter.is-active { opacity: 1; color: #fff; background: var(--gc-accent); border-color: var(--gc-accent); }
.gc-more-wrap { margin-top: 18px; text-align: center; }

/* Dispositions */
.gc-layout-grid .gc-gallery { display: grid; grid-template-columns: repeat(var(--gc-c), minmax(0, 1fr)); gap: var(--gc-gap); }
.gc-layout-masonry .gc-gallery { column-count: var(--gc-c); column-gap: var(--gc-gap); }
.gc-layout-masonry .gc-tile { margin: 0 0 var(--gc-gap); break-inside: avoid; }
.gc-layout-carousel .gc-gallery {
	display: flex; gap: var(--gc-gap); overflow-x: auto; scroll-snap-type: x mandatory;
	scrollbar-width: thin; padding-bottom: 6px;
}
.gc-layout-carousel .gc-tile {
	flex: 0 0 calc((100% - (var(--gc-c) - 1) * var(--gc-gap)) / var(--gc-c));
	scroll-snap-align: start;
}

/* Grille libre : 12 colonnes, cases carrées, taille propre à chaque vignette */
.gc-layout-custom { container-type: inline-size; }
.gc-layout-custom .gc-gallery {
	display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-auto-rows: calc((100cqw - 11 * var(--gc-gap)) / 12); grid-auto-flow: dense; gap: var(--gc-gap);
}
.gc-layout-custom .gc-tile { display: flex; flex-direction: column; min-height: 0; grid-column: span var(--w, 3); grid-row: span var(--h, 3); }
.gc-layout-custom .gc-frame { flex: 1; min-height: 0; aspect-ratio: auto; }
@media (max-width: 560px) {
	.gc-layout-custom .gc-gallery { grid-template-columns: repeat(var(--gc-c), minmax(0, 1fr)); grid-auto-rows: auto; }
	.gc-layout-custom .gc-tile { grid-column: auto; grid-row: auto; }
	.gc-layout-custom .gc-frame { flex: none; aspect-ratio: var(--gc-ratio, 1/1); }
}

/* Albums */
.gc-wrap a.gc-tile { text-decoration: none; }
.gc-album-open .gc-back { margin: 0 0 .5em; }
.gc-album-open .gc-album-heading { margin: 0 0 .8em; }

/* Vignettes */
.gc-wrap .gc-tile {
	display: block; width: 100%; margin: 0; padding: 0; font: inherit; color: inherit; text-align: left;
	background: none; border: 0; border-radius: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.gc-wrap .gc-tile:focus-visible { outline: 3px solid var(--gc-accent); outline-offset: 2px; }
.gc-frame {
	position: relative; display: block; overflow: hidden; aspect-ratio: var(--gc-ratio, 1/1);
	background: #1c1c1e; border-radius: var(--gc-radius);
	transition: transform .25s, box-shadow .25s;
}
.gc-shadow .gc-frame { box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.gc-wrap .gc-tile-media {
	display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover;
	border-radius: 0; transition: transform .35s, filter .35s;
}
.gc-layout-masonry .gc-frame { aspect-ratio: auto; }
.gc-layout-masonry .gc-tile--image .gc-tile-media { height: auto; }
.gc-layout-masonry .gc-tile--video .gc-frame,
.gc-layout-masonry .gc-tile--embed .gc-frame { aspect-ratio: 16/9; }

/* Effets au survol */
.gc-hover-zoom .gc-tile:hover .gc-tile-media, .gc-hover-zoom .gc-tile:focus-visible .gc-tile-media { transform: scale(1.07); }
.gc-hover-dim .gc-tile:hover .gc-tile-media, .gc-hover-dim .gc-tile:focus-visible .gc-tile-media { filter: brightness(.6); }
.gc-hover-gray .gc-tile-media { filter: grayscale(1); }
.gc-hover-gray .gc-tile:hover .gc-tile-media, .gc-hover-gray .gc-tile:focus-visible .gc-tile-media { filter: none; }
.gc-hover-blur .gc-tile:hover .gc-tile-media, .gc-hover-blur .gc-tile:focus-visible .gc-tile-media { filter: blur(3px); transform: scale(1.04); }
.gc-hover-lift .gc-tile:hover .gc-frame, .gc-hover-lift .gc-tile:focus-visible .gc-frame { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }

/* Titre et légende sur la vignette */
.gc-frame .gc-tile-text {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, .78)); transition: opacity .25s;
}
.gc-title-hover .gc-frame .gc-tile-text { opacity: 0; }
.gc-title-hover .gc-tile:hover .gc-tile-text, .gc-title-hover .gc-tile:focus-visible .gc-tile-text { opacity: 1; }
@media (hover: none) { .gc-title-hover .gc-frame .gc-tile-text { opacity: 1; } }
.gc-title-below .gc-tile-text { display: block; padding: 8px 2px 0; }
.gc-tile-title { display: block; font-size: .95em; font-weight: 600; line-height: 1.3; }
.gc-tile-caption {
	display: -webkit-box; margin-top: 2px; overflow: hidden; font-size: .82em; line-height: 1.35; opacity: .85;
	-webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}

/* Pastilles : lecture et nombre de commentaires */
.gc-play {
	position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
	background: rgba(0, 0, 0, .6); border: 2px solid #fff; border-radius: 50%; pointer-events: none;
}
.gc-play::after {
	content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
	border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.gc-count {
	position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px;
	padding: 3px 8px; font-size: 12px; font-weight: 600; line-height: 1.4; color: #fff;
	background: rgba(0, 0, 0, .65); border-radius: 999px;
}

/* Flèches du carrousel */
.gc-wrap .gc-scroll {
	position: absolute; top: calc(50% - 20px); z-index: 2; width: 40px; height: 40px;
	color: #111; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.gc-wrap .gc-scroll-prev { left: 8px; }
.gc-wrap .gc-scroll-next { right: 8px; }

/* Protection des images */
.gc-protect img, .gc-protect video { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }

/* ------------------------------------------------------------------ */
/* Visionneuse                                                         */
/* ------------------------------------------------------------------ */

html.gc-open { overflow: hidden; }

.gc-lightbox {
	--gc-stage: #0f0f10; --gc-ink: #fff;
	position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
	margin: 0; padding: 0; overflow: hidden; color: #1d1d1f; background: var(--gc-stage); border: 0;
	font-family: inherit; font-size: 16px; line-height: 1.5; text-align: left;
}
.gc-lightbox.gc-light { --gc-stage: #f1f1f3; --gc-ink: #1d1d1f; }
.gc-lightbox[open] { display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.gc-lightbox::backdrop { background: #0f0f10; }

.gc-stage { position: relative; min-width: 0; min-height: 0; }
.gc-media { position: absolute; inset: 56px 64px 24px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gc-media img, .gc-media video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.gc-media iframe { width: 100%; max-height: 100%; aspect-ratio: 16/9; border: 0; }
.gc-media img.gc-zoomable { cursor: zoom-in; transition: transform .25s; }
.gc-media img.gc-zoomed { cursor: zoom-out; transform: scale(2.2); }

.gc-lightbox .gc-btn, .gc-wrap .gc-btn {
	display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0;
	border: 0; border-radius: 50%; cursor: pointer; text-decoration: none; -webkit-appearance: none; appearance: none;
}
.gc-lightbox .gc-btn { width: 40px; height: 40px; color: var(--gc-ink); background: rgba(128, 128, 128, .22); transition: background-color .15s; }
.gc-lightbox .gc-btn:hover { background: rgba(128, 128, 128, .42); }
.gc-lightbox .gc-btn:focus-visible, .gc-wrap .gc-btn:focus-visible { outline: 3px solid var(--gc-accent); outline-offset: 2px; }
.gc-bar { position: absolute; top: 8px; right: 12px; z-index: 2; display: flex; align-items: center; gap: 8px; }
.gc-counter { margin-right: 6px; font-size: 14px; color: var(--gc-ink); opacity: .8; font-variant-numeric: tabular-nums; }
.gc-lightbox .gc-nav { position: absolute; top: calc(50% - 22px); z-index: 2; width: 44px; height: 44px; }
.gc-prev { left: 10px; }
.gc-next { right: 10px; }

.gc-panel { display: flex; flex-direction: column; gap: 12px; padding: 24px 22px; overflow-y: auto; background: #fff; }
.gc-panel .gc-title { margin: 0; font-size: 1.25em; font-weight: 700; line-height: 1.3; color: inherit; }
.gc-panel .gc-caption { margin: 0; white-space: pre-line; }
.gc-panel .gc-exif { margin: 0; font-size: .82em; color: #6b6b70; }
.gc-share { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-lightbox .gc-share-link {
	margin: 0; padding: 4px 11px; font: inherit; font-size: .82em; line-height: 1.4; color: #1d1d1f; text-decoration: none;
	background: #f1f1f3; border: 0; border-radius: 999px; cursor: pointer;
}
.gc-lightbox .gc-share-link:hover { background: #e2e2e6; }

.gc-comments { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid #e5e5ea; }
.gc-panel .gc-heading { margin: 0; font-size: 1em; font-weight: 700; color: inherit; }
.gc-panel .gc-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.gc-comment { margin: 0; padding: 10px 12px; background: #f6f6f8; border-radius: 8px; }
.gc-comment p { margin: 0; }
.gc-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.gc-comment-date { font-size: .78em; color: #6b6b70; }
.gc-comment-text { margin-top: 4px !important; white-space: pre-line; overflow-wrap: anywhere; }
.gc-panel .gc-empty { margin: 0; color: #6b6b70; }

.gc-form { display: flex; flex-direction: column; gap: 6px; }
.gc-ident { display: flex; flex-direction: column; gap: 6px; }
.gc-form .gc-as { margin: 0; font-size: .85em; color: #6b6b70; }
.gc-field-label { font-size: .82em; font-weight: 600; }
.gc-lightbox .gc-input {
	width: 100%; margin: 0 0 4px; padding: 8px 10px; font: inherit; font-size: 15px; line-height: 1.4;
	color: #1d1d1f; background: #fff; border: 1px solid #c7c7cc; border-radius: 6px;
}
.gc-lightbox .gc-input:focus { outline: 2px solid var(--gc-accent); outline-offset: 0; border-color: var(--gc-accent); }
.gc-lightbox textarea.gc-input { min-height: 84px; resize: vertical; }
.gc-lightbox .gc-send {
	align-self: flex-start; margin: 4px 0 0; padding: 9px 20px; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3;
	color: #fff; background: var(--gc-accent); border: 0; border-radius: 6px; cursor: pointer;
}
.gc-lightbox .gc-send:disabled { opacity: .6; cursor: default; }
.gc-form .gc-status { min-height: 1.4em; margin: 2px 0 0; font-size: .88em; }
.gc-status.is-ok { color: #12703a; }
.gc-status.is-error { color: #b3261e; }
.gc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 860px) {
	.gc-lightbox[open] { display: block; overflow-y: auto; }
	.gc-stage { padding: 56px 0 12px; }
	.gc-media { position: static; }
	.gc-media img, .gc-media video { max-height: 62vh; }
	.gc-bar { position: fixed; }
	.gc-lightbox .gc-nav { top: 30vh; }
	.gc-panel { overflow: visible; min-height: 40vh; }
}

@media (prefers-reduced-motion: reduce) {
	.gc-wrap *, .gc-lightbox * { transition: none !important; scroll-behavior: auto !important; }
}
