/* =========================================================================
   Maisons Paysannes 47 — correctifs mobile (navigation, boutons, cartes)
   Chargé après site.css. Aucun effet au-dessus de 950 px, sauf
   les règles « tous écrans » signalées.
   Cible : public senior, pouce, une main, gros caractères.
   ========================================================================= */

/* Bouton Menu de l'en-tête : masqué sur ordinateur */
.burger-entete { display: none; }
.nav-actions-mobile { display: none; }

/* ---------- Tous écrans : petits gains de lisibilité ---------- */
.carte__resume { font-size: .85rem; }
.carte__meta { font-size: .75rem; }
.lien-plus {
  display: table; margin: 32px auto 0; padding: 12px 22px;
  border-radius: var(--rayon); box-shadow: inset 0 0 0 2px var(--bleu);
  color: var(--bleu); text-decoration: none; font-weight: 700; font-size: .9rem;
}
.lien-plus:hover { background: var(--bleu); color: #fff; }

/* =========================================================================
   Tablette et mobile
   ========================================================================= */
@media (max-width: 950px) {

  /* --- En-tête compact et toujours visible (une seule barre de 64 px) --- */
  #shell { position: sticky; top: 0; z-index: 60; }
  .entete { box-shadow: 0 1px 0 rgba(0,0,0,.08); }
  .entete .conteneur {
    flex-wrap: nowrap; height: 64px; padding-top: 0; padding-bottom: 0; gap: 12px;
  }
  .marque img { height: 42px; }
  .actions-entete { display: none; }

  .burger-entete {
    display: inline-flex; align-items: center; gap: 10px; margin-left: auto;
    min-height: 48px; padding: 0 16px; border: 0; border-radius: 8px;
    background: var(--nav); color: #fff; font: inherit; font-size: 1rem; font-weight: 700;
    cursor: pointer;
  }
  .burger-entete__icone { display: inline-flex; flex-direction: column; gap: 4px; width: 20px; }
  .burger-entete__icone i { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
  body.menu-ouvert .burger-entete { background: var(--rouge); }
  body.menu-ouvert .burger-entete__icone i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.menu-ouvert .burger-entete__icone i:nth-child(2) { opacity: 0; }
  body.menu-ouvert .burger-entete__icone i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* --- Menu : panneau plein écran sous l'en-tête --- */
  .nav {
    display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    border-radius: 0; background: #2b2b2d; overflow-y: auto; overscroll-behavior: contain;
  }
  body.menu-ouvert { overflow: hidden; }
  body.menu-ouvert .nav { display: block; }
  .nav .conteneur { flex-direction: column; align-items: stretch; flex-wrap: nowrap; min-height: 0; padding-top: 8px; padding-bottom: 32px; gap: 0; }
  .nav .burger { display: none !important; }
  .nav .nav-items, .nav .nav-items.open { display: flex; flex-direction: column; align-items: stretch; width: 100%; padding: 0; }

  .nav .nav-items > a,
  .nav summary {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    min-height: 58px; padding: 0 6px; font-size: 1.1rem; color: #fff; text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.12); border-radius: 0; background: none;
  }
  .nav .nav-items > a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--ocre); padding-left: 16px; background: rgba(255,255,255,.06); }

  /* Sous-menus : chevron à droite, pas de triangle */
  .nav summary { list-style: none; cursor: pointer; }
  .nav summary::-webkit-details-marker { display: none; }
  .nav summary::after {
    content: ""; width: 10px; height: 10px; margin-right: 6px;
    border-right: 2px solid var(--ocre); border-bottom: 2px solid var(--ocre);
    transform: rotate(45deg) translateY(-3px); transition: transform .2s;
  }
  .nav details[open] > summary { color: var(--jaune); }
  .nav details[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
  .nav details > div { position: static; padding: 4px 0 8px; background: none; box-shadow: none; max-height: none; }
  .nav details > div a {
    display: flex; align-items: center; min-height: 52px; padding: 0 6px 0 22px;
    font-size: 1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06);
  }

  /* Adhérer / Espace adhérent : en bas du menu, en vrais boutons */
  .nav-actions-mobile { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; }
  .nav-actions-mobile a {
    display: flex; align-items: center; justify-content: center; min-height: 52px;
    border-radius: 8px; font-size: 1rem; font-weight: 700; text-decoration: none;
    color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.8);
  }
  .nav-actions-mobile a:first-child { background: var(--rouge); box-shadow: none; }

  /* A+ : bouton pleine largeur et explicite */
  #text-size {
    margin-top: 12px; min-height: 52px; width: 100%; border-radius: 8px;
    background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); font-size: 1rem; text-align: center;
  }
  #text-size::after { content: "  ·  Agrandir le texte"; font-weight: 400; }
  #text-size[aria-pressed="true"]::after { content: "  ·  Texte agrandi (toucher pour réduire)"; }

  /* Le bouton flottant ne doit pas passer par-dessus le menu */
  body.menu-ouvert .floating-contact { display: none; }

  /* Les ancres ne doivent pas se cacher sous l'en-tête collant */
  html { scroll-padding-top: 76px; }
}

