/**
 * APERMIS v3 — Composants du design system.
 * Boutons · cartes · pills · bandeau raisons · formulaires · header · footer · FAQ.
 * Règle contraste : corail jamais en texte < 19px ; texte sur corail = blanc ≥ 19px gras.
 */

/* ═══════════ Boutons ═══════════ */
.ap-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--ap-r-btn);           /* pill */
  font-family: var(--ap-sans);
  font-size: 1.1875rem;                     /* 19px — AA texte large sur corail */
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ap-btn-primary { background: var(--ap-corail); color: #fff; }
.ap-btn-primary:hover { background: var(--ap-corail-d); color: #fff; }

.ap-btn-secondary {
  background: transparent;
  color: var(--ap-marine);
  border: 1.5px solid var(--ap-marine);
  font-size: 1rem;                          /* marine/crème = 10,3:1 → 16px OK */
  font-weight: 600;
  padding: 11px 24px;
}
.ap-btn-secondary:hover { background: var(--ap-marine); color: #fff; }

.ap-btn-tertiary {
  background: none; border: 0; padding: 0;
  font-size: 1rem; font-weight: 600;
  color: var(--ap-marine);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 4px;
}
.ap-btn-tertiary:hover { color: var(--ap-corail-d); }

/* Variantes contextuelles */
.ap-btn-ghost {                              /* sur fonds sombres uniquement */
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .55);
}
.ap-btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ap-btn-inverse { background: #fff; color: var(--ap-corail-d); } /* CTA sur fond corail */
.ap-btn-inverse:hover { background: #FFF4EF; color: var(--ap-corail-d); }
/* « Petit » bouton = padding réduit SEULEMENT : la taille reste 19px gras
   (blanc/corail = 3,2:1 → AA « texte large » exige ≥ 19px gras, cf. tokens). */
.ap-btn-sm { padding: 8px 20px; }

.ap-cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.ap-cta-row-center { justify-content: center; }

/* ═══════════ Pills ═══════════ */
.ap-pill {
  display: inline-block;
  background: var(--ap-white);
  border: 1px solid var(--ap-sable);
  color: var(--ap-ink);
  border-radius: var(--ap-r-btn);
  padding: 8px 16px;
  font-size: var(--ap-fs-small);
  font-weight: 600;
}
.ap-pill-dark {                              /* sur fonds sombres (hero) */
  display: inline-block;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #EAF0F5;
  border-radius: var(--ap-r-btn);
  padding: 8px 15px;
  font-size: var(--ap-fs-small);
  font-weight: 600;
}

/* Pills de filtre / onglets — actif = marine (AA), inactif = encre */
.ap-filter {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--ap-sable);
  color: var(--ap-ink);
  border-radius: var(--ap-r-btn);
  padding: 9px 18px;
  font-size: var(--ap-fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.ap-filter:hover { border-color: var(--ap-marine); }
.ap-filter.is-active, .ap-filter[aria-pressed="true"] {
  background: var(--ap-marine);
  border-color: var(--ap-marine);
  color: #fff;
}

/* ═══════════ Cartes ═══════════ */
/* Carte photo : radius 16, overflow hidden, AUCUNE ombre, titre blanc sur dégradé bas */
.ap-card-photo {
  position: relative;
  border-radius: var(--ap-r-card);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--ap-sable);
}
.ap-card-photo-img {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #DCE6EE, #E9D9C8); /* placeholder local */
  display: flex; align-items: center; justify-content: center;
}
.ap-card-photo-img > span {
  font-size: 12px; color: #5B5246;
  background: rgba(255, 255, 255, .78);
  padding: 4px 10px; border-radius: 8px;
}
.ap-card-photo-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-card-photo picture, .ap-card-photo-real {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ap-card-photo-badge {
  position: absolute; top: 12px; left: 12px;
  background: #fff; color: var(--ap-ink);
  border-radius: var(--ap-r-btn);
  padding: 5px 12px; font-size: 12px; font-weight: 600;
}
.ap-card-photo-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px;
  /* Voile renforcé : ≥ ,78 sous le texte → blanc ≥ 6:1 même sur photo claire */
  background: linear-gradient(transparent 0%, rgba(14, 43, 67, .78) 40%, rgba(14, 43, 67, .92) 100%);
}
.ap-card-photo-cap h3 { color: #fff; font-size: 1.0625rem; margin: 0 0 2px; }
.ap-card-photo-cap p { color: #E7EEF4; font-size: 13.5px; margin: 0; }

/* Carte offre : blanc, bordure sable, titre serif marine */
.ap-card-offer {
  background: var(--ap-white);
  border: 1px solid var(--ap-sable);
  border-radius: var(--ap-r-card);
  padding: var(--ap-s-6);
}
.ap-card-offer > h3 {
  font-family: var(--ap-serif);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--ap-marine);
}
.ap-card-offer .ap-card-offer-desc { color: var(--ap-muted); font-size: 15px; }

/* ═══════════ Bandeau « bonnes raisons » ═══════════ */
.ap-band {
  background: var(--ap-white);
  border: 1px solid var(--ap-sable);
  border-radius: var(--ap-r-panel);
  padding: var(--ap-s-8);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--ap-s-6);
}
.ap-band-item { text-align: center; }
.ap-band-ico {
  width: 54px; height: 54px;
  margin: 0 auto var(--ap-s-3);
  border: 1.5px solid var(--ap-marine);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--ap-marine);
}
.ap-band-item h3 { font-size: 15px; margin-bottom: 4px; }
.ap-band-item p { font-size: var(--ap-fs-small); color: var(--ap-muted); margin: 0; }
@media (max-width: 960px) { .ap-band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .ap-band { grid-template-columns: 1fr; } }

/* ═══════════ Formulaires ═══════════ */
.ap-field { margin-bottom: var(--ap-s-4); }
.ap-field label {
  display: block;
  font-weight: 600;
  font-size: var(--ap-fs-small);
  color: var(--ap-ink);
  margin-bottom: 6px;
}
.ap-field input[type="text"], .ap-field input[type="email"], .ap-field input[type="tel"],
.ap-field input[type="number"], .ap-field input[type="date"],
.ap-field select, .ap-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: var(--ap-sans);
  font-size: 1rem;
  color: var(--ap-ink);
  background: var(--ap-white);
  border: 1.5px solid var(--ap-muted-soft); /* 3,7:1 sur blanc — WCAG 1.4.11 (sable = 1,3:1, décoratif only) */
  border-radius: var(--ap-r-field);
  transition: border-color .15s ease;
}
.ap-field input:focus, .ap-field select:focus, .ap-field textarea:focus {
  border-color: var(--ap-marine);
  outline: 2px solid var(--ap-marine);
  outline-offset: 1px;
}
.ap-field .ap-field-error { color: var(--ap-error); font-size: var(--ap-fs-small); margin-top: 5px; }
.ap-field.has-error input, .ap-field.has-error select, .ap-field.has-error textarea {
  border-color: var(--ap-error);
}
.ap-field .ap-field-hint { color: var(--ap-muted); font-size: var(--ap-fs-small); margin-top: 5px; }

/* Messages sémantiques */
.ap-msg { border-radius: var(--ap-r-field); padding: 12px 16px; font-size: 15px; }
.ap-msg-success { background: var(--ap-success-bg); color: var(--ap-success); }
.ap-msg-warn { background: var(--ap-warn-bg); color: var(--ap-warn); }
.ap-msg-error { background: var(--ap-error-bg); color: var(--ap-error); }

/* ═══════════ Header ═══════════ */
.ap-header {
  background: var(--ap-white);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--ap-sable);
}
.ap-header.is-scrolled { box-shadow: var(--ap-shadow-float); } /* ombre légère autorisée (flottant) */
.ap-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--ap-s-4);
  height: var(--ap-header-h);
}
.ap-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.ap-logo-word {
  font-family: var(--ap-serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--ap-marine);
}
.ap-logo-word b { color: var(--ap-corail); font-weight: 700; } /* logo = graphique, pas du texte courant */

