/* ===========================================
   FOOTER - STRUCTURE PRINCIPALE
   =========================================== */

.site-footer {
  background-color: var(--color-gentologie-green) !important;
  padding: var(--spacing-lg) 0;
}

.footer-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10%; /* 10% à gauche et à droite */
}

/* ===========================================
   FOOTER - RANGÉE PRINCIPALE (MARQUE + MENUS)
   =========================================== */

.footer-main-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr; /* marque à gauche, menus à droite */
  column-gap: 3rem;
  align-items: start;
  margin-bottom: var(--spacing-md);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.footer-logo {
  flex: 0 0 auto;
}

.footer-logo img {
  max-width: 100%;
  height: auto;
}

/* Les 2 boutons sous le logo */
.footer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.footer-btn {
  display: inline-block;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--color-gentologie-background);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Bouton plein */
.footer-btn-primary {
  background-color: var(--color-gentologie-background);
  color: var(--color-gentologie-green);
}

.footer-btn-primary:hover,
.footer-btn-primary:focus {
  background-color: transparent;
  color: var(--color-gentologie-background);
}

/* Bouton contour */
.footer-btn-secondary {
  background-color: transparent;
  color: var(--color-gentologie-background);
}

.footer-btn-secondary:hover,
.footer-btn-secondary:focus {
  background-color: var(--color-gentologie-background);
  color: var(--color-gentologie-green);
}

.scroll-to-top {
  font-family: var(--font-family-primary);
  color: var(--color-gentologie-text-alt);
  background-color: transparent;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  padding: 0;
  text-decoration: none;
}

.scroll-to-top:hover {
  color: var(--color-gentologie-background);
  transform: translateY(-2px);
}

.scroll-to-top:focus {
  outline: 1px solid var(--color-gentologie-text-alt);
  outline-offset: 2px;
}

.newsletter-footer-form-column h2 {
    color: var(--color-gentologie-title);
}

.newsletter-footer-subtitle {
    color: var(--color-gentologie-text-alt);
    text-align: center;
}

/* ===========================================
   FOOTER - COLONNES DE MENU (5 colonnes)
   =========================================== */

.footer-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 2rem;
  row-gap: 1.5rem;
  align-items: start;
}

.footer-menu-column {
  min-width: 0;
  margin-bottom: var(--spacing-md);
  text-align: left;
}

/* Titre de colonne : texte seulement, aucun lien */
.footer-category-title {
  margin: 0 0 var(--spacing-xs) 0;
  font-family: var(--font-family-tertiary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium) !important;
  line-height: var(--line-height-normal);
  color: var(--color-gentologie-background);
  text-transform: uppercase;
  white-space: nowrap; /* titre sur une seule ligne */
}

/* Override spécifique pour le footer */
.site-footer .footer-category-title,
.site-footer .footer-menu-column h4 {
  margin: 0 0 var(--spacing-xs) 0 !important;
  line-height: var(--line-height-normal) !important;
  color: var(--color-gentologie-background) !important;
}

.footer-subcategories {
  margin: 0;
  padding-left: 0;
  list-style: none;
  text-align: left;
  font-size: var(--font-size-xs);
}

.footer-subcategories li a {
  font-family: var(--font-family-tertiary);
  color: var(--color-gentologie-text-alt);
  text-decoration: none;
  font-size: var(--font-size-base);
  display: block;
  padding: var(--spacing-xs) 0;
  text-align: left;
  font-weight: 100;
}

.footer-subcategories li a:hover,
.footer-subcategories li a:focus {
  color: var(--color-gentologie-background);
  text-decoration:underline;
}

/* ===========================================
   FOOTER - RANGÉE INFÉRIEURE
   =========================================== */

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md); /* espace réduit */
  border-top: 1px solid var(--color-gentologie-border);
  padding-top: var(--spacing-md);
}

/* Menu légal à gauche */
.footer-legal-affiliation {
  display: flex;
  flex-direction: column;
}

