/* === Variables CSS === */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --accent: #0284c7;
  --btn-rgb: 2, 132, 199; /* pour boutons Lightbox semi-transparents */
}

/* === Reset et base === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  
}

/* === Header / Navigation === */
header {
  max-width: 1100px;
  margin: auto;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}

nav a:hover {
  color: var(--accent);
}

/* === Hero / Section principale === */
.hero {
  max-width: 900px;
  margin: auto;
  padding: 3rem 2rem;
}

/* === Grille / Cards === */
.grid {
  max-width: 1100px;
  margin: auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card div {
  padding: 1rem;
}

/* Hover automatique pour cards */
.card:hover {
  filter: brightness(1.1); /* léger éclaircissement automatique */
}

/* === Galerie mosaïque === */
.gallery {
  max-width: 1100px;
  margin: auto;
  padding: 2rem;
  column-count: 3;
  column-gap: 1rem;
}

.gallery img {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  border-radius: 12px;
  display: block;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(var(--bg-rgb, 15,15,26), 0.7); /* fond adaptatif à la palette */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: background 0.5s;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
  background: var(--card); /* fond image = couleur card */
  transition: background 0.5s;
}

/* === Boutons Lightbox (modernes et dynamiques) === */
.lightbox button {
  position: absolute;
  background: rgba(var(--btn-rgb), 0.2);
  border: none;
  font-size: 2rem;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-radius: 50%;
  color: #fff;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.lightbox button:hover {
  background: rgba(var(--btn-rgb), 0.4);
  transform: scale(1.1);
}

/* Fermeture */
.lightbox .close {
  top: 20px;
  right: 20px;
  font-size: 2.2rem;
}

/* Boutons latéraux */
.lightbox .prev,
.lightbox .next {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 1.8rem;
}

.lightbox .prev { left: 20px; }
.lightbox .next { right: 20px; }

/* === Animations === */
@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Paragraphes */
p {
  line-height: 1.8;
  margin-bottom: 1em;
}
