:root {
  --accent: #ef6b43;
  --background: #000;
  --muted: #4b4b4b;
  --controls-height: 78px;
  --logo-right: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: #fff;
  font-family: Arial, sans-serif;
}

button {
  font: inherit;
}

.showcase {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--background);
}

/* Logo posé sur le bandeau inférieur. */
.showcase-header {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 0;
  height: auto;
  padding: 0;
  pointer-events: none;
}

.showcase-header img {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  width: auto;
  max-width: 100vw;
  max-height: 100px;
  height: 100px;
  object-fit: contain;
}

/* Écrans étroits : logo plus petit */
@media (max-width: 400px) {
  .showcase-header img {
    height: 60px;
    max-height: 60px;
  }
}

.auto-gallery,
.gallery-viewport {
  width: 100%;
}

.gallery-viewport {
  position: relative;
  height: calc(100vh - var(--controls-height));
  overflow: hidden;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.65, 0, 0.35, 1);
}

.gallery-card {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: zoom-in;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-card figcaption {
  display: none;
}

.gallery-arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  width: 52px;
  height: 72px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font:
    300 42px/1 Arial,
    sans-serif;
  cursor: pointer;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  background: var(--accent);
}
.gallery-prev {
  left: 18px;
}
.gallery-next {
  right: 18px;
}

.gallery-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  width: calc(100% - var(--logo-right));
  margin-left: auto;
  height: var(--controls-height);
  padding: 0 18px;
  border-top: 1px solid #222;
  max-height: var(--controls-height);
  overflow: hidden;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-counter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.gallery-contact {
  color: #fff;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-contact:hover,
.gallery-contact:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery-dots::-webkit-scrollbar {
  display: none;
}

.gallery-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--muted);
  cursor: pointer;
}

.gallery-dot.active {
  background: var(--accent);
  transform: scale(1.45);
}

.gallery-counter {
  color: #bbb;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.play-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

/* Changer ces deux couleurs règle l'anneau du timer. */
.play-toggle [aria-hidden] {
  --progress: 0deg;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), var(--muted) 0);
  box-shadow: inset 0 0 0 2px #000;
  color: #fff;
  font-size: 10px;
}

/* Visionneuse avec zoom. */
.viewer-open {
  overflow: hidden;
}
.image-viewer[hidden] {
  display: none;
}

.image-viewer {
  position: fixed;
  z-index: 10;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
}

.viewer-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.viewer-stage img {
  width: 100%;
  height: 100%;
  padding: 72px 20px 92px;
  object-fit: contain;
  user-select: none;
  transform-origin: center;
  transition: transform 0.15s ease;
}

.image-viewer.can-pan .viewer-stage {
  cursor: grab;
}
.image-viewer.is-dragging .viewer-stage {
  cursor: grabbing;
}
.image-viewer.is-dragging .viewer-stage img {
  transition: none;
}

.viewer-close {
  position: absolute;
  z-index: 1;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid #555;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

.viewer-tools {
  position: absolute;
  z-index: 1;
  bottom: 22px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  transform: translateX(-50%);
  border: 1px solid #333;
  background: #111;
}

.viewer-tools button {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  background: #292929;
  color: #fff;
  cursor: pointer;
}

.viewer-tools button:hover {
  background: var(--accent);
}
.zoom-level {
  width: 60px;
  color: #bbb;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 600px) {
  :root {
    --controls-height: 70px;
  }
  .showcase-header {
    padding-left: 4px;
  }
  .showcase-header img {
    max-width: calc(100vw - 8px);
    height: 150px;
  }
  .gallery-controls {
    padding: 0 10px;
    max-height: var(--controls-height);
    overflow: hidden;
  }
  .gallery-arrow {
    width: 42px;
    height: 58px;
    font-size: 34px;
  }
  .gallery-prev {
    left: 8px;
  }
  .gallery-next {
    right: 8px;
  }
  .viewer-stage img {
    padding: 64px 8px 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-track,
  .viewer-stage img {
    transition: none;
  }
}
