/* ==================================================
   UGCS — PALMARÈS
   ================================================== */

.ugcs-palmares {
    width: 100%;
    max-width: 1440px;
    margin: 48px auto 0;
    padding: 0;

    font-family: var(--global-body-font-family);

    color: #10162F;
}


/* ==================================================
   EN-TÊTE DU MODULE
   ================================================== */

.ugcs-palmares__header {
    margin-bottom: 34px !important;
}


/* ==================================================
   TITRE
   ================================================== */

/*
 * Typographie laissée à Kadence (Customizer, seule source de vérité) ;
 * restent l'espacement (!important : piège des marges du thème sur
 * the_content), la couleur et les majuscules (signature UGCS). Trait
 * violet = ::after commun de .ugcs-titre-signe (assets/css/titres.css
 * du thème kadence-ugcs), à la place de l'ancien span
 * .ugcs-palmares__title-line (54 × 4 arrondi, en #A95BC2 hors charte).
 */
.ugcs-palmares__title {
    margin: 0 !important;

    color: #10162F;

    text-transform: uppercase;
}


/* ==================================================
   CHAPEAU
   ================================================== */

.ugcs-palmares__intro {
    max-width: 900px;

    margin: 23px 0 0 !important;

    font-size: 18px;
    line-height: 1.55;

    font-weight: 400;

    color: #34384B;
}


/* ==================================================
   SAISON
   ================================================== */

.ugcs-palmares__season {
    display: flex;

    align-items: center;

    gap: 11px;

    font-size: 20px;
    line-height: 1.2;

    font-weight: 700;

    color: #5B2167;
}


.ugcs-palmares__barre-outils {
    display: flex;

    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 16px;

    margin-bottom: 26px;
}


.ugcs-palmares__recherche-competiteur {
    position: relative;

    max-width: 420px;

    margin-bottom: 20px;
}

.ugcs-palmares__barre-outils .ugcs-palmares__recherche-competiteur {
    flex: 1 1 320px;
    margin-bottom: 0;
}

.ugcs-palmares__recherche-competiteur-boite {
    display: flex;
    align-items: stretch;

    height: 46px;

    border: 1px solid #DDD7E1 !important;
    border-radius: 8px;

    background-color: #FFFFFF;

    transition: border-color .2s ease, box-shadow .2s ease;
}

.ugcs-palmares__recherche-competiteur-boite:focus-within {
    border-color: #5B2167;

    box-shadow: 0 0 0 3px rgba(91, 33, 103, .10);
}

.ugcs-palmares__recherche-competiteur-boite svg {
    flex: 0 0 auto;

    align-self: center;

    margin-left: 16px;
    margin-right: 4px;

    color: #8A8F9F;

    pointer-events: none;
}

.ugcs-palmares__recherche-competiteur-champ {
    box-sizing: border-box !important;

    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;

    flex: 1 1 auto;
    min-width: 0;

    height: 100% !important;

    padding: 0 10px !important;
    margin: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;

    background-color: transparent !important;
    background-image: none !important;
    color: #10162F;

    font-family: var(--global-body-font-family);
    font-size: 15px;
    line-height: normal;
}

.ugcs-palmares__recherche-competiteur-champ::-webkit-search-decoration,
.ugcs-palmares__recherche-competiteur-champ::-webkit-search-cancel-button,
.ugcs-palmares__recherche-competiteur-champ::-webkit-search-results-button,
.ugcs-palmares__recherche-competiteur-champ::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.ugcs-palmares__recherche-competiteur-champ:focus {
    outline: 0;
}

.ugcs-palmares__recherche-competiteur-champ::placeholder {
    color: #8A8F9F;
}

.ugcs-palmares__recherche-competiteur-bouton {
    flex: 0 0 auto;

    padding: 0 18px;
    margin: 0;

    border: 0;
    border-left: 1px solid #DDD7E1;
    border-radius: 0 7px 7px 0;

    background-color: #5B2167;
    color: #FFFFFF;

    font-family: var(--global-body-font-family);
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: background-color .2s ease;
}

.ugcs-palmares__recherche-competiteur-bouton:hover,
.ugcs-palmares__recherche-competiteur-bouton:focus {
    background-color: #A35BB5;
}


.ugcs-palmares__season-icon {
    width: 26px;
    height: 26px;

    flex: 0 0 26px;

    color: #A35BB5; /* charte — jamais #A95BC2 */
}

/* Sélecteur de saison (mode automatique) */

.ugcs-palmares__season-select {
    padding: 6px 32px 6px 12px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    color: #5B2167;

    background-color: #F4EEF6;
    border: 1px solid #E3D9E7;
    border-radius: 8px;

    cursor: pointer;
}


