/* =============================================================================
   MOBILE.CSS — Optimisation mobile / tablette (chargée en dernier)
   -----------------------------------------------------------------------------
   Toutes les règles de ce fichier sont sous media query : le rendu desktop
   (validé) n'est jamais touché. Trois paliers :
     - <= 991.98px : tablette + mobile (bascule de navigation, grilles)
     - <= 767.98px : mobile large
     - <= 575.98px : téléphone
   ========================================================================== */

/* ==========================================================================
   1. TIROIR DE NAVIGATION MOBILE
   Le menu responsive du thème (#mainMenu en accordéon dans le bandeau, texte
   sur dégradé, cibles tactiles de 20px, sous-menus inatteignables) est
   remplacé par le panneau #nc-mobile-nav (include/mobile-nav.php).
   ========================================================================== */

.nc-nav-toggle {
    display: none;
}

@media (max-width: 991.98px) {

    /* --- Neutralisation du menu responsive du thème --- */
    #header #mainMenu,
    #header #mainMenu-trigger,
    #header .header-extras {
        display: none !important;
    }

    /* --- Bouton burger --- */
    /* Les enfants du bandeau sont tous en position absolue côté thème : le
       conteneur a une hauteur nulle, d'où un ancrage vertical impossible. */
    #header .header-inner > .container {
        min-height: 80px;
    }

    /* Le thème étire #logo sur toute la largeur du bandeau : le lien « accueil »
       couvrait alors la barre entière et interceptait l'appui sur le burger. */
    #header #logo {
        width: auto !important;
        left: 0;
        right: auto;
        text-align: left;
    }

    #header #logo a {
        padding-left: 20px;
    }

    #header .nc-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        right: 9px;
        transform: translateY(-50%);
        width: 46px;
        height: 46px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: inherit;
        cursor: pointer;
        z-index: 5;
        -webkit-tap-highlight-color: transparent;
    }

    .nc-nav-toggle-bars {
        display: block;
        position: relative;
        width: 22px;
        height: 16px;
    }

    .nc-nav-toggle-bars > span {
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background-color: currentColor;
        transition: transform 0.28s ease, opacity 0.2s ease, width 0.28s ease;
    }

    .nc-nav-toggle-bars > span:nth-child(1) { top: 0; }
    .nc-nav-toggle-bars > span:nth-child(2) { top: 7px; width: 70%; }
    .nc-nav-toggle-bars > span:nth-child(3) { top: 14px; }

    .nc-nav-toggle:hover .nc-nav-toggle-bars > span:nth-child(2),
    .nc-nav-toggle.is-active .nc-nav-toggle-bars > span:nth-child(2) {
        width: 100%;
    }

    .nc-nav-toggle.is-active .nc-nav-toggle-bars > span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nc-nav-toggle.is-active .nc-nav-toggle-bars > span:nth-child(2) {
        opacity: 0;
    }

    .nc-nav-toggle.is-active .nc-nav-toggle-bars > span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Le header est blanc/translucide dès le premier pixel de scroll : le
       burger suit la même bascule de couleur que le logo et le menu. */
    #header.dark .nc-nav-toggle {
        color: #fff;
    }

    #header:not(.dark) .nc-nav-toggle {
        color: var(--color-blue-darker, #003d6e);
    }
}

/* --- Panneau --- */
.nc-mnav {
    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
}

.nc-mnav.is-open {
    visibility: visible;
    pointer-events: auto;
}

.nc-mnav-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 18, 36, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.nc-mnav.is-open .nc-mnav-backdrop {
    opacity: 1;
}

.nc-mnav-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 400px);
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: -18px 0 50px rgba(0, 24, 48, 0.22);
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.nc-mnav.is-open .nc-mnav-panel {
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .nc-mnav-panel,
    .nc-mnav-backdrop {
        transition: none;
    }
}

/* Blocage du défilement de la page pendant l'ouverture (le panneau garde son
   propre scroll interne). */
body.nc-mnav-locked {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

.nc-mnav-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
    padding: 0 12px 0 20px;
    border-bottom: 1px solid rgba(0, 24, 48, 0.08);
}

.nc-mnav-logo img {
    display: block;
    height: 30px;
    width: auto;
}

.nc-mnav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(0, 24, 48, 0.05);
    color: var(--color-blue-darker, #003d6e);
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nc-mnav-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 0 16px;
}

.nc-mnav-list,
.nc-mnav-sub ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nc-mnav-item + .nc-mnav-item {
    border-top: 1px solid rgba(0, 24, 48, 0.06);
}

.nc-mnav-row {
    display: flex;
    align-items: stretch;
}

