/* Galerie : styles propres à la page, compatibles avec les deux thèmes. */
.gallery-page { max-width: 1180px; margin: 0 auto; padding: 64px 28px 80px; }
.gallery-heading { margin-bottom: 42px; text-align: center; }
.gallery-eyebrow { color: var(--muted-foreground); font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.gallery-heading h1 { margin: 12px 0; font-size: clamp(48px, 7vw, 76px); line-height: 1.05; letter-spacing: -.065em; font-weight: 650; }
.gallery-heading h1 span { color: #2997ff; }
.gallery-heading > p:not(.gallery-eyebrow) { color: var(--muted-foreground); font-size: 20px; letter-spacing: -.4px; }
.gallery-count { display: inline-block; margin-top: 18px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted-foreground); font-size: 11px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.gallery-item { display: block; min-width: 0; color: var(--foreground); text-decoration: none; border-radius: 16px; }
.gallery-item figure { margin: 0; }
.gallery-picture { position: relative; overflow: hidden; border-radius: 16px; background: var(--footer-background); border: 1px solid var(--border); aspect-ratio: 4 / 3; }
.gallery-picture > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover .gallery-picture > img { transform: scale(1.035); }
.gallery-expand { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgb(0 0 0 / 60%); color: #fff; }
.gallery-expand svg { width: 16px; height: 16px; }
.gallery-item figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 15px 2px 0; font-size: 14px; font-weight: 550; line-height: 1.5; }
.gallery-number { flex-shrink: 0; color: var(--muted-foreground); font-size: 11px; font-variant-numeric: tabular-nums; }
.gallery-tip, .gallery-empty { margin-top: 34px; text-align: center; color: var(--muted-foreground); font-size: 13px; }
.gallery-item:focus-visible { outline: 2px solid #2997ff; outline-offset: 6px; }

/* La visionneuse utilise une surface sombre pour respecter les couleurs des images. */
.gallery-viewer {
  position: fixed; inset: 0; margin: auto; padding: 0; width: 100vw; max-width: 100vw;
  height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0;
  background: #09090b; color: #f5f5f7; color-scheme: dark; overflow: hidden;
}
.gallery-viewer::backdrop { background: rgb(0 0 0 / 92%); }
.gallery-viewer:not([open]) { display: none; }
.gallery-viewer-shell { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.gallery-viewer-header { display: flex; align-items: center; gap: 18px; padding: 16px 24px; border-bottom: 1px solid #28282b; flex-shrink: 0; background: #111113; }
.gallery-viewer-caption { flex: 1; min-width: 0; }
.gallery-viewer-caption h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-viewer-caption p { margin: 3px 0 0; color: #a1a1a6; font-size: 12px; font-variant-numeric: tabular-nums; }
.gallery-viewer button { display: inline-flex; align-items: center; justify-content: center; padding: 0; min-width: 44px; height: 44px; min-height: 44px; border: 1px solid #363639; border-radius: 50%; background: #1d1d20; color: #f5f5f7; box-shadow: none; font-family: inherit; cursor: pointer; }
.gallery-viewer button:hover { background: #343438; }
.gallery-viewer button:disabled { opacity: .35; cursor: default; }
.gallery-viewer button:focus-visible, .gallery-stage:focus-visible { outline: 2px solid #2997ff; outline-offset: 3px; }
.gallery-zoom-controls { display: flex; align-items: center; gap: 5px; }
.gallery-zoom-controls button { border: 0; background: transparent; font-size: 23px; }
.gallery-zoom-controls #gallery-zoom-reset { min-width: 64px; border-radius: 9px; font-size: 12px; font-variant-numeric: tabular-nums; }
.gallery-viewer .gallery-close { font-size: 29px; font-weight: 300; }
.gallery-viewer-body { flex: 1; min-height: 0; position: relative; }
.gallery-stage { height: 100%; width: 100%; display: flex; overflow: auto; overscroll-behavior: contain; padding: 24px 70px; box-sizing: border-box; }
.gallery-stage img { display: block; flex-shrink: 0; max-width: none; max-height: none; width: auto; height: auto; margin: auto; border-radius: 4px; object-fit: contain; user-select: none; }
.gallery-stage.is-zoomed { padding: 24px; }
.gallery-viewer .gallery-arrow { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); background: rgb(29 29 32 / 90%); font-size: 34px; }
.gallery-previous { left: 14px; }
.gallery-next { right: 14px; }
.gallery-filmstrip { display: flex; justify-content: flex-start; gap: 10px; max-width: 100%; overflow-x: auto; padding: 16px max(20px, calc((100% - 330px) / 2)); background: #111113; flex-shrink: 0; }
.gallery-viewer .gallery-thumb { width: 96px; min-width: 96px; height: 64px; padding: 3px; border: 2px solid transparent; border-radius: 10px; background: transparent; overflow: hidden; flex-shrink: 0; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.gallery-viewer .gallery-thumb[aria-current="true"] { border-color: #2997ff; }
.gallery-keyboard-help { margin: 0; padding: 0 20px 12px; background: #111113; color: #a1a1a6; text-align: center; font-size: 11px; flex-shrink: 0; }
.gallery-keyboard-help span { padding: 0 10px; }
.gallery-error { margin: 0; padding: 10px; color: #ffb4b4; text-align: center; font-size: 13px; }
@media (max-width: 850px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
@media (max-width: 560px) {
  .gallery-page { padding: 42px 18px 54px; }
  .gallery-heading { margin-bottom: 28px; }
  .gallery-heading > p:not(.gallery-eyebrow) { font-size: 17px; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .gallery-picture { aspect-ratio: 16 / 10; }
  .gallery-viewer-header { padding: 10px; gap: 6px; flex-wrap: wrap; }
  .gallery-viewer-caption { flex-basis: calc(100% - 60px); order: 0; }
  .gallery-close { order: 1; }
  .gallery-zoom-controls { order: 2; justify-content: center; width: 100%; }
  .gallery-zoom-controls button { height: 36px; min-height: 36px; }
  .gallery-stage { padding: 14px 12px; }
  .gallery-viewer .gallery-arrow { top: auto; bottom: 12px; transform: none; }
  .gallery-filmstrip { padding: 12px 20px; justify-content: flex-start; }
  .gallery-keyboard-help { display: none; }
}
@media (prefers-reduced-motion: reduce) { .gallery-picture > img { transition: none; } }
