/* =====================================================================
   LC Football — Design system unificato (riferimento: widget Prossima Partita)
   Tutti i widget condividono .lc-card + token CSS locali (--lc-*) con
   override opzionale dai --jl-* del tema attivo. Night-mode via
   body.wp-night-mode-on. Container queries per sidebar stretti.
   ===================================================================== */

/* ─── 1. Token del design system (LC-local, ereditabili dal tema) ─── */
.lc-card {
    --lc-bg: rgba(255, 255, 255, 0.75);
    --lc-border: #e9e9e9;
    --lc-radius: 10px;
    --lc-shadow: rgba(0, 0, 0, 0.05) 0 1px 2px 0;
    --lc-accent: #cd1316;
    --lc-penalty: #d9534f;
    --lc-text: #333;
    --lc-muted: #888;
    --lc-title-font: var(--jl-title-font, inherit);
    --lc-title-font-weight: var(--jl-title-font-weight, 700);
    --lc-title-transform: var(--jl-title-transform, uppercase);
    --lc-title-line-height: var(--jl-title-line-height, 1.3);
    --lc-body-font: var(--jl-body-font, inherit);
}

body.wp-night-mode-on .lc-card {
    --lc-bg: #302e28;
    --lc-border: #4a4943;
    --lc-text: #fff;
    --lc-muted: #ccc;
}

/* ─── 2. Card base (contenitore di ogni widget) ─── */
.lc-card {
    container-type: inline-size;
    font-family: var(--lc-body-font);
    color: var(--lc-text);
    background: var(--lc-bg);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
    box-shadow: var(--lc-shadow);
    padding: 1rem;
    margin-bottom: 20px;
}


/* Titolo standard dei widget (sostituisce .lc-match-label / <h3> vecchi) */
.lc-card-title {
    margin: 0 0 0.75rem 0;
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    font-size: 13px;
    text-transform: var(--lc-title-transform);
    letter-spacing: 1px;
    line-height: var(--lc-title-line-height);
    color: var(--lc-text);
}

/* Contenitore dell'intestazione (personalizzabile da Elementor) */
.lc-card-title-box {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem 0;
}

.lc-card-title-box > .lc-card-title {
    margin: 0;
}

/* Titolo dei widget partita: di default replica lo stile della titolazione del tema */
.lc-widget-title {
    font-family: var(--jl-title-font);
    font-size: 20px;
    font-weight: var(--jl-title-font-weight);
    text-transform: var(--jl-title-transform);
    letter-spacing: var(--jl-title-space);
    line-height: var(--jl-title-line-height);
    color: var(--jl-txt-color);
    margin-top: 0;
    margin-bottom: 23px;
    clear: both;
    -ms-word-wrap: break-word;
    word-wrap: break-word;
}

/* Box informativo generico (es. info match) */
.lc-info-box {
    display: grid;
    gap: 0.25rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
}

/* Stato vuoto condiviso */
.lc-empty {
    text-align: center;
    padding: 20px;
    color: var(--lc-muted);
}

/* ─── 3. Logo squadra (riusato in tutti i widget) ─── */
.lc-team-logobox {
    --lc-logo-size: 88px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: var(--lc-logo-size);
    height: var(--lc-logo-size);
}

.lc-team-logobox--sm {
    --lc-logo-size: 28px;
}

/* Nei widget tabella (Classifica/Marcatori) il logo resta piccolo anche in
   container/viewport stretti: le regole responsive globali non lo devono
   ridimensionare. */
.lc-league-table .lc-team-logobox--sm,
.lc-top-scorers .lc-team-logobox--sm {
    width: 28px;
    height: 28px;
    --lc-logo-size: 28px;
}
.lc-league-table .lc-card-title-box,
.lc-top-scorers .lc-card-title-box{
    margin-bottom: 0;
}
.lc-league-table .lc-card-title-box .lc-card-title,
.lc-top-scorers .lc-card-title-box .lc-card-title{
    font-family: roboto,helvetica,sans-serif!important;
    font-weight: 400 !important;
    letter-spacing: normal;
}

.lc-team-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lc-team-logo-fallback {
    display: grid;
    place-items: center;
    width: 78%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: var(--lc-accent);
    color: #fff;
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: calc(var(--lc-logo-size) * 0.26);
}

