/* =========================================================
   JEREMY PHOTOGRAPHIE — style.css
   Fichier principal du lab. Modifie ici :
     - les couleurs (variables --xxx-color)
     - les polices (--font-base, --font-display)
     - les espacements globaux
   ========================================================= */

:root {
  /* === Couleurs : change ces valeurs pour re-themer tout le site === */
  --bg-color: #0b0b0d;           /* fond principal (noir profond) */
  --bg-elevated: #141418;        /* fond des cartes / sections */
  --text-color: #ececec;         /* texte principal */
  --text-muted: #9a9a9a;         /* texte secondaire */
  --accent-color: #c9a96a;       /* doré — couleur signature photo */
  --accent-hover: #e0c184;
  --border-color: #232328;

  /* === Typo === */
  --font-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Playfair Display", "Times New Roman", serif;

  /* === Espacements === */
  --container-max: 1200px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* === Effets === */
  --radius: 6px;
  --transition: 0.3s ease;
}

/* === Reset minimal === */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-color); }

/* === Container global === */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* === HERO === */
.hero {
  min-height: 38vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background:
    linear-gradient(rgba(11,11,13,0.25), rgba(11,11,13,0.55)),
    url('../images/hero/dsc01539-resized-651936ceb58a5954021712.webp') center/cover no-repeat;
  /* ↳ Change l'image du hero ici. Si pas d'image, le dégradé seul suffit. */
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  margin-bottom: var(--space-sm);
  color: #fff;
}

.hero p {
  max-width: 560px;
  font-size: 0.95rem;
  color: #d0d0d0;
  margin-top: 0;
}

/* === CARROUSEL (Swiper) === */
.carousel {
  padding: var(--space-lg) 0 var(--space-sm);
  background: var(--bg-elevated);
}

.swiper { width: 100%; padding: var(--space-md) 0; }

.swiper-slide {
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform var(--transition);
}

.swiper-slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.7));
}

.swiper-slide span { position: relative; z-index: 1; }
.swiper-slide:hover { transform: scale(1.02); }

.swiper-pagination-bullet {
  background: var(--accent-color) !important;
  opacity: 0.4;
}
.swiper-pagination-bullet-active { opacity: 1; }

/* === GALERIE (mosaïque) === */
.gallery {
  padding: var(--space-lg) 0;
}

.gallery h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: var(--space-lg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
}

.grid img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}

.grid img:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

/* === SECTION WELCOME (texte long) === */
.welcome {
  padding: var(--space-md) 0 var(--space-xl);
  background: var(--bg-elevated);
}

.welcome h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  text-align: center;
}

.welcome p {
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
  text-align: justify;
}

/* === SECTION TITRE GÉNÉRIQUE (portfolio, about, contact) === */
.page-hero {
  padding: calc(var(--space-md) + 60px) 0 calc(var(--space-md) + 40px);
  text-align: center;
  background:
    linear-gradient(rgba(11,11,13,0.25), rgba(11,11,13,0.55)),
    url('../images/hero/dsc02179-65365b13620b8787079560.webp') center 25%/cover no-repeat;
  color: #fff;
  margin-top: 0;
  min-height: 28vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: background var(--transition);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.15em;
  margin-bottom: var(--space-xs);
}

.page-hero p { color: #d0d0d0; max-width: 600px; margin: 0 auto; font-size: 0.95rem; }

/* === CONTACT FORM === */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex; flex-direction: column; gap: var(--space-sm);
  padding: var(--space-lg) 0;
}

