/* ========== BASE ==========: */
body {
  margin: 0;
  font-family: 'Space Mono', monospace;
  background: #fff;
  color: #000;
  line-height: 1.6;
  padding: 0;
}

/* ========== HEADER & NAV ==========: */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid #ddd;
}
header h1 {
  font-size: 20px;
  letter-spacing: 4px;
  margin: 0;
  font-weight: 400;
}
nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #000;
  font-size: 14px;
  letter-spacing: 2px;
}
nav a:hover { color: #555; }
nav a.active {
  background: linear-gradient(90deg, #FFFDF8, #FFF6D9, #FFEFC0);
  padding: 2px 6px;
}

/* ========== HOME (comme ABOUT) ==========: */
.home {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: left;
}
.intro-text {
  font-size: 16px;
  line-height: 1.8;
  white-space: normal;
  margin-bottom: 40px;
  letter-spacing: 0;
  font-weight: 400;
}
.polaroid {
  background: #fff;
  padding: 10px 10px 30px;
  display: block;
  margin: 30px 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  text-align: center;
  max-width: 450px;
}
.home .polaroid {
  margin: 30px auto;
  max-width: 350px;
}
.polaroid img { width: 100%; display: block; }
.polaroid p {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #444;
  margin-top: 10px;
  font-style: italic;
}
.polaroid.empty {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  border: 1px dashed #ccc;
}

/* ========== ABOUT ==========: */
.about {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}
.about h2 {
  font-size: 16px;
  text-transform: uppercase;
  margin-top: 50px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #FFFDF8, #FFF6D9, #FFEFC0);
  display: inline-block;
  padding: 2px 6px;
}
.about .polaroid { margin-left: auto; margin-right: auto; }

/* ========== CONTACT ==========: */
.contact {
  display: block;
  max-width: 800px;
  margin: 60px auto;
  padding: 0 50px;
  text-align: left;
}
.contact h2 { margin-bottom: 20px; }

/* ========== GALERIES ==========: */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 40px;
}
.gallery img {
  width: 100%;
  border-radius: 4px;
  transition: transform 0.3s;
}
.gallery img:hover { transform: scale(1.05); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 40px;
}
.gallery-grid figure { margin: 0; }
.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  transition: transform 0.3s ease;
  cursor: zoom-in;
}
.gallery-grid img:hover { transform: scale(1.02); }
.gallery-grid figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.gallery-grid .title { font-weight: 400; }
.gallery-grid .price { opacity: 0.8; }
.gallery-grid .sold  { color: #999; font-style: italic; }

/* Figures spéciales si déjà utilisées */
.gallery-grid figure.big   { grid-column: span 2; }
.gallery-grid figure.small { max-width: 300px; justify-self: center; }

/* ========== LIGHTBOX ==========: */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  padding: 20px;
  background: rgba(255,255,255,0.95);
}
.lightbox-content {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 95vh;
}
#lightbox-caption {
  margin: 16px auto 0;
  max-width: 90%;
  color: #333;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}
#lightbox-caption p { margin: 0 0 4px; }
.lightbox .close {
  position: absolute;
  top: 16px; right: 24px;
  background: none; border: 0;
  color: #000;
  font-size: 40px; line-height: 1;
  cursor: pointer;
}
.lightbox .close:hover { color: #555; }

/* ========== RESPONSIVE ==========: */
@media (max-width: 900px) {
  header { padding: 16px 24px; }
  nav a { margin-left: 14px; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    padding: 24px;
  }
}

@media (max-width: 640px) {
  /* Header en colonne + centré */
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  header h1 { margin-bottom: 10px; }
  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  nav a { margin: 0; }

  /* HOME (mobile) */
  .home { margin: 40px auto; padding: 0 16px; }
  .intro-text { font-size: 16px; }

  /* Titres centrés */
  .about h2, .contact h2 { text-align: center; }

  /* Galerie : 1 colonne, images empilées */
  .gallery, .gallery-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 20px;
    padding: 20px;
    text-align: center;
  }
  .gallery-grid figure {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }
  .gallery-grid figcaption { text-align: center; }

  /* Lightbox mobile : images bien proportionnées */
  .lightbox { padding: 8px; background: #fff; }
  .lightbox-content {
    max-width: 100%;
    max-height: 82svh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
  .lightbox .close { top: 6px; right: 10px; font-size: 28px; }
}

/* Utilitaire SEO */
.seo-hidden {
  position: absolute;
  left: -9999px;
}