/* ─── 4. Prossima partita (widget di riferimento) ─── */
.lc-next-match {
    text-align: center;
    margin:0;
}

/* Loghi prossima partita leggermente più grandi */
.lc-next-match .lc-team-logobox {
    --lc-logo-size: 100px;
}

.lc-next-match.lc-live .lc-tds {
    border-color: var(--lc-accent);
}

body.wp-night-mode-on .lc-next-match.lc-live .lc-tds {
    border-color: #fb3a3d;
}

.lc-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.5rem;
    border-radius: var(--lc-radius);
    background: rgba(255, 255, 255, 0.25);
}

body.wp-night-mode-on .lc-logos {
    background: transparent;
}

.lc-next-match .lc-vs {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 28px;
    text-transform: uppercase;
    color: var(--lc-accent);
}

.lc-next-match-info {
    display: grid;
    gap: 0.25rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
}

.lc-next-match-name {
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    font-size: 15px;
    line-height: 1.3;
    color: var(--lc-text);
}

.lc-next-match-kickoff,
.lc-next-match-date {
    font-size: 18px;
    font-weight: 600;
    color: var(--lc-text);
}

.lc-next-match-date {
    color: var(--lc-muted);
}

.lc-next-match-venue {
    font-size: 13px;
    color: var(--lc-muted);
}

/* Etichette rinvio/posticipata condivise */
.lc-postponed,
.lc-postponed-label {
    display: inline-block;
    background: #f0ad4e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.lc-original-date,
.lc-match-original {
    display: block;
    font-size: 12px;
    color: var(--lc-muted);
    margin-top: 4px;
}

/* Countdown */
.lc-tds {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
    background: rgba(255, 255, 255, 0.25);
}

body.wp-night-mode-on .lc-tds {
    background: transparent;
    border-color: #4a4943;
}

.lc-td {
    display: grid;
    grid-template-rows: auto auto;
    gap: 2px;
    place-items: center;
}

.lc-td-num {
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    font-size: 18px;
    line-height: 1.1;
    color: var(--lc-text);
    font-variant-numeric: tabular-nums;
}

.lc-td-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--lc-muted);
}

/* ─── 4b. Prossima partita — adattamento verticale desktop ────────────
   Quando il blocco parent Elementor ha un'altezza definita (min-height,
   altezza fissa, o flex-grow), il widget si distribuisce verticalmente
   con gap e padding proporzionali. Solo desktop (>767px).

   DOM Elementor: .e-con > .elementor-widget > .elementor-widget-container > (.lc-card-title / .lc-card)
   La catena flex deve attraversare TUTTI i livelli. */
@media (min-width: 768px) {
    .elementor-widget-lc_next_match {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .elementor-widget-lc_next_match > .elementor-widget-container {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 20px;
    }

    .elementor-widget-lc_next_match .lc-card {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        padding: clamp(0.4rem, 1.5vh, 1rem);
    }

    .elementor-widget-lc_next_match .lc-next-match {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: clamp(0.3rem, 1.5vh, 0.75rem);
    }

    .elementor-widget-lc_next_match .lc-logos {
        flex: 3;
        min-height: 0;
        padding: 1rem 0;
    }

    .elementor-widget-lc_next_match .lc-next-match-info {
        flex: 5;
        margin: 0;
        min-height: 0;
    }

    .elementor-widget-lc_next_match .lc-tds {
        flex: 1.5;
        min-height: 0;
    }

    /* Titolo outside: margin-bottom gestito dal gap del container */
    .elementor-widget-lc_next_match .lc-card-title {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    /* Titolo inside: margin gestito dal gap */
    .elementor-widget-lc_next_match .lc-card-title-box {
        margin-bottom: 0;
        flex-shrink: 0;
    }
}

/* ─── 5. Ultima partita ─── */
.lc-last-match {
    text-align: center;
}

.lc-last-match .lc-match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.lc-last-match .lc-score {
    font-family: var(--lc-title-font);
    font-weight: 900;
    font-size: 32px;
    color: var(--lc-text);
}

/* Rigori decisivi inline (H-A (P-Q dcr)) */
.lc-dcr {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 13px;
    color: var(--lc-accent);
    white-space: nowrap;
}

/* Banner opzionale */
.lc-last-match .lc-match-banner {
    text-align: center;
    margin-bottom: 0.75rem;
}

.lc-last-match .lc-match-banner img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--lc-radius);
}

