/*
 * Confort mobile commun a toutes les pages (04/11/2026).
 * 1. Barre d'action fixe en bas d'ecran (creee par mobile.js), mobile seulement.
 * 2. Bandeau cookies compact sur mobile, pose au-dessus de la barre (texte et fonctionnement inchanges).
 * 3. Paragraphes de contenu a 16 px minimum sur mobile.
 * 4. Cases a cocher : zone tactile de 24 px minimum.
 * Charge en dernier dans le <head> : il ne fait que surcharger, il ne remplace rien.
 */

/* 1. Barre d'action mobile */
.dd-mbar { display: none; }

@media (max-width: 768px) {
  .dd-mbar {
    display: flex;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90; /* sous le menu (100), la visionneuse (999) et le bandeau cookies (9999) */
    padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--color-bg-secondary, #241713);
    border-top: 1px solid var(--color-border-soft, rgba(245,236,217,.10));
    box-shadow: 0 -10px 24px -14px rgba(0,0,0,.6);
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    transition: transform .25s ease;
  }
  .dd-mbar.is-cache { transform: translateY(110%); }
  .dd-mbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--border-radius-soft, 4px);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .dd-mbar a i { font-size: .95em; }
  .dd-mbar__essai {
    flex: 1 1 auto;
    background: var(--color-accent-red, #d63a2f);
    border: 2px solid var(--color-accent-red, #d63a2f);
    color: #fff;
  }
  .dd-mbar__horaires {
    flex: 0 0 auto;
    background: transparent;
    border: 2px solid var(--color-border-strong, rgba(245,236,217,.30));
    color: var(--color-text-primary, #f5ecd9);
  }
  .dd-mbar a:active { opacity: .85; }
  .dd-mbar a:focus-visible { outline: 2px solid var(--color-text-primary, #f5ecd9); outline-offset: 2px; }
  .dd-mbar__court { display: none; }

  body.has-mbar { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 374px) {
  .dd-mbar__long { display: none; }
  .dd-mbar__court { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .dd-mbar { transition: none; }
}

/* 2. Bandeau cookies compact sur mobile */
@media (max-width: 768px) {
  html .dd-cookie { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  html body.has-mbar .dd-cookie { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html .dd-cookie__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  html .dd-cookie__text { flex: 0 0 auto; font-size: 14px; line-height: 1.4; }
  html .dd-cookie__actions { flex-wrap: nowrap !important; gap: 6px; }
  html .dd-cookie__btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    font-size: 14px;
    white-space: nowrap;
  }
  /* Ecran « Personnaliser » : « Enregistrer mes choix » sur sa propre ligne, Refuser et Tout accepter dessous */
  html .dd-cookie__choix > div { font-size: 14px !important; gap: 0 1rem !important; }
  html .dd-cookie__actions:has(> [data-dd-save]:not([hidden])) { flex-wrap: wrap !important; }
  html .dd-cookie__actions > [data-dd-save] { flex: 1 1 100%; order: -1; }
}

/* 3. Paragraphes de contenu : 16 px minimum sur mobile (les surtitres, dates et legendes ne bougent pas) */
@media (max-width: 768px) {
  /* Accueil */
  .discipline-note,
  .benefit-text,
  .schedule-card .card-sub,
  .schedule-card .note,
  .schedule-card li,
  .rates-sub,
  .rates-note,
  .rates-card li,
  /* Blog */
  .article-card p,
  /* Articles : blocs « ce que ca bloque », notes et sources posees en style en ligne */
  .content p.blocks,
  .content p[style*="font-size"],
  /* Pages disciplines */
  .principe-desc,
  .sidebar p.label,
  /* Stage */
  .stage-hero .facts li,
  .form-wrap .container > p,
  .form-note p { font-size: 1rem !important; }
}

/* 4. Cases a cocher : zone tactile de 24 px minimum */
input[type="checkbox"] { width: 20px; height: 20px; margin: 2px; flex: 0 0 auto; accent-color: var(--color-accent-red, #d63a2f); }
.dd-cookie__choix label { min-height: 44px; }
.check input[type="checkbox"] { width: 24px; height: 24px; }
.check label { min-height: 24px; }
