/* Pied de page éditorial — html/layouts/demat/pied.php (desktop + mobile : même fichier dans les deux templates). */

.dp {
  --dp-texte: rgba(251, 250, 247, 0.84);
  --dp-doux: rgba(251, 250, 247, 0.68);
  --dp-ligne: rgba(251, 250, 247, 0.14);
  --dp-carte: rgba(251, 250, 247, 0.05);
  margin-top: 4rem;
  color: var(--noir-goemon);
}

.dp-vague { display: block; width: 100%; height: 44px; margin-bottom: -1px; }

.dp-corps {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 100% 0%, rgba(14, 125, 140, 0.22), transparent 70%),
    var(--noir-goemon);
  color: var(--blanc-ecume);
  padding-top: clamp(2rem, 4vw, 3.5rem);
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
}

.dp a { color: inherit; }
.dp a:focus-visible,
.dp button:focus-visible,
.dp summary:focus-visible { outline: 2px solid var(--sable); outline-offset: 3px; border-radius: 4px; }

/* --- Bandeau --- */
.dp-haut {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--dp-ligne);
}

@media (min-width: 861px) { .dp--chez .dp-haut { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); } }

.dp-logo { display: inline-block; color: var(--blanc-ecume); line-height: 0; }
.dp-logo .logo-demat { width: auto; height: clamp(64px, 8vw, 104px); margin-left: -0.6rem; }
.dp-logo .logo-barres { fill: var(--bleu-glaz); }
.dp .logo-demat .logo-l { animation: none; opacity: 1; }

.dp-devise {
  margin: 1.25rem 0 0;
  font-family: var(--police-titres);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.dp-devise span { color: var(--sable); }

.dp-sousdevise { margin: 1rem 0 0; max-width: 44ch; color: var(--dp-doux); line-height: 1.6; }

.dp-surtitre {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0;
  color: var(--sable);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}

/* Appel « Moi » (pas de commune) */
.dp-appel {
  align-self: center;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--dp-ligne);
  border-radius: var(--rayon);
  background: var(--dp-carte);
}
.dp-appel-titre {
  margin: 0 0 0.6rem;
  font-family: var(--police-titres);
  font-weight: 400; font-synthesis: none;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.05;
}
.dp-appel p:not(.dp-appel-titre) { margin: 0 0 1.25rem; color: var(--dp-doux); max-width: 46ch; }

.dp-appel-bouton,
.dp-changer {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; padding: 0.6rem 1.2rem;
  border: 1px solid var(--sable); border-radius: 999px;
  background: var(--sable); color: var(--noir-goemon);
  font: inherit; font-weight: 700; font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.dp-appel-bouton:hover { background: var(--blanc-ecume); border-color: var(--blanc-ecume); }

.dp-changer { background: transparent; color: var(--blanc-ecume); border-color: var(--dp-ligne); font-weight: 600; margin-top: 1.25rem; }
.dp-changer:hover { border-color: var(--sable); }

/* « Chez vous, à <commune> » */
.dp-chez {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  border: 1px solid var(--dp-ligne);
  border-radius: var(--rayon);
  background: var(--dp-carte);
  overflow: hidden;
}
.dp-chez:not(:has(.dp-chez-photo)) { grid-template-columns: 1fr; }

.dp-chez-photo { margin: 0; display: flex; flex-direction: column; background: rgba(0, 0, 0, 0.25); }
.dp-chez-photo img { display: block; width: 100%; height: 100%; min-height: 220px; flex: 1; object-fit: cover; }
.dp-chez-credit { margin: 0; padding: 0.5rem 0.75rem; color: var(--dp-doux); font-size: 0.7rem; line-height: 1.4; }
.dp-chez-credit a { text-decoration: underline; text-underline-offset: 2px; }

.dp-chez-corps { padding: clamp(1.25rem, 2.5vw, 1.75rem); }

.dp-chez-titre {
  margin: 0.4rem 0 1rem;
  font-family: var(--police-titres);
  font-weight: 400; font-synthesis: none;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1;
  color: var(--blanc-ecume);
}

.dp-raccourcis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0.5rem; }
.dp-raccourcis a {
  display: flex; flex-direction: column; gap: 0.15rem;
  height: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: rgba(251, 250, 247, 0.06);
  text-decoration: none;
  transition: background-color 0.15s;
}
.dp-raccourcis a:hover { background: rgba(14, 125, 140, 0.45); }
.dp-raccourcis strong { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.95rem; }
.dp-raccourcis span { color: var(--dp-doux); font-size: 0.8rem; line-height: 1.35; }
.dp-fleche { flex: none; color: var(--sable); transition: transform 0.15s; }
.dp-raccourcis a:hover .dp-fleche { transform: translateX(3px); }