/* Intestazione match (titolo + data) */
.lc-last-match .lc-match-header {
    text-align: center;
    border-bottom: 1px solid var(--lc-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.lc-last-match .lc-match-title {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
    color: var(--lc-text);
    margin-bottom: 0.35rem;
}

.lc-last-match .lc-match-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--lc-muted);
}

/* Luogo */
.lc-last-match .lc-match-venue {
    text-align: center;
    font-size: 0.8rem;
    color: var(--lc-muted);
    margin-top: 0.5rem;
}

/* Marcatori (due colonne speculari) */
.lc-goals {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 12px;
    font-size: 13px;
}

.lc-goals-home {
    text-align: right;
    flex: 1;
}

.lc-goals-away {
    text-align: left;
    flex: 1;
}

.lc-goal {
    margin-bottom: 4px;
}

.lc-goal-minute {
    color: var(--lc-muted);
    margin-right: 4px;
}

.lc-goal-player {
    font-weight: 600;
}

.lc-goal-count {
    color: var(--lc-muted);
    margin-left: 4px;
}

.lc-goal-type {
    color: var(--lc-muted);
    font-size: 11px;
    margin-left: 4px;
}

.lc-match-info {
    font-size: 13px;
    color: var(--lc-muted);
}

/* ─── 6. Tabelle (Classifica, Marcatori) ─── */
.lc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 14px;
}

.lc-table th {
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    text-transform: var(--lc-title-transform);
    letter-spacing: 0.5px;
    font-size: 12px;
    color: var(--lc-muted);
    padding: 10px 8px;
}

.lc-table td {
    padding: 8px;
    color: var(--lc-text);
}

.lc-table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

body.wp-night-mode-on .lc-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.lc-col-pos {
    min-width: 36px;
    text-align: center;
}

.lc-col-num {
    min-width: 44px;
    text-align: center;
}

.lc-col-points {
    font-weight: 700;
    text-align: center;
}

.lc-col-penalty {
    color: var(--lc-penalty);
    text-align: center;
}

/* Colonna squadra: nome sempre su un'unica riga */
.lc-table .lc-col-team {
    text-align: left;
    min-width: 80px;
    white-space: nowrap;
}
.lc-table .lc-col-team.lc-col-team--logo-only {
    min-width: 40px;
    width: 40px;
    text-align: center;
}

/* Colonna giocatore: un nome lungo va a capo entro la larghezza massima */
.lc-table .lc-col-player {
    text-align: left;
    min-width: 80px;
    max-width: 200px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ─── 6b. Tabelle "standings": flat, edge-to-edge, scroll orizzontale ─── */
.lc-league-table,
.lc-top-scorers {
    padding: 0;
    overflow: hidden;
}

/* Scroll orizzontale invece di overflow fuori dal contenitore */
.lc-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--lc-border) var(--lc-bg);
}

/* Scrollbar in tinta (WebKit: Chrome/Edge/Safari) */
.lc-table-scroll::-webkit-scrollbar {
    height: 8px;
}

.lc-table-scroll::-webkit-scrollbar-track {
    background: var(--lc-bg);
    border-radius: 4px;
}

.lc-table-scroll::-webkit-scrollbar-thumb {
    background: var(--lc-border);
    border-radius: 4px;
}

.lc-table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--lc-muted);
}

.lc-table {
    width: 100%;
    border: none;
}

