/**
 * Footer Block Styles
 */

/* FIX-FOOTER-STRUCTURE: <footer> is the outer shell (darker or transparent),
   .footer-container is the inner rounded box with padding + background */
.usine-footer {
  color: var(--footer-text-color, #ffffff);
  padding: 2rem var(--section-padding-x, 64px);
  width: 100%;
  box-sizing: border-box;
  background-color: var(--footer-outer-bg, transparent);
}

/* Espace ciblé entre le FAQ et ce footer précis */
main#primary > .page-content-wrapper > .entry-content > section.usine-bloc-faq-01 + footer#footer-69ce4a3cb38d6 {
  margin-top: 16px;
}

/*
 * Footer site / instance coiffure (#footer-site + id Gutenberg historique) :
 * — sous-titre : aucun padding (surcharge ACF inline)
 * — shell footer : coins 8px
 * — listes de liens : largeur « hug » (fit-content)
 */
#footer-site,
#footer-69ce68670b693 {
  border-radius: 0;
  overflow: hidden;
  box-sizing: border-box;
}

#footer-site .footer-subtitle,
#footer-69ce68670b693 .footer-subtitle {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

#footer-site .footer-logo,
#footer-69ce68670b693 .footer-logo {
  display: flex !important;
  margin-bottom: 0 !important;
  line-height: 0;
  padding: 0 !important;
}

#footer-site .footer-logo-section,
#footer-69ce68670b693 .footer-logo-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Anti-conflit fort: aucun espace entre le logo et le subtitle */
#footer-site .footer-logo-section > .footer-logo + .footer-subtitle,
#footer-69ce68670b693 .footer-logo-section > .footer-logo + .footer-subtitle {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25 !important;
}

/* 16px entre sous-titre et blocs d’actions (écrase .footer-actions { margin-top: 2rem }) */
#footer-site .footer-logo-section > .footer-subtitle + .footer-actions,
#footer-69ce68670b693 .footer-logo-section > .footer-subtitle + .footer-actions {
  margin-top: 16px !important;
}

#footer-site .footer-container,
#footer-69ce68670b693 .footer-container {
  display: flow-root;
  padding-top: 0 !important;
}

#footer-site ul.footer-links,
#footer-69ce68670b693 ul.footer-links {
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

/* Colonnes alignées au contenu (hug) pour les titres + listes */
#footer-site .footer-column,
#footer-69ce68670b693 .footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Footer site : espacement contrôlé main -> bottom = 24px */
#footer-site .footer-bottom,
#footer-69ce68670b693 .footer-bottom {
  padding: 0 !important;
  margin-top: 0;
  margin-bottom: 0;
}

#footer-site .footer-divider,
#footer-69ce68670b693 .footer-divider {
  margin-top: 24px;
  margin-bottom: 24px;
  background: #5D5D5D;
}

#footer-site .footer-container,
#footer-69ce68670b693 .footer-container {
  padding: 0 !important;
}

.footer-container {
  max-width: var(--section-max-width, 1312px);
  margin: 0 auto;
  background-color: transparent;
  border-radius: 0;
  padding: 3rem 0 2rem;
  box-sizing: border-box;
}

.usine-footer.has-wrapper .footer-container {
  background-color: var(--footer-bg-color, #0a3760);
  border-radius: 24px;
  padding: 3rem 3rem 2rem;
}

/* Width variants */
.footer-width-filled .footer-container {
  max-width: 100%;
  border-radius: 0;
}

.footer-width-contained .footer-container {
  max-width: var(--section-max-width, 1312px);
}

/* Main horizontal layout: logo left, columns right */
.footer-main {
  display: flex;
  justify-content: space-between;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: flex-start;
}

.footer-logo-section {
  flex: 1 1 360px;
  max-width: 420px;
}

.footer-columns-wrapper {
  flex: 0 1 auto;
  max-width: min(100%, 620px);
}

/* Logo — FIX-FOOTER-LOGO-001: logo is now an <a> tag */
.footer-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.footer-logo-img {
  display: block;
  height: 52px;
  width: 180px;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}

.footer-logo-text {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--footer-text-color);
}

/* FIX-FOOTER-CTA-PILL: Footer CTA buttons get pill shape */
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}

.footer-actions .btn {
  border-radius: 0;
  font-weight: 500;
}

