/* Reset, .btn, .card commun, échelle de rayons/ombres : voir base.css.
   Cette page garde ses propres noms sémantiques (--main, --card, --text…)
   utilisés partout ci-dessous, mappés sur les variables de marque. */
:root {
  --main: var(--brand-primary, #898B77);
  --main-light: var(--brand-secondary, #a3a58f);
  --main-dark: var(--brand-accent, #6f715c);

  --bg-soft: #f5f5f2;
  --card: #ffffff;

  --text: var(--brand-text, #2c2a26);
  --muted: #6e6b5e;

  --accent: var(--brand-accent, #d4a5b5);
  --border: #e6e3dc;

  --shadow: var(--shadow-md);
  --shadow-hover: var(--shadow-lg);

  --overlay: rgba(20,18,15,0.75);
}

body {
  /* 🎯 ton branding */
  background: linear-gradient(180deg, var(--main) 0%, var(--main-light) 100%);
  color: var(--text);
}

/* HEADER */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;

  background: color-mix(in srgb, var(--main) 85%, transparent);
  backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 22px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.topnav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.topnav a:hover,
.topnav a.active {
  opacity: 1;
  color: var(--accent);
}

/* HERO */
.gallery-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  width: 100%;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  color: white;

  text-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.hero p {
  color: rgba(255,255,255,0.85);
}

/* GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* CARDS */
.gallery-card {
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-xl);
  overflow: hidden;

  box-shadow: var(--shadow);

  cursor: pointer;
  transition: all 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.gallery-card__image-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.gallery-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-card__image {
  transform: scale(1.05);
}

.gallery-card__body {
  padding: 16px;
}

.gallery-card__title {
  margin: 0 0 6px;
  font-weight: 800;
}

.gallery-card__hint {
  color: var(--muted);
  font-size: 0.9rem;
}

/* MODAL */
.photo-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.photo-modal.is-open {
  display: block;
}

.photo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.photo-modal__content {
  position: relative;
  z-index: 2;

  max-width: 1000px;
  width: calc(100% - 20px);
  margin: 30px auto;
  max-height: calc(100dvh - 60px);

  background: white;
  border-radius: var(--radius-2xl);
  overflow: hidden;

  display: grid;
  grid-template-columns: 1fr 1fr;

  box-shadow: 0 30px 70px rgba(0,0,0,0.35);

  animation: fadeIn 0.25s ease;
}

.photo-modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-modal__image-wrap {
  min-height: 320px;
}

.photo-modal__text {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.photo-modal__text h2 {
  margin-bottom: 10px;
}

.photo-modal__text p {
  color: #555;
  line-height: 1.6;
}

.photo-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 45px;
  height: 45px;

  border: none;
  border-radius: 50%;

  background: white;
  font-size: 20px;

  cursor: pointer;
}

/* ANIMATION */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* MOBILE */
@media (max-width: 800px) {
  .photo-modal__content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .topbar__inner {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .brand {
    font-size: 1.05rem;
  }
  
  .topnav {
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .topnav a {
    font-size: 0.95rem;
    flex: 1 1 140px;
  }
  
  .gallery-page {
    padding: 24px 14px 34px;
  }
  
  .hero {
    margin-bottom: 22px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
  }
  
  .hero p {
    font-size: 0.96rem;
    line-height: 1.5;
    padding: 0 6px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .gallery-card {
    border-radius: var(--radius-lg);
  }
  
  .gallery-card__body {
    padding: 14px;
  }
  
  .gallery-card__title {
    font-size: 1rem;
  }
  
  .gallery-card__hint {
    font-size: 0.9rem;
  }
  
  .photo-modal__content {
    grid-template-columns: 1fr;
    width: calc(100% - 16px);
    margin: 8px auto;
    border-radius: var(--radius-xl);
    max-height: calc(100dvh - 16px);
    overflow: auto;
  }
  
  .photo-modal__image-wrap {
    min-height: 240px;
  }
  
  .photo-modal__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .photo-modal__text {
    padding: 20px 16px 22px;
  }
  
  .photo-modal__text h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
  }
  
  .photo-modal__text p {
    font-size: 0.96rem;
    line-height: 1.6;
  }
  
  .photo-modal__close {
    width: 40px;
    height: 40px;
    top: 10px;
    right: 10px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .topbar__inner {
    padding: 12px;
  }

  .topnav a {
    flex-basis: calc(50% - 8px);
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .photo-modal__image-wrap {
    min-height: 220px;
  }
}