/* =========================================================================
   Téléphone
   ========================================================================= */
@media (max-width: 600px) {

  /* --- Accueil : le logo est déjà dans l'en-tête, on ne le répète pas --- */
  .hero { min-height: 0; }
  .hero__logo { display: none; }
  .hero__texte { padding-top: 36px; padding-bottom: 36px; }
  .hero h1 { font-size: 2rem; margin: 10px 0 22px; }
  .hero__boutons { flex-direction: column; gap: 12px; }
  .hero__boutons .btn { width: 100%; justify-content: center; text-align: center; }

  /* --- Boutons : taille de doigt partout (48 px mini) --- */
  .btn, button.btn, a.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
  .btn--grand { min-height: 52px; }
  .intro-copy + .btn, .section .conteneur > .btn--grand { width: 100%; }
  .carte__pied .btn { width: 100%; font-size: 1rem; }
  #contact-close { font-size: 1rem; }
  .lien-plus { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 52px; }

  /* --- Rubriques : 2 cartes empilées par rubrique (au lieu d'un carrousel caché), puis « Toutes les publications » --- */
  .section-head > .carousel-controls { display: none; }
  .carousel { display: grid; grid-template-columns: 1fr; gap: 18px; overflow: visible; scroll-snap-type: none; padding: 0; }
  .carousel > .carte { flex: none; }
  .carousel > .carte:nth-child(n+3) { display: none; }
  .carte__titre { font-size: 1.1rem; font-weight: 700; min-height: 0; padding: 16px 18px; color: var(--bleu); }
  .carte__resume { font-size: .95rem; text-align: left; padding: 14px 18px 0; }
  .carte__meta { font-size: .8rem; text-align: left; }

  /* --- Bouton flottant « Nous contacter » : rond, discret, hors du texte --- */
  .floating-contact {
    right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
    width: 58px; height: 58px; min-height: 58px; padding: 0; border-radius: 50%;
    font-size: 0; justify-content: center;
  }
  .floating-contact::before { content: "✉"; font-size: 26px; line-height: 1; }
  #footer { padding-bottom: 88px; }

  /* --- Fenêtre de contact : marges intérieures --- */
  #contact-dialog { padding: 20px 18px; width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  #contact-dialog .form-card { border: 0; }
  #contact-close { min-height: 48px; }

  /* --- Agenda : date sur une ligne, navigation des mois lisible --- */
  .evt-ligne { grid-template-columns: 1fr; gap: 8px; padding: 16px; }
  .evt-ligne > div:first-child { font-weight: 700; color: var(--rouge); white-space: nowrap; }
  .evt-ligne .btn { width: 100%; }
  .btn-mois { min-height: 48px; }

  /* --- Pied de page : liens espacés pour le pouce --- */
  .footer-links { gap: 0; }
  .footer-links a { display: flex; align-items: center; min-height: 48px; font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.12); }
  .pied { font-size: .85rem; }

  /* --- Carte : liste des lieux en vrais boutons --- */
  .map-places button, .map-places a { min-height: 48px; }
  .map-tools input { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .burger-entete__icone i { transition: none; }
}
