/* ============================================================
   ribault.fr — feuille de style
   Même esprit que le site du Club photo de Saint-Cézaire :
   sombre, élégant, photos en plein écran, accent doré.
   ============================================================ */

:root {
  --bg: #0d0e10;
  --bg-alt: #131519;
  --bg-card: #17191e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ece9e2;
  --muted: #a09c92;
  --accent: #d2a24c;
  --accent-soft: rgba(210, 162, 76, 0.14);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Outfit", "Segoe UI", system-ui, sans-serif;
  --header-h: 76px;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --row-h: 300px;   /* hauteur visée d'une rangée de la mosaïque */
  --gap: 10px;      /* espace entre les photos de la mosaïque */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 420;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}
p { margin: 0 0 1em; }

::selection { background: var(--accent); color: #14100a; }

.container { width: min(1180px, 92vw); margin-inline: auto; }
.container.large { width: min(1720px, 95vw); }

.section { padding: clamp(56px, 7vw, 90px) 0; }
.section.alt { background: var(--bg-alt); }

/* Étiquette de section : petites capitales dorées + filet */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.section-head { margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.section-head .sub { color: var(--muted); max-width: 640px; }
.section-head.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head .compte {
  margin: 0 0 0.6em;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  background: none;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.btn:hover { background: var(--accent); color: #14100a; transform: translateY(-2px); }
.btn.solid { background: var(--accent); color: #14100a; }
.btn.solid:hover { background: #e2b563; border-color: #e2b563; }
.btn.ghost { border-color: rgba(255, 255, 255, 0.35); color: var(--text); }
.btn.ghost:hover { background: var(--text); color: #14100a; border-color: var(--text); }

/* Lien discret en forme de texte (« Tout afficher ») */
.lien {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.lien:hover { border-bottom-color: var(--accent); }

/* ---------- En-tête ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.scrolled {
  background: rgba(13, 14, 16, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand .brand-name em { font-style: italic; color: var(--accent); }
.brand .brand-sub {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after { right: 0; }
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .site-header .container { gap: 12px; }
  .brand .brand-name { font-size: clamp(0.9rem, 4.4vw, 1.1rem); }
  .brand .brand-sub { display: none; }
  .main-nav { gap: 14px; }
  .main-nav a { font-size: 0.7rem; letter-spacing: 0.08em; }
  /* Sur téléphone, la place manque : le bouton et la flèche de la page de
     garde mènent déjà à la galerie, on garde les filtres Carole / Patrick. */
  .main-nav a[href="#photos"] { display: none; }
}

/* ---------- Page de garde : photos en plein écran ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--bg-alt);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slides .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  cursor: zoom-in;
}
.hero-slides .slide.on { opacity: 1; }
.hero-slides img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: heroZoom 9s ease-out forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }

/* Voile pour la lisibilité du titre : laisse passer les clics vers la photo */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13,14,16,0.5) 0%, rgba(13,14,16,0.18) 40%, rgba(13,14,16,0.82) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 0 6vw; pointer-events: none; }
.hero-content a, .hero-content .btn { pointer-events: auto; }
.hero-content h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 380;
  margin-bottom: 0.35em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.hero-content h1 em { font-style: italic; color: var(--accent); }
.hero-content h1 .eyebrow {
  display: flex;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 300;
  text-shadow: none;
}
.hero-content h1 .eyebrow::after {
  content: "";
  width: 42px; height: 1px;
  background: var(--accent);
  opacity: 0.7;
}
.hero-content .tagline {
  color: rgba(236, 233, 226, 0.85);
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 600px;
  margin: 0 auto 2.2em;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-credit {
  position: absolute;
  right: 22px; bottom: 18px;
  z-index: 2;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(236, 233, 226, 0.55);
  pointer-events: none;
}
.scroll-cue {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px; height: 42px;
  border: 1px solid rgba(236, 233, 226, 0.5);
  border-radius: 999px;
}
.scroll-cue::before {
  content: "";
  position: absolute;
  left: 50%; top: 8px;
  width: 3px; height: 8px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: var(--accent);
  animation: cue 1.8s infinite;
}
@keyframes cue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Filtres de la mosaïque ---------- */
.filtres {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filtres-haut {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.recherche { flex: 1 1 260px; position: relative; }
.recherche input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 16px 10px 44px;
  transition: border-color 0.2s;
}
.recherche input::placeholder { color: rgba(160, 156, 146, 0.7); }
.recherche input:focus { outline: none; border-color: var(--accent); }
.recherche svg {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.filtres-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Boutons « Copier le lien » et « Tout effacer » */
.btn-lien {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-lien svg { width: 15px; height: 15px; flex: none; }
.btn-lien:hover { color: var(--accent); border-color: var(--accent); }
.btn-lien.ok { color: #14100a; background: var(--accent); border-color: var(--accent); }

.facette { display: flex; align-items: flex-start; gap: 16px; }
.facette-nom {
  flex: none;
  width: 96px;
  padding-top: 7px;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
  padding: 5px 9px 5px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.puce .n {
  font-size: 0.7rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 24px;
  text-align: center;
}
.puce:hover { border-color: var(--accent); }
.puce:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.puce.on { background: var(--accent); border-color: var(--accent); color: #14100a; }
.puce.on .n { background: rgba(20, 16, 10, 0.18); color: #14100a; }
.puce.plus { border-style: dashed; color: var(--muted); padding-right: 14px; }
@media (max-width: 640px) {
  .filtres { padding: 14px; }
  .facette { flex-direction: column; gap: 8px; }
  .facette-nom { width: auto; padding-top: 0; }
}

/* ---------- La mosaïque ----------
   Rangées justifiées : chaque photo garde ses proportions (--r = largeur /
   hauteur) et les photos d'une même rangée ont la même hauteur, proche de
   --row-h. Une photo filtrée est simplement masquée : les rangées se
   recomposent toutes seules, sans rien reconstruire. */
.mosaique {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--gap);
}
.mosaique::after { content: ""; flex: 1000000 1 0px; } /* comble la dernière rangée */
.mosaique .ph {
  position: relative;
  flex-grow: calc(var(--r, 1.5) * 1000);
  flex-basis: calc(var(--r, 1.5) * var(--row-h));
  aspect-ratio: var(--r, 1.5);
  min-width: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: zoom-in;
}
.mosaique .ph img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.mosaique .ph:hover img { transform: scale(1.04); }
.mosaique .ph .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
}
.mosaique .ph:hover .cap, .mosaique .ph:focus-visible .cap { opacity: 1; transform: translateY(0); }
.mosaique .ph .cap .aut {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
@media (max-width: 1100px) { :root { --row-h: 240px; } }
@media (max-width: 760px) { :root { --row-h: 180px; --gap: 8px; } }
@media (max-width: 480px) { :root { --row-h: 140px; --gap: 6px; } }

.vide {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Visionneuse ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 9, 10, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox .lb-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  padding: 0 70px;
}
.lightbox img {
  max-width: min(94vw, 1800px);
  max-height: 76vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transition: opacity 0.25s;
}
.lightbox.chargement img { opacity: 0.3; }
.lightbox .lb-caption {
  text-align: center;
  margin-top: 16px;
  max-width: 86vw;
  font-size: 0.9rem;
  color: rgba(236, 233, 226, 0.9);
}
.lb-caption .titre { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 2px; }
.lb-caption .meta { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.06em; }
.lb-caption .meta .aut { color: var(--accent); text-transform: uppercase; letter-spacing: 0.16em; }
.lb-caption .tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 9px;
}
.lb-caption .tags a {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.lb-caption .tags a:hover { color: var(--accent); border-color: var(--accent); }
.lb-caption .exif {
  color: rgba(160, 156, 146, 0.7);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  margin-top: 7px;
}
.lightbox .lb-count {
  position: absolute;
  top: 32px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.lightbox .rond {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  width: 48px; height: 48px;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.lightbox .rond:hover { background: var(--accent); border-color: var(--accent); color: #14100a; }
.lightbox .lb-close { top: 22px; right: 22px; }
.lightbox .lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-lien { position: absolute; top: 28px; left: 22px; }
@media (max-width: 760px) {
  .lightbox .lb-fig { padding: 0 8px; }
  .lightbox img { max-height: 64vh; }
  .lightbox .rond { width: 40px; height: 40px; font-size: 1rem; }
  .lightbox .lb-prev { left: 8px; }
  .lightbox .lb-next { right: 8px; }
  .lightbox .lb-close { top: 12px; right: 12px; }
  .lightbox .lb-lien { top: 14px; left: 12px; }
  .lightbox .lb-lien span { display: none; }
  .lightbox .lb-count { top: 24px; }
  .lb-caption .exif { display: none; }
}

/* ---------- Bouton « Haut de page » ---------- */
.haut-de-page {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(13, 14, 16, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.35s, transform 0.35s, visibility 0.35s, background 0.25s, color 0.25s;
}
.haut-de-page.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.haut-de-page:hover { background: var(--accent); color: #14100a; border-color: var(--accent); }

/* ---------- Pied de page ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #0a0b0d;
  padding: 50px 0 28px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.site-footer .brand-name { font-family: var(--font-display); font-size: 1.5rem; }
.site-footer .brand-name em { font-style: italic; color: var(--accent); }
.site-footer p, .site-footer li { color: var(--muted); }
.site-footer h2 {
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 500;
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }

/* ---------- Apparition au défilement ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slides img { animation: none; transform: none; }
  .scroll-cue::before { animation: none; }
  .haut-de-page { transform: none; }
}
