/* ============================= */
/* 🌙 Variables de thème         */
/* ============================= */

:root {
  --bg: #ffffff;
  --text: #000000;
  --card-bg: #f0f0f0;
}

.dark {
  --bg: #121212;
  --text: #ffffff;
  --card-bg: #1e1e1e;
}
/* ============================= */
/* 🧱 Base globale               */
/* ============================= */

body {
  margin: 0;
  padding: 20px;
  font-family: Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: all 0.3s ease;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

/* ============================= */
/* 🎛️ Thème switch button       */
/* ============================= */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 4rem;
  flex-grow: 1;
  text-align: center;
}

.theme-toggle-fixed {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 5%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
}

.theme-toggle-fixed:hover {
  background-color: var(--card-bg);
  opacity: 0.85;
}

/* ============================= */
/* 🧱 Disposition horizontale    */
/* ============================= */

.content-wrapper {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

/* ============================= */
/* 📂 Menu latéral               */
/* ============================= */
.sidebar {
  position: fixed;
  top: 240px; /* adapte si t’as un header */
  left: 0;
  width: 220px;
  padding-left: 1rem;
  z-index: 999;
}
.menu {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-left: 20px;
  margin-bottom: 30px;
}

.menu button {
  padding: 6px 12px;
  background-color: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 1rem;
}

.menu button:hover {
  background-color: var(--card-bg);
  opacity: 0.8;
}

.menu .active {
  font-weight: bold;
  text-decoration: underline;
}

/* ============================= */
/* 🖼️ Galerie                    */
/* ============================= */

.gallery {
  margin-left: 240px; /* ou plus, pour éviter tout chevauchement */
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding-right: 20px;
}

.image-wrapper {
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: 8px;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

.image-wrapper img:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ============================= */
/* 🔍 Lightbox                  */
/* ============================= */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}
#toTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  font-size: 1.5rem;
  background-color: #0a0834;
  color: rgb(187, 128, 128);
  border: none;
  border-radius: 5%;
  padding: 0.16rem 3.1rem;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#toTopBtn.show {
  opacity: 1;
  visibility: visible;
}
/* ============================= */
/* 📱 Responsive                */
/* ============================= */

@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column;
  }

  .menu {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-left: 0;
  }

  .gallery {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .theme-toggle-fixed {
    font-size: 1rem;
    padding: 6px 8px;
  }

  .close-btn {
    font-size: 1.6rem;
    top: 10px;
    right: 15px;
  }
}

@media screen and (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    top: auto;
    padding-left: 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

  .gallery {
    margin-left: 0;
  }
}