/* ==========================================================================
   Team Nephis — Dispositif en vol   ·   CSS mobile first
   Palette : navy #14204A · or #C9A961 · or foncé (texte) #B8952F
   ========================================================================== */

.tn-patrol {
    --gtn-navy: #14204A;
    --gtn-gold: #C9A961;
    --gtn-gold-dark: #B8952F;
    --gtn-sky: url("../img/fond.png");
    max-width: 1440px;
    margin: 0 auto;
    font-family: "Barlow", system-ui, -apple-system, sans-serif;
}


/* --- Mini-diagramme (mobile uniquement) --------------------------------- */

.tn-patrol-minimap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 8px;
    margin: 0 0 16px;
    padding: 18px 14px;
    border-radius: 14px;
    background: #EAF4FC var(--gtn-sky) center / cover no-repeat;
}

.tn-patrol-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #0E1B4D;
}

.tn-patrol-mini::before {
    content: "▲";
    font-size: 18px;
    line-height: 1;
    color: var(--gtn-navy);
}

.tn-patrol-mini.is-leader::before {
    content: "▲";
    font-size: 20px;
    color: var(--gtn-gold);
}

.tn-patrol-mini.is-vacant {
    font-weight: 600;
    color: rgba(20, 32, 74, .45);
}

.tn-patrol-mini.is-vacant::before {
    content: "△";
    color: rgba(20, 32, 74, .3);
}

.tn-patrol-mini.mini-1 {
    grid-column: 2 / span 2;
    grid-row: 1;
}

.tn-patrol-mini.mini-3 {
    grid-column: 1 / span 2;
    grid-row: 2;
}

.tn-patrol-mini.mini-2 {
    grid-column: 3 / span 2;
    grid-row: 2;
}

.tn-patrol-mini.mini-6 {
    grid-column: 1;
    grid-row: 3;
}

.tn-patrol-mini.mini-4 {
    grid-column: 2 / span 2;
    grid-row: 3;
}

.tn-patrol-mini.mini-5 {
    grid-column: 4;
    grid-row: 3;
}

.tn-patrol-mini.mini-7 {
    grid-column: 2;
    grid-row: 4;
}

.tn-patrol-mini.mini-8 {
    grid-column: 3;
    grid-row: 4;
}

/* --- Liste des postes (base mobile) ------------------------------------- */

.tn-patrol-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tn-patrol-slot {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    grid-template-areas:
        "plane position hours"
        "plane callsign hours"
        "plane nicename hours";
    align-items: center;
    column-gap: 4px;
    padding: 10px;
    border-radius: 12px;
    color: var(--gtn-navy);
}

.tn-patrol-slot.is-taken {
    border: 1px solid rgba(20, 32, 74, .12);
    background: #fff;
    box-shadow: 0 6px 16px rgba(20, 32, 74, .08);
}

.tn-patrol-slot.is-leader {
    border-color: var(--gtn-gold);
}

.tn-patrol-slot.is-vacant {
    border: 1px dashed rgba(20, 32, 74, .3);
    background: rgba(20, 32, 74, .03);
}

.tn-patrol-plane {
    grid-area: plane;
    display: block;
    width: 55px;
    height: 46px;
    object-fit: contain;
    animation: gtn-float 5.5s ease-in-out infinite;
}

.tn-patrol-slot.is-vacant .tn-patrol-plane {
    filter: grayscale(1);
    opacity: .3;
}

@keyframes gtn-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tn-patrol-plane {
        animation: none;
    }
}

.tn-patrol-position {
    grid-area: position;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gtn-gold-dark);
}

.tn-patrol-slot.is-vacant .tn-patrol-position {
    color: rgba(20, 32, 74, .5);
}

.tn-patrol-callsign {
    grid-area: callsign;
    margin-top: 2px;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--gtn-navy);
}

.tn-patrol-slot.is-leader .tn-patrol-callsign {
    font-weight: 800;
}

.tn-patrol-nicename {
    grid-area: nicename;
    font-size: 12px;
    color: rgba(20, 32, 74, .6);
}

.tn-patrol-vacant {
    grid-area: callsign;
    margin-top: 2px;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(20, 32, 74, .55);
}

