/* ============================================================
   FOOTER RESPONSIVE & THEME - CASTAGNE
   ============================================================ */

/* === VARIABLES ET BASE === */
.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2.5rem;
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Transitions fluides pour tous les éléments */
#dynamic-footer * { 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

/* === DESKTOP (1240px+) === */
@media (min-width: 1240px) {
  /* Première rangée - 4 blocs horizontaux avec hauteurs égalisées */
  .footer-row-1 {
    display: flex;
    gap: 1.25rem;
    width: 100%;
    align-items: stretch;
  }
  
  .footer-logo-block {
    width: 198px;
    flex-shrink: 0;
  }
  
  .footer-logo-block #logo-block {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .footer-quicklinks-block {
    width: 222px;
    flex-shrink: 0;
    height: 200px;
  }
  
  .footer-location-block {
    width: 391px;
    flex-shrink: 0;
    height: 200px;
  }
  
  .footer-opensource-legal-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 200px;
  }
  
  .footer-opensource-legal-block #opensource-block {
    flex: 1;
  }
  
  .footer-opensource-legal-block #legal-block {
    flex: 1;
  }
  
  /* Deuxième rangée - Contact + Actions */
  .footer-row-2 {
    display: flex;
    gap: 1.25rem;
    width: 100%;
  }
  
  /* Masquer les actions mobile sur desktop */
  #actions-mobile-block {
    display: none !important;
  }
  
  /* Logo en bas */
  .footer-logo-bottom {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

/* === TABLETTE (768px - 1239px) === */
@media (max-width: 1239px) and (min-width: 768px) {
  .footer-container {
    padding: 0 2rem;
  }
  
  /* Première rangée - Grille 2x2 adaptée */
  .footer-row-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
  }
  
  .footer-logo-block {
    grid-column: 1;
    grid-row: 1;
    height: 200px;
  }
  
  .footer-logo-block #logo-block {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .footer-quicklinks-block {
    grid-column: 2;
    grid-row: 1;
    height: 200px;
  }
  
  .footer-opensource-legal-block {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  
  .footer-location-block {
    grid-column: 2;
    grid-row: 2;
  }
  
  /* Deuxième rangée - Contact simple sur tablette */
  .footer-row-2 {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
  }
  
  /* Style des boutons CTA sur tablette */
  #actions-block {
    display: flex;
    justify-content: center;
  }
  
  /* Masquer les actions mobile sur tablette */
  #actions-mobile-block {
    display: none !important;
  }
  
  .footer-logo-bottom {
    width: 100%;
  }
}

/* === MOBILE (767px-) === */
@media (max-width: 767px) {
  .footer-container {
    padding: 0 1rem;
  }
  
  /* Première rangée - Structure verticale complète */
  .footer-row-1 {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
  }
  
  .footer-logo-block,
  .footer-quicklinks-block,
  .footer-opensource-legal-block,
  .footer-location-block {
    width: 100%;
  }
  
  .footer-opensource-legal-block {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  
  /* Masquer le bloc contact "Let's spark something together" sur mobile */
  .footer-row-2 {
    display: none;
  }
  
  /* Mobile utilise la même structure que les autres blocs */
  #actions-mobile-block {
    display: flex !important;
    width: 100%;
  }
  
  .footer-logo-bottom {
    width: 100%;
  }
  
  /* Ajustements typographiques sur mobile */
  #dynamic-footer h3 {
    font-size: 1.125rem;
    line-height: 1.5rem;
  }
  
  #dynamic-footer .text-base {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  
  #dynamic-footer .text-sm {
    font-size: 0.75rem;
    line-height: 1rem;
  }
  
  /* Réduire les gaps et padding sur mobile */
  .footer-content {
    gap: 1rem;
  }
  
  #dynamic-footer .rounded-\[20px\] {
    padding: 1rem;
  }
  
  #dynamic-footer .gap-5 {
    gap: 1rem;
  }
  
  #dynamic-footer .gap-3 {
    gap: 0.75rem;
  }
}

/* === TRES PETIT MOBILE (480px-) === */
@media (max-width: 480px) {
  .footer-container {
    padding: 0 0.75rem;
  }
  
  #dynamic-footer .rounded-\[20px\] {
    padding: 0.75rem;
  }
  
  #dynamic-footer h3 {
    font-size: 1rem;
    line-height: 1.375rem;
  }
  
  #dynamic-footer .text-base {
    font-size: 0.8125rem;
    line-height: 1.125rem;
  }
}

/* === ADAPTATIONS FLUIDES === */
@media (min-width: 1400px) {
  .footer-container {
    max-width: 1400px;
    padding: 0 2.5rem;
  }
}

@media (max-width: 1399px) and (min-width: 1200px) {
  .footer-container {
    max-width: 100%;
    padding: 0 2rem;
  }
}

@media (max-width: 1399px) and (min-width: 1240px) {
  .footer-container {
    max-width: 100%;
    padding: 0 1.5rem;
  }
}

/* === STYLES THÈME DYNAMIQUE === */
/* Assurer que les blocs peuvent recevoir les couleurs de fond via JavaScript */
#logo-block,
#quicklinks-block,
#opensource-block,
#legal-block,
#location-block,
#contact-block,
#actions-block,
#actions-mobile-block {
  transition: background-color 0.3s ease-in-out;
}

/* Boutons Book Intro - Style par défaut via Tailwind, transitions seulement */
#book-intro-button,
#mobile-book-intro-button {
  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

