/* ===========================
   RÉSULTATS D'UNE ÉDITION
   (tableau, recherche, podium : js/resultats_course.js)
=========================== */

.rc {
    width: 100%;
    max-width: 68.75rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 2.75rem) 1rem clamp(2.5rem, 6vw, 4.375rem);
    font-family: var(--police-texte);
    color: #2b2b2b;
}

.rc-chargement,
.rc-erreur {
    padding: 2.5rem 0;
    text-align: center;
    color: #555;
}

.rc-bloc {
    margin-top: 1.375rem;
    padding: 1.125rem clamp(0.875rem, 3vw, 1.625rem);
    border-radius: 1rem;
    background: white;
    box-shadow: 0 0.5rem 1.375rem rgba(0, 0, 0, 0.09);
}

.rc-bloc h3 {
    margin: 0;
    font-family: var(--police-titre);
    font-size: clamp(1.25rem, 2.6vw, 1.6rem);
    color: #1a4aa0;
}

/* ----- En-tête et chiffres clés ----- */
.rc-edition {
    text-align: center;
}

.rc-edition-date {
    display: inline-block;
    padding: 0.375rem 1.125rem;
    border-radius: 62.4375rem;
    font-family: var(--police-titre);
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    color: #1a4aa0;
    background: white;
    box-shadow: 0 0.25rem 0.75rem rgba(26, 74, 160, 0.15);
}

.rc-tuiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
    margin-top: 1rem;
}