/* Subtitle */
.footer-subtitle {
  color: var(--footer-text-color);
  opacity: 0.8;
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-top: 0;
  white-space: pre-line;
}

.footer-meta {
  color: var(--footer-text-color);
  opacity: 0.9;
  white-space: pre-line;
  margin-bottom: 2rem;
}

/* Newsletter */
.footer-newsletter {
  margin-bottom: 2.5rem;
}

.footer-newsletter-name,
.footer-newsletter-label {
  margin: 0 0 0.75rem;
  color: var(--footer-text-color);
}

.footer-newsletter-name {
  opacity: 0.9;
}

.usine-footer .newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.usine-footer .newsletter-form .form-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 480px;
}

.usine-footer .newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--footer-text-color);
  font-size: 0.95rem;
}

.usine-footer .newsletter-input::placeholder {
  color: var(--footer-newsletter-placeholder-color, rgba(255, 255, 255, 0.5));
}

/* Contact Info */
/* FIX-EMPTY-CONTACT-001: Hide empty contact section */
.footer-contact:empty {
  display: none;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-icon .icon-img {
  width: 20px;
  height: 20px;
}

.contact-icon .icon--fallback {
  width: 20px;
  height: 20px;
}

.contact-text {
  color: var(--footer-text-color);
  opacity: 0.8;
  font-size: 0.95rem;
}

/* Footer Columns — FIX-FOOTER-COLUMNS: auto-fit for variable column count */
.footer-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 240px);
  justify-content: start;
  gap: 2rem clamp(2rem, 4vw, 5rem);
  width: max-content;
  max-width: 100%;
  margin-bottom: 2rem;
}

.footer-column-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--footer-text-color);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-link-item {
  margin-bottom: 0.75rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--footer-text-color);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
  font-size: 0.95rem;
}

.footer-link:hover {
  opacity: 1;
}

.footer-link-icon {
  flex-shrink: 0;
}

.footer-link.btn-disabled {
  opacity: 0.65;
}

.footer-link-chevron {
  display: none;
}

/* Social Links */
.footer-social {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.footer-social-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--footer-text-color);
}

.footer-social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--footer-text-color);
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
}

.footer-social-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.footer-social-link .dashicons {
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.footer-social-link .social-icon-img,
.footer-social-link .icon--fallback {
  width: 20px;
  height: 20px;
}

/* Footer Bottom — FIX-FOOTER-BOTTOM: Better spacing and integration */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

/* FIX-FOOTER-DIVIDER: Subtler separator + more spacing */
.footer-divider {
  width: 100%;
  height: 1px;
  margin: 2.5rem 0 0;
  background: rgba(255, 255, 255, 0.1);
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.72) !important;
}