/* Cible tactile de 56px minimum (recommandation iOS/Material) sur toute la
   largeur du panneau. Couleur/graisse alignées sur le menu desktop
   (#header:not(.dark) #mainMenu nav > ul > li > a, custom.css). */
.nc-mnav-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 10px 20px;
    font-size: 16.5px;
    font-weight: 500;
    line-height: 1.3;
    color: #5b6068;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.nc-mnav-link:active {
    background-color: rgba(0, 108, 166, 0.06);
}

.nc-mnav-item.is-current > .nc-mnav-row > .nc-mnav-link {
    color: var(--color-teal, #1d9c95);
}

.nc-mnav-expand {
    flex: 0 0 auto;
    width: 56px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(0, 24, 48, 0.4);
    font-size: 13px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nc-mnav-expand i {
    display: inline-block;
    transition: transform 0.25s ease;
}

.nc-mnav-expand[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.nc-mnav-sub {
    height: 0;
    overflow: hidden;
    transition: height 0.28s ease;
}

.nc-mnav-sub ul {
    padding: 2px 0 10px;
    margin: 0 20px 6px;
    border-left: 2px solid rgba(0, 108, 166, 0.14);
}

.nc-mnav-sub a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #5b6068;
    text-decoration: none;
}

.nc-mnav-sub li.is-current > a {
    color: var(--color-teal, #1d9c95);
    font-weight: 500;
}

.nc-mnav-foot {
    flex: 0 0 auto;
    padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 24, 48, 0.08);
    background-color: #fff;
}

.nc-mnav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    border-radius: 999px;
    background-image: linear-gradient(135deg, var(--color-teal, #1d9c95) 0%, var(--color-blue, #006ca6) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.nc-mnav-cta:hover,
.nc-mnav-cta:focus {
    color: #fff;
}

.nc-mnav-foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.nc-mnav-lang {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background-color: rgba(0, 24, 48, 0.06);
}

.nc-mnav-lang a {
    min-width: 52px;
    padding: 9px 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    color: #5b6068;
    text-decoration: none;
}

.nc-mnav-lang a.is-active {
    background-color: #fff;
    color: var(--color-blue-darker, #003d6e);
    box-shadow: 0 2px 6px rgba(0, 24, 48, 0.12);
}

.nc-mnav-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(0, 24, 48, 0.06);
    color: var(--color-blue-darker, #003d6e);
    font-size: 16px;
}

/* ==========================================================================
   2. CONFORT DE LECTURE : typographie et rythme vertical
   ========================================================================== */

@media (max-width: 991.98px) {

    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        font-size: 16px;
        line-height: 1.6;
    }

    p {
        line-height: 1.6;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Le thème empile des sections à 120-130px de padding : sur un écran de
       844px de haut, une section vide occupe déjà un tiers de l'écran. */
    section,
    section.p-t-120,
    section.p-b-120 {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .p-t-120 { padding-top: 64px; }
    .p-b-120 { padding-bottom: 64px; }
    .p-t-100 { padding-top: 56px; }
    .p-b-100 { padding-bottom: 56px; }
    .p-t-80  { padding-top: 48px; }
    .p-b-80  { padding-bottom: 48px; }
    .m-b-60  { margin-bottom: 36px; }
    .m-b-50  { margin-bottom: 32px; }
    .m-b-40  { margin-bottom: 28px; }

    h1, .h1 { font-size: 2rem; line-height: 1.15; }
    h2, .h2 { font-size: 1.75rem; line-height: 1.2; }
    h3, .h3 { font-size: 1.35rem; line-height: 1.3; }
    h4, .h4 { font-size: 1.15rem; line-height: 1.35; }

    /* Les titres légers (font-weight 300) tiennent mal en petit corps. */
    h1, h2, h3, .h1, .h2, .h3 {
        font-weight: 400;
    }

    .section-kicker {
        font-size: 0.78rem;
        letter-spacing: 1.4px;
        margin-bottom: 8px;
    }

    /* Les mots techniques longs (radiopharmaceutiques, théranostique...)
       débordent des colonnes étroites. */
    h1, h2, h3, h4, h5, p, li, dd, dt, blockquote, .lead {
        overflow-wrap: break-word;
        word-break: normal;
        hyphens: auto;
    }
}

@media (max-width: 575.98px) {

    body {
        font-size: 15.5px;
    }

    h1, .h1 { font-size: 1.8rem; }
    h2, .h2 { font-size: 1.6rem; }
    h3, .h3 { font-size: 1.25rem; }

    section {
        padding-top: 52px;
        padding-bottom: 52px;
    }
}

/* ==========================================================================
   3. CIBLES TACTILES ET FORMULAIRES
   ========================================================================== */

@media (max-width: 991.98px) {

    .btn,
    button:not(.nc-mnav-expand):not(.nc-nav-toggle):not(.nc-mnav-close),
    input[type="submit"] {
        min-height: 48px;
    }

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 24px;
        white-space: normal;
        text-align: center;
    }

    /* Un input sous 16px déclenche un zoom automatique sur iOS à la mise au
       point du champ. */
    input,
    select,
    textarea,
    .form-control {
        font-size: 16px;
    }

    .form-control {
        min-height: 50px;
    }

    textarea.form-control {
        min-height: 120px;
    }

    /* Le bouton "retour en haut" du thème chevauche les CTA de bas de page. */
    #scrollTop {
        width: 42px;
        height: 42px;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   4. LISIBILITÉ DES CARTES POSÉES SUR UNE IMAGE
   Sur petit écran la carte se raccourcit : le dégradé calibré pour 260-340px
   de haut ne couvre plus le texte, qui devient illisible sur la photo.
   ========================================================================== */

@media (max-width: 991.98px) {

    .activity-card-overlay {
        background: linear-gradient(180deg,
            rgba(0, 20, 40, 0.25) 0%,
            rgba(0, 20, 40, 0.62) 40%,
            rgba(0, 20, 40, 0.92) 100%);
    }

    .activity-card {
        min-height: 250px;
    }

    /* Sur une carte raccourcie, l'icône flottante recouvrait le titre : on la
       réduit et on garantit la hauteur nécessaire au-dessus du contenu. */
    .activity-card-icon {
        top: 16px;
        left: 16px;
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .activity-card-content {
        padding: 20px;
    }

    .activity-card-title,
    .activity-card-featured .activity-card-title {
        font-size: 19px;
    }

    .activity-card-text {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .home-info-tile-overlay {
        background: linear-gradient(180deg, rgba(0, 15, 30, 0.3) 0%, rgba(0, 15, 30, 0.9) 100%);
    }
}

/* Tablette : une seule colonne de cartes pleine largeur étire trop les
   visuels et allonge la page inutilement. */
@media (min-width: 576px) and (max-width: 991.98px) {

    .activities-secondary {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-info-tile {
        flex: 1 1 50%;
    }

    .home-info-tile-cta {
        flex-basis: 100%;
    }
}

/* ==========================================================================
   5. PAGE D'ACCUEIL
   ========================================================================== */

@media (max-width: 991.98px) {

    /* Tuiles de bas de page : hauteur réduite et texte resserré. */
    .home-info-tile {
        min-height: 260px;
    }

    .home-info-tile-body {
        padding: 26px 20px;
    }

    .home-info-tile-body h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    /* L'icône décorative en filigrane sortait du cadre par la droite. */
    .home-info-cta-icon {
        font-size: 6rem;
        top: -10px;
        right: 0;
    }

    .home-info-tile-cta .home-info-cta-heading {
        font-size: 1.6rem;
        gap: 14px;
    }

    .home-info-cta-arrow {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    /* Aperçu équipe : le "nuage" décalé créait de grands vides et un ruban
       de 8 écrans de haut. Grille régulière et compacte sur mobile. */
    .home-team-cloud {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        justify-items: center;
        margin-top: 26px;
    }

    .home-team-face,
    .home-team-face.size-sm,
    .home-team-face.size-md,
    .home-team-face.size-lg {
        width: 100%;
        max-width: 84px;
        height: auto;
        aspect-ratio: 1 / 1;
        margin-top: 0 !important;
    }

    /* Logos financeurs : grille alignée plutôt qu'un empilement irrégulier. */
    .home-partners-logos {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        align-items: center;
        justify-items: center;
        gap: 14px;
    }

    .home-partners-logos img {
        max-width: 100%;
        height: auto;
        max-height: 46px;
        object-fit: contain;
    }

    /* Bandeau de chiffres clés. */
    .home-stats-band {
        padding: 20px;
        margin-top: 32px;
        border-radius: 16px;
    }

    .home-stats-card {
        padding: 22px 18px 6px;
    }

    .home-stat {
        gap: 14px;
        margin-bottom: 16px;
    }

    .home-stat-icon {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }

    .home-stat-number {
        font-size: 1.5rem;
    }

    /* Liste d'études : le libellé de phase seul sur sa ligne gaspillait une
       ligne complète, on le remonte en surtitre compact. */
    .home-study-item {
        padding: 18px 0;
    }

    .home-study-phase {
        min-width: 0;
        font-size: 0.72rem;
    }

    .home-study-title {
        font-size: 1rem;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 575.98px) {

    .home-team-cloud {
        grid-template-columns: repeat(3, 1fr);
    }

    .home-partners-logos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   6. HERO DE PAGE ET FIL D'ARIANE
   ========================================================================== */

@media (max-width: 991.98px) {

    .page-hero {
        min-height: 62vh;
    }

    .page-hero-title,
    .page-hero h1 {
        font-size: 2rem;
        line-height: 1.1;
    }

    .page-hero-breadcrumb,
    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {

    .page-hero {
        min-height: 54vh;
    }

    .page-hero-title,
    .page-hero h1 {
        font-size: 1.75rem;
    }
}

/* ==========================================================================
   7. PAGE ÉTUDES CLINIQUES : barre de filtres
   Les trois contrôles + le compteur ne tiennent pas sur une ligne de 375px :
   le tri sortait du cadre. On passe en défilement horizontal façon "chips".
   ========================================================================== */

@media (max-width: 767.98px) {

    .etudes-toolbar,
    .etudes-filters {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        /* Débord volontaire jusqu'aux bords de l'écran : le dernier filtre
           « sort » du cadre, ce qui signale que la rangée se fait défiler. */
        margin-left: -20px;
        margin-right: -20px;
        padding: 0 20px 4px;
    }

    .etudes-toolbar::-webkit-scrollbar,
    .etudes-filters::-webkit-scrollbar {
        display: none;
    }

    .etudes-filter-dropdown,
    .etudes-sort-wrapper,
    .etudes-count {
        flex: 0 0 auto;
    }

    .etudes-filter-btn {
        white-space: nowrap;
        min-height: 44px;
    }

    .etudes-search input,
    .etudes-search-input {
        min-height: 50px;
    }
}

/* ==========================================================================
   8. PAGE ÉQUIPE
   Le ruban de portraits défile déjà horizontalement : on lui ajoute
   l'aimantation attendue d'un carrousel tactile.
   ========================================================================== */

@media (max-width: 991.98px) {

    .eq-band-track {
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
    }

    .eq-band-item {
        scroll-snap-align: center;
    }

    /* Les flèches précédent/suivant doublent un geste tactile évident et
       poussent le titre de section sur deux lignes. */
    .eq-band-nav {
        display: none;
    }
}

/* ==========================================================================
   9. PAGE LE KIOSQUE / ACTUALITÉS
   ========================================================================== */

@media (max-width: 767.98px) {

    .actu-featured-stack .actu-featured-media,
    .actu-featured-media {
        min-height: 200px;
    }

    .actu-featured-body,
    .actu-featured-stack .actu-featured-body {
        padding: 22px 20px 24px;
    }

    .actu-featured-body h2 {
        font-size: 20px;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    /* L'accroche complète poussait le lien « Lire l'article » hors du premier
       écran : trois lignes suffisent à donner envie de cliquer. */
    .actu-featured-body p {
        font-size: 14.5px;
        line-height: 1.6;
        margin-bottom: 16px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .actu-card-body {
        padding: 18px 18px 20px;
    }

    .actu-card-body h3 {
        font-size: 16.5px;
    }

    .kiosque-masthead-title {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   10. PIED DE PAGE
   ========================================================================== */

@media (max-width: 991.98px) {

    #footer .footer-content {
        padding-top: 44px;
        padding-bottom: 24px;
    }

    #footer .footer-col {
        margin-bottom: 28px;
    }

    #footer .footer-col-left img {
        max-width: 180px;
        height: auto;
    }

    /* Trois listes empilées faisaient défiler l'équivalent de deux écrans :
       deux colonnes suffisent et restent lisibles. */
    #footer .footer-nav-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 20px;
    }

    #footer .footer-nav-section h5 {
        margin-bottom: 4px;
    }

    #footer .footer-nav-section li {
        margin-bottom: 0;
    }

    #footer .footer-nav-section ul li a {
        display: inline-block;
        padding: 8px 0;
        font-size: 14px;
        line-height: 1.3;
    }

    #footer .footer-col-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    #footer .footer-social {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    #footer .footer-social .social-icons {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #footer .footer-bottom {
        padding-top: 16px;
        text-align: center;
    }
}

@media (max-width: 380px) {

    #footer .footer-nav-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   11. DIVERS : débordements horizontaux résiduels
   ========================================================================== */

@media (max-width: 991.98px) {

    /* Filet de sécurité : aucune barre de défilement horizontale sur le site. */
    html,
    body {
        overflow-x: hidden;
    }

    img,
    svg,
    video,
    iframe,
    table {
        max-width: 100%;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Les grilles à gouttières négatives du thème dépassent quand le container
       est déjà réduit à 20px de marge. */
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    .cta-banner {
        padding: 56px 0;
    }

    .quote-break {
        min-height: 320px;
    }
}
