:root { color-scheme: dark; background: #101820; color: #F0EDE7; font-family: 'Instrument Sans', sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .3em; }
a:focus-visible, button:focus-visible { outline: 2px solid #D5B58F; outline-offset: 5px; }
.gallery-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; min-height: 88px; padding: 16px clamp(20px, 4vw, 64px); }
h1 { margin: 0; font: 600 clamp(1rem, 2vw, 1.5rem) 'Syne', sans-serif; }
.back { justify-self: start; padding-block: 12px; font-size: .875rem; }
.back span { margin-right: 10px; color: #D5B58F; }
.brand { justify-self: end; width: 110px; padding: 5px 8px; background: #F0EDE7; border-radius: 3px; }
.brand img { display: block; width: 100%; height: auto; }
main { padding: 0 clamp(12px, 3vw, 48px) 20px; }
figure { margin: 0; }
.image-space { position: relative; overflow: hidden; height: max(180px, calc(100svh - 212px)); display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
/* Dimensions automatiques : l'image peut rétrécir, jamais dépasser sa taille native. */
#photo, .slide-layer img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.slide-layer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; will-change: transform; }
figcaption { max-width: 75ch; margin: 12px auto; text-align: center; font-size: .875rem; line-height: 1.6; color: #F0EDE7; }
.controls { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 6vw, 80px); margin-top: 14px; }
[hidden] { display: none !important; }
button { width: 48px; height: 48px; border: 0; background: transparent; color: #D5B58F; font: inherit; font-size: 1.6rem; cursor: pointer; border-radius: 50%; transition: background 160ms ease; }
button:hover:enabled { background: #344956; }
button:disabled { opacity: .25; cursor: default; }
#counter { min-width: 7ch; margin: 0; text-align: center; font-size: .8125rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.help { text-align: center; color: #b4c0c5; font-size: .75rem; line-height: 1.6; margin: 10px 0 0; }
#message { text-align: center; font-size: .875rem; line-height: 1.5; margin: 0; }
#message:not(:empty) { margin-top: 12px; }
@media (max-width: 600px) {
  .gallery-header { min-height: 76px; gap: 12px; padding-inline: 20px; }
  .brand { width: 76px; }
  .back { font-size: .8125rem; }
  .back span { margin-right: 3px; }
  .image-space { height: max(180px, calc(100svh - 200px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
