:root {
  --jaune-pages: #fffbe7;
  --violet: #550066;
  --violet-page: #eee6f0;
  --violet-cartes: #ddcce0;
  --violet-clair: #aa80b3;
  --violet-foncé: #33003d;
  --gris: #444;
}

/* === STRUCTURE GLOBALE === */
body {
  margin: 0;
  background: var(--violet-page);
  font-family: 'Roboto Condensed', sans-serif;
  color: var(--gris);
  font-size: 0.9rem;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

header {
  background: white;
  color: var(--violet);
  padding-bottom: 0.5rem;
}

/* === TITRES === */
h1 {
  padding: 0.5rem;
  font-size: 2.5rem;
  font-family: 'Oswald', sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  margin: 0;
}

h2 {
  padding: 0.5rem 0 0.5rem 1rem;
  font-size: 1.5rem;
  color: var(--violet);
  font-family: 'Oswald', sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  margin: 0.2rem 0;
}

h3 {
  margin: 0;
  padding: 0;
  font-size: 1.3rem;
  font-family: 'Open Sans', sans-serif;
  text-transform: uppercase;
  color: var(--violet-foncé);
  font-weight: 400;
}

/* === MENU === */

/* Wrapper uniquement pour logo + menu */
.header-menu-wrapper {
  display: flex;
  align-items: center;
  /* NE PAS mettre flex: 1 ou width: 100% ici */
  gap: 20px; /* espace entre logo et menu */
  padding-left: 1rem;
  padding-top: 1rem;
  padding-right: 2rem;
}

/* Branding (logo + texte) */
.branding {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #000;
  /* IMPORTANT : ne pas occuper tout l'espace */
  flex-shrink: 0; /* empêche le branding de s'étirer */
}

/* Logo */
.branding img {
  height: 50px;
  margin-right: 10px;
}

/* Texte du logo */
.branding span {
  font-weight: bold;
  font-size: 1.6em;
  font-family: 'Oswald', sans-serif;
  line-height: 1; /* pour que ça ne pousse pas la ligne */
  white-space: nowrap; /* le texte reste sur une seule ligne */
  max-width: 50%;
}

/* Menu (à droite du branding) */
.menusite {
  margin-left: auto;  /* pousse le menu à droite */
  white-space: nowrap; /* empêche le menu de passer à la ligne */
}

.menusite ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.menusite li a {
  text-decoration: none;
  color: #000;
  font-weight: normal;          /* pas en gras */
  text-transform: uppercase;    /* tout en majuscules */
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;            /* plus grand que 1.2rem */
  transition: color 0.3s;
}

.menusite li a:hover {
  color: #555;                  /* couleur au survol */
}

/* === SÉPARATEUR === */
.separateur {
  border: none;
  height: 0.7rem;
  background-color: var(--violet-clair);
  margin: 0;
}

/* === TEXTE MÉTA === */
.texte_meta {
  padding: 0.5rem;
  font-size: 1rem;
  color: var(--violet-foncé);
  font-family: 'Open Sans', sans-serif;
  margin: 0;
}

/* === FILTRES === */
.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 95%;
  padding: 0 0.5rem 0.5rem;
  align-items: stretch;
}

.filters-toggle {
  display: none;
}

.champ-recherche {
  flex: 2 1 300px;  /* grow 2, shrink 1, base 300px */
  min-width: 60px; /* jamais trop petit */
  max-width: 600px;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-style: italic;
  border: 1px solid var(--violet-foncé);
  background: var(--violet-cartes);
  box-sizing: border-box;
  border-radius: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--gris);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}*/

.champ-recherche:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}

.filtres-droite {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.filtres-droite select {
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-style: italic;
  border: 1px solid var(--violet-foncé);
  background: var(--violet-cartes);
  border-radius: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--gris);
  transition: all 0.2s ease;
}

.filtres-droite select,
.filtres-droite button {
  flex: 1 1 120px;   /* prennent la même largeur proportionnelle */
  min-width: 60px;
  max-width: 200px;
}

/* === BOUTON VIOLET AVEC REMPLISSAGE === */
.bouton {
  position: relative;
  height: 2.5rem;
  display: inline-block;
  padding: 0 1.5rem;
  background: var(--violet);
  color: white;
  border: none;
  border-radius: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  min-width: 60px;
}

.bouton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--violet-clair);
  z-index: -1;
  transition: width 0.4s ease;
}

.bouton:hover::after {
  width: 100%;
}

