/* ══════════════════════════════════════════
   GALERIE — Page header · Filtres · Grille masonry · Lightbox
   Sub-nav · Recettes · Avis
   ══════════════════════════════════════════ */

/* ── PAGE HEADER ── */
.page-hero {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-top: 68px;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
[data-theme="light"] .page-hero-bg {
  background: linear-gradient(160deg, var(--bg2) 0%, var(--bg) 60%);
}
[data-theme="dark"] .page-hero-bg {
  background: linear-gradient(160deg, var(--bg3) 0%, var(--bg) 60%);
}
.page-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 40%, rgba(196,146,40,.08) 0%, transparent 65%);
}

.page-hero-inner {
  position: relative;
  z-index: 2;
  padding: 3rem 1.5rem 3.5rem;
  width: 100%;
}

.page-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(44px, 10vw, 72px);
  font-weight: 300;
  line-height: .95;
  color: var(--ink);
  margin: 1rem 0 1.25rem;
  transition: color .5s;
}
.page-hero-title em { font-style: italic; color: var(--gold2); }

.page-hero-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
  max-width: 420px;
  line-height: 1.8;
}

/* ── SUB-NAVIGATION ── */
.gal-subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0 1.5rem 2rem;
  flex-wrap: wrap;
}

.gal-subnav a {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .25s, border-color .25s;
}
.gal-subnav a:hover {
  color: var(--gold2);
}
.gal-subnav a.active {
  color: var(--gold2);
  border-bottom-color: var(--gold2);
}

#univers,
#recettes,
#avis {
  scroll-margin-top: 68px;
}

/* ── SECTION HEADERS ── */
.gal-section-header {
  padding: 4rem 1.5rem 1.5rem;
  max-width: 640px;
}

.gal-section-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
  max-width: 420px;
  line-height: 1.8;
  margin-top: .75rem;
}

/* ── FILTRES ── */
.gal-filters {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 2.5rem 1.5rem 1.5rem;
  flex-wrap: wrap;
}

.gal-filter {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 9px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.gal-filter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.gal-filter span { position: relative; z-index: 1; }

.gal-filter:hover {
  color: var(--gold2);
  border-color: var(--gold2);
}
.gal-filter.active {
  border-color: var(--gold);
  color: #fff;
}
.gal-filter.active::before { transform: scaleX(1); }

.gal-count {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-left: auto;
  font-weight: 300;
  padding-right: .25rem;
}

/* ── GRILLE MASONRY ── */
.gal-wrap {
  padding: 0 1.5rem 5rem;
}

.gal-grid {
  columns: 1;
  column-gap: 12px;
}

.gal-item {
  break-inside: avoid;
  margin-bottom: 12px;
  cursor: pointer;
}

/* Transition de filtrage */
.gal-item {
  transition: opacity .28s ease, transform .28s ease;
}
.gal-item.is-hiding {
  opacity: 0;
  transform: scale(.96);
  pointer-events: none;
}
.gal-item.is-hidden {
  display: none;
}

/* Image + overlay */
.gal-item-inner {
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--bg2);
}
.gal-item-inner img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .55s cubic-bezier(.25,.46,.45,.94);
  will-change: transform;
}
.gal-item:hover .gal-item-inner img {
  transform: scale(1.04);
}

/* Overlay doré */
.gal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(196, 146, 40, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .35s;
}
.gal-overlay-icon {
  font-size: 28px;
  color: #fff;
  font-weight: 300;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .3s, transform .3s;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
}
.gal-item:hover .gal-overlay { background: rgba(196, 146, 40, .28); }
.gal-item:hover .gal-overlay-icon { opacity: 1; transform: scale(1); }

/* Caption */
.gal-caption {
  padding: .65rem 0 .25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.gal-caption-cat {
  font-size: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  background: var(--bg2);
  padding: 3px 8px;
  border: 1px solid var(--border);
}
.gal-caption-name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}

/* ── SECTION ALT BACKGROUND ── */
.gal-section-alt {
  background: var(--section-alt);
  transition: background .5s;
  padding-bottom: 4rem;
}

/* ── RECETTES ── */
.recettes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 1.5rem;
}

.recette-card {
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}

.recette-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.15);
}

.recette-visual {
  height: 160px;
  background: linear-gradient(160deg, hsl(var(--rc-hue), 25%, 12%) 0%, hsl(var(--rc-hue), 25%, 18%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--gold);
}

.recette-num {
  position: absolute;
  top: .75rem;
  left: 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-style: italic;
  font-weight: 300;
  opacity: .07;
  color: var(--ink);
  line-height: 1;
}

.recette-icon {
  font-size: 48px;
}

.recette-body {
  padding: 1.5rem;
  background: var(--card-bg);
}

.recette-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--gold2);
  margin: 0 0 .5rem;
}

