/* ============================================================
   STUDIO SABLE — feuille de style
   Palette : noir chaud + sable + ocre
   ============================================================ */

:root{
  --noir:        #2B241C;
  --noir-2:      #362D24;
  --noir-3:      #43382C;
  --sable:       #E4D5BC;
  --sable-clair: #F3EADB;
  --sable-sourd: #B9A98E;
  --ocre:        #C08A4E;
  --ocre-clair:  #D9A76A;
  --ligne:       rgba(228,213,188,.18);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --marge: clamp(20px, 5vw, 90px);
  --transition: .5s cubic-bezier(.22,.61,.36,1);
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--noir);
  color: var(--sable);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img{ max-width:100%; display:block; }

/* Indispensable : sans cette règle, un `display` posé par une classe (ex. .visionneuse)
   l'emporte sur l'attribut HTML `hidden`. La visionneuse restait alors étalée sur tout
   l'écran, invisible (opacity 0) mais interceptant TOUS les clics de la page. */
[hidden]{ display: none !important; }

h1,h2,h3{ font-family: var(--serif); font-weight: 400; letter-spacing: .01em; margin:0; }

a{ color: inherit; }

::selection{ background: var(--ocre); color: var(--noir); }

.saut-contenu{
  position:absolute; left:-9999px; top:0; z-index:100;
  background: var(--ocre); color: var(--noir); padding: 10px 18px; text-decoration:none;
}
.saut-contenu:focus{ left: 12px; top: 12px; }

/* ---------------- En-tête ---------------- */
.entete{
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display:flex; align-items:center; justify-content:space-between; gap: 20px;
  padding: 26px var(--marge);
  transition: background var(--transition), padding var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}
/* dégradé sombre derrière l'en-tête tant qu'il est posé sur la photo :
   rend le texte lisible quelle que soit l'image, sans l'alourdir d'ombres */
.entete::before{
  content:""; position:absolute; inset: 0 0 auto 0; height: 190%;
  background: linear-gradient(to bottom, rgba(22,18,13,.62) 0%, rgba(22,18,13,.3) 50%, transparent 100%);
  z-index: -1; pointer-events: none; transition: opacity .4s;
}
.entete.figee::before{ opacity: 0; }

.entete.figee .marque-nom,
.entete.figee .marque-metier,
.entete.figee .nav a{ text-shadow: none; }
.entete.figee .nav a{ color: var(--sable-sourd); }

.entete.figee{
  background: rgba(43,36,28,.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--ligne);
  padding-top: 14px; padding-bottom: 14px;
}

.marque{ text-decoration:none; display:flex; flex-direction:column; line-height:1.15; }
.marque-nom{
  font-family: var(--serif); font-size: 27px; letter-spacing: .05em;
  color: var(--sable-clair); text-shadow: 0 1px 10px rgba(24,19,14,.6);
}
.marque-metier{
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--sable); margin-top: 5px; text-shadow: 0 1px 10px rgba(24,19,14,.6);
}

.nav{ display:flex; gap: clamp(20px, 3vw, 44px); }
.nav a{
  text-decoration:none; font-size: 14px; letter-spacing: .15em; font-weight: 400;
  text-transform: uppercase; color: var(--sable-clair);
  text-shadow: 0 1px 10px rgba(24,19,14,.6);
  padding: 6px 0; position: relative; transition: color .3s, text-shadow .3s;
}
.nav a::after{
  content:""; position:absolute; left:0; bottom:0; height:2px; width:0;
  background: var(--ocre); transition: width .35s ease;
}
.nav a:hover{ color: var(--sable-clair); }
.nav a:hover::after{ width:100%; }