/* === CARTES D'ÉVÉNEMENTS === */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(375px, 0.33fr));
  justify-content: start;
  gap: 20px;
  padding: 1rem;
}

.event {
  background: white;
  border-radius: 10px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s;
  padding: 0;
}

/* === IMAGE DE LA CARTE === */
.event .image-container {
  width: 100%;
  height: 200px;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: var(--violet-cartes);
  position: relative;
}

.event .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* === OVERLAY DE DESCRIPTION === */
.event .description-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 1rem;
  overflow-y: auto;
  font-size: 1rem;
  text-align: justify;
  text-wrap: balance;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.event .image-container:hover .description-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* === TOGGLE ÉVÉNEMENTS PASSÉS === */
.toggle-past {
  margin: 20px auto;
  display: block;
  padding: 10px 15px;
  background: #333;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.toggle-past:hover {
  background: #555;
}

/* === INFOS DANS LA CARTE === */

.info {
  display: flex;
  flex: 1; /* prend tout l’espace vertical disponible */
  flex-direction: column;
  justify-content: space-between; /* pousse la barre tout en bas */
  gap: 1rem;
  padding: 0.5rem;
  background: transparent;
}

.info-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* espace entre le haut et le bas */
  height: 100%; /* occupe toute la hauteur de la cellule */
}

.info h3 {
  margin-bottom: 0;
}

/* === LIEN DU H3 (surlignage violet animé) === */
.info-left a {
  position: relative;
  display: inline-block;
  padding: 0 4px;
  color: var(--violet-foncé);
  text-decoration: none;
  transition: color 0.3s ease;
  z-index: 1;
  width: 90%;
}

.info-left a::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--violet);
  z-index: -1;
  transition: width 0.35s ease;
}

.info-left a:hover::before {
  width: 100%;
}

.info-left h3:hover {
  color: white;
}

/* === MÉTA-DONNÉES (orga, lieu, date) === */
.info p {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.organisateurs::before,
.lieu::before {
  margin-right: 5px;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  vertical-align: middle;
}

.organisateurs {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: grey;
  line-height: 1;
  margin: 0 0 1em;
}

.organisateurs::before { content: "🌟"; }
.lieu::before { content: "📍"; }

.datecomplete {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  line-height: 1;
  margin: 0 0 0.25em;
}

.lieu {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1;
  margin: 0 0 0.4em;
}

/* === ICÔNES DE LA COLONNE DROITE === */

.event-icons {
  position: absolute;
  right: 0.6em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  justify-content: center;
  gap: 0.4em;
  z-index: 20;
}

.event-icons a {
  color: var(--violet);
  font-size: 1.5em; /* ↑ augmente la taille des icônes */
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.event-icons a:hover {
  color: var(--violet-clair);
  transform: scale(1.5);
}

/* === BARRE DE PARTAGE === */
.share-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  overflow: visible;
  position: relative;
  -webkit-overflow-scrolling: touch;
  margin-top: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(25px, 8vw, 35px);
  height: clamp(25px, 8vw, 35px);
  color: var(--violet);
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 1.3em;
}

.share-btn:hover {
  color: #b37ac5; /* violet clair — adapte la teinte selon ton thème */
  transform: scale(1.5);
  background: none; /* explicitement aucun fond */
  border: none;
  box-shadow: none;
}

.share-btn svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.share-btn a {
  color: var(--violet);
  font-size: 1.3em;
  background: none;
  border: none;
  box-shadow: none;
}

.share-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 9999;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--violet-page);
  color: black;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.5rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.share-btn:hover::after,
.share-btn:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

* {
  box-sizing: border-box;
}

/* === MEDIA QUERIES === */

/* ÉCRANS MOYENS ET TABLETTES (≥768px et ≤900px) */
@media (min-width: 768px) and (max-width: 950px) {
	
	.cards-container {
		grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	}
	  
	.filtres {
	  flex-wrap: nowrap;
	  gap: 0.5rem;
	  align-items: center;
	  justify-content: space-between;
	}

	.champ-recherche {
	  flex: 2 1 0;        /* grow:2 pour prendre plus d'espace, shrink:1, basis:0 pour que flexbox calcule la largeur */
	  min-width: 120px;   /* jamais trop petit */
	  height: 2.5rem;
	}

	.filtres-droite select,
	.filtres-droite button {
	  flex: 1 1 0;        /* grow:1, shrink:1, basis:0, prennent proportionnellement moins que le champ recherche */
	  min-width: 100px;
	  height: 2.5rem;
	}

	.filtres-droite {
	  display: flex;
	  gap: 0.5rem;
	  flex-wrap: nowrap;
	  justify-content: flex-end;
	}
}