.dp-voisines { margin-top: 1.25rem; }
.dp-voisines h3 { margin: 0 0 0.5rem; color: var(--dp-doux); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-family: inherit; }
.dp-voisines ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dp-voisines a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0.3rem 0.8rem;
  border: 1px solid var(--dp-ligne); border-radius: 999px;
  font-size: 0.88rem; text-decoration: none;
}
.dp-voisines a:hover { border-color: var(--sable); color: #fff; }

/* --- Colonnes --- */
.dp-colonnes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem;
  padding-block: clamp(2rem, 4vw, 3rem);
}

.dp-col h2,
.dp-departements h2 {
  margin: 0 0 1rem;
  font-family: inherit;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sable);
}
.dp-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.dp-col a {
  display: inline-block;
  padding-block: 0.3rem;
  color: var(--dp-texte);
  text-decoration: none;
  line-height: 1.35;
  background: linear-gradient(var(--bleu-glaz), var(--bleu-glaz)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.2s, color 0.15s;
}
.dp-col a:hover { color: #fff; background-size: 100% 2px; }

/* Départements */
.dp-departements {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--dp-ligne);
}
.dp-departements h2 { margin: 0; }
.dp-departements ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dp-departements a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 40px; padding: 0.35rem 0.95rem 0.35rem 0.4rem;
  border: 1px solid var(--dp-ligne); border-radius: 999px;
  text-decoration: none; font-size: 0.92rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.dp-departements a:hover { border-color: var(--sable); }
.dp-departements a[aria-current] { background: var(--bleu-glaz); border-color: var(--bleu-glaz); }
.dp-dept-code {
  display: inline-grid; place-items: center;
  min-width: 2rem; height: 2rem; border-radius: 999px;
  background: rgba(251, 250, 247, 0.1);
  font-family: var(--police-donnees); font-size: 0.8rem; color: var(--sable);
}
.dp-departements a[aria-current] .dp-dept-code { color: var(--blanc-ecume); background: rgba(0, 30, 38, 0.3); }

/* --- Bas --- */
.dp-bas {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem;
  padding-block: 1.5rem 5.5rem; /* clear the fixed buttons (accessibility, cookies, search) */
  border-top: 1px solid var(--dp-ligne);
  color: var(--dp-doux);
  font-size: 0.85rem;
}
.dp-bas p { margin: 0; }
.dp-legal ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.dp-legal a, .dp-copie a, .dp-sources a { text-decoration: underline; text-decoration-color: rgba(251, 250, 247, 0.3); text-underline-offset: 3px; }
.dp-legal a:hover, .dp-copie a:hover, .dp-sources a:hover { color: #fff; text-decoration-color: currentColor; }
.dp-sources { flex-basis: 100%; order: 3; }
.dp-copie { order: 4; }
.dp-modules { order: 5; }
.dp-kenavo {
  order: 2;
  margin-left: auto !important;
  font-family: var(--police-titres); font-weight: 400; font-synthesis: none;
  font-size: 1.6rem; line-height: 1;
  color: var(--sable);
}

/* --- Tablette / étroit --- */
@media (max-width: 1100px) {
  .dp-colonnes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .dp-haut { grid-template-columns: 1fr; }
  .dp-colonnes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .dp-chez { grid-template-columns: 1fr; }
  .dp-chez-photo img { aspect-ratio: 16 / 9; min-height: 0; }
  .dp-colonnes { grid-template-columns: 1fr; gap: 0; }
  .dp-kenavo { margin-left: 0 !important; }
}

/* Mobile template: the body already clears the tab bar; no floating buttons. Collapsible columns (details/summary). */
.dp--mobile .dp-bas { padding-bottom: 1.5rem; }
details.dp-col { border-bottom: 1px solid var(--dp-ligne); }
details.dp-col summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px;
  list-style: none;
  cursor: pointer;
}
details.dp-col summary::-webkit-details-marker { display: none; }
details.dp-col summary h2 { margin: 0; font-size: 0.85rem; }
details.dp-col summary::after {
  content: ''; width: 10px; height: 10px; margin-right: 0.35rem;
  border-right: 2px solid var(--sable); border-bottom: 2px solid var(--sable);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s;
}
details.dp-col[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
details.dp-col ul { padding-bottom: 1rem; }
details.dp-col a { padding-block: 0.55rem; }
details.dp-col:first-child { border-top: 1px solid var(--dp-ligne); }

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

@media print { .dp { display: none; } }