/* ---------------- Accueil ---------------- */
.accueil{
  position: relative; min-height: min(72svh, 760px);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding: 110px var(--marge) 80px; overflow:hidden;
}
.accueil-fond{
  position:absolute; inset:-6%;
  background-size: cover; background-position: center 62%;
  filter: saturate(.85) contrast(1.05);
  transform: scale(1.06);
  animation: zoomDoux 24s ease-out forwards;
}
@keyframes zoomDoux{ to{ transform: scale(1); } }
.accueil-voile{
  position:absolute; inset:0;
  background:
    radial-gradient(115% 85% at 50% 44%, rgba(28,23,17,.34) 0%, rgba(28,23,17,.14) 45%, rgba(30,25,19,.55) 72%, rgba(43,36,28,.96) 100%),
    linear-gradient(to bottom, rgba(30,25,19,.42) 0%, transparent 30%, transparent 55%, rgba(43,36,28,.55) 82%, rgba(43,36,28,1) 100%);
}
.accueil-texte{ position:relative; max-width: 100%; }
.accueil h1{
  /* le nom complet tient sur une seule ligne et se met à l'échelle de la fenêtre */
  font-size: min(9.6vw, 190px); line-height: 1.04; letter-spacing: .01em;
  white-space: nowrap;
  color: var(--sable-clair); margin: 0;
  text-shadow: 0 2px 30px rgba(24,19,14,.75), 0 1px 4px rgba(24,19,14,.5);
  animation: monte 1.1s .35s both;
}
.baseline{
  font-family: var(--serif); font-style: italic;
  font-size: clamp(16px, 2.1vw, 23px); color: var(--sable-clair);
  margin: 22px 0 0; animation: monte 1.1s .55s both;
  text-shadow: 0 1px 18px rgba(24,19,14,.8);
}
@keyframes monte{ from{ opacity:0; transform: translateY(26px);} to{ opacity:1; transform:none;} }

/* ---------------- Sections ---------------- */
.section{ padding: clamp(48px, 7vw, 96px) var(--marge); }

.titre-section{ max-width: 720px; margin-bottom: clamp(28px, 3.5vw, 46px); }
.section h2{
  font-size: clamp(34px, 6vw, 62px); line-height: 1.05; color: var(--sable-clair);
}
.chapeau{
  color: var(--sable-sourd); max-width: 52ch; margin: 14px 0 0;
  font-size: 16px;
}

/* ---------------- Grille des albums ---------------- */
/* Grille des albums : 5 par ligne, et la dernière ligne — si elle est
   incomplète — se centre d'elle-même (c'est ce que fait justify-content
   sur une disposition en flex, ce qu'une grille CSS ne sait pas faire).
   Une ligne complète mesure exactement 100 % : le centrage ne se voit
   que sur la ligne incomplète. */
.grille-albums{
  --par-ligne: 5;
  --ecart: clamp(14px, 1.8vw, 22px);
  display:flex; flex-wrap:wrap; justify-content:center;
  gap: var(--ecart);
}
.grille-albums > .carte{
  /* le -1px absorbe les arrondis d'affichage : sans lui, cinq cartes
     peuvent dépasser 100 % d'un dixième de pixel et la 5e passe à la ligne */
  flex: 0 0 calc((100% - (var(--par-ligne) - 1) * var(--ecart) - 1px) / var(--par-ligne));
  max-width: calc((100% - (var(--par-ligne) - 1) * var(--ecart) - 1px) / var(--par-ligne));
}
@media (max-width: 1279px){ .grille-albums{ --par-ligne: 4; } }
@media (max-width: 1023px){ .grille-albums{ --par-ligne: 3; } }
@media (max-width:  759px){ .grille-albums{ --par-ligne: 2; } }
@media (max-width:  519px){ .grille-albums{ --par-ligne: 1; } }

.carte{
  position: relative; border: 0; padding: 0; margin: 0;
  background: var(--noir-2); color: inherit; text-align: left;
  cursor: pointer; overflow: hidden; font: inherit;
  aspect-ratio: 4 / 5;
}
.carte-img{
  position:absolute; inset:0; width:100%; height:100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.22,.61,.36,1), filter .6s;
  filter: saturate(.85) brightness(.82);
}
.carte::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(to top, rgba(26,21,16,.92) 0%, rgba(26,21,16,.25) 48%, rgba(26,21,16,.05) 100%);
  transition: opacity .5s;
}
.carte-contenu{
  position:absolute; inset:auto 0 0 0; z-index:2;
  padding: clamp(20px, 2.4vw, 32px);
}
.carte-meta{
  font-size: 10px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ocre-clair); margin: 0 0 10px;
}
.carte h3{
  font-size: clamp(24px, 2.6vw, 32px); color: var(--sable-clair); margin: 0;
}
.carte-compte{
  font-size: 12px; letter-spacing: .1em; color: var(--sable-sourd);
  margin: 10px 0 0;
  opacity: 0; transform: translateY(10px);
  transition: opacity .45s, transform .45s;
}
.carte:hover .carte-img,
.carte:focus-visible .carte-img{ transform: scale(1.06); filter: saturate(1) brightness(.95); }
.carte:hover .carte-compte,
.carte:focus-visible .carte-compte{ opacity:1; transform:none; }
.carte:focus-visible{ outline: 1px solid var(--ocre); outline-offset: 3px; }