.tn-patrol-hours {
    grid-area: hours;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    text-transform: uppercase;
    color: rgba(20, 32, 74, .4);
}

.tn-patrol-hours-label {
    font-size: 10px;
    letter-spacing: .1em;
}

.tn-patrol-hours-value {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--gtn-gold-dark);
}

.tn-patrol-apply {
    grid-area: hours;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--gtn-gold);
    background: transparent;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gtn-gold-dark);
    text-decoration: none;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.tn-patrol-apply:hover {
    background: rgba(201, 169, 97, .12);
    color: #8c7020;
}

.tn-patrol-apply:focus-visible {
    outline: 2px solid var(--gtn-gold);
    outline-offset: 2px;
}

/* --- Légende ------------------------------------------------------------ */

.tn-patrol-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    letter-spacing: .06em;
    color: rgba(20, 32, 74, .55);
}

.tn-patrol--dashboard .tn-patrol-legend {
    flex-direction: column;
    align-items: flex-start;
}

.tn-patrol-legend li {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
}

.tn-patrol-key {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 11px solid rgba(20, 32, 74, .2);
}

.tn-patrol-key--leader {
    border-bottom-color: var(--gtn-gold);
}

.tn-patrol-key--taken {
    border-bottom-color: var(--gtn-navy);
}

.tn-patrol-key--vacant {
    position: relative;
    border-bottom-color: rgba(20, 32, 74, .3);
}

.tn-patrol-key--vacant::after {
    content: "";
    position: absolute;
    top: 3px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 7px solid #fff;
}

.tn-patrol-count {
    width: 100%;
    color: rgba(20, 32, 74, .4);
}

/* --- Très petits écrans : heures sous la carte -------------------------- */

@media (max-width: 340px) {
    .tn-patrol-slot {
        grid-template-columns: 48px 1fr;
        grid-template-areas:
            "plane position"
            "plane callsign"
            "plane nicename"
            "hours hours";
    }

    .tn-patrol-plane {
        width: 48px;
        height: 38px;
    }

    .tn-patrol-hours {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid rgba(20, 32, 74, .12);
    }

    .tn-patrol-apply {
        margin-top: 10px;
    }
}

/* ==========================================================================
   Tablette et desktop : la liste redevient une formation en diamant
   ========================================================================== */