.ap-nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.ap-nav-list a {
  font-size: 15px; font-weight: 600; color: var(--ap-ink);
  text-decoration: none; white-space: nowrap;
}
.ap-nav-list a:hover { color: var(--ap-corail-d); }

/* Sous-menus WP (.sub-menu) — desktop : dropdown au survol/focus */
.ap-nav-list li { position: relative; }
.ap-nav-list .sub-menu {
  list-style: none; margin: 0; padding: 8px 0;
  position: absolute; top: 100%; left: -12px;
  min-width: 230px;
  background: var(--ap-white);
  border: 1px solid var(--ap-sable);
  border-radius: 12px;
  box-shadow: var(--ap-shadow-float); /* élément flottant : ombre autorisée */
  display: none;
  z-index: 60;
}
.ap-nav-list li:hover > .sub-menu,
.ap-nav-list li:focus-within > .sub-menu { display: block; }
.ap-nav-list .sub-menu a { display: block; padding: 9px 16px; }
.ap-nav-list .menu-item-has-children > a::after {
  content: " ▾"; font-size: 11px; color: var(--ap-muted);
}

.ap-header-actions { display: flex; align-items: center; gap: var(--ap-s-4); }
.ap-header-tel {
  font-weight: 600; font-size: 15px; color: var(--ap-marine);
  text-decoration: none; white-space: nowrap;
}
.ap-header-tel:hover { color: var(--ap-corail-d); }