.footer-copyright * {
  color: inherit !important;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-credit-text {
  font-size: 14px;
  line-height: 1;
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-legal-link {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-legal-link:hover {
  opacity: 1;
}

/* Webiteasy logo in footer copyright */
.footer-webiteasy-link {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.footer-webiteasy-logo {
  height: 20px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.72;
  transition: opacity 0.2s;
}

.footer-webiteasy-link:hover .footer-webiteasy-logo {
  opacity: 1;
}

/* Tablette : colonnes plus tôt, respiration homogène */
@media (max-width: 1024px) {
  .usine-footer {
    padding-top: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-left: max(var(--section-padding-x, 32px), env(safe-area-inset-left));
    padding-right: max(var(--section-padding-x, 32px), env(safe-area-inset-right));
  }

  /* #footer-site uniquement : 32px h aut/bas (surcharge inline ACF 80px). Gauche/droite inchangés. */
  html body footer#footer-site.usine-footer,
  footer#footer-site.usine-footer {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  .footer-container {
    padding: 2.5rem 0 1.75rem;
  }

  .usine-footer.has-wrapper .footer-container {
    padding: 2.5rem 1.75rem 1.75rem;
    border-radius: 20px;
  }

  .footer-main {
    flex-direction: column;
    gap: 2.25rem;
    align-items: stretch;
  }

  .footer-logo-section {
    flex: none;
    max-width: none;
  }

  .footer-columns-wrapper {
    width: 100%;
    max-width: none;
  }

  .footer-columns {
    width: 100%;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.75rem 2rem;
  }

  .footer-social {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-legal-links {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.75rem;
  }

  /*
   * #footer-site uniquement (tablette + mobile) : colonnes + liste nav sans padding ;
   * .footer-bottom aligné à gauche, sans padding.
   * Contre-pass : .footer-link mobile (min-height 44px + padding), éventuel [class*="__card"]
   * sous .entry-content si le footer était déplacé, DS .text-* — chaîne html body pour max spécificité.
   */
  html body footer#footer-site.usine-footer .footer-columns-wrapper .footer-column,
  html body footer#footer-site.usine-footer .footer-columns .footer-column,
  footer#footer-site .footer-columns-wrapper .footer-column,
  footer#footer-site .footer-columns .footer-column {
    padding: 0 !important;
    padding-block: 0 !important;
    padding-inline: 0 !important;
  }

  html body footer#footer-site.usine-footer ul.footer-links,
  html body footer#footer-site.usine-footer .footer-links,
  footer#footer-site ul.footer-links,
  footer#footer-site .footer-links {
    padding: 0 !important;
    padding-block: 0 !important;
    padding-inline: 0 !important;
    padding-inline-start: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  html body footer#footer-site.usine-footer li.footer-link-item,
  footer#footer-site li.footer-link-item {
    padding: 0 !important;
    margin: 0 !important;
  }

  html body footer#footer-site.usine-footer a.footer-link,
  html body footer#footer-site.usine-footer span.footer-link,
  html body footer#footer-site.usine-footer .footer-link[class*="text-"],
  footer#footer-site a.footer-link,
  footer#footer-site span.footer-link,
  footer#footer-site .footer-link[class*="text-"] {
    padding: 0 !important;
    padding-block: 0 !important;
    padding-inline: 0 !important;
    min-height: 0 !important;
  }

  footer#footer-site .footer-bottom,
  main#primary footer#footer-site .footer-bottom {
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }

  footer#footer-site .footer-bottom .footer-copyright,
  footer#footer-site .footer-bottom .footer-legal-links,
  main#primary footer#footer-site .footer-bottom .footer-copyright,
  main#primary footer#footer-site .footer-bottom .footer-legal-links {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    justify-content: flex-start !important;
  }

  footer#footer-site .footer-legal-links,
  main#primary footer#footer-site .footer-legal-links {
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
  }

  footer#footer-site .footer-legal-link,
  main#primary footer#footer-site .footer-legal-link {
    padding: 0 !important;
    justify-content: flex-start !important;
    min-height: 0 !important;
  }
}

/* Mobile : lisibilité, zones tactiles, pas d’overflow horizontal */
@media (max-width: 768px) {
  .usine-footer {
    padding: 1rem max(var(--section-padding-x, 16px), env(safe-area-inset-left));
    padding-right: max(var(--section-padding-x, 16px), env(safe-area-inset-right));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  html body footer#footer-site.usine-footer,
  footer#footer-site.usine-footer {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  .footer-container {
    padding: 1.75rem 0 1.25rem;
  }

  .usine-footer.has-wrapper .footer-container {
    padding: 1.75rem 1.25rem 1.25rem;
    border-radius: 16px;
  }

  .footer-main {
    gap: 1.75rem;
  }

  .footer-logo-img {
    height: auto;
    max-height: 48px;
    width: auto;
    max-width: min(240px, 85vw);
  }

  .footer-actions {
    margin-top: 1.5rem;
    gap: 0.625rem;
  }

  .footer-actions .btn {
    min-height: 44px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-column-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .footer-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.25rem 0;
    font-size: 1rem;
    opacity: 0.92;
  }

  .footer-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-bottom {
    padding-top: 1.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8125rem;
  }

  .footer-legal-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-legal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.25rem 0;
  }

  .footer-social-links {
    gap: 1.25rem;
  }

  .footer-social-link {
    width: 44px;
    height: 44px;
  }

  /*
   * #footer-site : répété en fin de ≤768 pour passer APRÈS .footer-link { min-height + padding }
   * (même spécificité « html body » > une classe seule).
   */
  html body footer#footer-site.usine-footer .footer-columns-wrapper .footer-column,
  html body footer#footer-site.usine-footer .footer-columns .footer-column {
    padding: 0 !important;
    padding-block: 0 !important;
    padding-inline: 0 !important;
  }

  html body footer#footer-site.usine-footer ul.footer-links {
    padding: 0 !important;
    padding-inline-start: 0 !important;
    margin: 0 !important;
  }

  html body footer#footer-site.usine-footer li.footer-link-item {
    padding: 0 !important;
    margin: 0 !important;
  }

  html body footer#footer-site.usine-footer a.footer-link,
  html body footer#footer-site.usine-footer span.footer-link {
    padding: 0 !important;
    min-height: 0 !important;
  }
}

