/*
 * CookinBreak — pied de page du site (desktop + mobile)
 * ------------------------------------------------------------------
 * Un seul composant, préfixe cbf-. Tout lit les tokens de ds/tokens.css (mode sombre automatique).
 * Balisage : app/views/site_footer.php · comportement : static/js/site-footer.js.
 *
 * Trois dispositions (la marque est toujours une bande au-dessus du plan du site) :
 *   ≥ 1100 px  plan du site en 6 colonnes
 *   720–1099   plan du site en 3 colonnes
 *   < 720 px   colonnes en accordéon
 *
 * Les remises à zéro sont en :where() (spécificité nulle) : elles ne doivent pas l'emporter sur les classes cbf__.
 */

.cbf {
  margin: var(--ds-space-12) 12px 12px;
  background: var(--ds-surface);
  color: var(--ds-text);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-sm);
  line-height: 1.5;
}
:where(.cbf) *,
:where(.cbf) *::before,
:where(.cbf) *::after { box-sizing: border-box; }
:where(.cbf) ul { list-style: none; margin: 0; padding: 0; }
:where(.cbf) p { margin: 0; }
:where(.cbf) a { color: inherit; text-decoration: none; }
.cbf a:focus-visible,
.cbf summary:focus-visible { outline: none; box-shadow: var(--ds-focus-ring); border-radius: var(--ds-radius-xs); }

.cbf .cb-icon { flex: none; vertical-align: -0.125em; }
.cbf__nowrap { white-space: nowrap; }

.cbf__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.cbf__inner {
  display: grid;
  gap: var(--ds-space-8);
  max-width: 1480px;
  margin: 0 auto;
  padding: var(--ds-space-8) var(--ds-space-5) var(--ds-space-5);
}

/* ------------------------------------------------------------------
 * Marque : logo, accroche, réseaux
 * ------------------------------------------------------------------ */
.cbf__brand { display: grid; gap: var(--ds-space-4); align-content: start; max-width: 420px; }
.cbf__logo { justify-self: start; }
.cbf__logo-img { display: block; width: auto; height: 46px; }
.dark-mode .cbf__logo-img { filter: invert(1) hue-rotate(180deg); }
.cbf__tagline { color: var(--ds-text-2); }

.cbf__social { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
.cbf__social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--ds-surface-2); color: var(--ds-text-2); font-size: 19px;
  transition: background var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease), transform var(--ds-duration) var(--ds-ease);
}
.cbf__social-link:hover { background: var(--ds-primary-soft); color: var(--ds-primary-text); transform: translateY(-2px); }

/* ------------------------------------------------------------------
 * Plan du site
 * ------------------------------------------------------------------ */
.cbf__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-8) var(--ds-space-6); }

.cbf__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--ds-space-3);
  list-style: none; cursor: default;
  font-weight: 600; font-size: var(--ds-text-base); color: var(--ds-text);
}
.cbf__head::-webkit-details-marker { display: none; }
.cbf__head-label { flex: 1; min-width: 0; }
.cbf__chev { display: none; color: var(--ds-text-3); font-size: 16px; transform-origin: 50% 50%; transition: transform var(--ds-duration) var(--ds-ease); }