/* ---------------- Galerie ouverte ---------------- */
.galerie-section{ padding-top: clamp(92px, 9vw, 124px); }

.retour{
  background: none; border: 0; color: var(--sable-sourd); font: inherit;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; padding: 8px 0; margin-bottom: 22px;
  display:inline-flex; align-items:center; gap: 10px; transition: color .3s;
}
.retour:hover{ color: var(--ocre-clair); }
.retour span{ transition: transform .3s; display:inline-block; }
.retour:hover span{ transform: translateX(-5px); }

.galerie-entete{ max-width: 700px; margin-bottom: clamp(26px, 3vw, 40px); }
.galerie-entete h2{ font-size: clamp(38px, 7vw, 74px); color: var(--sable-clair); }
.galerie-meta{
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--ocre); margin: 14px 0 0;
}
.galerie-desc{ color: var(--sable-sourd); margin: 16px 0 0; max-width: 56ch; }

.mosaique{ columns: 3; column-gap: clamp(12px, 1.6vw, 22px); }
@media (max-width: 1000px){ .mosaique{ columns: 2; } }
@media (max-width: 620px){  .mosaique{ columns: 1; } }

.vignette{
  position: relative; break-inside: avoid; margin: 0 0 clamp(12px, 1.6vw, 22px);
  cursor: zoom-in; overflow: hidden; background: var(--noir-2);
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1);
}
.vignette.vue{ opacity:1; transform:none; }
.vignette img{
  width:100%; height:auto;
  transition: transform 1s cubic-bezier(.22,.61,.36,1), filter .5s;
  filter: saturate(.88) brightness(.88);
}
.vignette:hover img{ transform: scale(1.04); filter: saturate(1) brightness(1); }
.vignette figcaption{
  position:absolute; left:0; right:0; bottom:0;
  padding: 34px 18px 16px;
  font-size: 12px; letter-spacing: .08em; color: var(--sable-clair);
  background: linear-gradient(to top, rgba(26,21,16,.9), transparent);
  opacity:0; transform: translateY(8px); transition: opacity .4s, transform .4s;
}
.vignette:hover figcaption{ opacity:1; transform:none; }

/* ---------------- À propos ---------------- */
.apropos{
  display:grid; gap: clamp(18px, 3.5vw, 56px); align-items:start;
  grid-template-columns: minmax(0, .55fr) minmax(0, 1fr);
  border-top: 1px solid var(--ligne);
}
@media (max-width: 860px){ .apropos{ grid-template-columns: 1fr; gap: 16px; } }

.apropos-titre h2{ margin: 0; }

.apropos-texte p{
  color: var(--sable-sourd);
  max-width: 58ch;
  font-size: clamp(16px, 1.35vw, 18px);
}
.apropos-texte p:first-of-type{ margin-top: 0; }
.lieu{
  font-size: 11px !important; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ocre) !important; margin-top: 30px !important;
}

/* ---------------- Contact ---------------- */
.contact{
  border-top: 1px solid var(--ligne);
  display:grid; align-items:center;
  gap: clamp(24px, 4vw, 60px);
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
}
@media (max-width: 860px){ .contact{ grid-template-columns: 1fr; } }

.contact-portrait{ margin: 0; overflow: hidden; }
.contact-portrait img{
  width: 100%; height: auto;
  filter: saturate(.92) brightness(.94);
  transition: filter .7s ease, transform 1.4s cubic-bezier(.22,.61,.36,1);
}
.contact-portrait:hover img{ filter: none; transform: scale(1.02); }

