
:root {
  --bg: #f4f1ea;
  --ink: #181b17;
  --muted: #74786f;
  --card: #fff;
  --accent: #d1a85a;
  --dark: #10140f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.hero {
  min-height: 72vh;
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  color: white;
  background:
    linear-gradient(rgba(10,14,9,.34), rgba(10,14,9,.58)),
    radial-gradient(circle at 30% 30%, #706c46 0, transparent 35%),
    linear-gradient(135deg, #3f5435 0%, #a77f48 55%, #d7ba7f 100%);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .25;
}

.hero::before {
  width: 45vw;
  height: 45vw;
  background: #d6b568;
  left: -15vw;
  bottom: -25vw;
}

.hero::after {
  width: 35vw;
  height: 35vw;
  background: #315130;
  right: -10vw;
  top: -15vw;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 48px 24px;
}

.eyebrow {
  display: inline-block;
  font-size: .75rem;
  letter-spacing: .22em;
  font-weight: 700;
  opacity: .85;
}

.eyebrow.dark { color: #8b6a2b; }

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  margin: 0;
}

h1 {
  font-size: clamp(4rem, 11vw, 8.5rem);
  line-height: .92;
  margin: .4rem 0 1rem;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin: 0 0 2rem;
  opacity: .92;
}

.hero__cta {
  color: white;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.45);
  padding: 12px 18px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.08);
}

.gallery-wrap {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 90px;
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 30px;
}

.gallery-head h2 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  margin-top: 6px;
}

.count {
  color: var(--muted);
  font-weight: 600;
}

/* IMPORTANT : vraie grille, ordre gauche -> droite puis ligne suivante */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.photo-card {
  position: relative;
  width: 100%;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #ddd;
  cursor: zoom-in;
  box-shadow: 0 6px 24px rgba(40,30,10,.06);
  content-visibility: auto;
  contain-intrinsic-size: 320px 240px;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .45s ease, filter .3s ease;
}

.photo-card:hover img {
  transform: scale(1.018);
  filter: brightness(.82);
}

.photo-card__actions {
  position: absolute;
  inset: auto 12px 12px auto;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: .25s ease;
}

.photo-card:hover .photo-card__actions {
  opacity: 1;
  transform: translateY(0);
}

.icon-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  text-decoration: none;
  background: rgba(255,255,255,.94);
  color: #161914;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  font-size: 1.15rem;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  border: 1px dashed #c8c3b7;
  border-radius: 18px;
}

.empty-state h3 { font-size: 2rem; }

.empty-state p { color: var(--muted); }

code {
  background: rgba(0,0,0,.06);
  padding: 2px 6px;
  border-radius: 5px;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 0 20px 46px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7,8,7,.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 80px;
}

.lightbox.open { display: flex; }

.lightbox__stage {
  max-width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.lightbox__stage img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
}

.lightbox__bar {
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 2px 0;
}

.lightbox__bar strong {
  display: block;
  max-width: 55vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox__bar span {
  color: #aaa;
  font-size: .9rem;
}

.download-btn {
  text-decoration: none;
  color: #171914;
  background: white;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  white-space: nowrap;
}

.lightbox__close,
.lightbox__nav {
  position: fixed;
  z-index: 101;
  color: white;
  border: 0;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  backdrop-filter: blur(7px);
}

.lightbox__close {
  right: 22px;
  top: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 2rem;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 74px;
  border-radius: 14px;
  font-size: 3rem;
  line-height: 1;
}

.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }

.gallery-sentinel {
  width: 100%;
  height: 2px;
  margin-top: 1px;
}

/* Tablette */
@media (max-width: 1000px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 700px) {
  .hero { min-height: 58vh; }

  .gallery-wrap {
    width: min(100% - 18px, 1500px);
    padding-top: 48px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .photo-card {
    border-radius: 10px;
  }

  .photo-card__actions {
    opacity: 1;
    transform: none;
  }

  .gallery-head {
    align-items: start;
    flex-direction: column;
  }

  .lightbox {
    padding: 58px 10px 16px;
  }

  .lightbox__nav {
    width: 42px;
    height: 58px;
    font-size: 2.2rem;
    background: rgba(0,0,0,.24);
  }

  .lightbox__nav--prev { left: 6px; }
  .lightbox__nav--next { right: 6px; }

  .lightbox__bar {
    align-items: stretch;
    flex-direction: column;
  }

  .download-btn {
    text-align: center;
  }

  .lightbox__bar strong {
    max-width: 86vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-card img,
  .photo-card__actions {
    transition: none !important;
  }
}