/* Téléphone rond (mobile — tap ≥ 44px, brief hero §3) */
.ap-header-tel-round {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ap-marine);
  color: #fff;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ap-header-tel-round:hover { background: var(--ap-marine-d); color: #fff; }

/* Burger (mobile) */
.ap-burger {
  display: none;
  background: none; border: 0; cursor: pointer;
  padding: 10px; border-radius: 8px;
}
.ap-burger-line {
  display: block; width: 22px; height: 2px;
  background: var(--ap-marine); margin: 5px 0;
  transition: transform .2s ease, opacity .2s ease;
}
.ap-burger[aria-expanded="true"] .ap-burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ap-burger[aria-expanded="true"] .ap-burger-line:nth-child(2) { opacity: 0; }
.ap-burger[aria-expanded="true"] .ap-burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Le téléphone texte disparaît en premier (place pour la nav complète)
   → l'icône ronde prend le relais dès 1200px (pas de trou 960-1200). */
@media (max-width: 1200px) {
  .ap-header-tel { display: none; }
  .ap-header-tel-round { display: flex; }
}
@media (max-width: 960px) {
  .ap-burger { display: block; }
  .ap-header-inner { gap: var(--ap-s-2); }
  .ap-header-actions { gap: var(--ap-s-2); }
  .ap-nav {
    display: none;
    position: absolute; top: var(--ap-header-h); left: 0; right: 0;
    background: var(--ap-white);
    border-bottom: 1px solid var(--ap-sable);
    box-shadow: var(--ap-shadow-float);
    padding: var(--ap-s-4) var(--ap-gutter) var(--ap-s-6);
    max-height: calc(100dvh - var(--ap-header-h));
    overflow-y: auto;
  }
  .ap-nav.is-open { display: block; }
  .ap-nav-list { flex-direction: column; gap: 0; }
  .ap-nav-list a { display: block; padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--ap-sable); white-space: normal; }
  /* Mobile : sous-menus à plat, indentés (pas de dropdown) */
  .ap-nav-list .sub-menu {
    display: block; position: static;
    min-width: 0; padding: 0 0 0 var(--ap-s-4);
    background: none; border: 0; border-radius: 0; box-shadow: none;
  }
  .ap-nav-list .sub-menu a { padding: 10px 0; font-size: 15px; }
  .ap-nav-list .menu-item-has-children > a::after { content: ""; }
}

/* ═══════════ FAQ (details/summary — accessible sans JS) ═══════════ */
.ap-faq details {
  background: var(--ap-white);
  border: 1px solid var(--ap-sable);
  border-radius: 14px;
  padding: 0 20px;
  margin-bottom: 10px;
}
.ap-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 600;
  color: var(--ap-marine);
  font-size: 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.ap-faq summary::-webkit-details-marker { display: none; }
.ap-faq summary::after {
  content: "+";
  color: var(--ap-corail); /* décoratif (icône), pas du texte */
  font-size: 22px; font-weight: 400; flex-shrink: 0;
}
.ap-faq details[open] summary::after { content: "\2013"; }
.ap-faq details p {
  color: var(--ap-muted); font-size: 15px;
  padding: 0 0 18px; margin: 0; max-width: 780px;
}

