/* ==========================================================================
   Footer Hermits — 3 colonnes (≥ 981px), contact + 2 colonnes (≤ 980px)
   Toutes les dimensions sont fluides : à ajuster via les variables ci-dessous.
   ========================================================================== */

.hf {
  /* Couleurs (couleurs globales Divi, avec secours) */
  --hf-bg: var(--gcid-secondary-color, #000);
  --hf-fg: #fff;
  --hf-accent: var(--gcid-primary-color, #edece9);
  --hf-font: var(--et_global_body_font, 'EB Garamond'), 'EB Garamond', Georgia, serif;
  --hf-font-legal: 'Times New Roman', Times, serif;

  /* Mise en page */
  --hf-width: 90%;
  --hf-pad-y: clamp(4rem, 3.5rem + 2vw, 5rem);
  --hf-top-gap: clamp(3rem, 2.5rem + 1.5vw, 4rem);
  --hf-col-gap: clamp(1.5rem, .5rem + 3.5vw, 3.75rem);
  --hf-stack-gap: clamp(.9375rem, .25rem + 2vw, 1.875rem);
  --hf-link-gap: .625rem;
  --hf-sep: 1rem;

  /* Typographie */
  --hf-fs: 1rem;
  --hf-fs-address: .875rem;
  --hf-fs-legal: .75rem;

  /* Mouvement (mêmes courbes que le header) */
  --hf-ease: cubic-bezier(.22, .61, .36, 1);
  --hf-ease-out: cubic-bezier(.16, 1, .3, 1);

  position: relative;
  z-index: 410;
  padding-block: var(--hf-pad-y);
  background: var(--hf-bg);
  color: var(--hf-fg);
  font-family: var(--hf-font);
  font-size: var(--hf-fs);
  line-height: 1.4875;
  -webkit-font-smoothing: antialiased;
}

/* Remises à zéro (isole le footer des styles Divi) */
.hf *, .hf *::before, .hf *::after { box-sizing: border-box; }
.hf ul { list-style: none; margin: 0; padding: 0; }
.hf li, .hf p { margin: 0; padding: 0; }
.hf address { font-style: normal; margin: 0; }
.hf a { color: inherit; text-decoration: none; }
.hf img { display: block; max-width: 100%; height: auto; }
.hf a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: .25rem;
}
.hf-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.hf-inner {
  width: var(--hf-width);
  margin-inline: auto;
}

/* Soulignement animé (identique au header) */
.hf-link {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-bottom: .08em;
  transition: background-size .45s var(--hf-ease-out);
}
.hf-link:hover,
.hf-link[aria-current] { background-size: 100% 1px; }

/* --------------------------------------------------------------------------
   Rangée 1 : contact | liens | liens
   -------------------------------------------------------------------------- */

.hf-top {
  display: grid;
  grid-template-columns: 50% minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--hf-col-gap);
  row-gap: 1.875rem;
  align-items: start;
  margin-bottom: var(--hf-top-gap);
}

.hf-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--hf-stack-gap);
  font-weight: 500;
}
/* Interligne identique à l'existant (23,8 px pour 14 px) */
.hf-address {
  font-size: var(--hf-fs-address);
  line-height: 1.7;
}
.hf-contact strong { font-weight: 700; }

.hf-social {
  display: flex;
  gap: .625rem;
}
.hf-social a {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 3px;
  transition: opacity .3s var(--hf-ease), transform .45s var(--hf-ease-out);
}
.hf-social svg { width: 1rem; height: 1rem; }
.hf-social a:hover {
  opacity: .7;
  transform: translateY(-2px);
}

.hf-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--hf-link-gap);
}

/* ESPACE PRO : filet beige sous le libellé */
.hf .hf-pro {
  padding-bottom: 0;
  background: none;
  border-bottom: 1px solid var(--hf-accent);
  transition: border-color .3s var(--hf-ease);
}
.hf .hf-pro:hover { border-bottom-color: var(--hf-fg); }

/* --------------------------------------------------------------------------
   Rangée 2 : logo Biobject | Mercoeur Édition, filet blanc dessous
   -------------------------------------------------------------------------- */

.hf-brands {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: var(--hf-sep);
  padding-bottom: var(--hf-sep);
}
.hf-brands::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hf-fg);
  transform-origin: left center;
}
.hf-logo { width: 55%; }
.hf-logo__img { width: 100%; }
.hf-partner {
  flex: none;
  width: max(12%, 4.25rem);
  transition: opacity .3s var(--hf-ease);
}
.hf-partner__img { width: 100%; }
.hf-partner:hover { opacity: .75; }

/* --------------------------------------------------------------------------
   Rangée 3 : copyright | liens légaux
   -------------------------------------------------------------------------- */

.hf-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem var(--hf-col-gap);
  font-family: var(--hf-font-legal);
  font-size: var(--hf-fs-legal);
  /* Interligne de l'existant (23,8 px) : zone de clic confortable au doigt */
  line-height: 1.98;
}
.hf-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .3125rem .9375rem;
}
.hf-legal .hf-link {
  display: inline-block;
  text-decoration: underline;
  text-underline-offset: .15em;
  background: none;
  transition: opacity .3s var(--hf-ease);
}
.hf-legal .hf-link:hover { opacity: .7; }

/* --------------------------------------------------------------------------
   Tablette / mobile
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  /* Contact sur toute la largeur, puis les deux colonnes de liens côte à côte
     (corrige la colonne de liens trop étroite en tablette). */
  .hf-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hf-contact { grid-column: 1 / -1; }

  /* Copyright au-dessus des liens légaux (évite le retour à la ligne isolé). */
  .hf-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .hf-legal { justify-content: flex-start; }
}

@media (max-width: 767px) {
  .hf-legal {
    flex-direction: column;
    gap: .3125rem;
  }
}

/* --------------------------------------------------------------------------
   Apparition au défilement (activée par JS seulement si le footer est hors
   écran au chargement : sans JS, tout est visible)
   -------------------------------------------------------------------------- */

.hf.is-ready .hf-reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity .8s var(--hf-ease), transform 1s var(--hf-ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.hf.is-ready .hf-brands::after {
  transform: scaleX(0);
  transition: transform 1.2s var(--hf-ease-out) .45s;
}
.hf.is-visible .hf-reveal {
  opacity: 1;
  transform: none;
}
.hf.is-visible .hf-brands::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .hf *,
  .hf *::before,
  .hf *::after {
    transition-duration: .15s !important;
    transition-delay: 0s !important;
  }
  .hf .hf-reveal,
  .hf .hf-social a,
  .hf .hf-brands::after { transform: none !important; }
}