.contact-texte .chapeau{ margin-top: 16px; }

.adresse-postale{
  display: flex; flex-direction: column;
  font-style: normal;
  margin-top: 22px;
  padding-left: 18px;
  border-left: 1px solid var(--ligne);
  color: var(--sable-sourd);
  font-size: 15px; line-height: 1.75;
}
.adresse-postale:empty{ display: none; }

.liens-contact{
  display:flex; flex-wrap:wrap;
  gap: 12px 36px; margin-top: 28px;
}
.liens-contact a{
  text-decoration:none; font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 30px); color: var(--sable-clair);
  border-bottom: 1px solid var(--ligne); padding-bottom: 6px;
  transition: color .3s, border-color .3s;
}
.liens-contact a:hover{ color: var(--ocre-clair); border-color: var(--ocre); }

/* ---------------- Pied ---------------- */
.pied{
  border-top: 1px solid var(--ligne);
  padding: 22px var(--marge);
  display:flex; flex-wrap:wrap; gap: 10px 24px; justify-content:space-between;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sable-sourd);
}

/* Accès discret à l'espace privé (affiché par script.js hors ouverture locale) */
.pied-prive{
  display:inline-block; margin-left: 14px; padding: 0 8px;
  color: inherit; text-decoration: none; opacity: .3;
  transition: opacity .25s ease, color .25s ease;
}
.pied-prive:hover, .pied-prive:focus-visible{ opacity: 1; color: var(--ocre); }

/* ---------------- Apparition au défilement ---------------- */
.reveler{
  opacity: 0; transform: translateY(30px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22,.61,.36,1);
}
.reveler.vue{ opacity:1; transform:none; }

/* ---------------- Visionneuse ---------------- */
.visionneuse{
  position: fixed; inset: 0; z-index: 200;
  background: rgba(22,18,14,.97);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display:flex; align-items:center; justify-content:center;
  opacity: 0; transition: opacity .35s ease;
}
.visionneuse.ouverte{ opacity: 1; }

.v-scene{
  margin: 0; max-width: 92vw; max-height: 88svh;
  display:flex; flex-direction:column; align-items:center; gap: 16px;
}
.v-scene img{
  max-width: 92vw; max-height: 78svh; width:auto; height:auto;
  object-fit: contain; box-shadow: 0 30px 90px rgba(0,0,0,.6);
  animation: apparait .45s ease;
}
@keyframes apparait{ from{ opacity:0; transform: scale(.97);} to{ opacity:1; transform:none;} }

.v-scene figcaption{
  display:flex; align-items:center; gap: 18px; flex-wrap:wrap; justify-content:center;
  font-size: 12px; letter-spacing: .14em; color: var(--sable-sourd);
}
.v-compteur{ color: var(--ocre); }

.v-fermer, .v-nav{
  position: absolute; background: none; border: 0; cursor: pointer;
  color: var(--sable-sourd); transition: color .25s, transform .25s;
  line-height: 1; padding: 10px;
}
.v-fermer{ top: 18px; right: 22px; font-size: 40px; }
.v-nav{ top: 50%; transform: translateY(-50%); font-size: 56px; }
.v-prec{ left: clamp(6px, 2vw, 30px); }
.v-suiv{ right: clamp(6px, 2vw, 30px); }
.v-fermer:hover{ color: var(--sable-clair); transform: rotate(90deg); }
.v-nav:hover{ color: var(--sable-clair); }
.v-prec:hover{ transform: translateY(-50%) translateX(-5px); }
.v-suiv:hover{ transform: translateY(-50%) translateX(5px); }

body.fige{ overflow: hidden; }

@media (max-width: 620px){
  .nav{ gap: 15px; }
  .nav a{ font-size: 12px; letter-spacing: .1em; }
  .marque-nom{ font-size: 22px; }
  .marque-metier{ display:none; }
  .v-nav{ font-size: 40px; }
  .v-fermer{ font-size: 32px; top: 10px; right: 12px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html{ scroll-behavior: auto; }
  .reveler, .vignette{ opacity:1 !important; transform:none !important; }
}