/* ==================================================
   CONTENEUR TABLEAU
   ================================================== */

.ugcs-palmares__table-wrapper {
    width: 100%;
    position: relative;

    overflow: hidden;

    background-color: #FFFFFF;

    border: 1px solid #E3D9E7;

    border-radius: 14px;
}

.ugcs-palmares__table-wrapper.is-loading {
    opacity: .5;
}


/* ==================================================
   TABLEAU
   ================================================== */

.ugcs-palmares__table {
    width: 100%;

    margin: 0;

    border: 0;

    border-collapse: collapse;
    border-spacing: 0;

    table-layout: fixed;

    background-color: #FFFFFF;
}


/* ==================================================
   LARGEUR DES COLONNES
   ================================================== */

.ugcs-palmares__table th:nth-child(1),
.ugcs-palmares__table td:nth-child(1) {
    width: 24%;
}


.ugcs-palmares__table th:nth-child(2),
.ugcs-palmares__table td:nth-child(2) {
    width: 28%;
}


.ugcs-palmares__table th:nth-child(3),
.ugcs-palmares__table td:nth-child(3) {
    width: 18%;
}


.ugcs-palmares__table th:nth-child(4),
.ugcs-palmares__table td:nth-child(4) {
    width: 30%;
}


/* Tableau à 5 colonnes (recherche toutes saisons) : largeurs
   dédiées, Niveau et Compétiteurs privilégiées comme colonnes les
   plus importantes ; Saison et Classement resserrées. */
.ugcs-palmares__table--avec-saison th:nth-child(1),
.ugcs-palmares__table--avec-saison td:nth-child(1) {
    width: 12%;
}

.ugcs-palmares__table--avec-saison th:nth-child(2),
.ugcs-palmares__table--avec-saison td:nth-child(2) {
    width: 24%;
}

.ugcs-palmares__table--avec-saison th:nth-child(3),
.ugcs-palmares__table--avec-saison td:nth-child(3) {
    width: 28%;
}

.ugcs-palmares__table--avec-saison th:nth-child(4),
.ugcs-palmares__table--avec-saison td:nth-child(4) {
    width: 14%;
}

.ugcs-palmares__table--avec-saison th:nth-child(5),
.ugcs-palmares__table--avec-saison td:nth-child(5) {
    width: 22%;
}


/* Tableau de classement (Rang / Compétiteur / Podiums /
   Compétitions) : Rang resserré, Compétiteur privilégié, Podiums
   et Compétitions à largeur strictement identique. */
.ugcs-palmares__table--classement th:nth-child(1),
.ugcs-palmares__table--classement td:nth-child(1) {
    width: 10%;
}

.ugcs-palmares__table--classement th:nth-child(2),
.ugcs-palmares__table--classement td:nth-child(2) {
    width: 40%;
}

.ugcs-palmares__table--classement th:nth-child(3),
.ugcs-palmares__table--classement td:nth-child(3),
.ugcs-palmares__table--classement th:nth-child(4),
.ugcs-palmares__table--classement td:nth-child(4) {
    width: 25%;
}


/* ==================================================
   EN-TÊTE DU TABLEAU
   ================================================== */

.ugcs-palmares__table thead {
    background-color: #F4EEF6;
}


.ugcs-palmares__table th {
    padding: 22px 28px;

    border: 0;

    text-align: left;

    vertical-align: middle;

    font-size: 15px;
    line-height: 1.3;

    font-weight: 700;

    color: #5B2167;

    text-transform: uppercase;

    letter-spacing: 0.01em;
}


/* ==================================================
   LIGNES ALTERNÉES
   ================================================== */

.ugcs-palmares__table tbody tr:nth-child(odd) {
    background-color: #FFFFFF;
}


.ugcs-palmares__table tbody tr:nth-child(even) {
    background-color: #F8F4FA;
}


/* ==================================================
   CELLULES
   ================================================== */

.ugcs-palmares__table td {
    padding: 28px;

    border: 0;

    border-top: 1px solid #E7E2E9;

    text-align: left;

    vertical-align: middle;

    font-size: 17px;
    line-height: 1.5;

    color: #10162F;
}


/* Séparateurs verticaux */

.ugcs-palmares__table th + th,
.ugcs-palmares__table td + td {
    border-left: 1px solid #E7E2E9;
}


/* ==================================================
   NIVEAU
   ================================================== */

.ugcs-palmares__table td:first-child strong {
    font-size: 17px;
    line-height: 1.4;

    font-weight: 700;

    color: #10162F;
}


