/* ==========================================================================
   S11.cz - HOME.CSS
   Styly specifické pro úvodní stranu (Index)
   ========================================================================== */

/* --- HERO SEKCE (Úvodní banner) --- */
.archive-hero {
    text-align: center;
    padding: 80px 0 60px;
}

.archive-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2.5px;
    margin-bottom: 15px;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.archive-hero h1 span {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
}

.archive-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.archive-hero p strong {
    color: var(--text-main, #fff);
    font-weight: 600;
}

/* --- LAYOUT: hlavní obsah vlevo + úzký sidebar se svislými záložkami vpravo --- */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 56px;
    grid-template-areas: "main sidebar";
    gap: 24px;
    align-items: start;
}

.home-main { grid-area: main; min-width: 0; }
.home-sidebar { grid-area: sidebar; }

/* Sticky panel — drží se v rámci .home-layout, viditelný po celou dobu scrollu. */
.home-sidebar {
    position: sticky;
    top: 95px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    /* Schovat scrollbar v rámci tabu — vypadá to čisteji */
    scrollbar-width: thin;
}

.sidebar-section {
    margin-bottom: 14px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

/* Titulek sekce v sidebaru — také svisle, ať to vizuálně sedí se záložkami. */
.sidebar-title {
    display: block;
    margin: 0 auto 8px;
    padding: 0 4px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
    line-height: 1;
    opacity: 0.7;
}

/* --- Sidebar záložky (svislý text, „bookmark" tvar přilepený k pravému okraji) --- */
.home-sidebar .chip {
    display: block;
    width: 40px;
    min-height: 130px;
    margin: 0 0 6px auto; /* zarovnání na pravý okraj sidebaru */
    padding: 14px 6px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px; /* zaoblené na levé straně (sticking-out side) */
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    transition: width 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.home-sidebar .chip:hover {
    width: 44px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main, #fff);
}

.home-sidebar .chip.active {
    width: 48px;
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
    border-right-color: transparent;
    font-weight: 700;
}

.home-sidebar .chip-sub {
    width: 32px;
    min-height: 100px;
    padding: 10px 4px;
    font-size: 0.75rem;
}

.home-sidebar .chip-sub:hover {
    width: 36px;
}

.home-sidebar .chip-sub.active {
    width: 40px;
}

/* --- Společný wrapper bloků --- */
.home-block {
    margin-bottom: 60px;
}

.home-block .section-header {
    margin-bottom: 20px;
}

.section-sub {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85em;
}

/* --- BLOCK A: Poslední odehrané kolo + roleta s detailem --- */
.last-round-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-row-wrapper {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.match-row-wrapper:hover,
.match-row-wrapper.expanded {
    border-color: var(--accent);
}

.match-row-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    padding: 12px 38px 12px 16px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s ease;
}

.match-row-link:hover {
    background: rgba(255, 255, 255, 0.02);
}

.match-row-link .match-mini-row {
    margin-bottom: 0;
}

.match-toggle-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.2s ease, color 0.15s ease;
}

.match-row-wrapper.expanded .match-toggle-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--accent);
}

.score-link-unplayed {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Roleta s detailem */
.match-detail-panel {
    padding: 20px 22px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
}

.match-detail-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
    font-style: italic;
}

/* Trenér jako první řádek nad sestavou */
.lineup-coach {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
}

.lineup-coach-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.lineup-coach-name {
    color: var(--text-main, #fff);
    font-weight: 600;
}

/* --- Spodní část match-fragmentu (sestavy + footer) --- */
.match-fragment .mf-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
}

.match-fragment .mf-coaches,
.match-fragment .mf-spectators {
    color: var(--text-muted);
}

/* --- BLOCK B: Aktuální tabulka --- */
.standings-block .view-all {
    display: inline-block;
    margin-top: 14px;
}

/* Pozitivní / negativní rozdíl + žlutá pro karty */
.text-positive { color: #4ade80; }
.text-negative { color: #f87171; }
.text-yellow   { color: #f5d020; }

/* --- BLOCK C: Top 10 hráčů (swap-table) + sortable-table sdílí klikací hlavičky --- */
.swap-table th,
.sortable-table th {
    white-space: nowrap;
}

.swap-table td,
.sortable-table td {
    vertical-align: middle;
}

.swap-th {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.swap-th:hover {
    color: var(--accent);
}

.swap-th.stat-active {
    color: var(--accent);
    background: var(--accent-glow);
}

.swap-th::after {
    content: '↕';
    display: inline-block;
    margin-left: 6px;
    opacity: 0.4;
    font-size: 0.7em;
}

.swap-th.stat-active::after {
    content: '▼';
    opacity: 1;
}

.swap-th[data-dir="asc"]::after {
    content: '▲';
    opacity: 1;
}

.swap-th[data-dir="desc"]::after {
    content: '▼';
    opacity: 1;
}

/* --- RESPONZIVITA --- */
@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "sidebar" "main";
        gap: 30px;
    }
    .home-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
    .sidebar-section {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        justify-content: center;
        margin-bottom: 14px;
    }
    .sidebar-title {
        writing-mode: horizontal-tb;
        transform: none;
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    /* Na mobilu vrátíme chips do horizontální pill podoby — vertikální tab tu nemá smysl. */
    .home-sidebar .chip,
    .home-sidebar .chip-sub {
        display: inline-block;
        width: auto !important;
        min-height: 0;
        margin: 0;
        padding: 6px 14px;
        writing-mode: horizontal-tb;
        transform: none;
        border: 1px solid var(--border);
        border-radius: 999px;
        text-align: center;
        font-size: 0.85rem;
    }
    .home-sidebar .chip.active,
    .home-sidebar .chip-sub.active {
        border-color: var(--accent);
    }
}

@media (max-width: 650px) {
    .archive-hero h1 {
        font-size: 2.5rem;
    }
    .home-sidebar .chip,
    .home-sidebar .chip-sub {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    /* Sestavy na mobilu jeden sloupec (match.css už to dělá pro .lineup-container) */
}
