/* ------------------------------------------------------------------
   Didier Delmas — feuille de style unique
   Direction artistique : fond blanc, une seule police serif,
   mise en page très aérée, aucun élément décoratif.
   ------------------------------------------------------------------ */

:root {
  --blanc: #ffffff;
  --encre: #1a1a1a;      /* texte principal, nom du photographe */
  --gris: #8c8c8c;       /* liens de navigation, texte secondaire */
  --gris-clair: #d8d8d8; /* filets, soulignement des liens */

  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino,
           "Times New Roman", Times, serif;

  /* Gabarit de la visionneuse */
  --img-max-w: 1180px;
  --pad-x: 4rem;
  --pad-top: 9.5rem;
  --pad-bottom: 7rem;

  --nav-h: 5.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--blanc);
  color: var(--encre);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

/* Lien d'évitement (accessibilité clavier) */
.saut {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1.25rem;
  background: var(--blanc);
  color: var(--encre);
  z-index: 100;
}

.saut:focus {
  left: 1rem;
  top: 1rem;
}

/* Réservé aux lecteurs d'écran */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------
   En-tête — 3 zones : Contact / Didier Delmas / Index
   ------------------------------------------------------------------ */

.entete {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem;
  padding: 2.6rem var(--pad-x) 1.6rem;
  background: var(--blanc);
  pointer-events: none;
}

.entete > * {
  pointer-events: auto;
}

.entete__lien {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--gris);
  transition: color 0.35s ease;
}

.entete__lien:hover,
.entete__lien:focus-visible {
  color: var(--encre);
}

.entete__lien--gauche {
  justify-self: start;
}

.entete__lien--droite {
  justify-self: end;
}

.entete__nom {
  justify-self: center;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.045em;
  color: var(--encre);
  white-space: nowrap;
}

/* La page courante reste lisible mais discrète */
.entete__lien[aria-current="page"] {
  color: var(--encre);
}

/* ------------------------------------------------------------------
   Visionneuse — une photo par écran, défilement infini
   ------------------------------------------------------------------ */

html.visionneuse {
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

html.visionneuse::-webkit-scrollbar {
  display: none;
}

.flux {
  margin: 0;
}

.vue {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  /* l'élagage du flux compense lui-même le défilement */
  overflow-anchor: none;
}

.vue img {
  max-width: min(100%, var(--img-max-w));
  max-height: 100%;
  width: auto;
  height: auto;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.vue img.chargee {
  opacity: 1;
}

/* Indice de défilement, volontairement très discret */
.indice {
  position: fixed;
  left: 50%;
  bottom: 2.4rem;
  transform: translateX(-50%);
  z-index: 15;
  color: var(--gris);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  opacity: 0;
  animation: indice-apparition 1.2s ease 1.8s forwards;
  pointer-events: none;
}

.indice.masque {
  animation: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes indice-apparition {
  to {
    opacity: 0.85;
  }
}

/* ------------------------------------------------------------------
   Page de texte (Contact)
   ------------------------------------------------------------------ */

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 6rem) var(--pad-x) 8rem;
}

.page h1 {
  margin: 0 0 3rem;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.page p {
  margin: 0 0 1.4rem;
}

.page a {
  border-bottom: 1px solid var(--gris-clair);
  transition: border-color 0.35s ease;
}

.page a:hover,
.page a:focus-visible {
  border-color: var(--encre);
}

.coordonnees {
  margin: 0 0 3.5rem;
  line-height: 2.1;
}

/* La ville n'est pas un lien : on la distingue par la couleur, pas par un filet */
.coordonnees .lieu {
  color: var(--gris);
}

.secondaire {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gris-clair);
  font-size: 0.95rem;
  color: var(--gris);
}

.secondaire a {
  border-bottom: 0 !important;
  transition: color 0.35s ease;
}

.secondaire a:hover,
.secondaire a:focus-visible {
  color: var(--encre);
}

/* ------------------------------------------------------------------
   Adaptations petits écrans — en largeur
   ------------------------------------------------------------------ */

@media (max-width: 900px) {
  :root {
    --pad-x: 2rem;
    --pad-top: 7.5rem;
    --pad-bottom: 5rem;
    --nav-h: 4.5rem;
  }

  .entete {
    padding: 1.8rem var(--pad-x) 1.2rem;
  }

  .entete__nom {
    font-size: 1.25rem;
  }

  .entete__lien {
    font-size: 0.95rem;
  }
}

@media (max-width: 560px) {
  :root {
    --pad-x: 1.75rem;
    --pad-top: 6.5rem;
    --pad-bottom: 3.5rem;
  }

  .entete__nom {
    font-size: 1.1rem;
  }

  .entete__lien {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
  }
}

/* ------------------------------------------------------------------
   Adaptations petits écrans — en hauteur

   Sans cela, les marges verticales (fixes) dévorent toute la place sur
   un écran bas : téléphone en mode paysage, fenêtre de navigateur
   écrasée, écran d'ordinateur portable ancien. La marge haute doit
   toujours rester supérieure à la hauteur de l'en-tête, sinon la
   photographie passe dessous.
   ------------------------------------------------------------------ */

@media (max-height: 760px) {
  :root {
    --pad-top: 7.5rem;
    --pad-bottom: 4rem;
  }
}

@media (max-height: 560px) {
  :root {
    --pad-top: 5rem;
    --pad-bottom: 2.5rem;
    --nav-h: 3.6rem;
  }

  .entete {
    padding: 1.1rem var(--pad-x) 0.8rem;
  }

  .entete__nom {
    font-size: 1.1rem;
  }

  .entete__lien {
    font-size: 0.85rem;
  }

  .indice {
    bottom: 0.9rem;
  }
}

@media (max-height: 400px) {
  :root {
    --pad-top: 3.6rem;
    --pad-bottom: 1.4rem;
    --nav-h: 2.8rem;
  }

  .entete {
    padding: 0.7rem var(--pad-x) 0.5rem;
  }

  .entete__nom {
    font-size: 0.95rem;
  }

  .entete__lien {
    font-size: 0.78rem;
  }

  /* la flèche n'a plus la place de s'afficher sans gêner la photo */
  .indice {
    display: none;
  }
}

/* ------------------------------------------------------------------
   Réduction des animations
   ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html.visionneuse {
    scroll-snap-type: y proximity;
  }

  .vue img {
    opacity: 1;
    transition: none;
  }

  .indice {
    animation: none;
    opacity: 0.85;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
