/* ==============================
   VARIABLES & RESET
   ============================== */
:root {
  --bg:           #0a0f0c;
  --card:         #0e1411;
  --fg:           #e6ebe5;
  --muted:        #6a7a6c;
  --border:       rgba(230,235,229,0.08);
  --accent:       #5e8c61;
  --secondary:    #131c16;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Karla', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  --px: clamp(1.5rem, 5vw, 3.5rem);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ==============================
   SHARED UTILITIES
   ============================== */
.label-tag, .section-tag, .essay-cat, .essay-date, .essay-read {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.section-tag { color: var(--accent); margin-bottom: 0.75rem; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 300;
  color: var(--fg);
}

.section-header {
  padding: 5rem var(--px) 2.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.see-all-link {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.see-all-link:hover { color: var(--accent); }
.see-all-link svg { transition: transform 0.3s; }
.see-all-link:hover svg { transform: translateX(3px); }

.divider {
  height: 1px;
  background: var(--border);
  margin: 0 var(--px);
}

/* ==============================
   NAV
   ============================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--px);
  background: linear-gradient(to bottom, rgba(10,15,12,0.95) 0%, rgba(10,15,12,0) 100%);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg);
  transition: color 0.5s;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: none;
  align-items: center;
  gap: 2.5rem;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--fg); }

.nav-burger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==============================
   MOBILE OVERLAY
   ============================== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.overlay-link {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg);
  font-weight: 300;
  transition: color 0.3s;
}
.overlay-link:hover { color: var(--accent); }

/* ==============================
   HERO
   ============================== */
.hero {
  position: relative;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--px) 4rem;
  overflow: hidden;
  background: var(--card);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(10,15,12,0.3) 50%, rgba(10,15,12,0.1) 100%);
}

.hero-content { position: relative; z-index: 10; }

.label-tag {
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: block;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 300;
  line-height: 0.95;
  color: var(--fg);
  margin-bottom: 2rem;
  max-width: 900px;
}
.hero-title em {
  font-style: normal;
  color: rgba(237,233,227,0.7);
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  line-height: 1.7;
  max-width: 28rem;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: var(--px);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.scroll-line {
  width: 1px;
  height: 4rem;
  background: linear-gradient(to bottom, var(--border), transparent);
}
.scroll-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: translateY(1.5rem);
}

/* ==============================
   GALLERY
   ============================== */
.gallery-wrap { padding: 0 var(--px) 5rem; }

.masonry {
  columns: 2;
  column-gap: 0.5rem;
}

.photo-item {
  break-inside: avoid;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
}
.photo-item img {
  width: 100%;
  object-fit: cover;
  transition: transform 0.7s ease, filter 0.7s ease;
  display: block;
}
.photo-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.5);
}
.photo-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.4s;
}
.photo-item:hover .photo-caption { opacity: 1; }

.photo-cat {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.photo-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--fg);
}

.see-all-mobile {
  margin-top: 1.5rem;
  text-align: center;
}
.see-all-mobile a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.see-all-mobile a:hover { color: var(--accent); }

/* ==============================
   ESSAYS
   ============================== */
.essays { padding: 5rem var(--px); }
.essays .section-header { padding: 0 0 3.5rem; }

.essays-list {}

.essay-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2.25rem 0 2.5rem;
  transition: color 0.3s;
  cursor: pointer;
}
.essay-body { flex: 1; }

.essay-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.essay-cat { color: var(--accent); }
.essay-date, .essay-read { color: var(--muted); letter-spacing: 0.15em; }

.essay-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  color: var(--fg);
  line-height: 1.25;
  margin-bottom: 1rem;
  transition: color 0.4s;
}
.essay-item:hover .essay-title { color: rgba(196,160,106,0.9); }

.essay-excerpt {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 42rem;
}

.essay-arrow {
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.3s, transform 0.3s;
}
.essay-item:hover .essay-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ==============================
   ABOUT
   ============================== */
.about { padding: 5rem var(--px) 7rem; }

.about-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.about-img-wrap {
  position: relative;
  background: var(--card);
  overflow: hidden;
  aspect-ratio: 3/4;
}
.about-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.9;
}
.about-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,20,17,0.6), transparent);
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 300;
  color: var(--fg);
  line-height: 1.1;
  margin-bottom: 1.75rem;
}
.about-title em {
  font-style: normal;
  color: rgba(237,233,227,0.65);
}

.about-body {
  color: var(--muted);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 1rem 2rem;
  margin-top: 1rem;
  transition: border-color 0.4s, color 0.4s;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline svg { transition: transform 0.3s; }
.btn-outline:hover svg { transform: translateX(3px); }

/* ==============================
   FOOTER
   ============================== */
.footer {
  padding: 2.5rem var(--px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 300;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--fg); }
.footer-link-desktop { display: none; }

/* ==============================
   RESPONSIVE
   ============================== */
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
  .see-all-link { display: flex; }
  .scroll-indicator { display: flex; }
  .masonry { columns: 3; column-gap: 0.75rem; }
  .photo-item { margin-bottom: 0.75rem; }
  .see-all-mobile { display: none; }
  .about-inner { grid-template-columns: 5fr 7fr; gap: 5rem; }
  .footer { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-link-desktop { display: inline-flex; }
}

/* ==============================
   ÉTAT DE CHARGEMENT GALERIE
   ============================== */
.gallery-loading {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3rem 0;
  text-align: center;
  column-span: all;
}

/* ==============================
   LIGHTBOX
   ============================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 12, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 1.5rem;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

/* Empeche le scroll du site quand la lightbox est ouverte */
body.lb-locked {
  overflow: hidden;
}

.lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 100%;
  max-height: 100%;
}

.lb-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lb-image.loaded {
  opacity: 1;
  transform: scale(1);
}

.lb-caption {
  text-align: center;
}
.lb-cat {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.lb-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--fg);
}

/* Bouton fermer */
.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 235, 229, 0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.lb-close:hover {
  background: rgba(230, 235, 229, 0.12);
  border-color: var(--accent);
}

/* Boutons navigation */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 235, 229, 0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.lb-nav:hover {
  background: rgba(230, 235, 229, 0.12);
  border-color: var(--accent);
}
.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }

/* Indique qu'une image est cliquable */
.photo-item { cursor: zoom-in; }

/* --- Adaptation mobile --- */
@media (max-width: 640px) {
  .lightbox { padding: 0.75rem; }
  .lb-image { max-height: 72vh; }
  .lb-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
  }
  /* Sur mobile : fleches plus petites et en bas, pour ne pas gener l'image */
  .lb-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
    width: 46px;
    height: 46px;
  }
  .lb-prev { left: 25%; }
  .lb-next { right: 25%; }
  .lb-stage { gap: 0.85rem; }
}

/* ==============================
   LIGHTBOX — EXIF
   ============================== */
.lb-exif {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
}
.lb-exif:empty { display: none; }

.lb-exif-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.lb-exif-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.lb-exif-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg);
  letter-spacing: 0.05em;
}

/* Sur mobile : exif en ligne compacte */
@media (max-width: 640px) {
  .lb-exif { gap: 0.4rem 1rem; margin-top: 0.5rem; }
  .lb-exif-value { font-size: 10px; }
  .lb-exif-label { font-size: 7px; }
}

/* ==============================
   LIGHTBOX — LIEU & DATE
   ============================== */
.lb-caption-top { text-align: center; }

.lb-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.lb-meta:empty { display: none; }

.lb-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.lb-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}