/* Pastilles d'icône (mêmes teintes que l'en-tête) */
.cbf__tile {
  --t-bg: var(--ds-surface-2); --t-ink: var(--ds-text-2);
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px; font-size: 18px;
  background: var(--t-bg); color: var(--t-ink);
}
.cbf__tile--teal   { --t-bg: var(--ds-primary-soft); --t-ink: var(--ds-primary-text); }
.cbf__tile--orange { --t-bg: #ffe9d6; --t-ink: #b4571a; }
.cbf__tile--rose   { --t-bg: #fde3e6; --t-ink: #ae2139; }
.cbf__tile--green  { --t-bg: #e2f3e5; --t-ink: #2f7a4b; }
.cbf__tile--blue   { --t-bg: #e5edfa; --t-ink: #2f5fb3; }
.cbf__tile--sand   { --t-bg: #f3ecdf; --t-ink: #7a5c2e; }
.dark-mode .cbf__tile--orange { --t-bg: rgba(255, 160, 92, 0.16); --t-ink: #ffb27a; }
.dark-mode .cbf__tile--rose   { --t-bg: rgba(255, 129, 150, 0.16); --t-ink: #ff9fae; }
.dark-mode .cbf__tile--green  { --t-bg: rgba(111, 212, 145, 0.16); --t-ink: #8fe0ab; }
.dark-mode .cbf__tile--blue   { --t-bg: rgba(155, 188, 247, 0.16); --t-ink: #9bbcf7; }
.dark-mode .cbf__tile--sand   { --t-bg: rgba(226, 196, 150, 0.14); --t-ink: #e6cfa6; }

.cbf__list { display: grid; gap: 2px; }
.cbf__link {
  display: inline-block;
  padding: 5px 0;
  color: var(--ds-text-2);
  transition: color var(--ds-duration) var(--ds-ease);
}
.cbf__link:hover { color: var(--ds-primary-text); }
.cbf__go { margin-left: 5px; font-size: 14px; transition: transform var(--ds-duration) var(--ds-ease); }
.cbf__link:hover .cbf__go { transform: translateX(3px); }
.cbf__link--all { margin-top: 4px; font-weight: 600; color: var(--ds-primary-text); }
.cbf__ext { margin-left: 4px; font-size: 13px; opacity: 0.7; }
.cbf__note { margin-left: 2px; font-size: var(--ds-text-xs); color: var(--ds-text-3); white-space: nowrap; }
.cbf__note--now { color: var(--ds-accent-text); font-weight: 600; }

/* ------------------------------------------------------------------
 * Barre du bas : copyright, liens légaux, haut de page
 * ------------------------------------------------------------------ */
.cbf__bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-3) var(--ds-space-6);
  padding-top: var(--ds-space-5);
  border-top: 1px solid var(--ds-border);
  color: var(--ds-text-3); font-size: var(--ds-text-xs);
}
.cbf__legal { display: flex; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-5); flex: 1; }
.cbf__legal a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--ds-text-2); }
.cbf__legal .cb-icon { font-size: 15px; }
.cbf__legal a:hover { color: var(--ds-primary-text); }
/* Thème de l'appareil : trois icônes (clair, sombre, auto) */
.cbf__theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: 14px; background: var(--ds-surface-2); }
.cbf__theme[hidden] { display: none; }
.cbf__theme-opt { position: relative; margin: 0; }
.cbf__theme-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cbf__theme-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 30px; border-radius: 11px;
  color: var(--ds-text-3); font-size: 17px;
  transition: background var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease);
}
.cbf__theme-opt:hover .cbf__theme-ico { color: var(--ds-text); }
.cbf__theme-opt input:checked + .cbf__theme-ico { background: var(--ds-surface); color: var(--ds-primary-text); box-shadow: var(--ds-shadow-sm); }
.cbf__theme-opt input:focus-visible + .cbf__theme-ico { box-shadow: var(--ds-focus-ring); }

.cbf__top {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--ds-radius-btn);
  background: var(--ds-surface-2); color: var(--ds-text-2); font-weight: 600;
  transition: background var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease);
}
.cbf__top:hover { background: var(--ds-primary-soft); color: var(--ds-primary-text); }

/* ------------------------------------------------------------------
 * ≥ 720 px : marque en bande (logo · accroche · réseaux) ; ≥ 1100 px : 6 colonnes
 * ------------------------------------------------------------------ */
@media (min-width: 720px) {
  .cbf__brand {
    grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--ds-space-8);
    max-width: none; padding-bottom: var(--ds-space-8); border-bottom: 1px solid var(--ds-border);
  }
  .cbf__tagline { max-width: 48ch; }
}
@media (min-width: 1100px) {
  .cbf { margin-inline: 16px; }
  .cbf__inner { padding: var(--ds-space-10) var(--ds-space-10) var(--ds-space-6); }
  .cbf__nav { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--ds-space-6); }
}

/* ------------------------------------------------------------------
 * < 720 px : colonnes en accordéon
 * ------------------------------------------------------------------ */
@media (max-width: 719.98px) {
  .cbf { margin: var(--ds-space-10) 8px 8px; border-radius: var(--ds-radius-md); }
  .cbf__inner { gap: var(--ds-space-6); padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-4); }
  .cbf__nav { grid-template-columns: 1fr; gap: 0; }
  .cbf__col + .cbf__col { border-top: 1px solid var(--ds-border); }
  .cbf__head { margin: 0; padding: 12px 0; cursor: pointer; }
  .cbf__chev { display: inline-block; }
  .cbf__col[open] .cbf__chev { transform: rotate(180deg); }
  .cbf__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ds-space-4); padding: 0 0 var(--ds-space-4) 42px; }
  .cbf__list li:has(.cbf__link--all) { grid-column: 1 / -1; }
  .cbf__link { padding: 7px 0; }
  .cbf__bottom { flex-direction: column; align-items: flex-start; }
  .cbf__bottom > .cbf__theme { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .cbf, .cbf * { transition: none !important; }
}
