/* ─── Medagliere Storace – Frontend CSS ─── */

.ms-medagliere { font-family: inherit; }

.ms-section { margin-bottom: 48px; }

.ms-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 20px;
    margin-bottom: 0 !important;
    border-radius: 8px 8px 0 0;
    color: #fff;
}
.ms-section-piscina      .ms-section-title { background: #1e40af; }
.ms-section-acque_gelide .ms-section-title { background: #0369a1; }
.ms-section-acque_libere .ms-section-title { background: #075985; }

.ms-table-wrap { overflow-x: auto; }

.ms-front-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-top: none;
    font-size: .95rem;
}

.ms-front-table thead th {
    background: #f1f5f9;
    color: #374151;
    padding: 10px 16px;
    text-align: left;
    font-size: .82rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0;
}

.ms-front-table tbody td {
    padding: 9px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ms-front-table tbody tr:last-child td { border-bottom: none; }
.ms-front-table tbody tr:hover { background: #f8fafc; }
.ms-front-table tbody tr:nth-child(even) { background: #fafafa; }
.ms-front-table tbody tr:nth-child(even):hover { background: #f0f6ff; }

/* Podio */
.ms-front-table tbody tr.ms-podio {
    background: #fffbeb !important;
    font-weight: 500;
}
.ms-front-table tbody tr.ms-podio:hover { background: #fef9c3 !important; }

.ms-year {
    font-weight: 700;
    color: #1e40af;
    white-space: nowrap;
}

.ms-result {
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .ms-front-table { font-size: .85rem; }
    .ms-front-table thead th,
    .ms-front-table tbody td { padding: 8px 10px; }
    .ms-section-title { font-size: 1.1rem; padding: 8px 14px; }
}

/* ─────────────────────────────────────────────
   STATISTICHE MEDAGLIE  [medagliere_stats]
   Design: compatto, minimalista, orizzontale
───────────────────────────────────────────── */

.ms-stats-wrapper {
    font-family: inherit;
    padding: 4px 0 16px;
}

.ms-stats-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Card ── */
.ms-scard {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    display: grid;
    grid-template-columns: 200px 1fr;
    transition: box-shadow .25s ease;
}
.ms-scard:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

/* ── Colonna sinistra: header ── */
.ms-scard-header {
    background: var(--scard-gradient);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    color: #fff;
}
.ms-scard-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.2));
}
.ms-scard-title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    line-height: 1.3;
}
.ms-scard-total {
    font-size: .85rem;
    opacity: .9;
    font-weight: 600;
    margin-top: 3px;
}

/* ── Colonna destra: dati ── */
.ms-scard-body {
    padding: 14px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: #fff;
}

/* ── Riga medaglia ── */
.ms-mrow {
    display: grid;
    grid-template-columns: 22px 32px 58px 1fr 44px;
    align-items: center;
    gap: 8px;
}
.ms-mrow-emoji { font-size: .95rem; line-height: 1; }
.ms-mrow-count {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1d2327;
    text-align: right;
    white-space: nowrap;
}
.ms-mrow-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #9ca3af;
    font-weight: 600;
    white-space: nowrap;
    overflow: visible;
}
.ms-mrow-bar-wrap {
    background: #f1f5f9;
    border-radius: 99px;
    height: 5px;
    overflow: hidden;
}
.ms-mrow-bar {
    height: 100%;
    border-radius: 99px;
    min-width: 3px;
    width: 0;
    transition: width 1s cubic-bezier(.4,0,.2,1);
}
.ms-mrow-gold   .ms-mrow-bar { background: linear-gradient(90deg,#d97706,#fbbf24); }
.ms-mrow-silver .ms-mrow-bar { background: linear-gradient(90deg,#94a3b8,#cbd5e1); }
.ms-mrow-bronze .ms-mrow-bar { background: linear-gradient(90deg,#92400e,#d97706); }

.ms-mrow-pct {
    font-size: .85rem;
    font-weight: 700;
    color: #374151;
    text-align: right;
    white-space: nowrap;
}

/* ── Divider ── */
.ms-scard-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 2px 0;
}

/* ── Footer podio ── */
.ms-podio-row {
    display: grid;
    grid-template-columns: 22px 32px 58px 1fr 44px;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.ms-podio-label {
    grid-column: 1 / 4;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--scard-color);
    font-weight: 700;
    white-space: nowrap;
}
.ms-podio-bar-wrap {
    background: #e8ecf0;
    border-radius: 99px;
    height: 5px;
    overflow: hidden;
}
.ms-podio-bar-fill {
    height: 100%;
    background: var(--scard-gradient);
    border-radius: 99px;
    width: 0;
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.ms-podio-pct {
    font-size: .9rem;
    font-weight: 800;
    color: var(--scard-color);
    text-align: right;
    white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .ms-scard { grid-template-columns: 140px 1fr; }
    .ms-scard-header { padding: 14px 14px; }
    .ms-scard-body { padding: 12px 14px; }
    .ms-mrow, .ms-podio-row { grid-template-columns: 18px 26px 52px 1fr 40px; gap: 6px; }
}
@media (max-width: 420px) {
    .ms-scard { grid-template-columns: 1fr; }
    .ms-scard-header { flex-direction: row; align-items: center; padding: 12px 16px; gap: 10px; }
}