/* Reset bordi imposti dal tema/UA: niente linee tra i campi */
.lc-league-table .lc-table,
.lc-top-scorers .lc-table,
.lc-league-table .lc-table th,
.lc-league-table .lc-table td,
.lc-top-scorers .lc-table th,
.lc-top-scorers .lc-table td {
    border: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* ─── 6c. Dark mode (standings) ─── */
/* Il tema forza spesso il colore dei <td>/<th> a nero: ripristiniamo i token LC. */
body.wp-night-mode-on .lc-league-table .lc-table td,
body.wp-night-mode-on .lc-top-scorers .lc-table td {
    color: var(--lc-text) !important;
}

body.wp-night-mode-on .lc-league-table .lc-table th,
body.wp-night-mode-on .lc-top-scorers .lc-table th {
    color: var(--lc-muted) !important;
}

/* L'header personalizzato in Elementor (colore testo / sfondo) non deve
   restare a tonalità chiare su sfondo scuro → si forzano colori adatti. */
body.wp-night-mode-on .lc-card-title {
    color: var(--lc-text) !important;
}

body.wp-night-mode-on .lc-card-title-box {
    background-color: transparent !important;
}

.lc-table th,
.lc-table td {
    white-space: nowrap;
}

/* Cella squadra con logo (Classifica / Marcatori) */
.lc-team-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}
.lc-team-cell.lc-team-cell--logo-only {
    gap: 0;
    justify-content: center;
}

/* ─── 7. Giornata (match_day) ─── */
.lc-match-day-titlebox .lc-widget-title {
    margin-bottom: 0;
}

.lc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Giornata: raggruppamento per giorno */
.lc-match-day-group {
    margin-bottom: 1.25rem;
}

.lc-match-day-group:last-child {
    margin-bottom: 0;
}

.lc-day-header {
    width: fit-content;
    margin: 0 auto 0.85rem;
    padding: 0 0.5rem 0.3rem;
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    text-transform: var(--jl-title-transform);
    letter-spacing: var(--jl-title-space);
    line-height: 1.3;
    font-size: 1rem;
    color: var(--lc-text);
    text-align: center;
    border-bottom: 2px solid var(--lc-accent);
}

.lc-day-mobile {
    display: none;
}

/* Lista delle partite della giornata (card per partita) */
.lc-match-cards {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

@container (max-width: 380px) {
    .lc-match-cards {
        grid-template-columns: 1fr;
    }
}

.lc-match-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.9rem 0.85rem 0.85rem;
    background: var(--lc-bg);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius, 10px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lc-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.lc-match-card.lc-postponed {
    opacity: 0.72;
}

/* Pillola di stato (angolo in alto a destra) */
.lc-match-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

.lc-match-status--today {
    color: var(--lc-accent);
    border: 1px solid var(--lc-accent);
    background: transparent;
}

.lc-match-status--live {
    color: #fff;
    background: var(--lc-accent);
}

body.wp-night-mode-on .lc-match-status--live {
    background: #fb3a3d;
}

.lc-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: lc-pulse 1.2s ease-in-out infinite;
}

@keyframes lc-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

/* Fixture centrale: badge + nome per squadra, risultato al centro */
.lc-match-fixture {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.lc-fixture-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.lc-team-logobox--match {
    --lc-logo-size: 60px;
}

.lc-team-name {
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    font-size: 0.92rem;
    line-height: 1.2;
    color: var(--lc-text);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lc-fixture-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 0.25rem;
}

.lc-match-score {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    color: var(--lc-text);
    white-space: nowrap;
}

.lc-score-sep {
    color: var(--lc-muted);
    font-weight: 600;
    margin: 0 0.15rem;
}

.lc-vs {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--lc-text);
}

body.wp-night-mode-on .lc-vs {
    color: #fff;
}

.lc-dcr {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--lc-muted);
    text-transform: none;
}

.lc-postponed-label {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lc-muted);
}

/* Piede: ora · stadio */
.lc-match-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    font-size: 12px;
    color: var(--lc-muted);
}

.lc-match-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--lc-text);
}

.lc-match-venue {
    font-size: 15px;
    font-weight: 500;
    color: var(--lc-muted);
}

.lc-match-sep {
    color: var(--lc-border);
}

/* Countdown calendar — eredita stili da .lc-tds, solo spacing + live */
.lc-match-countdown {
    margin-top: 6px;
}

.lc-match-countdown.lc-live {
    background: var(--lc-live, #e23744);
}

/* Marcatori */
.lc-match-scorers {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--lc-border);
    font-size: 13px;
}

.lc-match-scorers .lc-goals {
    margin-top: 0;
    gap: 1.5rem;
}

