/*
 * UAJRP CONNECT — Correctifs responsivité mobile
 * Appliqué globalement sur toutes les pages internes.
 * Breakpoints : 480px (très petit), 640px (petit), 768px (tablette)
 */

/* ══════════════════════════════════════════════
   1. HERO SECTIONS — Padding excessif sur mobile
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .pt-hero, .about-hero, .ct-hero, .gov-hero,
  .cm-hero, .fp-hero, .ml-hero, .pc-hero,
  .op-hero, .an-hero, .ibi-banner,
  [class$="-hero"], [class*="-hero "] {
    padding-top: 2.5rem !important;
    padding-bottom: 2rem !important;
  }
  .pt-hero-content, .about-hero-content, .ct-hero-content,
  .gov-hero-content, .cm-hero-content, .fp-hero-content,
  .ml-hero-content, .pc-hero-content, .op-hero-content,
  .an-hero-content {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* ══════════════════════════════════════════════
   2. GRILLES — Sauts trop brusques
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Gouvernance */
  .bureau-grid, .commission-grid, .assoc-grid,
  .identity-grid, .values-grid,
  /* A propos */
  .history-grid,
  /* Partenaires rejoindre */
  .pt-benefits-grid, .pt-checkbox-grid,
  /* Annonceurs */
  .an-grid-formules, .an-stats {
    grid-template-columns: 1fr !important;
  }

  /* Opportunités */
  .op-grid { grid-template-columns: 1fr !important; }

  /* Carte membre */
  .adv-grid, .specimen-features { grid-template-columns: 1fr !important; }

  /* Partenaires rejoindre — checkboxes 2 cols minimum */
  .pt-checkbox-grid { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 480px) {
  /* checkboxes : 1 col sur très petit écran */
  .pt-checkbox-grid { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════════
   3. PARTENAIRE.PHP — Hero grid & sidebar
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .fp-hero-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
  .fp-logo {
    width: 110px !important;
    height: 110px !important;
    margin: 0 auto !important;
  }
  .fp-hero-actions {
    flex-direction: column !important;
    align-items: center !important;
  }
  .fp-grid {
    grid-template-columns: 1fr !important;
  }
  .fp-aside {
    width: 100% !important;
  }
}

/* ══════════════════════════════════════════════
   4. MENTIONS LÉGALES — Label fixe 220px
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .ml-row {
    flex-direction: column !important;
  }
  .ml-label {
    flex: none !important;
    width: 100% !important;
    font-weight: 700;
  }
  .ml-quote {
    padding: .85rem 1rem !important;
  }
  .ml-prose ul {
    padding-left: 1rem !important;
  }
}

/* ══════════════════════════════════════════════
   5. CONTACT.PHP — Carte et carte map
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ct-grid {
    grid-template-columns: 1fr !important;
  }
  .ct-form-card {
    padding: 1.25rem 1rem !important;
  }
}
@media (max-width: 640px) {
  .ct-map iframe {
    height: 220px !important;
  }
  .ct-info-item {
    padding: .75rem !important;
  }
}

/* ══════════════════════════════════════════════
   6. POLITIQUE CONFIDENTIALITÉ — Tables & TOC
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .pc-toc ol {
    grid-template-columns: 1fr !important;
  }
  .pc-table {
    font-size: .78rem !important;
  }
  .pc-table td, .pc-table th {
    padding: .45rem .55rem !important;
  }
  .pc-highlight {
    padding: .85rem 1rem !important;
  }
  .pc-contact-card {
    padding: 1.25rem 1rem !important;
  }
  /* Scroll horizontal pour tables larges */
  .pc-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ══════════════════════════════════════════════
   7. OPPORTUNITÉS — Card head & meta
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .op-card-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .4rem !important;
  }
  .op-meta {
    flex-wrap: wrap !important;
    gap: .4rem !important;
  }
  .op-type {
    padding: .3rem .6rem !important;
  }
}

/* ══════════════════════════════════════════════
   8. ANNONCEURS — Stats & formulaire ville/pays
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .an-stats {
    grid-template-columns: 1fr 1fr !important;
  }
  .an-formule-card {
    padding: 1.5rem 1rem !important;
  }
  /* Inline flex ville/pays → colonne */
  .an-form-inline {
    flex-direction: column !important;
  }
}

/* ══════════════════════════════════════════════
   9. GOUVERNANCE — Organigramme & cartes bureau
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .org-branch {
    gap: 1rem !important;
  }
  .org-branch::before {
    display: none !important;
  }
  .bureau-card-photo {
    width: 90px !important;
    height: 90px !important;
  }
}

/* ══════════════════════════════════════════════
   10. CARTE MEMBRE — Specimen & preview
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .card-preview-wrap {
    max-width: 100% !important;
    padding: 0 .5rem !important;
  }
  .form-wrap {
    padding: 1.5rem 1rem !important;
  }
  .form-row-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════
   11. À PROPOS — Identity card featured
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .identity-card-featured {
    grid-column: span 1 !important;
  }
  .history-visual {
    aspect-ratio: 16/9 !important;
  }
}

/* ══════════════════════════════════════════════
   12. GLOBAL — Paddings sections internes
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {
  .pt-benefits, .pt-section, .pt-cta,
  .fp-body, .ml-body, .pc-body,
  .ct-body, .gov-body, .op-body, .an-body {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  /* Conteneurs génériques */
  .mw-7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Formulaires génériques */
  .pt-form, .ct-form-card, .an-form-card {
    padding: 1.25rem 1rem !important;
    border-radius: .75rem !important;
  }

  /* Boutons côte à côte → colonne */
  .pt-cta-actions, .fp-hero-actions,
  .ct-actions, .an-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .6rem !important;
  }
  .pt-cta-actions .cta-btn,
  .fp-hero-actions .fp-btn-primary,
  .fp-hero-actions .fp-btn-secondary {
    width: 100% !important;
    justify-content: center !important;
  }
}
