/* =========================================================================
   CDTP — Footer
   Template override : cdtp-child/footer.php
   Dépendances : tokens.css
   Enqueue : toutes les pages
   ========================================================================= */

/* =========================================================================
   WRAPPER GLOBAL
   ========================================================================= */
.cdtp-footer {
  position: relative;
  z-index: 5;
  background: var(--ink-1000);
  color: var(--paper-100);
  padding: 80px 32px 32px;
  border-top: 1px solid var(--ink-700);
  margin-top: var(--space-9); /* 96px — espace avant le footer */
}

/* =========================================================================
   GRILLE PRINCIPALE — 4 colonnes
   ========================================================================= */
.cdtp-footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-7); /* 48px */
  padding-bottom: var(--space-7);
  border-bottom: 1px dashed var(--ink-700);
}

.cdtp-footer-col {
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

/* =========================================================================
   COLONNE LOGO
   ========================================================================= */
.cdtp-footer-logo-main {
  font-family: var(--font-blackletter);
  font-weight: 400;
  font-size: var(--type-36);
  margin: 0;
  color: var(--paper-100);
  line-height: 1;
}

.cdtp-footer-logo-subline {
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  transform: translateY(-2px);
}

.cdtp-footer-logo-amp {
  font-family: var(--font-amp);
  font-style: italic;
  font-size: 44px;
  color: var(--blood-500);
  line-height: 1;
}

.cdtp-footer-logo-sub {
  font-family: var(--font-script);
  font-size: 40px;
  color: var(--paper-100);
  line-height: 1;
}

.cdtp-footer-tag {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-2);
  margin: 14px 0 0 0;
  max-width: 280px;
  line-height: var(--leading-body);
}

/* =========================================================================
   COLONNES NAV
   ========================================================================= */

/* Label de section — style mono uppercase rouge */
.cdtp-footer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-stencil);
  text-transform: uppercase;
  color: var(--blood-500);
  margin: 0 0 var(--space-2) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* cursor pointer uniquement sur mobile via media query */
}

/* Chevron — masqué sur desktop, visible sur mobile */
.cdtp-footer-chevron {
  display: none;
  transition: transform 220ms var(--ease-out-hard);
  flex-shrink: 0;
}

/* Corps des liens */
.cdtp-footer-links-body {
  display: grid;
  gap: var(--space-1);
}

.cdtp-footer-link {
  font-family: var(--font-sans);
  font-size: var(--type-14);
  color: var(--paper-100);
  text-decoration: none;
  padding: 3px 0;
  transition: color var(--dur-fast) ease;
}

.cdtp-footer-link:hover {
  color: var(--blood-300);
}

/* =========================================================================
   BANDE LÉGALE
   ========================================================================= */
.cdtp-footer-legal {
  max-width: 1320px;
  margin: 0 auto;
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  text-transform: uppercase;
}

.cdtp-footer-tiny-script {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--paper-200);
  text-transform: none;
  letter-spacing: 0;
}

.cdtp-footer-legal-amp {
  font-family: var(--font-amp);
  font-style: italic;
  color: var(--blood-500);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

/* ≤ 1024px — 2 colonnes */
@media (max-width: 1024px) {
  .cdtp-footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6); /* 32px */
  }
}

/* ≤ 768px — 1 colonne + accordéon nav */
@media (max-width: 768px) {
  .cdtp-footer {
    padding: 56px 20px 24px;
  }

  .cdtp-footer-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: var(--space-6);
  }

  /* Logo : centré */
  .cdtp-footer-col--logo {
    text-align: center;
    justify-items: center;
    padding-bottom: var(--space-6);
    border-bottom: 1px dashed var(--ink-700);
    margin-bottom: var(--space-5);
  }

  .cdtp-footer-logo-subline {
    justify-content: center;
  }

  .cdtp-footer-tag {
    text-align: center;
  }

  /* Colonnes nav : séparateur + accordéon */
  .cdtp-footer-col--nav {
    border-bottom: 1px dashed var(--ink-700);
    padding: var(--space-4) 0;
    gap: 0;
  }

  .cdtp-footer-label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
  }

  /* Chevron visible sur mobile */
  .cdtp-footer-chevron {
    display: block;
  }

  /* Chevron rotation quand ouvert */
  .js-footer-accordion.is-open .cdtp-footer-chevron {
    transform: rotate(180deg);
  }

  /* Corps masqué par défaut, révélé via JS (max-height transition) */
  .cdtp-footer-links-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 280ms var(--ease-out-hard);
    gap: 0;
  }

  .js-footer-accordion.is-open .cdtp-footer-links-body {
    max-height: 300px; /* valeur généreuse */
  }

  .cdtp-footer-link {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--ink-800);
  }

  .cdtp-footer-link:last-child {
    border-bottom: none;
  }

  /* Bande légale — colonne sur mobile */
  .cdtp-footer-legal {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
  }
}