/* -----------------------------
   GRAND MOBILE / PETIT TABLETTE (≤768px)
   ----------------------------- */
@media (max-width: 768px) {

  /* Conteneur de cartes responsive */
  .cards-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  /* Icônes et boutons */
  .event-icons a {
    width: 2.1rem;
    height: 2.1rem;
  }

  .share-btn { 
    width: clamp(28px, 8vw, 36px);
    height: clamp(28px, 8vw, 36px);
  }

  /* Loupe pour activer les filtres (toujours visible) */
  .filters-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1rem;
    background: var(--violet);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100; /* au-dessus des filtres */
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
  }

  .filters-toggle:hover {
    transform: scale(1.1);
  }

  /* Filtres masqués par défaut */
  .filtres {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1rem;
    background: var(--violet-page);
    z-index: 1000; /* sous la loupe */
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    max-height: 100vh;
    overflow-y: auto;
  }

  /* Filtres visibles après clic */
  .filtres.active {
    display: flex !important;
  }

  /* Champ de recherche et filtres alignés, largeur complète */
  .champ-recherche,
  .filtres input,
  .filtres select,
  .filtres button {
    width: 100%;
    flex: none;
    box-sizing: border-box;
    height: 2.5rem;
    font-size: 1rem;
    padding: 0 0.5rem;
	max-width: none !important; /* enlever la limitation de 200px */
  }

  /* Tous les filtres en colonne */
  .filtres,
  .filtres-droite {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
	width: 100% !important;
  }

}

/* -----------------------------
   ÉCRANS TRÈS PETITS (≤600px)
   ----------------------------- */
@media (max-width: 600px) {

  .cards-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  /* Filtres masqués par défaut */
  .filtres {
    display: none !important;
  }

  .filtres.active {
    display: flex !important;
  }

  /* Champ de recherche et filtres alignés, largeur complète */
  .champ-recherche,
  .filtres input,
  .filtres select,
  .filtres button {
    width: 100%;
    flex: none;
    box-sizing: border-box;
    height: 2.5rem;
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  /* Tous les filtres en colonne */
  .filtres,
  .filtres-droite {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
	width: 100% !important;
  }
  
    /* Header menu responsive */
  .header-menu-wrapper {
    flex-direction: column;       /* logo au dessus du menu */
    align-items: flex-start;      /* alignement à gauche */
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0.5rem;                  /* espace réduit entre logo et menu */
  }

  .branding span {
    font-size: 1.2em;             /* réduit le texte sur mobile */
    max-width: 100%;
    white-space: normal;           /* permet de passer à la ligne si besoin */
    word-break: break-word;
  }

  /* Menu vertical */
  .menusite {
    display: none !important;
  }

  .menusite ul {
    flex-direction: column;       /* menu en colonne */
    gap: 0.75rem;                 /* espacement entre les liens */
  }

  .menusite li a {
    font-size: 1.3rem;            /* un peu plus grand pour lisibilité */
  }
}

/* -----------------------------
   MOBILE / PETIT TABLETTE (≤768px)
   ----------------------------- */
@media (max-width: 768px) {

  /* Header menu responsive */
  .header-menu-wrapper {
    flex-direction: column;       /* logo au dessus du menu */
    align-items: flex-start;      /* alignement à gauche */
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0.5rem;                  /* espace réduit entre logo et menu */
  }

  .branding span {
    font-size: 1.2em;             /* réduit le texte sur mobile */
    max-width: 100%;
    white-space: normal;           /* permet de passer à la ligne si besoin */
    word-break: break-word;
  }

  /* Menu vertical */
  .menusite {
    display: none !important;
  }

  .menusite ul {
    flex-direction: column;       /* menu en colonne */
    gap: 0.75rem;                 /* espacement entre les liens */
  }

  .menusite li a {
    font-size: 1.3rem;            /* un peu plus grand pour lisibilité */
  }
}


/* -----------------------------
   ÉCRANS TRÈS PETITS (≤480px)
   ----------------------------- */
@media (max-width: 480px) {
  .branding span {
    font-size: 1em;               /* encore plus petit */
  }

  .menusite li a {
    font-size: 1.2rem;            /* ajuste la taille pour petit écran */
  }
}