/* ═══════════ Footer ═══════════ */
.ap-footer {
  background: var(--ap-marine-d);
  color: var(--ap-on-dark-soft);
  padding: var(--ap-s-12) 0 var(--ap-s-6);
  margin-top: var(--ap-s-4);
  font-size: 15px;
}
.ap-footer a { color: var(--ap-on-dark); }
.ap-footer a:hover { color: #fff; }

/* Contact très visible (pattern conversion tél/Myriam) */
.ap-footer-contact {
  text-align: center;
  padding-bottom: var(--ap-s-8);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  margin-bottom: var(--ap-s-8);
}
.ap-footer-contact-label {
  font-family: var(--ap-serif); font-weight: 600;
  font-size: 1.375rem; color: #fff; margin-bottom: var(--ap-s-2);
}
.ap-footer-tel {
  font-family: var(--ap-serif);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); /* 28 → 40px */
  font-weight: 700;
  color: #fff !important;
  text-decoration: underline;
  text-decoration-color: rgba(240, 99, 60, .8);
  text-underline-offset: 6px;
}
.ap-footer-hours { color: var(--ap-on-dark-soft); margin: var(--ap-s-2) 0 0; font-size: var(--ap-fs-small); }

.ap-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--ap-s-8);
  margin-bottom: var(--ap-s-8);
}
.ap-footer-logo {
  font-family: var(--ap-serif); font-weight: 700; font-size: 22px;
  color: #fff !important; text-decoration: none;
}
.ap-footer-logo b { color: var(--ap-corail); }
.ap-footer-brand p { font-size: var(--ap-fs-small); }
.ap-footer-col h2 {
  font-family: var(--ap-sans); font-weight: 600;
  font-size: 13px; line-height: 1.4; letter-spacing: 1px; text-transform: uppercase;
  color: #fff; margin: 0 0 var(--ap-s-3);
}
.ap-footer-col ul { list-style: none; margin: 0; padding: 0; }
.ap-footer-col li { padding: 4px 0; }
.ap-footer-col a { text-decoration: none; }
.ap-footer-col a:hover { text-decoration: underline; }

.ap-footer-legal {
  font-size: 13px;
  color: var(--ap-on-dark-faint);
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: var(--ap-s-6);
}
.ap-footer-bottom {
  display: flex; justify-content: space-between; gap: var(--ap-s-4);
  flex-wrap: wrap; font-size: 13px; color: var(--ap-on-dark-faint);
}
/* Soulignement explicite : auto-portant même sous la pile compat v2 */
.ap-footer-links a { color: var(--ap-on-dark-soft); text-decoration: underline; text-underline-offset: 2px; }

/* Variante crème (proposition 2 — cf. démo composants) */
.ap-footer--cream { background: var(--ap-cream); color: var(--ap-muted); border-top: 1px solid var(--ap-sable); }
.ap-footer--cream a, .ap-footer--cream .ap-footer-col h2,
.ap-footer--cream .ap-footer-contact-label { color: var(--ap-marine); }
.ap-footer--cream .ap-footer-tel { color: var(--ap-marine) !important; }
.ap-footer--cream .ap-footer-logo { color: var(--ap-marine) !important; }
.ap-footer--cream .ap-footer-legal, .ap-footer--cream .ap-footer-bottom { color: var(--ap-muted); }
.ap-footer--cream .ap-footer-contact, .ap-footer--cream .ap-footer-legal { border-color: var(--ap-sable); }

@media (max-width: 960px) { .ap-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .ap-footer-grid { grid-template-columns: 1fr; } .ap-footer-bottom { flex-direction: column; } }

/* ═══════════ Pages standard (compat plugins) ═══════════ */
.ap-page { padding: var(--ap-s-8) 0 var(--ap-s-16); }
/* Auto-portant (les pages compat chargent la pile v2 dont le h1 générique passe après) */
.ap-page-title {
  margin-top: var(--ap-s-6);
  font-family: var(--ap-serif);
  font-weight: 700;
  font-size: var(--ap-fs-h1);
  line-height: var(--ap-lh-h1);
  color: var(--ap-marine);
}
.ap-page-content { max-width: 860px; }
.ap-page-content img { border-radius: var(--ap-r-card); }
.ap-404 { text-align: left; padding-top: var(--ap-s-16); }