.recette-body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.85;
  margin: 0;
}

/* ── AVIS ── */
.avis-score {
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
}

.avis-score-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  font-style: italic;
  font-weight: 300;
  color: var(--gold2);
  line-height: 1;
}

.avis-stars {
  font-size: 24px;
  color: var(--gold3);
  margin-top: .5rem;
}

.avis-score-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: .5rem;
}

.avis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 1.5rem;
}

.avis-card {
  border: 1px solid var(--border);
  padding: 2rem;
  transition: border-color .25s, transform .3s, box-shadow .3s;
}

.avis-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.avis-card-stars {
  font-size: 14px;
  color: var(--gold3);
  margin-bottom: .75rem;
}

.avis-card-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.75;
  margin: 0;
}

.avis-card-author {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-top: 1rem;
}

.avis-cta {
  text-align: center;
  padding: 3rem 0 5rem;
}

/* ── LIGHTBOX ── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s .35s;
}
#lightbox.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s 0s;
}

#lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 5, 2, 0);
  transition: background .35s;
  cursor: pointer;
}
#lightbox.is-open #lb-backdrop { background: rgba(10, 5, 2, .92); }

#lb-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 900px);
  width: 100%;
  opacity: 0;
  transform: scale(.95);
  transition: opacity .35s, transform .35s;
}
#lightbox.is-open #lb-content { opacity: 1; transform: scale(1); }

#lb-img-wrap {
  width: 100%;
  max-height: 75vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196,146,40,.2);
}
#lb-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
}

#lb-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 .5rem;
  width: 100%;
}
#lb-cat-tag {
  font-size: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border2);
  padding: 3px 10px;
}
#lb-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-style: italic;
  color: rgba(250,246,238,.7);
}
#lb-counter {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(250,246,238,.3);
}

/* Boutons lightbox */
#lb-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: 1px solid rgba(196,146,40,.3);
  color: rgba(250,246,238,.6);
  width: 36px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lb-close:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

#lb-prev, #lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid rgba(196,146,40,.25);
  color: rgba(250,246,238,.5);
  width: 48px;
  height: 80px;
  font-size: 24px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
}
#lb-prev { left: 1.5rem; }
#lb-next { right: 1.5rem; }
#lb-prev:hover, #lb-next:hover {
  background: rgba(196,146,40,.15);
  color: var(--gold3);
  border-color: var(--gold);
}

/* ── BREAKPOINTS ── */
@media (min-width: 600px) {
  .page-hero-inner { padding: 3rem 3rem 4rem; }
  .page-hero-title { font-size: clamp(52px, 8vw, 80px); }
  .gal-filters { padding: 2.5rem 3rem 1.5rem; gap: 1rem; }
  .gal-wrap { padding: 0 3rem 5rem; }
  .gal-grid { columns: 2; column-gap: 14px; }
  .gal-item { margin-bottom: 14px; }

  .gal-subnav { padding: 0 3rem 2rem; }
  .gal-section-header { padding: 4rem 3rem 1.5rem; }
  .recettes-grid { grid-template-columns: repeat(2, 1fr); padding: 0 3rem; }
  .avis-grid { grid-template-columns: repeat(2, 1fr); padding: 0 3rem; }
}

@media (min-width: 960px) {
  .page-hero { min-height: 380px; }
  .page-hero-inner { padding: 4rem 5rem 4.5rem; }
  .page-hero-title { font-size: clamp(60px, 6vw, 88px); }
  .page-hero-sub { font-size: 15px; max-width: 500px; }
  .gal-filters { padding: 3rem 5rem 2rem; gap: 1.25rem; }
  .gal-wrap { padding: 0 5rem 7rem; }
  .gal-grid { columns: 3; column-gap: 16px; }
  .gal-item { margin-bottom: 16px; }
  #lb-prev { left: 2.5rem; }
  #lb-next { right: 2.5rem; }

  .gal-subnav { padding: 0 5rem 2rem; }
  .gal-section-header { padding: 4rem 5rem 2rem; }
  .recettes-grid { grid-template-columns: repeat(3, 1fr); padding: 0 5rem; }
  .avis-grid { grid-template-columns: repeat(3, 1fr); padding: 0 5rem; }
}

/* Mobile touch — cursor: auto */
@media (max-width: 959px) {
  .gal-filter, .gal-item { cursor: auto !important; }
  #lb-close, #lb-prev, #lb-next { cursor: auto !important; }
}
