/* Pagina Atleti: vista a schede grandi (js/athlete_hero.js) e scelta Schede/Lista. */
.athletes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 15px;
}

.athletes-toolbar .search-container {
    flex: 1 1 260px;
    margin: 0;
}

.athletes-view-switch {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--border, #d6e2f2);
    border-radius: 999px;
    background: var(--surface, #fff);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.athletes-view-switch button {
    min-height: 38px;
    padding: 6px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--navy, #0b1f3a);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.athletes-view-switch button[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--primary, #1d4ed8), var(--blue, #3ca9ff));
    color: #fff;
}

.athletes-view-switch button:focus-visible {
    outline: 3px solid var(--blue, #3ca9ff);
    outline-offset: 2px;
}

/* Nella vista a schede ci sono tutti gli agonisti: le schede in cima servono solo alla lista. */
.athletes-page.is-hero-view #tabellaAtleti,
.athletes-page.is-hero-view .tabs,
.athletes-page.is-list-view .athlete-hero {
    display: none;
}

/* Nella vista a schede l'ordinamento si sceglie con il menu (anche su schermi larghi). */
.athletes-page.is-hero-view .athlete-mobile-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 2px 0 10px;
    color: var(--muted, #5b6b82);
    font-size: 0.85rem;
    font-weight: 700;
}

.athletes-page.is-hero-view .athlete-mobile-sort label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.athletes-page.is-hero-view .athlete-mobile-sort select,
.athletes-page.is-hero-view .athlete-sort-direction {
    min-height: 38px;
    border: 1px solid var(--border, #d6e2f2);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--navy, #0b1f3a);
    font: inherit;
}

.athletes-page.is-hero-view .athlete-mobile-sort select {
    padding: 6px 30px 6px 10px;
}

.athletes-page.is-hero-view .athlete-sort-direction {
    display: inline-flex;
    width: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.athlete-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 16px;
    align-items: stretch;
}

.athlete-hero-layout[hidden] {
    display: none;
}

.athlete-hero-stage.team-dialog-photo-stage {
    height: min(74vh, 720px);
    min-height: 420px;
    border-radius: 24px;
    background: radial-gradient(circle at 30% 20%, #1e3a8a 0%, #0f172a 70%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.athlete-hero-stage:focus-visible {
    outline: 3px solid var(--blue, #3ca9ff);
    outline-offset: 3px;
}

.athlete-hero-stage.is-instant .team-dialog-photo-slide {
    transition: none;
}

.athlete-hero-card {
    position: relative;
    width: min(90%, 980px);
    height: calc(100% - 36px);
    overflow: hidden;
    border-radius: 22px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.athlete-hero-card.is-current-user {
    box-shadow: 0 0 0 4px #ffd400, 0 18px 50px rgba(0, 0, 0, 0.45);
}

.athlete-hero-media {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

/* Sfondo: la stessa foto sfocata riempie la scheda, davanti la foto intera e nitida. */
.athlete-hero-backdrop {
    position: absolute;
    inset: -40px;
    width: calc(100% + 80px);
    height: calc(100% + 80px);
    object-fit: cover;
    filter: blur(28px) saturate(1.2) brightness(0.7);
    transform: scale(1.05);
}

.athlete-hero-photo {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: 50% 0;
}

.athlete-hero-media.has-no-photo {
    background: linear-gradient(150deg, var(--primary, #1d4ed8), #0f172a 75%);
    color: rgba(255, 255, 255, 0.22);
}

.athlete-hero-media.has-no-photo img {
    display: none;
}

.athlete-hero-media.has-no-photo svg {
    width: min(55%, 320px);
    height: auto;
    margin-bottom: 18%;
}

.athlete-hero-card.is-passed .athlete-hero-media {
    filter: grayscale(1);
}

.athlete-hero-info {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    gap: 10px;
    padding: 90px clamp(18px, 4vw, 40px) clamp(18px, 3vw, 32px);
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.75) 38%, rgba(15, 23, 42, 0.95) 100%);
    text-align: left;
}

.athlete-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.athlete-hero-chip {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.athlete-hero-chip.is-me {
    background: #ffd400;
    color: #0b1f3a;
}

.athlete-hero-name {
    display: grid;
    margin: 0;
    color: #fff;
    line-height: 1;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.athlete-hero-first-name {
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    font-weight: 400;
}

.athlete-hero-last-name {
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    font-weight: 900;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.athlete-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 0;
}

.athlete-hero-stat {
    display: grid;
    min-width: 92px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}

.athlete-hero-stat dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.8;
    text-transform: uppercase;
}

.athlete-hero-stat dd {
    margin: 2px 0 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.athlete-hero-stat small {
    font-size: 0.72rem;
    opacity: 0.8;
}

.athlete-hero-open {
    justify-self: start;
    margin-top: 4px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0b1f3a;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.athlete-hero-open:focus-visible {
    outline: 3px solid #ffd400;
    outline-offset: 2px;
}

.athlete-hero-counter {
    z-index: 4;
}

/* Elenco dei nomi scorrevole con le frecce su e giu'. */
.athlete-hero-names {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border, #d6e2f2);
    border-radius: 24px;
    background: var(--surface, #fff);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
    touch-action: none;
}

.athlete-hero-names[hidden] {
    display: none;
}

.athlete-hero-names-arrow {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary, #1d4ed8), var(--blue, #3ca9ff));
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.athlete-hero-names-arrow:focus-visible {
    outline: 3px solid var(--blue, #3ca9ff);
    outline-offset: 2px;
}

.athlete-hero-names-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.athlete-hero-names-item button {
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--navy, #0b1f3a);
    font: inherit;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: transform 240ms ease, opacity 240ms ease;
}

.athlete-hero-names-item[data-offset="-2"] button,
.athlete-hero-names-item[data-offset="2"] button {
    opacity: 0.35;
    transform: scale(0.86);
}

.athlete-hero-names-item[data-offset="-1"] button,
.athlete-hero-names-item[data-offset="1"] button {
    opacity: 0.65;
    transform: scale(0.94);
}

.athlete-hero-names-item[data-offset="0"] button {
    padding: 14px 10px;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(60, 169, 255, 0.18));
    color: var(--primary, #1d4ed8);
    font-size: 1.15rem;
    font-weight: 800;
}

.athlete-hero-names-item button:focus-visible {
    outline: 3px solid var(--blue, #3ca9ff);
    outline-offset: 1px;
}

.athlete-hero-empty {
    padding: 40px 16px;
    border-radius: 18px;
    background: var(--surface, #fff);
    text-align: center;
    font-weight: 700;
}

@media (max-width: 860px) {
    .athlete-hero-layout {
        grid-template-columns: 1fr;
    }

    .athlete-hero-stage.team-dialog-photo-stage {
        height: min(68vh, 620px);
        min-height: 380px;
        border-radius: 20px;
    }

    .athlete-hero-card {
        width: calc(100% - 24px);
        height: calc(100% - 24px);
    }

    .athlete-hero-stage .team-dialog-photo-nav {
        width: 36px;
        height: 46px;
        font-size: 1.9rem;
    }

    /* Su telefono l'elenco mostra solo il nome attuale e i due vicini. */
    .athlete-hero-names {
        grid-template-columns: 52px 1fr 52px;
        grid-template-rows: auto;
        align-items: center;
        padding: 8px;
    }

    .athlete-hero-names-item[data-offset="-2"],
    .athlete-hero-names-item[data-offset="2"],
    .athlete-hero-names-item[data-offset="-1"],
    .athlete-hero-names-item[data-offset="1"] {
        display: none;
    }

    .athlete-hero-stat {
        min-width: 0;
        padding: 6px 10px;
    }

    .athlete-hero-stat dd {
        font-size: 1.05rem;
    }
}