.footer-legal-menu a {
  margin-right: var(--spacing-md);
  color: var(--color-gentologie-text-alt);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.footer-legal-menu a:hover,
.footer-legal-menu a:focus {
  text-decoration: underline;
}

/* Réseaux sociaux au-dessus du copyright */
.footer-bottom-right {
  display: flex;
  flex-direction: column; /* empile verticalement */
  align-items: flex-end;  /* aligne à droite */
  gap: 0.5rem; /* espace entre social et copyright */
}

.footer-social a {
  margin-left: var(--spacing-sm);
  display: inline-block;
  text-align: right;
}

.footer-social img {
  width: 20px;
  height: 20px;
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: var(--color-gentologie-text-alt);
  text-align: right;
}

.footer-copyright a {
  color: var(--color-gentologie-text-alt);
  text-decoration: none;
}

.footer-copyright a:hover,
.footer-copyright a:focus {
  text-decoration: underline;
}

.footer-affiliation-note p {
  color: var(--color-gentologie-text-alt);
  font-size: var(--font-size-xs);
  margin: 0.5rem 0 0 0;
}

/* ===========================================
   FAIT AU CANADA - BOUTON DE SOUMISSION
   =========================================== */

.footer-fait-au-canada {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
  font-size: var(--font-size-sm);
  color: var(--color-gentologie-text-alt);
}
.footer-fait-au-canada img {
  width: 20px;
  height: auto;
  flex-shrink: 0;
}

/* ===========================================
   NEWSLETTER FOOTER - STRUCTURE
   =========================================== */

.footer-newsletter {
  width: 100vw;
  position: relative;
  overflow: hidden;
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--color-gentologie-green)
}

.footer-newsletter-inner {
  display: flex;
  justify-content: center;   /* centre le contenu horizontalement */
  flex-wrap: nowrap;         /* empêche l'empilement sur desktop */
  width: 100%;
  max-width: 1200px;         /* largeur max souhaitée */
  margin: 0 auto;
  padding: 0 20px;
}

/* ===========================================
   NEWSLETTER - COLONNE FORMULAIRE
   =========================================== */

.newsletter-footer-form-column {
  flex: 1 1 100%;
  max-width: 100%;           /* pas de limite */
}

.newsletter-footer-form-column h2 {
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-3xl);
  color: var(--color-gentologie-text-alt);
  text-align: center;
}

.newsletter-subtitle {
  margin-bottom: var(--spacing-medium);
  color: var(--color-gentologie-text-alt);
  font-weight: var(--font-weight-normal);
  text-align: center;
}

.newsletter-footer-form-column form label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gentologie-green);
}

.newsletter-footer-form-column form input,
.newsletter-footer-form-column form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
  background: var(--color-gentologie-background);
  color: var(--color-gentologie-green);
  border: 1px solid var(--color-gentologie-border);
  padding: var(--spacing-md);
  font-size: var(--font-size-lg);
  width: 100%;
  margin-bottom: var(--spacing-md);
  box-sizing: border-box;
  height: 3.75rem;
  line-height: var(--line-height-normal);
}

.newsletter-footer-form-column form input[type="checkbox"] {
  width: auto;
  height: auto;
  display: inline;
  margin: 0;
  padding: 0;
}

.newsletter-footer-form-column form select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg viewBox='0 0 10 6' fill='%23004d28' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6H0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  background-size: var(--spacing-md);
  padding-right: 2.5rem;
  cursor: pointer;
}

.newsletter-footer-form-column form input::placeholder {
  color: rgba(0, 77, 40, 0.7);
}


/* ===========================================
   NEWSLETTER - GROUPE D'INTÉRÊTS (Nos infolettres)
   =========================================== */

.mc-interest-group fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.mc-interest-group legend {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gentologie-text-alt);
  font-size: var(--font-size-md);
  padding: 0;
}

.newsletter-interest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--spacing-md);
  row-gap: var(--spacing-sm);
}

.newsletter-interest-list li {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.newsletter-interest-list input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  width: 1.2rem;
  height: 1.2rem;
  min-width: 1.2rem;
  min-height: 1.2rem;
  margin: 0;
  border: 2px solid var(--color-gentologie-text-alt);
  background-color: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
}

.newsletter-interest-list input[type="checkbox"]:checked {
  background-color: var(--color-gentologie-background);
  border-color: var(--color-gentologie-background);
}

.newsletter-interest-list input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.08rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid var(--color-gentologie-green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.newsletter-interest-list input[type="checkbox"]:focus {
  outline: 1px solid var(--color-gentologie-background);
  outline-offset: 2px;
}

.newsletter-interest-list label {
  margin: 0 !important;
  font-weight: var(--font-weight-normal) !important;
  font-size: var(--font-size-sm);
  color: var(--color-gentologie-text-alt);
  cursor: pointer;
  line-height: var(--line-height-normal);
}

@media (max-width: 480px) {
  .newsletter-interest-list {
    grid-template-columns: 1fr;
  }
}

/* ===========================================
   NEWSLETTER - CONFIDENTIALITÉ ET GDPR
   =========================================== */

.newsletter-privacy {
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
}

.newsletter-privacy input[type="checkbox"] {
  margin-right: var(--spacing-sm);
  width: 1.2rem;
  height: 1.2rem;
}

.newsletter-privacy label {
  font-size: var(--font-size-sm);
  color: var(--color-gentologie-background-alt);
}

.newsletter-gdpr {
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
}

.newsletter-gdpr-label {
  display: flex !important;
  align-items: flex-start;
  gap: var(--spacing-small);
  line-height: var(--line-height-normal);
  cursor: pointer;
  font-weight: var(--font-weight-normal) !important;
}

.newsletter-gdpr-label input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
}