.rc-tuile {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 1rem 0.875rem;
    border-radius: 1rem;
    color: white;
    background: linear-gradient(135deg, #1a4aa0, #06276b);
    box-shadow: 0 0.5rem 1.25rem rgba(6, 39, 107, 0.25);
}

.rc-tuile:nth-child(1) { background: linear-gradient(135deg, #ff7800, #ffb700); box-shadow: 0 0.5rem 1.25rem rgba(255, 120, 0, 0.3); color: #3a2300; }

.rc-tuile-valeur {
    font-family: var(--police-titre);
    font-size: clamp(1.7rem, 3.6vw, 2.3rem);
    line-height: 1.1;
}

.rc-tuile-libelle {
    font-size: 0.95rem;
    font-weight: bold;
}

.rc-tuile-detail {
    font-size: 0.82rem;
    opacity: 0.85;
}

.rc-repartition {
    display: flex;
    height: 0.375rem;
    margin-top: 0.5rem;
    overflow: hidden;
    border-radius: 62.4375rem;
    background: rgba(255, 255, 255, 0.35);
}

.rc-repartition i:first-child { background: #1a4aa0; }
.rc-repartition i:last-child { background: white; }

/* ----- Podium ----- */
.rc-bloc-tete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.rc-onglets,
.rc-segment {
    display: inline-flex;
    padding: 0.1875rem;
    border-radius: 62.4375rem;
    background: rgb(251, 245, 234);
}

.rc-onglet,
.rc-seg {
    padding: 0.375rem 0.875rem;
    border: 0;
    border-radius: 62.4375rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1a4aa0;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.rc-onglet:hover,
.rc-seg:hover {
    background: rgba(26, 74, 160, 0.1);
}

.rc-onglet--actif,
.rc-seg--actif,
.rc-onglet--actif:hover,
.rc-seg--actif:hover {
    color: white;
    background: linear-gradient(135deg, #ff7800, #ffb700);
}

.rc-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: clamp(0.5rem, 2vw, 1.125rem);
    margin-top: 1.125rem;
}

.rc-marche {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.875rem 0.5rem 0;
    border: 0;
    border-radius: 0.875rem 0.875rem 0 0;
    font: inherit;
    text-align: center;
    color: #1a1a1a;
    cursor: pointer;
    transform-origin: bottom;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.rc-marche:hover,
.rc-marche:focus-visible {
    transform: translateY(-0.25rem);
    filter: brightness(1.05);
}

.rc-marche--1 { background: linear-gradient(#ffe27a, #ffb700); }
.rc-marche--2 { background: linear-gradient(#eceff3, #b9c0cc); }
.rc-marche--3 { background: linear-gradient(#f0c39b, #c98547); }

.rc-marche-nom {
    font-size: 0.9rem;
    line-height: 1.2;
    word-break: break-word;
}

.rc-marche-nom--fort {
    font-family: var(--police-titre);
    font-size: 1rem;
}

.rc-marche-temps {
    margin-top: 0.25rem;
    font-family: var(--police-titre);
    font-size: 1.15rem;
}

.rc-marche-club {
    font-size: 0.75rem;
    opacity: 0.75;
}

.rc-socle {
    display: block;
    width: 100%;
    margin-top: 0.625rem;
    padding: 0.375rem 0;
    font-family: var(--police-titre);
    font-size: 1.8rem;
    line-height: 1.1;
    color: white;
    background: rgba(6, 39, 107, 0.82);
}

.rc-marche--1 .rc-socle { padding: 1.375rem 0; }
.rc-marche--2 .rc-socle { padding: 0.875rem 0; }
.rc-marche--3 .rc-socle { padding: 0.375rem 0; }

.rc-podium .rc-marche {
    transform: scaleY(0.2);
    opacity: 0;
}

.rc-podium--joue .rc-marche {
    transform: none;
    opacity: 1;
    transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.3s ease, filter 0.2s ease;
}

.rc-podium--joue .rc-marche--1 { transition-delay: 0.15s; }
.rc-podium--joue .rc-marche--3 { transition-delay: 0.3s; }

.rc-podium--joue .rc-marche:hover { transform: translateY(-0.25rem); transition-delay: 0s; }

/* ----- Recherche et filtres ----- */
.rc-barre {
    position: relative;
}

.rc-recherche {
    position: relative;
}

.rc-recherche svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 1.375rem;
    height: 1.375rem;
    color: #1a4aa0;
    transform: translateY(-50%);
    pointer-events: none;
}

.rc-q {
    width: 100%;
    padding: 0.875rem 2.875rem 0.875rem 3rem;
    border: 0.125rem solid rgba(26, 74, 160, 0.25);
    border-radius: 62.4375rem;
    font: inherit;
    font-size: 1.05rem;
    color: #1a1a1a;
    background: rgb(251, 245, 234);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rc-q::-webkit-search-cancel-button { display: none; }

.rc-q:focus {
    outline: none;
    border-color: #ff7800;
    background: white;
    box-shadow: 0 0 0 0.25rem rgba(255, 120, 0, 0.2);
}

.rc-effacer {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 1.875rem;
    height: 1.875rem;
    border: 0;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    color: white;
    background: #1a4aa0;
    transform: translateY(-50%);
    cursor: pointer;
}

.rc-effacer[hidden],
.rc-reinit[hidden] { display: none; }

.rc-filtres {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

.rc-select {
    flex: 1 1 12.5rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.5625rem 0.875rem;
    border: 0.125rem solid rgba(26, 74, 160, 0.2);
    border-radius: 62.4375rem;
    font: inherit;
    font-size: 0.92rem;
    color: #1a4aa0;
    background: white;
    cursor: pointer;
}

.rc-select:focus {
    outline: none;
    border-color: #ff7800;
}

.rc-reinit {
    padding: 0.5rem 0.875rem;
    border: 0;
    border-radius: 62.4375rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    color: #ff7800;
    background: transparent;
    text-decoration: underline;
    cursor: pointer;
}

.rc-compte {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: #666;
}

/* ----- Tableau ----- */
.rc-tableau-cadre {
    margin-top: 1.375rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 0.5rem 1.375rem rgba(0, 0, 0, 0.09);
}

.rc-tableau {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.rc-tableau th {
    position: sticky;
    top: calc(var(--header-h, 3.75rem) + 0.875rem);   /* un peu d'air sous le header */
    z-index: 2;
    padding: 0;
    box-shadow: 0 -0.875rem 0 white;   /* masque les lignes qui passent dans cet espace */
    text-align: left;
    color: white;
    background: linear-gradient(135deg, #1a4aa0, #06276b);
}

.rc-tableau th:first-child { border-top-left-radius: 1rem; }
.rc-tableau th:last-child { border-top-right-radius: 1rem; }

.rc-tri {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.8125rem 0.625rem;
    border: 0;
    font: inherit;
    font-size: 0.88rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    text-align: left;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.rc-tri::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 0.25rem solid transparent;
    border-right: 0.25rem solid transparent;
    border-bottom: 0.375rem solid currentColor;
    opacity: 0;
}

.rc-th--actif .rc-tri::after { opacity: 1; }
.rc-th--desc .rc-tri::after { transform: rotate(180deg); }
.rc-tri:hover { background: rgba(255, 255, 255, 0.12); }

.rc-tableau td {
    padding: 0.625rem;
    border-bottom: 0.0625rem solid rgba(26, 74, 160, 0.1);
    font-size: 0.95rem;
}

.rc-c-place { width: 4rem; }
.rc-c-temps { width: 5.75rem; font-variant-numeric: tabular-nums; }
.rc-c-sexe { width: 4.375rem; }
.rc-c-cat { width: 5.625rem; }
.rc-c-plus { width: 2.75rem; }

.rc-ligne {
    cursor: pointer;
    transition: background 0.15s ease;
}

.rc-ligne:nth-child(4n + 1) td { background: rgba(251, 245, 234, 0.55); }

.rc-ligne:hover td { background: rgba(255, 183, 0, 0.16); }

.rc-ligne--ouverte td {
    background: rgba(255, 183, 0, 0.2) !important;
    border-bottom-color: transparent;
}

.rc-ligne--eclat td { animation: rc-eclat 2.2s ease; }

@keyframes rc-eclat {
    0%, 60% { background: rgba(255, 120, 0, 0.4); }
}

.rc-place {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.375rem;
    border-radius: 62.4375rem;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.rc-place--1 { color: #4a3000; background: linear-gradient(135deg, #ffe27a, #ffb700); }
.rc-place--2 { color: #333; background: linear-gradient(135deg, #f1f3f6, #b9c0cc); }
.rc-place--3 { color: #3b200a; background: linear-gradient(135deg, #f0c39b, #c98547); }

.rc-nom {
    display: block;
    padding: 0;
    border: 0;
    font: inherit;
    text-align: left;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.rc-nom:focus-visible {
    outline: 0.125rem solid #ff7800;
    outline-offset: 0.1875rem;
    border-radius: 0.25rem;
}

.rc-nom-complet {
    font-weight: bold;
    color: #1a4aa0;
}

.rc-prenom {
    font-weight: normal;
    color: #2b2b2b;
}

.rc-nom-petit {
    display: none;
    margin-top: 0.125rem;
    font-size: 0.8rem;
    color: #666;
}

.rc-sexe {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.0625rem 0.4375rem;
    border-radius: 62.4375rem;
    font-size: 0.78rem;
    font-weight: bold;
    text-align: center;
    color: white;
}

.rc-sexe--M { background: #1a4aa0; }
.rc-sexe--F { background: #ff7800; }

.rc-cat {
    display: inline-block;
    padding: 0.125rem 0.5625rem;
    border-radius: 0.375rem;
    font-size: 0.82rem;
    font-weight: bold;
    color: #1a4aa0;
    background: rgba(26, 74, 160, 0.1);
}

.rc-aucun { color: #aaa; }

.rc-chevron {
    display: block;
    width: 0.5625rem;
    height: 0.5625rem;
    margin: 0 auto;
    border-right: 0.15625rem solid #1a4aa0;
    border-bottom: 0.15625rem solid #1a4aa0;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}

.rc-ligne--ouverte .rc-chevron { transform: rotate(225deg); }

mark {
    padding: 0 0.0625rem;
    border-radius: 0.1875rem;
    color: inherit;
    background: #ffd54a;
}

/* ----- Fiche d'un coureur ----- */
.rc-detail td {
    padding: 0;
    background: rgb(251, 245, 234);
}

.rc-detail[hidden] { display: none; }

.rc-fiche {
    display: grid;
    grid-template-columns: auto minmax(0, 16.25rem) minmax(16.25rem, 1fr);
    gap: 1.25rem 2rem;
    padding: 1.125rem 1rem 1.375rem;
    animation: rc-ouvre 0.3s ease;
}

@keyframes rc-ouvre {
    from { opacity: 0; transform: translateY(-0.375rem); }
}

.rc-rangs {
    display: flex;
    align-self: start;
    gap: 0.625rem;
}

.rc-rang {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    background: white;
    box-shadow: 0 0.1875rem 0.625rem rgba(0, 0, 0, 0.08);
}

.rc-rang-titre {
    font-family: var(--police-titre);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a4aa0;
}

.rc-rang-valeur {
    font-family: var(--police-titre);
    font-size: 1.7rem;
    line-height: 1.2;
    color: #ff7800;
}

.rc-rang-sur,
.rc-rang-sous {
    font-size: 0.78rem;
    color: #666;
}

.rc-infos {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    gap: 0.3125rem 0.875rem;
    margin: 0;
    font-size: 0.92rem;
}

.rc-infos dt { color: #666; }
.rc-infos dd { margin: 0; font-weight: bold; }

/* ----- Historique du coureur ----- */
.rc-histo {
    min-width: 0;
    max-width: 23.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 0.1875rem 0.625rem rgba(0, 0, 0, 0.08);
}

.rc-histo[hidden] { display: none; }

.rc-histo-titre {
    margin: 0;
    font-family: var(--police-titre);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a4aa0;
}

.rc-histo-resume,
.rc-histo-vide {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #666;
}

.rc-histo-liste {
    margin: 0.375rem 0 0;
    padding: 0;
    list-style: none;
}

.rc-histo-liste li + li { border-top: 0.0625rem solid rgba(26, 74, 160, 0.08); }

.rc-histo-ligne-contenu {
    display: grid;
    grid-template-columns: 2.6em 1fr auto 4.6em;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3125rem 0.25rem;
    border-radius: 0.375rem;
    font-size: 0.86rem;
    color: inherit;
    text-decoration: none;
}

a.rc-histo-ligne-contenu:hover { background: rgba(255, 183, 0, 0.18); }

.rc-histo-ici { background: rgba(26, 74, 160, 0.07); border-radius: 0.375rem; }

.rc-histo-an { font-weight: bold; color: #1a4aa0; }
.rc-histo-temps { font-variant-numeric: tabular-nums; }
.rc-histo-place { color: #555; white-space: nowrap; }
.rc-histo-top { font-size: 0.75rem; font-weight: bold; color: #ff7800; white-space: nowrap; }

/* ----- Vide, « Voir plus » ----- */
.rc-vide {
    padding: 2.25rem 1rem;
    text-align: center;
    color: #555;
}

.rc-vide[hidden] { display: none; }

.rc-pied {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.rc-btn {
    padding: 0.6875rem 1.5rem;
    border: 0;
    border-radius: 62.4375rem;
    font: inherit;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #ff7800, #ffb700);
    box-shadow: 0 0.25rem 0.75rem rgba(255, 120, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rc-btn:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.125rem rgba(255, 120, 0, 0.35);
}

.rc-btn--clair {
    color: #1a4aa0;
    background: white;
    box-shadow: 0 0.25rem 0.75rem rgba(26, 74, 160, 0.18);
}

/* lien de retour sous le tableau */
.rc-retour {
    max-width: 68.75rem;
    margin: 0 auto;
    padding: 0 1rem 0.625rem;
    text-align: center;
}

.rc-retour a {
    font-family: var(--police-texte);
    font-weight: bold;
    color: #1a4aa0;
    text-decoration: underline;
}

.rc-retour a:hover { color: #ff7800; }

/* ----- Tablette et téléphone ----- */
@media (max-width: 1120px) {
    .rc-fiche { grid-template-columns: auto 1fr; }
    .rc-histo { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 860px) {
    .rc-tuiles { grid-template-columns: repeat(2, 1fr); }
    .rc-fiche { grid-template-columns: 1fr; }
    .rc-rangs { flex-wrap: wrap; }
    .rc-rang { flex: 1 1 5.625rem; }
}

@media (max-width: 700px) {
    /* le sexe et le club passent sous le nom, le tableau tient sans défiler */
    .rc-c-sexe,
    .rc-c-club { display: none; }

    .rc-nom-petit { display: block; }

    .rc-c-place { width: 3.25rem; }
    .rc-c-temps { width: 4.375rem; }
    .rc-c-cat { width: 4.125rem; }
    .rc-c-plus { width: 1.875rem; }

    .rc-tableau td { padding: 0.5625rem 0.3125rem; font-size: 0.9rem; }
    .rc-tri { padding: 0.75rem 0.3125rem; }

    .rc-marche { padding: 0.75rem 0.25rem 0; }
    .rc-marche-nom { font-size: 0.74rem; }
    .rc-marche-nom--fort { font-size: 0.78rem; }
    .rc-marche-temps { font-size: 1rem; }
    .rc-marche-club { display: none; }

    .rc-detail td { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .rc-podium .rc-marche,
    .rc-podium--joue .rc-marche { transition: none; transform: none; opacity: 1; }
    .rc-fiche,
    .rc-ligne--eclat td { animation: none; }
}
