/* ==========================================================================
   ExpoBeton RDC - Section « Panelistes » (12eme edition)
   Carousel autonome (sans dependance JavaScript) branche sur la charte
   graphique du site : Rouge #c22439, Jaune #fdbd1b, Bleu #3da8e0,
   Bleu foncé #112bb5, police Archivo, angles carres.
   Fichier charge par paneliste/panelistes.php - ne depend d'aucune autre
   feuille de style du theme.
   ========================================================================== */

.panelistes-section {
    background: linear-gradient(180deg, #ffffff 0%, #f4f6fc 22%, #f4f6fc 100%);
    border-top: 1px solid rgba(17, 43, 181, 0.08);
    position: relative;
}

/* Ligne decorative reprise du losange ExpoBeton, en tete de section */
.panelistes-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #112bb5 0 34%, #c22439 34% 56%, #fdbd1b 56% 78%, #3da8e0 78% 100%);
}

.panelistes-subtitle {
    margin: 14px 0 0;
    font-family: 'Archivo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #5a5f77;
}

/* --------------------------------------------------------------------------
   1. Structure du carousel
   -------------------------------------------------------------------------- */
.pnl-carousel {
    position: relative;
    margin-top: 10px;
}

.pnl-viewport {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-inline: 0;
    padding: 10px 0 26px;
    /* La barre de defilement est retiree a l'ecran : la navigation se fait
       au geste, aux fleches ou au clavier. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pnl-viewport::-webkit-scrollbar {
    display: none;
}

.pnl-card {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e7eaf4;
    border-top: 5px solid #112bb5;
    box-shadow: 0 14px 34px rgba(17, 43, 181, 0.10);
    margin: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-top-color 0.35s ease;
}

.pnl-card:hover,
.pnl-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(17, 43, 181, 0.20);
    border-top-color: #fdbd1b;
}

/* Visuel de la carte : portrait decoupe dans l'affiche (ratio 2/3 identique a
   celui du fichier image, donc aucun recadrage cote navigateur). Le nom, la
   fonction et la societe sont rendus en vrai texte HTML en dessous ; l'affiche
   officielle complete reste accessible au clic (lightbox). */
.pnl-media {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #eef1f8;
    padding: 0;
    border: 0;
    width: 100%;
    cursor: zoom-in;
}

.pnl-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    display: block;
    transition: transform 0.6s ease;
}

.pnl-card:hover .pnl-media img {
    transform: scale(1.05);
}

/* Etiquette de categorie en haut a gauche : le haut du portrait est clair,
   elle ne masque ni le visage ni les informations de l'affiche. */
.pnl-media-tag {
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(17, 43, 181, 0.92);
    color: #fdbd1b;
    font-family: 'Archivo', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    padding: 6px 12px;
}

.pnl-expand {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #112bb5;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 13px;
    line-height: 1;
}

.pnl-card:hover .pnl-expand,
.pnl-expand:focus {
    opacity: 1;
    transform: translateY(0);
}

.pnl-expand:hover {
    background: #c22439;
    color: #fff;
}

/* Zone texte */
.pnl-info {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}

.pnl-nom {
    font-family: 'Archivo', sans-serif;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.18;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #112bb5;
    margin: 0;
}

.pnl-fonction {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #1a1a2e;
    margin: 0;
}

.pnl-organisation {
    margin-top: auto;
    padding-top: 12px;
}

.pnl-organisation span {
    display: inline-block;
    background: #f4f6fc;
    border-left: 3px solid #fdbd1b;
    color: #5a5f77;
    font-family: 'Archivo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 5px 10px;
}

/* --------------------------------------------------------------------------
   2. Barre de navigation
   -------------------------------------------------------------------------- */
.pnl-nav-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
}

.pnl-btn {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 0;
    background: #112bb5;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
}

.pnl-btn:hover {
    background: #c22439;
    transform: translateY(-2px);
}

.pnl-btn[disabled] {
    background: #c9cfe2;
    cursor: default;
    transform: none;
}

