/* =====================================================================
   dirigeants_pc.css — navigation PC dans les predecesseurs
   (page dirigeants.php). Charge APRES dirigeants.css.

   Tout ce qui change l'affichage est confine a min-width: 769px :
   la vue mobile (<= 768px) reste strictement celle de dirigeants.css.
   Les seuls styles hors media query MASQUENT les nouveaux elements.
   ===================================================================== */

.pred-toolbar,
.pred-frise {
    display: none;
}

@media (min-width: 769px) {

    /* --- Barre d'outils : titre, aide, recherche ------------------- */
    .pred-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        position: relative;
        z-index: 30;
        /* aligne sur le carrousel : chevron 44px + espace 15px */
        margin: 4px 59px 0 59px;
    }

    .pred-title {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #00507D;
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        white-space: nowrap;
    }
    .pred-title svg {
        width: 18px;
        height: 18px;
        color: #FF6A00;
    }
    .pred-count {
        background: #FF6A00;
        color: #ffffff;
        border-radius: 999px;
        padding: 2px 9px;
        font-size: 0.72rem;
        letter-spacing: 0;
    }

    .pred-tools {
        display: flex;
        align-items: center;
        gap: 14px;
        min-width: 0;
    }

    .pred-hint {
        display: flex;
        align-items: center;
        gap: 4px;
        color: #7a8a96;
        font-size: 0.72rem;
        white-space: nowrap;
    }
    .pred-hint kbd {
        font-family: inherit;
        font-size: 0.68rem;
        line-height: 1.5;
        color: #00507D;
        background: #ffffff;
        border: 1px solid #d5e0e7;
        border-bottom-width: 2px;
        border-radius: 4px;
        padding: 0 5px;
    }

    .pred-search {
        position: relative;
        width: 260px;
        flex-shrink: 1;
        min-width: 180px;
    }
    .pred-search > svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        color: #7a8a96;
        pointer-events: none;
    }
    .pred-search input {
        width: 100%;
        height: 36px;
        box-sizing: border-box;
        padding: 0 14px 0 36px;
        border: 1.5px solid #e0e8ed;
        border-radius: 999px;
        background: #ffffff;
        color: #00507D;
        font: inherit;
        font-size: 0.85rem;
        outline: none;
        box-shadow: 0 2px 8px rgba(0, 80, 125, 0.06);
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .pred-search input::placeholder {
        color: #9aa9b4;
    }
    .pred-search input:focus {
        border-color: #00507D;
        box-shadow: 0 0 0 3px rgba(0, 80, 125, 0.12);
    }

    .pred-results {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        width: 330px;
        max-height: 360px;
        overflow-y: auto;
        margin: 0;
        padding: 6px;
        list-style: none;
        text-align: left;
        background: #ffffff;
        border: 1px solid #e6edf2;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(0, 40, 70, 0.18);
    }
    .pred-results[hidden] {
        display: none;
    }
    .pred-results li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 7px 8px;
        border-radius: 8px;
        cursor: pointer;
    }
    .pred-results li[data-i]:hover,
    .pred-results li.is-sel {
        background: #f0f6fa;
    }
    .pred-results li img {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        border-radius: 50%;
        object-fit: cover;
        background: #F2F8FB;
    }
    .pred-results li > span {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .pred-results .r-name {
        color: #00507D;
        font-size: 0.85rem;
        font-weight: 800;
        text-transform: uppercase;
    }
    .pred-results .r-name span {
        color: #555555;
        font-weight: 400;
        text-transform: none;
    }
    .pred-results .r-meta {
        color: #FF6A00;
        font-size: 0.7rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pred-results .r-empty,
    .pred-results .r-more {
        color: #7a8a96;
        font-size: 0.78rem;
        cursor: default;
    }

    /* --- Bloc predecesseurs : defile avec la page ------------------
       dirigeants.css le rend sticky en pred-mode (fige a sa position
       de depart pendant le defilement vertical). Avec la frise, ce
       bloc fige donnait l'impression d'etre colle a l'ecran pendant
       que la page remontait : on revient a un defilement normal. */
    /* !important : neutralise aussi un eventuel "top" ecrit en inline
       par l'ancien script d'epinglage (sinon le bloc serait decale
       vers le bas de toute la hauteur de l'en-tete). */
    body.pred-mode .predecessors {
        position: relative !important;
        top: auto !important;
    }

    /* L'en-tete du dirigeant (z-index 100 dans dirigeants.css) passait
       PAR-DESSUS la barre de navigation (100) et le bandeau d'actualites
       (99) quand on fait defiler la page : on le place en dessous. */
    .sticky-header {
        z-index: 80;
    }

    /* --- Carrousel ------------------------------------------------- */
    .carousel-section {
        margin: 0 auto 6px auto;
    }
    .carousel-track {
        /* reference des offsetLeft des cartes pour le JS */
        position: relative;
        /* le defilement fluide est gere par le JS */
        scroll-behavior: auto;
    }
    .carousel-btn.is-disabled {
        opacity: 0.35;
        pointer-events: none;
        box-shadow: none;
    }
    .carousel-card.is-target {
        animation: predTarget 2.2s ease;
    }
    @keyframes predTarget {
        0%, 60% { box-shadow: 0 0 0 3px #FF6A00, 0 12px 25px rgba(255, 106, 0, 0.25); }
        100%    { box-shadow: 0 4px 15px rgba(0, 80, 125, 0.08); }
    }

    /* --- Frise des mandats ----------------------------------------- */
    .pred-frise {
        display: block;
        margin: 0 59px 24px 59px;
        padding: 9px 18px 8px 18px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 14px;
        box-shadow: 0 4px 15px rgba(0, 80, 125, 0.08);
        user-select: none;
        text-align: left;
    }

    .frise-head {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 4px;
        color: #7a8a96;
        font-size: 0.7rem;
    }
    .frise-head > span:first-child {
        color: #00507D;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .frise-head strong {
        color: #00507D;
    }

    .frise-rail {
        position: relative;
        height: 44px;
        cursor: pointer;
        touch-action: none;
    }
    .frise-rail::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 15px;
        height: 4px;
        border-radius: 2px;
        background: #e6edf2;
    }

    .frise-ticks {
        position: absolute;
        inset: 0;
        pointer-events: none;
    }
    .frise-tick {
        position: absolute;
        top: 11px;
        width: 1px;
        height: 12px;
        background: #c3d2dc;
        transform: translateX(-0.5px);
    }
    .frise-tick.is-major {
        top: 8px;
        height: 18px;
        background: #8fa6b6;
    }
    .frise-tick.in-view {
        background: #00507D;
    }
    .frise-tick.is-match {
        top: 5px;
        width: 2px;
        height: 24px;
        background: #FF6A00;
        z-index: 2;
    }
    .frise-tick.is-hover {
        width: 2px;
        background: #FF6A00;
        z-index: 3;
    }
    .frise-label {
        position: absolute;
        top: 21px;
        left: 50%;
        transform: translateX(-50%);
        color: #7a8a96;
        font-size: 0.62rem;
        font-weight: 600;
        white-space: nowrap;
    }

    .frise-thumb {
        position: absolute;
        top: 4px;
        height: 26px;
        box-sizing: border-box;
        border: 2px solid #00507D;
        border-radius: 8px;
        background: rgba(0, 80, 125, 0.08);
        cursor: grab;
        transition: background 0.2s ease;
        z-index: 1;
    }
    .frise-thumb:hover,
    .is-scrubbing .frise-thumb {
        background: rgba(0, 80, 125, 0.16);
    }
    .is-scrubbing .frise-rail,
    .is-scrubbing .frise-thumb {
        cursor: grabbing;
    }

    .frise-tip {
        position: absolute;
        bottom: calc(100% + 6px);
        left: 0;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 12px 6px 6px;
        background: #0b2d4a;
        color: #ffffff;
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        font-size: 0.75rem;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.12s ease;
        z-index: 5;
    }
    .frise-tip.is-on {
        opacity: 1;
    }
    .frise-tip img {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 2px solid #ffffff;
        object-fit: cover;
    }
    .frise-tip b {
        display: block;
        font-size: 0.78rem;
        text-transform: uppercase;
    }
    .frise-tip small {
        color: #ffb27a;
        font-size: 0.68rem;
    }

    .frise-ends {
        display: flex;
        justify-content: space-between;
        margin-top: 1px;
        color: #a0afba;
        font-size: 0.6rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
}

/* Peu de predecesseurs, tout tient a l'ecran (classe posee par le JS) */
@media (min-width: 769px) {
    .pred-fits .pred-frise,
    .pred-fits .pred-hint,
    .pred-fits .pred-search {
        display: none;
    }
    .pred-fits .pred-toolbar {
        margin-bottom: 4px;
    }
}

/* Ecran PC etroit : l'aide clavier cede la place a la recherche */
@media (min-width: 769px) and (max-width: 1100px) {
    .pred-hint {
        display: none;
    }
}
