/* Galerie Nivet-Carzon — version sobre */
:root {
  --fond: #FFFFFF;
  --texte: #3D0050;
  --discret: rgb(61 0 80 / 0.55);
  --filet: rgb(61 0 80 / 0.18);

  --police: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --petit: 0.75rem;
  --espacement: 0.14em;

  /* Taille du rond photo : suit la largeur ET la hauteur de l'écran */
  --taille-rond: clamp(150px, min(38vw, 40svh), 340px);
  --zoom-max: 2.4;   /* agrandissement maximal au survol */
  --marge: max(24px, env(safe-area-inset-left));
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 1px solid var(--texte);
  outline-offset: 4px;
}

/* Petites capitales espacées, comme sur un carton d'exposition */
.nom,
.lieu,
.liens a,
.liens button,
.panneau h2,
.fermer {
  font-size: var(--petit);
  font-weight: 400;
  letter-spacing: var(--espacement);
  text-transform: uppercase;
}

/* ---------- En-tête ---------- */

.entete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) var(--marge) 0;
}

.nom,
.lieu { margin: 0; }
.lieu { color: var(--discret); }

/* ---------- Scène : ovale de texte + diaporama ---------- */

.scene {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.anneau {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.anneau text {
  font-family: var(--police);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--texte);
}

.diaporama {
  position: relative;
  z-index: 2;
  width: var(--taille-rond);
  height: var(--taille-rond);
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #f4f2f5;
  transition: transform 450ms cubic-bezier(.2, .8, .2, 1);
}

/* Sur ordinateur, la photo s'agrandit au passage de la souris */
@media (hover: hover) {
  .diaporama { cursor: zoom-in; }
  .diaporama:hover { transform: scale(var(--zoom, 1.6)); }
}

.diaporama img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 260ms linear;
}

.diaporama img.visible { opacity: 1; }

/* ---------- Pied de page : liens ---------- */

.pied {
  position: relative;
  z-index: 3;
  padding: 0 var(--marge) max(24px, env(safe-area-inset-bottom));
}

.liens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 36px;
}

.liens a,
.liens button {
  position: relative;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--texte);
  font-family: var(--police);
  text-decoration: none;
  cursor: pointer;
}

/* Soulignement fin qui apparaît au survol */
.liens a::after,
.liens button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms ease;
}

.liens a:hover::after,
.liens button:hover::after,
.liens button[aria-expanded="true"]::after { transform: scaleX(1); }

/* ---------- Panneau « À propos » ---------- */

.panneau {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(520px, calc(100% - 2 * var(--marge)));
  max-height: min(68svh, 540px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--filet);
  background: var(--fond);
  transform: translateX(-50%);
  animation: apparition 300ms ease;
}

.panneau[hidden] { display: none; }

@keyframes apparition {
  from { opacity: 0; }
}

.panneau-entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 28px 0;
}

.panneau h2 { margin: 0; }

.fermer {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--discret);
  font-family: var(--police);
  cursor: pointer;
}
.fermer:hover { color: var(--texte); }

.panneau-texte {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 28px 28px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.panneau-texte p { margin: 0 0 1em; }
.panneau-texte p:last-child { margin-bottom: 0; }

.panneau-texte .english {
  margin-top: 1.6em;
  padding-top: 1.4em;
  border-top: 1px solid var(--filet);
  color: var(--discret);
}

.panneau a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Petits écrans ---------- */

@media (max-width: 600px) {
  :root { --taille-rond: clamp(150px, min(56vw, 34svh), 300px); --marge: 20px; }

  .entete { flex-direction: column; align-items: center; gap: 6px; }
  .liens { gap: 4px 24px; }
  .panneau-entete { padding: 18px 20px 0; }
  .panneau-texte { padding: 12px 20px 22px; }
}

/* Écrans bas (téléphone à l'horizontale) */
@media (max-height: 500px) {
  .entete { padding-top: 14px; }
  .pied { padding-bottom: 10px; }
  .liens a,
  .liens button { padding: 6px 0; }
  .panneau { max-height: 78svh; }
}

@media (prefers-reduced-motion: reduce) {
  .diaporama,
  .diaporama img,
  .liens a::after,
  .liens button::after { transition: none; }
  .panneau { animation: none; }
}