/* ==========================================================
   Scope local (footer ciblé) — Desktop uniquement
   ========================================================== */
@media (min-width: 1025px) {
  /* #footer-site desktop : +20% de hauteur via paddings verticaux (80 -> 96) */
  #footer-site.usine-footer,
  #footer-69ce68670b693.usine-footer {
    padding-top: 96px !important;
    padding-bottom: 96px !important;
  }

  /* Desktop+ : footer-site en pleine largeur (conteneur interne non "contained") */
  footer#footer-site .footer-container {
    max-width: 100%;
  }

  /* Conteneur visuel principal rouge */
  #footer-69ce4a3cb38d6 .footer-container {
    border-radius: 8px !important;
    padding: 40px 40px 20px !important;
    overflow: hidden;
  }

  /* Structure desktop maîtrisée: 2 colonnes avec vrai espace entre les zones */
  #footer-69ce4a3cb38d6 .footer-main {
    display: grid;
    grid-template-columns: minmax(340px, 520px) minmax(0, 1fr);
    column-gap: 200px;
    row-gap: 0;
    align-items: start;
  }

  #footer-69ce4a3cb38d6 .footer-main > .footer-logo-section {
    width: 100%;
    max-width: 520px;
    padding: 0 !important;
    margin: 0;
  }

  #footer-69ce4a3cb38d6 .footer-main > .footer-columns-wrapper {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    align-self: start;
  }

  #footer-69ce4a3cb38d6 .footer-columns {
    width: 100%;
    justify-content: end;
    justify-items: start;
    gap: 24px 64px;
    margin-bottom: 0;
  }

  #footer-69ce4a3cb38d6 .footer-main > .footer-logo-section .footer-subtitle {
    font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    margin: 0 0 20px;
    opacity: 1;
    max-width: 34ch;
  }

  #footer-69ce4a3cb38d6 .footer-logo {
    margin-bottom: 16px;
  }

  #footer-69ce4a3cb38d6 .footer-actions {
    margin-top: 16px;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: center;
  }

  #footer-69ce4a3cb38d6 .footer-actions .btn {
    white-space: nowrap;
  }

  /* Bas de footer: compact et bien réparti */
  #footer-69ce4a3cb38d6 .footer-divider {
    margin: 20px 0 0;
    opacity: 0.6;
  }

  #footer-69ce4a3cb38d6 .footer-bottom {
    padding-top: 14px;
    margin-bottom: 0;
    gap: 24px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }

  #footer-69ce4a3cb38d6 .footer-copyright {
    margin: 0;
  }

  #footer-69ce4a3cb38d6 .footer-legal-links {
    margin-left: auto;
    gap: 20px;
    flex-wrap: nowrap;
    align-items: center;
  }

  #footer-69ce4a3cb38d6 .footer-link-item {
    margin-bottom: 10px;
  }

  /*
   * Footer site (id stable : #footer-site, voir render.php contexte global).
   * Ancien id Gutenberg ponctuel conservé pour compatibilité si HTML déjà en cache.
   */
  #footer-site .footer-main,
  #footer-69ce68670b693 .footer-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) !important;
    column-gap: 200px !important;
    row-gap: 0;
    align-items: start;
    width: 100%;
  }

  #footer-site .footer-main > .footer-logo-section,
  #footer-69ce68670b693 .footer-main > .footer-logo-section {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    flex: 1 1 auto !important;
    justify-self: stretch;
  }

  #footer-site .footer-main > .footer-columns-wrapper,
  #footer-69ce68670b693 .footer-main > .footer-columns-wrapper {
    width: max-content;
    max-width: min(100%, 620px);
    justify-self: end;
    align-self: start;
    flex: 0 0 auto !important;
  }

  #footer-site .footer-columns,
  #footer-69ce68670b693 .footer-columns {
    width: fit-content;
    max-width: 100%;
    justify-content: end;
    justify-items: start;
    grid-auto-columns: max-content;
    gap: 0;
  }
}
