/* =========================================================
   Artisylvie — Galerie photo
   Ambiance chaleureuse : lin, terre cuite, fil doré.
   ========================================================= */

:root {
  --cream:        #FBF3E7;
  --cream-2:      #F3E7D4;
  --paper:        #FFFDF9;
  --ink:          #4A3428;
  --ink-soft:     #7A6555;
  --terracotta:   #C1633D;
  --terracotta-d: #A24E2F;
  --gold:         #C99B4A;
  --sage:         #7C8B5E;
  --shadow:       0 10px 30px -12px rgba(74, 52, 40, 0.35);
  --shadow-soft:  0 4px 16px -6px rgba(74, 52, 40, 0.25);
  --radius:       18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Karla', 'Segoe UI', sans-serif;
  line-height: 1.5;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(74,52,40,0.05) 1px, transparent 0);
  background-size: 22px 22px;
}

h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--ink);
  margin: 0;
}

code {
  background: var(--cream-2);
  border: 1px dashed var(--gold);
  border-radius: 6px;
  padding: 0.1em 0.45em;
  font-size: 0.92em;
}

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

.hero {
  position: relative;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-d) 55%, #8f4326 100%);
  padding: 5.5rem 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.10) 0, transparent 45%),
                     radial-gradient(circle at 85% 80%, rgba(255,255,255,0.08) 0, transparent 40%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }

.hero-eyebrow {
  color: #FBE3CE;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: #FFF8EF;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-tag {
  color: #F6DFC7;
  max-width: 46ch;
  margin: 1rem auto 0;
  font-size: 1.05rem;
}

.hero-wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%; height: 40px;
  fill: var(--cream);
}

/* ---------- Layout ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---------- Filtres ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2.75rem;
}

.pill {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--terracotta-d);
  background: var(--paper);
  border: 1.5px solid var(--cream-2);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  box-shadow: var(--shadow-soft);
}

.pill:hover { transform: translateY(-1px); border-color: var(--gold); }

.pill.is-active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

.pill-count {
  display: inline-block;
  margin-left: 0.35em;
  opacity: 0.75;
  font-weight: 500;
}

/* ---------- Sections / grille ---------- */

.gallery-section { margin-bottom: 3.25rem; }
.gallery-section.is-hidden { display: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 2px dashed var(--cream-2);
  padding-bottom: 0.6rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 600;
}

.section-count {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-2);
  box-shadow: var(--shadow-soft);
  border: 3px solid var(--paper);
  outline: 1px dashed rgba(201, 155, 74, 0.55);
  outline-offset: -9px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.thumb:hover,
.thumb:focus-visible {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--shadow);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--cream-2);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.thumb img.is-loaded { opacity: 1; }

/* ---------- État vide ---------- */

.empty-state {
  max-width: 560px;
  margin: 2rem auto;
  text-align: center;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-soft);
  border: 1.5px dashed var(--gold);
}

.empty-emoji { font-size: 2.4rem; margin: 0 0 0.5rem; }
.empty-state h2 { font-size: 1.4rem; font-style: italic; margin-bottom: 0.9rem; }
.empty-state p { color: var(--ink-soft); }

/* ---------- Pied de page ---------- */

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 1.5rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 19, 12, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.lightbox[hidden] { display: none; }

.lb-stage {
  max-width: 92vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 92vw;
  max-height: 78vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lb-img.is-loaded { opacity: 1; }

.lb-bar {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #F6E9D8;
  font-size: 0.9rem;
  max-width: 92vw;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.lb-title { font-family: 'Fraunces', serif; font-style: italic; font-size: 1.05rem; }
.lb-counter { opacity: 0.65; }

.lb-download {
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
}
.lb-download:hover { border-color: var(--gold); }

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255, 253, 249, 0.12);
  color: #FFF8EF;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.2s ease;
  line-height: 1;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 253, 249, 0.24); }

.lb-close {
  top: 1.25rem; right: 1.25rem;
  width: 44px; height: 44px;
  font-size: 1.2rem;
}

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  font-size: 1.8rem;
}

.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

@media (max-width: 640px) {
  .hero { padding: 4rem 1.25rem 3rem; }
  .lb-prev, .lb-next { width: 42px; height: 42px; font-size: 1.4rem; }
  .lb-prev { left: 0.4rem; }
  .lb-next { right: 0.4rem; }
}