.lc-match-scorers .lc-goal {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.lc-match-scorers .lc-goals-home .lc-goal {
    justify-content: flex-end;
}

.lc-match-scorers .lc-goals-away .lc-goal {
    justify-content: flex-start;
}

.lc-match-scorers .lc-goal-minute {
    margin: 0;
}

@container (max-width: 360px) {
    .lc-match-scorers .lc-goals {
        flex-direction: column;
        gap: 6px;
    }
    .lc-match-scorers .lc-goals-home,
    .lc-match-scorers .lc-goals-away {
        text-align: center;
    }
}

.lc-match-original {
    margin-top: 6px;
    font-size: 11px;
    color: var(--lc-muted);
}

/* Responsive: badge e risultato più compatti su schermi piccoli */
@container (max-width: 420px) {
    .lc-team-logobox--match { --lc-logo-size: 50px; }
    .lc-match-score { font-size: 1.4rem; }
    .lc-team-name { font-size: 0.82rem; }
    .lc-match-card { padding: 0.8rem 0.6rem; }
}

/* ─── 8. Calendario (matchday browser) ─── */
.lc-calendar {
    background: none;
    border: none;
    box-shadow: none;
}

.lc-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.4rem 0.75rem;
    background: var(--lc-bg);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius, 8px);
}

.lc-cal-prev,
.lc-cal-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--lc-accent);
    border-radius: 50%;
    background: var(--lc-accent);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lc-cal-icon {
    display: block;
    width: 18px;
    height: 18px;
}

.lc-calendar-nav .lc-cal-prev:hover:not(:disabled),
.lc-calendar-nav .lc-cal-next:hover:not(:disabled) {
    background-color: #e0191c !important;
    border-color: #e0191c !important;
    box-shadow: 0 2px 10px rgba(205, 19, 22, 0.4);
    transform: scale(1.08);
}

body.wp-night-mode-on .lc-cal-prev,
body.wp-night-mode-on .lc-cal-next {
    background: #fb3a3d;
    border-color: #fb3a3d;
}

body.wp-night-mode-on .lc-calendar-nav .lc-cal-prev:hover:not(:disabled),
body.wp-night-mode-on .lc-calendar-nav .lc-cal-next:hover:not(:disabled) {
    background-color: #ff4a4d !important;
    border-color: #ff4a4d !important;
    box-shadow: 0 2px 10px rgba(251, 58, 61, 0.45);
}

.lc-calendar-nav .lc-cal-prev:focus,
.lc-calendar-nav .lc-cal-next:focus {
    outline: none;
}

.lc-calendar-nav .lc-cal-prev:focus-visible,
.lc-calendar-nav .lc-cal-next:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(205, 19, 22, 0.45);
}