.pnl-btn-play {
    background: #fff;
    color: #112bb5;
    border: 1px solid #dfe3f0;
    font-size: 13px;
}

.pnl-btn-play:hover {
    background: #fdbd1b;
    color: #1a1a2e;
}

.pnl-progress {
    flex: 1 1 auto;
    height: 4px;
    background: #dfe3f0;
    overflow: hidden;
}

.pnl-progress-bar {
    height: 100%;
    width: 12%;
    background: linear-gradient(90deg, #112bb5, #3da8e0);
    transition: width 0.25s ease;
}

.pnl-counter {
    flex: 0 0 auto;
    font-family: 'Archivo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5a5f77;
    margin: 0;
}

.pnl-counter strong {
    color: #c22439;
}

.pnl-viewport:focus-visible,
.pnl-btn:focus-visible,
.pnl-expand:focus-visible,
.pnl-media:focus-visible {
    outline: 3px solid #fdbd1b;
    outline-offset: 2px;
}

/* Libelle destine aux lecteurs d'ecran. Definie localement (et non via la
   classe .sr-only du theme) : la section doit rester lisible meme sur une
   page qui ne chargerait pas Bootstrap. */
.pnl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   3. Boite d'agrandissement
   -------------------------------------------------------------------------- */
.pnl-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.pnl-modal.is-open {
    display: block;
}

.pnl-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 26, 107, 0.88);
}

.pnl-modal-dialog {
    position: relative;
    margin: 4vh auto 0;
    width: min(92vw, 620px);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-top: 6px solid #fdbd1b;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

/* L'affiche est plafonnee en hauteur pour que la legende reste visible sans
   faire defiler la boite. */
.pnl-modal-dialog img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 58vh;
    margin: 0 auto;
}

.pnl-modal-caption {
    padding: 18px 22px 24px;
}

.pnl-modal-caption .pnl-nom {
    font-size: 20px;
}

.pnl-modal-close {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: #112bb5;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.pnl-modal-close:hover {
    background: #c22439;
}

body.pnl-lock {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Points de rupture : 1, 2, 3 puis 4 cartes visibles
   -------------------------------------------------------------------------- */
@media (min-width: 576px) {
    .pnl-card {
        flex-basis: calc((100% - 22px) / 2);
    }
}

@media (min-width: 992px) {
    .pnl-card {
        flex-basis: calc((100% - 44px) / 3);
    }
}

@media (min-width: 1200px) {
    .pnl-card {
        flex-basis: calc((100% - 66px) / 4);
    }
    .pnl-nom {
        font-size: 16.5px;
    }
    .pnl-fonction {
        font-size: 13.5px;
    }
}

@media (max-width: 575px) {
    .pnl-viewport {
        gap: 14px;
    }
    /* Carte pleine largeur : on garde tete et epaules, la legende reste
       proche du pouce et les controles restent atteignables. */
    .pnl-media {
        aspect-ratio: 1 / 1;
    }
    .pnl-media img {
        object-position: 50% 18%;
    }
    .pnl-nav-bar {
        gap: 10px;
    }
    .pnl-btn {
        /* 44 px : taille minimale de cible tactile recommandee. */
        width: 44px;
        height: 44px;
    }
    .pnl-counter {
        font-size: 11.5px;
    }
}

/* --------------------------------------------------------------------------
   5. Mouvement reduit et impression
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .pnl-viewport {
        scroll-behavior: auto;
    }
    .pnl-card,
    .pnl-card:hover,
    .pnl-media img,
    .pnl-card:hover .pnl-media img,
    .pnl-progress-bar {
        transition: none;
        transform: none;
    }
}

@media print {
    .panelistes-section {
        background: #fff;
    }
    .pnl-viewport {
        overflow: visible;
        flex-wrap: wrap;
    }
    .pnl-nav-bar,
    .pnl-modal,
    .pnl-expand {
        display: none !important;
    }
}