@media (min-width: 769px) {

    .tn-patrol-intro {
        max-width: 720px;
        margin-bottom: 24px;
        font-size: 16px;
        line-height: 1.65;
    }

    .tn-patrol-minimap {
        display: none;
    }

    .tn-patrol-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 16px 14px;
        padding: 34px 26px 38px;
        border: 1px solid rgba(20, 32, 74, .12);
        border-radius: 18px;
        background: #EAF4FC var(--gtn-sky) center / cover no-repeat;
        box-shadow: 0 18px 50px rgba(20, 32, 74, .18);
    }

    /* Chaque poste occupe 2 colonnes : le décalage d'une colonne fait le diamant */
    .pos-1 {
        grid-column: 3 / span 2;
        grid-row: 1;
    }

    /* Leader */
    .pos-3 {
        grid-column: 2 / span 2;
        grid-row: 2;
    }

    /* Intérieur gauche */
    .pos-2 {
        grid-column: 4 / span 2;
        grid-row: 2;
    }

    /* Intérieur droit */
    .pos-6 {
        grid-column: 1 / span 2;
        grid-row: 3;
    }

    /* Extérieur gauche */
    .pos-4 {
        grid-column: 3 / span 2;
        grid-row: 3;
    }

    /* Charognards */
    .pos-5 {
        grid-column: 5 / span 2;
        grid-row: 3;
    }

    /* Extérieur droit */
    .pos-7 {
        grid-column: 2 / span 2;
        grid-row: 4;
    }

    /* Leader solo */
    .pos-8 {
        grid-column: 4 / span 2;
        grid-row: 4;
    }

    /* Second solo */

    .tn-patrol-slot {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 18px 20px 16px;
        border-radius: 14px;
        text-align: left;
    }

    .tn-patrol-slot.is-taken {
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 14px 30px rgba(20, 32, 74, .18);
    }

    .tn-patrol-slot.is-leader {
        box-shadow: 0 14px 30px rgba(20, 32, 74, .22);
    }

    .tn-patrol-slot.is-vacant {
        background: rgba(255, 255, 255, .55);
    }

    .tn-patrol-plane {
        width: 100%;
        height: 62px;
        margin: 6px 0 4px;
        filter: drop-shadow(0 10px 14px rgba(20, 32, 74, .28));
    }

    .tn-patrol-slot.is-vacant .tn-patrol-plane {
        filter: grayscale(1);
    }

    /* Cycles décalés pour éviter un vol synchrone */
    .pos-1 .tn-patrol-plane {
        animation-duration: 6s;
    }

    .pos-2 .tn-patrol-plane {
        animation-duration: 6.5s;
        animation-delay: -1.2s;
    }

    .pos-3 .tn-patrol-plane {
        animation-duration: 7s;
        animation-delay: -.6s;
    }

    .pos-4 .tn-patrol-plane {
        animation-duration: 6.8s;
        animation-delay: -2s;
    }

    .pos-5 .tn-patrol-plane {
        animation-duration: 7.4s;
        animation-delay: -.9s;
    }

    .pos-6 .tn-patrol-plane {
        animation-duration: 7.5s;
        animation-delay: -1.6s;
    }

    .pos-7 .tn-patrol-plane {
        animation-duration: 6.6s;
        animation-delay: -2.4s;
    }

    .pos-8 .tn-patrol-plane {
        animation-duration: 7.2s;
        animation-delay: -.3s;
    }

    .tn-patrol-position {
        font-size: 8px;
        letter-spacing: .14em;
    }

    .tn-patrol-slot.is-leader .tn-patrol-position::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        margin-right: 8px;
        background: var(--gtn-gold);
        transform: rotate(45deg);
    }

    .tn-patrol-callsign {
        font-size: 19px;
        margin-top: 0;
    }

    .tn-patrol-nicename {
        font-size: 15px;
        margin-top: 2px;
    }

    .tn-patrol-vacant {
        font-size: 13px;
        letter-spacing: .1em;
    }

    .tn-patrol-hours {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px solid rgba(20, 32, 74, .12);
        text-align: left;
        font-size: 12px;
        color: rgba(20, 32, 74, .45);
    }

    .tn-patrol-hours-label {
        font-size: 12px;
    }

    .tn-patrol-hours-value {
        font-size: 12px;
    }

    .tn-patrol-apply {
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px solid rgba(20, 32, 74, .12);
    }

    .tn-patrol-apply {
        height: auto;
        padding: 0;
        border: 0;
        font-size: 12px;
        letter-spacing: .14em;
    }

    .tn-patrol-apply::after {
        content: " →";
    }

    .tn-patrol-apply:hover {
        background: none;
    }

    .tn-patrol-legend {
        gap: 10px;
        margin-top: 20px;
        font-size: 13px;
    }

    .tn-patrol-count {
        width: auto;
        margin-left: 0;
    }
}

@media (min-width: 1100px) {
    .tn-patrol-grid {
        gap: 22px 20px;
        padding: 54px 46px 58px;
    }

    .tn-patrol-plane {
        height: 78px;
    }

    .tn-patrol-slot.is-leader .tn-patrol-plane {
        height: 86px;
    }

    .tn-patrol-position {
        font-size: 11px;
        letter-spacing: .2em;
    }

    .tn-patrol-callsign {
        font-size: 22px;
    }

    .tn-patrol-slot.is-leader .tn-patrol-callsign {
        font-size: 24px;
    }
}

/* ==========================================================================
   Anciens pilotes
   ========================================================================== */

.tn-available-pilots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 1440px;
    margin: 0 auto;
}

.tn-pilot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.tn-pilot-card {
    padding: 18px;
    border: 1px solid rgba(20, 32, 74, .12);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(20, 32, 74, .08);
}

.tn-pilot-card-title {
    margin: 0 0 10px;
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #14204A;
}

.tn-pilot-card-info p {
    margin: 0 0 6px;
    font-size: 15px;
    color: rgba(20, 32, 74, .7);
}

.tn-pilot-card-info strong {
    font-weight: 600;
    color: #B8952F;
}

@media (min-width: 600px) {
    .tn-available-pilots {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 18px;
    }

    .tn-pilot-card {
        padding: 20px;
    }
}