@import url('../fonts/font-young-serif.css');
@import url('../fonts/font-bricolage.css');
@import url('../fonts/font-marcellus.css');
@import url('../fonts/font-calistoga.css');

:root {
  --fond: #1b1917;
  --fond-haut: rgb(27 25 23 / 0.94);
  --clair: #f3eee6;
  --marge: clamp(16px, 2.4vw, 40px);
  --sortie: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scrollbar-color: #4a4540 var(--fond); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--clair);
  font: 400 1rem/1.4 'Bricolage Grotesque', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--clair); outline-offset: 4px; }

/* Rapid clicks on the arrows and thumbnails must not select or drag anything. */
.planche,
.loupe {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.planche img,
.loupe img { -webkit-user-drag: none; }

/* ---------- Planche ---------- */

.planche {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  max-width: 1760px;
  margin-inline: auto;
  padding: 0 var(--marge) clamp(40px, 5vw, 72px);
}

.proposition { min-width: 0; }

.proposition__tete {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: clamp(20px, 2.6vw, 36px) 0 16px;
  background: var(--fond-haut);
  backdrop-filter: blur(6px);
}

.proposition__nom { margin: 0; font-size: clamp(1.25rem, 1.8vw, 1.75rem); font-weight: 400; line-height: 1.1; }

.nom-a { font-family: 'Young Serif', Georgia, serif; }
.nom-b { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-variation-settings: 'opsz' 96, 'wdth' 75; letter-spacing: -0.01em; }
.nom-c { font-family: 'Marcellus', serif; text-transform: uppercase; letter-spacing: 0.06em; }
.nom-d { font-family: 'Calistoga', serif; }

.nuances { display: flex; height: 6px; margin-top: 12px; border-radius: 999px; overflow: hidden; }

.nuances i { flex: var(--f, 1); background: var(--c); }

.ecrans { display: grid; gap: clamp(14px, 1.6vw, 24px); margin: 0; padding: 0; list-style: none; }

.ecran {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #2a2724;
  cursor: zoom-in;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.25), 0 18px 36px -18px rgb(0 0 0 / 0.6);
  transition: transform 0.4s var(--sortie), box-shadow 0.4s var(--sortie);
}

.ecran:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgb(0 0 0 / 0.3), 0 26px 44px -18px rgb(0 0 0 / 0.7); }

.ecran img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }

/* ---------- Agrandissement ---------- */

.loupe {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(14 13 12 / 0.96);
  color: var(--clair);
}

.loupe::backdrop { background: transparent; }

.loupe[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.loupe__haut { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 3vw, 40px); }

.loupe__nom { margin: 0; font-size: 1.4rem; line-height: 1.1; }

.loupe__scene { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 clamp(64px, 7vw, 120px); }

.loupe__scene img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.8);
}

.loupe__bas { display: flex; justify-content: center; gap: 10px; padding: 18px; }

.loupe__bas i { width: 8px; height: 8px; border-radius: 50%; background: rgb(243 238 230 / 0.25); transition: background-color 0.2s; }

.loupe__bas i.actif { background: var(--clair); }

.bouton-rond {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  padding: 0;
  border: 1px solid rgb(243 238 230 / 0.25);
  border-radius: 50%;
  background: rgb(243 238 230 / 0.06);
  color: var(--clair);
  cursor: pointer;
  transition: background-color 0.2s;
}

.bouton-rond:hover { background: rgb(243 238 230 / 0.16); }

.bouton-rond svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.loupe__prec, .loupe__suiv { position: absolute; top: 50%; translate: 0 -50%; }

.loupe__prec { left: clamp(8px, 2vw, 32px); }

.loupe__suiv { right: clamp(8px, 2vw, 32px); }

.loupe__haut-droite { display: flex; gap: 8px; }

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

@media (max-width: 900px) {
  .planche {
    grid-template-columns: repeat(4, 80vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .proposition { scroll-snap-align: start; }
  .loupe__scene { padding: 0 8px; }
  .loupe__prec, .loupe__suiv { top: auto; bottom: -62px; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
