/* ═══════════════════════════════════════════
   ENF — Correctifs responsive (petits écrans)
   Chargé après les styles de chaque page.
═══════════════════════════════════════════ */
html, body { overflow-x: hidden; max-width: 100%; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
.about-img-wrapper img, .photo-grid img, .gallery-item img, .event-card-img img,
.book-card-cover img, .pastor-photo, .hero-slide video { height: 100%; }
.about-img-wrapper img { height: 480px; }
.photo-grid img { height: 220px; }
.event-card-img img { height: 150px; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 991px) {
  #mainNav .navbar-collapse { background: #fefefe; padding: .5rem 0 1rem; }
  #mainNav .nav-link { padding: .55rem .5rem !important; }
}

@media (max-width: 768px) {
  .container { padding-left: 1.25rem; padding-right: 1.25rem; }

  /* Accueil — hero */
  #hero { min-height: 78vh; min-height: 78svh; }
  #hero-content { padding: 6rem 1rem 3rem; }
  #hero-content h1 { font-size: 2rem; line-height: 1.15; }
  #hero-content .hero-subtitle { font-size: 1rem; margin-bottom: 1.6rem; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons a { text-align: center; }
  .scroll-indicator { display: none; }
  .hero-slide { transform: none !important; }

  /* Accueil — sections */
  .about-img-wrapper img { height: 240px; }
  .about-img-badge { bottom: .8rem; left: .8rem; font-size: .8rem; padding: .5rem .9rem; }
  .event-card { flex: 0 0 82vw; max-width: 300px; }
  #verset-band blockquote { font-size: 1.05rem; }
  .ministry-card { padding: 1.8rem 1.4rem; }
  .gallery-grid { gap: .5rem; }
  #about, #ministeres, #bibliotheque-preview, #contact, #don { padding: 3.2rem 0; }
  .section-title { font-size: 1.65rem; }

  /* Pages internes — hero */
  #page-hero { padding: 6rem 0 3rem; }
  #page-hero h1 { font-size: 1.9rem; }
  #page-hero .hero-subtitle { font-size: .95rem; padding: 0 .5rem; }
  #page-hero .hero-logo { height: 64px; }

  /* Pages ministères / louange */
  .info-strip { margin-top: 1.5rem; }
  .info-card { padding: 1rem 1.1rem; }
  .ministry-section { padding: 3rem 0; }
  .photo-grid img { height: 140px; }
  .cta-box { padding: 2rem 1.25rem; border-radius: 18px; }
  .cta-box h3 { font-size: 1.4rem; }
  .timeline .t { min-width: 56px; }

  /* Footer */
  #footer { padding: 3rem 0 1.25rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-affiliations img { height: 34px; }
}

@media (max-width: 480px) {
  #hero-content h1 { font-size: 1.75rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid .col-6 { flex: 0 0 50%; }
}

/* ═══════════════════════════════════════════
   Navbar : hauteur identique sur toutes les pages
   (pas de rétrécissement au scroll, logo fixe)
═══════════════════════════════════════════ */
#mainNav, #mainNav.scrolled { padding: .55rem 0 !important; min-height: 68px; }
#mainNav .navbar-brand img, #mainNav.scrolled .navbar-brand img { height: 42px !important; }
#mainNav .navbar-brand { padding: 0; display: flex; align-items: center; }
#mainNav .nav-link.active::after { display: none; }

/* ═══════════════════════════════════════════
   Correctifs tactiles et lisibilité sur téléphone

   Ces règles utilisent une spécificité renforcée (« body #… ») car le
   <style> placé en fin de page l'emporterait sinon sur cette feuille,
   chargée dans le <head>.
═══════════════════════════════════════════ */

@media (max-width: 767.98px) {

  /* ── Appel aux dons ──
     L'onglet vertical fixé à droite mordait sur le titre d'accueil : jusqu'à
     17 px de texte recouvert sur un téléphone (« repartez transformé » et
     « les autres » étaient coupés). Sur petit écran il devient un bouton
     rond compact, en bas à droite — le bouton « retour en haut » occupe la
     gauche, il n'y a donc pas de collision. Le libellé reste porté par
     aria-label pour les lecteurs d'écran. */
  body #offrande-tab {
    writing-mode: horizontal-tb;
    top: auto;
    bottom: 1.25rem;
    right: 1.25rem;
    transform: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    letter-spacing: 0;
    box-shadow: 0 6px 20px rgba(7, 10, 116, .28);
  }
  body #offrande-tab i {
    font-size: 1.3rem;
    margin: 0;
  }
  body #offrande-tab:hover {
    padding: 0;
  }

  /* ── Champs de saisie ──
     En dessous de 16 px, Safari sur iOS zoome automatiquement quand on
     touche un champ, et l'utilisateur doit repincer pour revenir. Les champs
     du site étaient entre 13,1 et 15,2 px.
     !important est nécessaire ici : certaines règles de page ciblent les
     champs par identifiant (#prayer-modal input), donc avec une spécificité
     qu'un sélecteur d'élément ne peut pas atteindre. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  /* ── Zones tactiles ──
     WCAG 2.2 demande 24 × 24 px au minimum. Ces liens faisaient 17 à 20 px
     de haut : difficiles à viser au doigt. */
  .footer-bottom a,
  #cookie-banner .ck-text a {
    display: inline-block;
    padding-top: .3rem;
    padding-bottom: .3rem;
  }

  /* Croix de fermeture du bandeau d'annonce : 22 × 22 px par défaut
     (gabarit Bootstrap), trop petite pour être visée au doigt. */
  #announcement-bar .btn-close {
    width: 28px;
    height: 28px;
    padding: .5rem;
    background-size: 12px;
  }
}

@media (max-width: 576px) {
  /* Même gabarit que le bouton « retour en haut », pour rester cohérent */
  body #offrande-tab {
    width: 40px;
    height: 40px;
    bottom: .75rem;
    right: .75rem;
  }
  body #offrande-tab i { font-size: 1.15rem; }
}

/* ═══════════════════════════════════════════
   Boutons : pas de soulignement

   Bootstrap 5 souligne les liens par défaut, contrairement à Bootstrap 4.
   Les éléments qui se comportent comme des boutons ou de la navigation
   héritaient donc d'un trait sous leur libellé.

   Seuls ces éléments sont visés : les liens en pleine page (mentions
   légales, confidentialité, corps de texte) gardent leur soulignement,
   qui aide à les repérer.
═══════════════════════════════════════════ */
a[class*="btn"],
.prayer-btn,
.song-btn,
.cat-pill,
.ministry-card,
.nav-link,
.navbar-brand,
.social-icon,
#offrande-tab,
#back-top {
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   Boutons flottants : éviter le chevauchement

   Les deux occupent désormais le coin inférieur droit. Sur petit écran,
   l'appel aux dons reste en bas et le « retour en haut » se place
   juste au-dessus.

   « body #back-top » et non « #back-top » : backtop.js injecte son propre
   style dans le <head> à l'exécution, donc après cette feuille. À
   spécificité égale, c'est lui qui l'emporterait.
═══════════════════════════════════════════ */
@media (max-width: 767.98px) {
  /* 1,25rem de marge + 46px de bouton + 0,6rem d'écart */
  body #back-top { bottom: calc(1.25rem + 46px + 0.6rem); }
}

@media (max-width: 576px) {
  /* 0,75rem de marge + 40px de bouton + 0,5rem d'écart */
  body #back-top { bottom: calc(0.75rem + 40px + 0.5rem); }
}