.lc-cal-prev:disabled,
.lc-cal-next:disabled {
    background: var(--lc-border);
    border-color: var(--lc-border);
    color: var(--lc-muted);
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lc-cal-current {
    flex: 1;
    text-align: center;
    font-family: var(--jl-title-font);
    font-weight: var(--jl-title-font-weight);
    text-transform: var(--jl-title-transform);
    letter-spacing: var(--jl-title-space);
    font-size: 1.15rem;
    color: var(--lc-text);
}

.lc-calendar-content {
    font-size: 14px;
    color: var(--lc-muted);
}

/* ─── 9. Responsive ─── */
@media (max-width: 600px) {
    .lc-goals {
        flex-direction: column;
        gap: 8px;
    }

    .lc-goals-home,
    .lc-goals-away {
        text-align: center;
    }

    .lc-table {
        font-size: 12px;
    }

    .lc-table th,
    .lc-table td {
        padding: 6px 4px;
    }
}

@media only screen and (max-width: 767px) {
    .lc-logos {
        gap: 2.5rem;
    }

    .lc-next-match .lc-team-logobox {
        width: 80px;
        height: 80px;
    }

    .lc-match-status--today {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media only screen and (max-width: 480px) {
    .lc-next-match .lc-team-logobox {
        width: 68px;
        height: 68px;
    }

    .lc-next-match-name {
        font-size: 14px;
    }

    .lc-next-match-kickoff,
    .lc-next-match-date {
        font-size: 16px;
    }
}

/* ─── 10. Container query: widget stretto (sidebar <~340px) ─── */
@container (max-width: 340px) {
    .lc-logos {
        gap: 0.75rem;
        padding: 0.4rem;
    }

    .lc-next-match .lc-team-logobox {
        width: 64px;
        height: 64px;
    }

    .lc-team-logo-fallback {
        font-size: calc(var(--lc-logo-size) * 0.26);
    }

    .lc-next-match .lc-vs {
        font-size: 16px;
    }

    .lc-next-match-name {
        font-size: 13px;
    }

    .lc-next-match-kickoff,
    .lc-next-match-date {
        font-size: 15px;
    }

    .lc-tds {
        gap: 0.2rem;
        padding: 0.35rem;
    }

    .lc-td-num {
        font-size: 16px;
    }

    .lc-td-label {
        font-size: 9px;
        letter-spacing: 0;
    }

    .lc-match-time {
        width: 100%;
    }
}

/* ─── 11. Fix spazio vuoto sotto il widget su mobile (quirk flexbox Elementor) ─── */
@media only screen and (max-width: 767px) {
    .e-con:has(.elementor-widget-lc_next_match),
    .e-con:has(.elementor-widget-lc_last_match),
    .e-con:has(.elementor-widget-lc_league_table),
    .e-con:has(.elementor-widget-lc_top_scorers),
    .e-con:has(.elementor-widget-lc_match_day),
    .e-con:has(.elementor-widget-lc_calendar) {
        flex-wrap: nowrap;
    }

    .lc-day-desktop {
        display: none;
    }

    .lc-day-mobile {
        display: inline;
    }

    .lc-match-cards {
        grid-template-columns: 1fr;
    }
}

/* ─── Team Calendar (Calendario Squadra) ─── */
.calendario-container {
    --lc-bg: rgba(255, 255, 255, 0.75);
    --lc-border: #e9e9e9;
    --lc-radius: 10px;
    --lc-accent: #cd1316;
    --lc-text: #333;
    --lc-muted: #888;
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
    background: var(--lc-bg);
    overflow: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--lc-border) var(--lc-bg);
}

.calendario-container::-webkit-scrollbar {
    height: 8px;
}

.calendario-container::-webkit-scrollbar-track {
    background: var(--lc-bg);
    border-radius: 4px;
}

.calendario-container::-webkit-scrollbar-thumb {
    background: var(--lc-border);
    border-radius: 4px;
}

.calendario-container::-webkit-scrollbar-thumb:hover {
    background: var(--lc-muted);
}

.calendario-container .table-heading {
    margin: 0;
    padding: 15px;
    background: var(--lc-bg);
    color: var(--lc-text);
    border-bottom: none;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    width: 100%;
}

.calendario-container table {
    border-collapse: collapse;
    border: none;
    width: 100%;
    font-size: 14px;
}

.calendario-container .head-row th {
    font-size: 12px;
    font-weight: 500;
    background: var(--lc-bg);
    color: var(--lc-muted);
    border: none;
    padding: 8px 10px;
    text-align: left;
}

.calendario-container .trow td {
    height: 40px;
    padding: 5px 10px;
    vertical-align: middle;
    border: none;
    border-top: 1px solid var(--lc-border);
    white-space: nowrap;
    font-size: 14px;
    color: var(--lc-text);
}

.calendario-container tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

.calendario-container .trow:hover td {
    background: rgba(0, 0, 0, 0.04);
}

.calendario-container .avversario {
    min-width: 50px;
}

.calendario-container .head-row th.avversario,
.calendario-container .head-row th.risultato,
.calendario-container .head-row th.ora,
.calendario-container .avv,
.calendario-container .time {
    text-align: center;
}

.calendario-container .logo-squadra-table {
    height: 28px;
    width: 28px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.calendario-container .tdris {
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 700;
    color: var(--lc-text);
}

.calendario-container .tdris.vinta {
    color: #1abc9c;
}

.calendario-container .tdris.persa {
    color: var(--lc-accent);
}

.calendario-container .tdris.pareggio {
    color: #FBBA00;
}

.calendario-container svg {
    height: 18px;
    fill: var(--lc-accent);
}

@media (min-width: 767px) {
    .calendario-container .logo-squadra-table {
        height: 40px;
        width: 40px;
    }
}

/* Modalità scura (i colori base derivano dai token LC) */
body.wp-night-mode-on .calendario-container {
    --lc-bg: #302e28;
    --lc-border: #4a4943;
    --lc-text: #fff;
    --lc-muted: #ccc;
}

body.wp-night-mode-on .calendario-container tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

body.wp-night-mode-on .calendario-container .trow:hover td {
    background: rgba(255, 255, 255, 0.05);
}

body.wp-night-mode-on .calendario-container svg {
    fill: #FAD201;
}

body.wp-night-mode-on .calendario-container .tdris.vinta {
    color: #4cd07d;
}

body.wp-night-mode-on .calendario-container .tdris.persa {
    color: #fb3a3d;
}

body.wp-night-mode-on .calendario-container .tdris.pareggio {
    color: #FBBA00;
}

/* ─── 12. Matches Slider (Ultime / Prossime Partite) ─── */
.lc-matches-slider-card {
    position: relative;
    --lc-bg: rgba(255, 255, 255, 0.75);
    --lc-border: #e9e9e9;
    --lc-radius: 10px;
    --lc-shadow: rgba(0, 0, 0, 0.05) 0 1px 2px 0;
    --lc-accent: #cd1316;
    --lc-penalty: #d9534f;
    --lc-text: #333;
    --lc-muted: #888;
    --lc-title-font: var(--jl-title-font, inherit);
    --lc-title-font-weight: var(--jl-title-font-weight, 700);
    --lc-title-transform: var(--jl-title-transform, uppercase);
    --lc-title-line-height: var(--jl-title-line-height, 1.3);
    --lc-body-font: var(--jl-body-font, inherit);
}

body.wp-night-mode-on .lc-matches-slider-card {
    --lc-bg: #302e28;
    --lc-border: #4a4943;
    --lc-text: #fff;
    --lc-muted: #ccc;
}

.lc-matches-slider {
    padding: 0;
}

.lc-matches-slider .swiper {
    overflow: hidden;
    padding: 0.5rem 0;
}

.lc-matches-slider .swiper-wrapper {
    align-items: stretch;
}

/* Fallback senza Swiper: se la libreria non si è caricata (optimizer, altro
   tema senza Swiper), lo slider resta scrollabile con gap invece di impilare
   le card. All'init Swiper aggiunge .swiper-initialized e prende il controllo. */
.lc-matches-slider .swiper:not(.swiper-initialized) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.lc-matches-slider .swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    gap: 12px;
}

/* ── Match slide (one per card) ── */
.lc-match-slide {
    display: grid;
    grid-template-rows: auto 1fr;
    width: auto !important;
    flex-shrink: 0;
    align-self: stretch;
    gap: 0.5rem;
}

.lc-slide-date {
    height: 20px;
    line-height: 20px;
    overflow: hidden;
    visibility: hidden;
    text-align: left;
    font-family: var(--lc-title-font);
    font-weight: 400;
    font-size: 13px;
    text-transform: var(--lc-title-transform);
    letter-spacing: 0.5px;
    color: var(--lc-muted);
    white-space: nowrap;
}

.lc-slide-date.lc-slide-date--visible {
    overflow: visible;
    visibility: visible;
}

/* ── Match card ── */
.lc-match-slide .lc-match-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 280px;
    min-height: 160px;
    padding: 0.9rem 0.85rem 0.85rem;
    margin: 0;
    background: var(--lc-bg);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius, 10px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
    flex-shrink: 0;
}

.lc-match-slide .lc-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.lc-match-slide .lc-match-card.lc-match-highlight {
    border-color: var(--lc-accent);
    box-shadow: 0 0 0 2px rgba(205, 19, 22, 0.25), 0 8px 25px rgba(0, 0, 0, 0.12);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lc-match-slide .lc-match-card.lc-match-highlight.lc-highlight-fade {
    border-color: var(--lc-border);
    box-shadow: var(--lc-shadow);
}

/* ── Logos row ── */
.lc-match-card__logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.lc-match-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.lc-team-logobox--match {
    --lc-logo-size: 60px;
}

.lc-match-card__name {
    font-family: var(--lc-title-font);
    font-weight: var(--lc-title-font-weight);
    font-size: 0.92rem;
    line-height: 1.2;
    color: var(--lc-text);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

/* ── Center (risultato o VS) ── */
.lc-match-card__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.lc-match-card__result {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    background: var(--lc-accent);
}
body.wp-night-mode-on .lc-match-card__result {
    background: #FBBA00;
}

.lc-result-score {
    font-family: var(--lc-title-font);
    font-weight: 900;
    font-size: 1.15rem;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
}

.lc-result-pen {
    font-family: var(--lc-title-font);
    font-weight: 600;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

.lc-match-card__vs {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--lc-text);
}

/* ── Foot: time · venue ── */
.lc-match-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    font-size: 12px;
    color: var(--lc-muted);
}

.lc-match-card__time {
    font-size: 15px;
    font-weight: 700;
    color: var(--lc-text);
}

.lc-match-card__venue {
    font-size: 15px;
    font-weight: 500;
    color: var(--lc-muted);
}

.lc-match-card__sep {
    color: var(--lc-border);
}

/* ── Scorers ── */
.lc-match-card__scorers {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--lc-border);
    font-size: 13px;
}

.lc-match-card__scorers .lc-goals {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
}

.lc-scorers-home,
.lc-scorers-away {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.lc-scorers-home {
    align-items: flex-end;
}

.lc-scorers-away {
    align-items: flex-start;
}

.lc-scorer {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.lc-scorer-min {
    color: var(--lc-text);
    font-weight: 700;
}

/* ── Postponed label ── */
.lc-match-card__postponed {
    font-family: var(--lc-title-font);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lc-muted);
}

.lc-match-slide .lc-match-card.lc-postponed {
    opacity: 0.72;
}

/* ── Slider header (heading + arrows) ── */
.lc-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.lc-slider-header .lc-card-title {
    margin-bottom: 0;
}

/* ── Slider header arrows ── */
.lc-slider-arrows.jl_arpw {
    display: flex;
    flex-direction: row !important;
    position: static;
    opacity: 1;
    visibility: visible;
    gap: 5px;
    padding: 0;
    margin: 0;
    margin-right:3rem;
}

.lc-slider-arrows.jl_arpw div {
    position: static !important;
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Hide Swiper's default ::after arrows */
.lc-slider-arrows .swiper-button-next::after,
.lc-slider-arrows .swiper-button-prev::after {
    display: none !important;
}

/* Reset Swiper's inline styles on nav buttons */
.lc-slider-arrows .swiper-button-next,
.lc-slider-arrows .swiper-button-prev {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    color: inherit !important;
}

.lc-slider-arrows .jl-spn-inner {
    width: 40px;
    height: 40px;
    border-radius: 100px;
    background: rgba(205, 19, 22, 0.10);
    color: #8b0d10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .3s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, .08);
}

.lc-slider-arrows .jl-spn-inner:hover {
    background: #cd1316;
    color: #fff;
}

body.wp-night-mode-on .lc-slider-arrows .jl-spn-inner {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 0, 0, .3);
}

body.wp-night-mode-on .lc-slider-arrows .jl-spn-inner:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.lc-slider-arrows i {
    font-size: 11px;
}

/* ── Animazioni ── */
@keyframes lc-pop-in {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes lc-fade-up {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ── Responsive: card piu strette su mobile ── */
@media (max-width: 600px) {
    .lc-match-slide .lc-match-card {
        width: 260px;
        min-height: 120px;
        padding: 0.75rem;
    }

    .lc-team-logobox--match {
        --lc-logo-size: 42px;
    }

    .lc-match-card__name {
        font-size: 0.7rem;
    }

    .lc-result-score {
        font-size: 0.95rem;
    }

    .lc-match-card__scorers {
        font-size: 12px;
    }

    .lc-day-date {
        font-size: 0.65rem;
    }
}

/* ── Container query: sidebar stretta ── */
@container (max-width: 340px) {
    .lc-match-slide .lc-match-card {
        width: 160px;
        min-height: 140px;
        padding: 0.6rem;
    }

    .lc-team-logobox--match {
        --lc-logo-size: 55px;
    }

    .lc-match-card__name {
        font-size: 0.65rem;
    }

    .lc-result-score {
        font-size: 0.85rem;
    }
}

/* ── Fix flex wrap Elementor mobile ── */
@media only screen and (max-width: 767px) {
    .e-con:has(.elementor-widget-lc_last_matches) {
        flex-wrap: nowrap;
    }
}