.newsletter-gdpr-label span {
  flex: 1;
  font-size: var(--font-size-sm);
  margin-top: 0.1rem;
}

.newsletter-gdpr-label,
.newsletter-gdpr-label span,
.newsletter-gdpr-label a {
  color: var(--color-gentologie-text-alt) !important;
}

.newsletter-gdpr-label a {
  text-decoration: underline;
}

.newsletter-gdpr-label a:hover {
  text-decoration: none;
}

/* ===========================================
   NEWSLETTER - BOUTON DE SOUMISSION
   =========================================== */

.newsletter-form-column form button {
  background-color: transparent;
  color: var(--color-gentologie-green);
  border: 2px solid var(--color-gentologie-border-alt);
  font-family: var(--font-family-primary);
  padding: var(--spacing-md) var(--spacing-medium);
  cursor: pointer;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  width: 100%;
  display: block;
  margin-top: var(--spacing-sm);
}

.newsletter-form-column form button:hover,
.newsletter-form-column form button:focus {
  background-color: var(--color-gentologie-background-button-alt);
  color: var(--color-gentologie-text-button-alt);
}



/* ===========================================
   RESPONSIVE - DESKTOP (+ que 1025px) - Newsletter
   =========================================== */

@media (min-width: 1025px) {

  /* Conteneur du formulaire - reset complet */
  .newsletter-footer-form-column {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
  }

  /* Formulaire en grille - reset complet */
  .newsletter-footer-form-column form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
    row-gap: 1.5rem;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  /* Réinitialiser les marges des mc-field-group */
  .newsletter-footer-form-column .mc-field-group {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Labels sans marge */
  .newsletter-footer-form-column form label {
    margin: 0 0 var(--spacing-xs) 0 !important;
    padding: 0 !important;
    display: block;
    width: 100%;
  }

  /* Forcer chaque input/select à avoir la bonne hauteur */
  .newsletter-footer-form-column form input[type="email"],
  .newsletter-footer-form-column form input[type="text"],
  .newsletter-footer-form-column form select {
    width: 100% !important;
    height: 3.75rem;
    margin: 0 !important;
    padding: var(--spacing-md) !important;
    box-sizing: border-box !important;
  }

  /* Email : 1ère ligne, 2 colonnes */
  .newsletter-footer-form-column form .mc-field-group:nth-child(1) {
    grid-column: 1 / 3;
  }

  /* Genre : 2e ligne, colonne gauche */
  .newsletter-footer-form-column form .mc-field-group:nth-child(2) {
    grid-column: 1 / 2;
  }

  /* Prénom : 2e ligne, colonne droite */
  .newsletter-footer-form-column form .mc-field-group:nth-child(3) {
    grid-column: 2 / 3;
  }

  /* Nom : 3e ligne, colonne gauche */
  .newsletter-footer-form-column form .mc-field-group:nth-child(4) {
    grid-column: 1 / 2;
  }

  /* Langue : 3e ligne, colonne droite */
  .newsletter-footer-form-column form .mc-field-group:nth-child(5) {
    grid-column: 2 / 3;
  }

  /* RGPD : 4e ligne, 2 colonnes */
  .newsletter-footer-form-column form .newsletter-gdpr {
    grid-column: 1 / 3;
    margin-bottom: 0;
  }

  /* Éléments cachés ne doivent pas occuper d'espace */
  .newsletter-footer-form-column form div[hidden],
  .newsletter-footer-form-column form div[aria-hidden="true"] {
    grid-column: 1 / 3;
    height: 0;
    overflow: hidden;
  }

  /* Conteneur messages */
  .newsletter-footer-form-column form #mce-responses {
    grid-column: 1 / 3;
  }

  /* Bouton : dernière ligne, 2 colonnes */
  .newsletter-footer-form-column form .clear {
    grid-column: 1 / 3;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  .newsletter-footer-form-column form input[type="submit"],
  .newsletter-footer-form-column form .button {
    width: 100% !important;
    height: auto;
    padding: 1.25rem !important;
    font-size: 1.25rem;
    margin: 0 !important;
    box-sizing: border-box;
    display: block;
  }
}

/* ===========================================
   RESPONSIVE - TABLETTE (jusqu'à 1024px)
   =========================================== */

@media (max-width: 1024px) {
  .footer-newsletter-inner {
    flex-direction: column; /* ok pour empiler */
    text-align: center;
    gap: var(--spacing-lg);
  }

  /* Cacher la colonne image */
  .newsletter-image-column {
    display: none;
  }

  /* Formulaire prend toute la largeur */
  .newsletter-footer-form-column {
    max-width: 100%;
    flex: 1 1 100%;
    margin: 0 auto;
  }
}

/* ===========================================
   RESPONSIVE - TABLETTE FOOTER (769px - 1024px)
   =========================================== */

@media (min-width: 769px) and (max-width: 1024px) {
  /* ICÔNES SOCIALES CENTRÉES EN TABLETTE */
  .footer-bottom-row {
    justify-content: center;
    gap: var(--spacing-lg);
  }
  
  .footer-bottom-right {
    align-items: center;
  }
  
  .footer-social {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
  }
  
  .footer-social a {
    margin: 0;
  }
  
  .footer-copyright {
    text-align: center;
  }
}

/* ===========================================
   RESPONSIVE - FOOTER MENUS (jusqu'à 1024px)
   =========================================== */

@media (max-width: 1024px) {
  .footer-main-row {
    grid-template-columns: 1fr; /* marque au-dessus des menus */
    row-gap: var(--spacing-lg);
  }

  .footer-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ===========================================
   RESPONSIVE - MOBILE (jusqu'à 768px)
   =========================================== */

@media (max-width: 768px) {
  .footer-inner {
    padding: 0 var(--spacing-md) !important;
  }

  /* === MARQUE + MENU EN 2 COLONNES MOBILE === */
  .footer-brand {
    align-items: center;
    text-align: center;
  }

  .footer-buttons {
    justify-content: center;
  }

  .footer-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--spacing-sm);
  }
  /* === FIN MENU 2 COLONNES === */

  /* === FOOTER BOTTOM CENTRÉ MOBILE === */
  .footer-bottom-row {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
    align-items: center;
  }
  
  /* Colonne légale centrée */
  .footer-legal-affiliation {
    align-items: center;
    width: 100%;
  }
  
  .footer-legal-menu {
    text-align: center;
    width: 100%;
  }

  .footer-legal-menu a {
    margin: 0 var(--spacing-sm);
    display: inline-block;
  }
  
  /* Colonne droite (icônes + copyright) CENTRÉE */
  .footer-bottom-right {
    align-items: center;
    width: 100%;
  }
  
  /* Icônes sociales CENTRÉES */
  .footer-social {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
  }
  
  .footer-social a {
    margin: 0;
  }
  
  /* Copyright centré */
  .footer-copyright {
    text-align: center;
    width: 100%;
  }
  /* === FIN FOOTER BOTTOM CENTRÉ === */
}

/* ===========================================
   RESPONSIVE - TRÈS PETITS ÉCRANS (480px)
   =========================================== */

@media (max-width: 480px) {
  .footer-inner {
    padding: 0 var(--spacing-sm);
  }

  .footer-menu-grid {
    column-gap: var(--spacing-sm);
  }

  .footer-newsletter {
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  /* === ICÔNES SOCIALES CENTRÉES PETIT ÉCRAN === */
  .footer-bottom-row {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
    align-items: center;
  }
  
  .footer-bottom-right {
    align-items: center;
    width: 100%;
  }
  
  .footer-social {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
  }
  
  .footer-social a {
    margin: 0;
  }
  
  .footer-copyright {
    text-align: center;
    width: 100%;
  }
  
  .footer-legal-affiliation {
    align-items: center;
    width: 100%;
  }
  
  .footer-legal-menu {
    text-align: center;
    width: 100%;
  }
  
  .footer-legal-menu a {
    margin: 0 var(--spacing-xs);
    display: inline-block;
    font-size: var(--font-size-xs);
  }
  /* === FIN ICÔNES CENTRÉES PETIT ÉCRAN === */
}

/* ===========================================
   AJUSTEMENT BARRE ADMIN WORDPRESS
   =========================================== */

/* Mobile/Tablette uniquement - Barre admin WordPress */
@media screen and (max-width: 1199px) {
  /* Barre admin sur écrans larges mobiles (>782px) */
  .admin-bar .mobile-top-bar {
    top: 32px;
  }
  
  .admin-bar .mobile-menu {
    top: calc(32px + 75px); /* Barre admin + hauteur mobile-top-bar */
  }
  
  /* Barre admin sur petits écrans mobiles (≤782px) */
  @media screen and (max-width: 782px) {
    .admin-bar .mobile-top-bar {
      top: 46px;
    }
    
    .admin-bar .mobile-menu {
      top: calc(46px + 75px); /* Barre admin + hauteur mobile-top-bar */
      height: calc(100vh - 46px - 75px);
    }
  }
}