.contact-form input,
.contact-form textarea {
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
  font-family: var(--font-base);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.contact-form textarea { min-height: 160px; resize: vertical; }

.contact-form button {
  padding: 1rem 2rem;
  background: var(--accent-color);
  color: #0b0b0d;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.contact-form button:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* === Message de confirmation après envoi === */
.contact-confirm {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  max-width: 600px;
  margin: 0 auto;
}

.contact-confirm i {
  font-size: 4rem;
  color: var(--accent-color);
  margin-bottom: var(--space-md);
}

.contact-confirm p {
  font-size: 1.1rem;
  color: var(--text-color);
}

/* === Note d'aide sous le formulaire (fallback mailto) === */
.contact-fallback {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-fallback i { color: var(--accent-color); margin-right: 0.4rem; }

/* === UTILITAIRES === */
.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero { min-height: 30vh; padding: var(--space-md); }
  .grid img { height: 240px; }
  .swiper-slide { height: 240px; }
}

/* =========================================================
   THÈME CLAIR — [data-theme="light"]
   Override les variables CSS définies dans :root.
   Pas besoin de toucher au reste : tout le site s'adapte.
   ========================================================= */
[data-theme="light"] {
  --bg-color: #f5f3ee;          /* fond crème/ivoire */
  --bg-elevated: #ffffff;       /* cartes en blanc */
  --text-color: #1a1a1a;
  --text-muted: #5a5a5a;
  --accent-color: #a8843a;      /* doré plus profond pour contraste */
  --accent-hover: #8a6a26;
  --border-color: #e2dfd7;
}

/* Ajustements spécifiques au thème clair (header plus opaque,
   contact form lisible, etc.) */
[data-theme="light"] header {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] nav .logo,
[data-theme="light"] .desktop-nav a,
[data-theme="light"] .mobile-menu a,
[data-theme="light"] .menu-toggle,
[data-theme="light"] .theme-toggle {
  color: #0b0b0d;
}

[data-theme="light"] .desktop-nav a {
  color: #2a2a2a;
}

[data-theme="light"] .hero {
  /* Sur fond clair on éclaircit le voile pour garder la lisibilité du titre */
  background:
    linear-gradient(rgba(245, 243, 238, 0.35), rgba(245, 243, 238, 0.75)),
    url('../images/hero/dsc01539-resized-651936ceb58a5954021712.webp') center/cover no-repeat;
}

[data-theme="light"] .hero h1 { color: #0b0b0d; }
[data-theme="light"] .hero p { color: #2a2a2a; }

/* Page hero en mode clair (mêmes images mais voile plus leger) */
[data-theme="light"] .page-hero {
  background:
    linear-gradient(rgba(245, 243, 238, 0.35), rgba(245, 243, 238, 0.75)),
    url('../images/hero/dsc02179-65365b13620b8787079560.webp') center 25%/cover no-repeat;
}
[data-theme="light"] .page-hero h1 { color: #0b0b0d; }
[data-theme="light"] .page-hero p { color: #2a2a2a; }

/* === Variantes par page === */
.page-hero--about {
  background:
    linear-gradient(rgba(11,11,13,0.25), rgba(11,11,13,0.55)),
    url('../images/hero/dsc0587-resized-651926002f51e085999236.webp') center/cover no-repeat;
}
[data-theme="light"] .page-hero--about {
  background:
    linear-gradient(rgba(245, 243, 238, 0.35), rgba(245, 243, 238, 0.75)),
    url('../images/hero/dsc0587-resized-651926002f51e085999236.webp') center/cover no-repeat;
}

.page-hero--contact {
  background:
    linear-gradient(rgba(11,11,13,0.25), rgba(11,11,13,0.55)),
    url('../images/hero/dsc03774-68d323cf8c74f615770968.webp') center/cover no-repeat;
}
[data-theme="light"] .page-hero--contact {
  background:
    linear-gradient(rgba(245, 243, 238, 0.35), rgba(245, 243, 238, 0.75)),
    url('../images/hero/dsc03774-68d323cf8c74f615770968.webp') center/cover no-repeat;
}

[data-theme="light"] .contact-form input,
[data-theme="light"] .contact-form textarea {
  color: #1a1a1a;
  background: #ffffff;
}

[data-theme="light"] .contact-form button { color: #ffffff; }

/* Footer en mode clair */
[data-theme="light"] footer {
  background: #f5f3ee;
  border-top-color: #e2dfd7;
}

[data-theme="light"] footer a,
[data-theme="light"] footer p {
  color: #1a1a1a;
}

[data-theme="light"] footer .socials a {
  border-color: #d0cdc4;
}

/* =========================================================
   GALLERY — génération dynamique par js/gallery-data.js
   ========================================================= */
.gallery .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.gallery-item {
  margin: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: var(--space-sm) var(--space-md);
}

.gallery-item figcaption h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-color);
}

.gallery-item figcaption .gallery-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.gallery-item figcaption p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.4;
}

/* =========================================================
   LIGHTBOX — zoom au clic
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox figure {
  margin: 0;
  max-width: min(95vw, 1200px);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  text-align: center;
  color: #ececec;
  max-width: 800px;
}

.lightbox-caption h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.lightbox-caption .gallery-date {
  display: block;
  font-size: 0.85rem;
  color: #9a9a9a;
  margin-bottom: 0.5rem;
}

.lightbox-caption p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
}

.lightbox-prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}