/* ==================================================
   COMPÉTITEURS
   ================================================== */

.ugcs-palmares__gymnasts {
    display: flex;

    flex-direction: column;

    gap: 3px;

    margin: 0 !important;

    padding: 0 !important;

    list-style: none !important;
}


.ugcs-palmares__gymnasts li {
    margin: 0 !important;

    padding: 0 !important;

    font-size: 17px;
    line-height: 1.4;
}


/* ==================================================
   CLASSEMENT
   ================================================== */

.ugcs-palmares__ranking {
    display: flex;

    align-items: baseline;

    flex-wrap: wrap;

    gap: 5px;

    margin: 0 !important;
    padding: 0 !important;

    white-space: nowrap;
}


/* Largeur toujours réservée (que la médaille soit présente ou non),
   pour que le chiffre du classement s'aligne verticalement sur toutes
   les lignes, avec ou sans médaille. */
.ugcs-palmares__medal {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 20px;
    width: 20px;

    font-size: 16px;
    line-height: 1;
}
/* Masqué visuellement, mais lisible par un lecteur d'écran — la
   médaille (or/argent/bronze) est annoncée en plus du chiffre, sans
   ajouter d'icône visible ni décaler l'alignement des chiffres. */
.ugcs-palmares .screen-reader-text {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


.ugcs-palmares__ranking strong {
    font-size: 21px;
    line-height: 1;

    font-weight: 700;

    color: #5B2167;
}


.ugcs-palmares__ranking sup {
    position: relative;

    top: -0.2em;

    font-size: 58%;
}


.ugcs-palmares__ranking span {
    font-size: 17px;

    color: #34384B;
}


/* ==================================================
   COMPÉTITION
   ================================================== */

.ugcs-palmares__competition {
    display: flex;

    flex-direction: column;

    gap: 5px;
}


.ugcs-palmares__competition strong {
    font-size: 17px;
    line-height: 1.35;

    font-weight: 600;

    color: #10162F;
}


.ugcs-palmares__competition-link {
    text-decoration: none;
}

.ugcs-palmares__competition-link strong {
    color: #5B2167;
}

.ugcs-palmares__competition-link:hover strong,
.ugcs-palmares__competition-link:focus strong {
    text-decoration: underline;
}


.ugcs-palmares__competition-meta {
    font-size: 16px;
    line-height: 1.45;

    color: #55596A;
}


/* ==================================================
   AUCUN RÉSULTAT
   ================================================== */

.ugcs-palmares__empty {
    padding: 40px 28px;

    text-align: center;

    font-size: 16px;

    color: #55596A;
}


/* ==================================================
   SURVOL
   ================================================== */

@media (hover: hover) {

    .ugcs-palmares__table tbody tr {
        transition: background-color 0.18s ease;
    }


    .ugcs-palmares__table tbody tr:hover {
        background-color: #F1E8F4;
    }

}


/* ==================================================
   TABLETTE
   ================================================== */

@media (max-width: 1024px) {

    .ugcs-palmares__intro {
        font-size: 17px;
    }


    .ugcs-palmares__season {
        font-size: 18px;
    }


    .ugcs-palmares__table {
        table-layout: auto;
    }


    .ugcs-palmares__table th,
    .ugcs-palmares__table td {
        padding: 20px;
    }


    .ugcs-palmares__table th {
        font-size: 13px;
    }


    .ugcs-palmares__table td,
    .ugcs-palmares__table td:first-child strong,
    .ugcs-palmares__gymnasts li,
    .ugcs-palmares__competition strong {
        font-size: 15px;
    }


    .ugcs-palmares__competition-meta,
    .ugcs-palmares__ranking span {
        font-size: 14px;
    }


    .ugcs-palmares__ranking strong {
        font-size: 18px;
    }

}


/* ==================================================
   SMARTPHONE
   ================================================== */

@media (max-width: 767px) {

    .ugcs-palmares__header {
        margin-bottom: 26px !important;
    }


    .ugcs-palmares__intro {
        margin-top: 18px !important;

        font-size: 16px;
        line-height: 1.5;
    }


    .ugcs-palmares__barre-outils {
        flex-direction: column;
        align-items: stretch;

        gap: 14px;

        margin-bottom: 18px;
    }


    .ugcs-palmares__season {
        font-size: 17px;
    }


    .ugcs-palmares__recherche-competiteur {
        max-width: none;
    }


    .ugcs-palmares__barre-outils .ugcs-palmares__recherche-competiteur {
        flex: 1 1 auto;
    }


    .ugcs-palmares__season-icon {
        width: 22px;
        height: 22px;

        flex-basis: 22px;
    }


    /* ==================================================
       TABLEAU → CARTES
       ================================================== */

    .ugcs-palmares__table-wrapper {
        overflow: hidden;

        border: 1px solid #E3D9E7;

        border-radius: 12px;

        background-color: transparent;
    }


    .ugcs-palmares__table,
    .ugcs-palmares__table tbody,
    .ugcs-palmares__table tr,
    .ugcs-palmares__table td {
        display: block;

        width: 100%;
    }


    /* Neutralise les largeurs de colonnes fixes du tableau desktop
       (table-layout: fixed + width en % par colonne) : sans ce
       correctif, leur spécificité (nth-child) l'emporte malgré le
       "width: 100%" ci-dessus, et la colonne "Compétition" reste
       coincée à 30% de large, faisant retourner le texte mot par mot. */
    .ugcs-palmares__table th:nth-child(1),
    .ugcs-palmares__table td:nth-child(1),
    .ugcs-palmares__table th:nth-child(2),
    .ugcs-palmares__table td:nth-child(2),
    .ugcs-palmares__table th:nth-child(3),
    .ugcs-palmares__table td:nth-child(3),
    .ugcs-palmares__table th:nth-child(4),
    .ugcs-palmares__table td:nth-child(4),
    .ugcs-palmares__table--avec-saison th:nth-child(5),
    .ugcs-palmares__table--avec-saison td:nth-child(5),
    .ugcs-palmares__table--classement th:nth-child(1),
    .ugcs-palmares__table--classement td:nth-child(1),
    .ugcs-palmares__table--classement th:nth-child(2),
    .ugcs-palmares__table--classement td:nth-child(2),
    .ugcs-palmares__table--classement th:nth-child(3),
    .ugcs-palmares__table--classement td:nth-child(3),
    .ugcs-palmares__table--classement th:nth-child(4),
    .ugcs-palmares__table--classement td:nth-child(4) {
        width: 100%;
    }


    .ugcs-palmares__table thead {
        display: none;
    }


    .ugcs-palmares__table tbody {
        display: grid;

        gap: 0;
    }


    /* Lignes impaires */

    .ugcs-palmares__table tbody tr:nth-child(odd) {
        background-color: #FFFFFF;
    }


    /* Lignes paires */

    .ugcs-palmares__table tbody tr:nth-child(even) {
        background-color: #F8F4FA;
    }


    .ugcs-palmares__table tbody tr {
        display: flex;
        flex-direction: column;

        overflow: hidden;

        border: 0;
        border-top: 1px solid #E3D9E7;

        padding: 16px 18px;
    }


    .ugcs-palmares__table tbody tr:first-child {
        border-top: 0;
    }


    .ugcs-palmares__table td {
        padding: 0;

        margin-top: 18px;

        border: 0;

        font-size: 15px;

        background-color: transparent;
    }


    .ugcs-palmares__table td:first-child {
        margin-top: 0;
    }


    /* Libellé de chaque information */

    .ugcs-palmares__table td::before {
        content: attr(data-label);

        display: block;

        margin-bottom: 5px;

        font-size: 13px;
        line-height: 1.4;

        font-weight: 700;

        color: #5B2167;

        text-transform: uppercase;

        letter-spacing: 0.02em;
    }


    /* Suppression des séparateurs verticaux */

    .ugcs-palmares__table th + th,
    .ugcs-palmares__table td + td {
        border-left: 0;
    }


    .ugcs-palmares__table td:first-child strong,
    .ugcs-palmares__gymnasts li,
    .ugcs-palmares__competition strong {
        font-size: 15px;
    }


    .ugcs-palmares__ranking {
        white-space: normal;
    }


    .ugcs-palmares__ranking strong {
        font-size: 16px;
    }


    /* La section Classement est souvent très courte ("19e" seul) :
       un espacement identique aux sections plus longues la fait
       paraître isolée plutôt qu'ancrée dans la carte — on la
       resserre un peu. */
    .ugcs-palmares__table td[data-label="Classement"] {
        margin-top: 10px;
    }


    .ugcs-palmares__ranking span,
    .ugcs-palmares__competition-meta {
        font-size: 14px;
    }

}


/* ==================================================
   PETITS SMARTPHONES
   ================================================== */

@media (max-width: 480px) {

    .ugcs-palmares__table td {
        grid-template-columns: 1fr;

        gap: 7px;
    }


    .ugcs-palmares__table td::before {
        margin-bottom: 1px;
    }

}
