/* Variables globales */
:root {
  --main-font: Arial, sans-serif;
  --font-color: #000;
  --accent-color: #00f;
  --base-font-size: 16px;
  --line-height: 1.4;
  --caption-width: 60%; /* largeur par défaut */
  --gap-main: 50px;
}

/* Reset de base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Typographie globale */
body, h1, h2, p {
  font-family: var(--main-font);
  font-weight: normal;
  font-size: var(--base-font-size);
  color: var(--font-color);
  line-height: var(--line-height);
}

body {
  background: #fff;
  padding: 20px;
}

/* En-tête */
header {
  text-align: center;
  margin-bottom: 20px;
}

/* Menu de filtres */
.filter-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  list-style: none;
}

.filter-menu li,
#menu-toggle {
  cursor: pointer;
  padding: 8px 15px;
  background: none;
  border: none;
  color: var(--font-color);
  font-weight: normal;
  font-size: 1rem;
  transition: color 0.3s;
}

.filter-menu li:hover,
.filter-menu li.active,
#menu-toggle:hover,
#menu-toggle.active {
  color: var(--accent-color);
}

#menu-toggle {
  display: none;
}

/* Galerie et images dans le texte */
.gallery,
#text-section {
  display: grid;
  gap: var(--gap-main);
  justify-items: center;
}

.gallery-item,
.text-image {
  text-align: center;
}

.gallery-item img,
.text-image img,
.caption,
.text-image .caption {
  width: var(--caption-width);
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.caption,
.text-image .caption {
  padding-top: 10px;
  font-size: 0.9rem;
  text-align: center;
  word-wrap: break-word;
}

/* Section texte */
#text-section {
  max-width: 700px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1205px) {
  :root {
    --caption-width: 80%;
  }

  .caption,
  .text-image .caption {
    font-size: 0.85rem;
    padding: 5px;
  }

  .filter-menu {
    display: none;
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .filter-menu.active {
    display: flex;
  }

  #text-section {
    padding: 10px;
    font-size: 1rem;
  }

  #menu-toggle {
    display: inline-block;
  }
}

@media (max-width: 540px) {
  :root {
    --caption-width: 100%;
  }

  .filter-menu {
    align-items: center;
  }

  .caption,
  .text-image .caption {
    font-size: 0.8rem;
  }
}
