/* LA 2028 Schedule page */
.la2028-schedule-page {
    padding-bottom: 3rem;
}

/* Embedded block on destination page */
.la2028-schedule-embedded {
    margin-top: 1rem;
}

.la2028-block-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: #343c60;
    margin: 0 0 0.25rem;
    text-align: center;
}

.la2028-block-dates {
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    margin: 0 0 1rem;
}

.la2028-schedule-embedded .la2028-table-wrap {
    max-height: 1200px;
    overflow: auto;
    position: relative;
}

.la2028-schedule-embedded .la2028-table-scroll {
    overflow: visible;
    cursor: default;
}

.la2028-schedule-embedded .la2028-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.la2028-schedule-embedded .la2028-table thead th.la2028-th-merged {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
}

.la2028-schedule-embedded .la2028-table tbody td.la2028-sport-venue-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}

.la2028-schedule-embedded .la2028-table tbody tr.la2028-zone-row td.la2028-zone-cell {
    position: sticky;
    left: 0;
    z-index: 2;
}

@media (max-width: 768px) {
    .la2028-schedule-embedded .la2028-table-wrap {
        max-height: 900px;
    }
}

.la2028-hero {
    padding: 2.5rem 0;
    text-align: center;
}

.la2028-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.la2028-title span {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    opacity: 0.95;
}

.la2028-dates {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

/* Toolbar — sticky & compact */
.la2028-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
    margin-bottom: 0;
    position: sticky;
    top: var(--la2028-toolbar-top, 0px);
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.la2028-toolbar-tz {
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* Table wrapper: no overflow so position:sticky works in .la2028-table-scroll.
   In modern browsers overflow:clip restores rounded corner clipping. */
.la2028-table-wrap {
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: visible;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
@supports (overflow: clip) {
    .la2028-table-wrap {
        overflow: clip;
    }
}

.la2028-table-scroll {
    overflow-x: auto;
    overflow-y: clip;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
}
.la2028-table-scroll:active {
    cursor: grabbing;
}

.la2028-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: auto;
    min-width: 900px;
}

.la2028-table th,
.la2028-table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.4rem;
    vertical-align: middle;
    text-align: center;
    background: #fff;
}

/* Header: одна строка — объединённая колонка Sport/Venue + даты (дни недели) */
.la2028-table thead tr:first-child th {
    background: #2f3759;
    color: #fff;
    font-weight: 600;
    padding: 0.6rem 0.4rem;
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
    will-change: transform;
}

/* Объединённая колонка Sport + Venue в шапке */
.la2028-table thead tr:first-child th.la2028-th-merged {
    left: 0;
    z-index: 4;
    min-width: 150px;
    width: 150px;
    text-align: left;
    padding-left: 0.75rem;
    vertical-align: middle;
}
.la2028-th-sport-label {
    display: block;
    font-size: 1em;
}
.la2028-th-venue-label {
    display: block;
    font-size: 0.75em;
    font-weight: 500;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.9);
}
/* Колонки дат в шапке — всегда закреплены сверху */
.la2028-table thead tr:first-child th.la2028-day-row {
    background: #2f3759;
    min-width: 7.5rem;
}

/* Body: объединённая колонка Sport + Venue (sticky слева) */
.la2028-table tbody td.la2028-sport-venue-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f8f9fb;
    font-weight: 600;
    color: #343c60;
    text-align: left;
    padding-left: 0.75rem;
    min-width: 150px;
    width: 150px;
    vertical-align: middle;
    box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.06);
}
.la2028-table tbody td.la2028-sport-venue-cell .la2028-sport-name {
    display: block;
    font-weight: 600;
    color: #343c60;
}
.la2028-table tbody td.la2028-sport-venue-cell .la2028-venue-sublabel {
    display: block;
    font-size: 0.75em;
    font-weight: 500;
    color: #6b7280;
    margin-top: 0.15rem;
}

.la2028-table tbody tr:hover td.la2028-sport-venue-cell {
    background: #eef0f7;
}

/* Колонки дней: достаточная ширина, чтобы время не наползало */
.la2028-table tbody td[data-date] {
    min-width: 7.5rem;
}

/* Cell with medal (icon) */
.la2028-table .la2028-cell-medal {
    padding: 0.35rem;
}

.la2028-table .la2028-cell-medal img {
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
}

/* Cell with schedule: одна строка на время, колонка растёт по содержимому */
.la2028-table .la2028-cell-schedule {
    font-size: 0.7rem;
    color: #374151;
    padding: 0;
    text-align: left;
    vertical-align: top;
    min-width: 7.5rem;
}

/* Event line: группа из времени + описания */
.la2028-table .la2028-cell-schedule .la2028-event-line {
    display: block;
    padding: 0.35rem 0.5rem;
    line-height: 1.4;
    color: #4b5563;
    background: transparent;
}

.la2028-table .la2028-cell-schedule .la2028-event-line + .la2028-event-line {
    border-top: 1px solid #e5e7eb;
}

/* Header: время + тип сессии */
.la2028-event-header {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-wrap: nowrap;
}

.la2028-table .la2028-cell-schedule .la2028-event-time {
    display: inline-block;
    white-space: nowrap;
    font-weight: 600;
    color: #374151;
    font-size: 0.72rem;
}

.la2028-event-type {
    font-size: 0.58rem;
    color: #9ca3af;
    font-weight: 400;
    white-space: nowrap;
}

/* Описания — строки с цветовой полоской пола */
.la2028-desc-item {
    font-size: 0.6rem;
    line-height: 1.35;
    padding: 1px 0 1px 7px;
    border-left: 2.5px solid #d1d5db;
    color: #6b7280;
    margin-top: 2px;
}

.la2028-desc-item.la2028-g-men {
    border-left-color: #3b82f6;
    color: #1e40af;
}

.la2028-desc-item.la2028-g-women {
    border-left-color: #ec4899;
    color: #be185d;
}

.la2028-desc-item.la2028-g-mixed {
    border-left-color: #0b7a00;
    color: #0b7a00;
}

.la2028-desc-item.la2028-g-neutral {
    border-left-color: #d1d5db;
    color: #6b7280;
}

.la2028-table tbody tr:hover .la2028-cell-schedule .la2028-event-time {
    color: #1f2937;
}

.la2028-table tbody tr:hover td:not(.la2028-sport-venue-cell):not(.la2028-zone-cell) {
    background: #f2f3f9;
}

.la2028-table .la2028-cell-empty {
    background: #fafafa;
}

/* Zone row: вся строка закреплена при скролле (ячейка зоны + spacer), подчёркивание на всю ширину */
.la2028-table tbody tr.la2028-zone-row td.la2028-zone-cell {
    position: sticky;
    top: 3.85rem;
    left: 0;
    z-index: 3;
    will-change: transform;
    background: #e8eaef;
    color: #2f3759;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #2f3759;
    min-width: 150px;
    width: 150px;
    box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.06), 0 2px 0 0 #2f3759;
}

.la2028-table tbody tr.la2028-zone-row td.la2028-zone-spacer {
    position: sticky;
    top: 3.85rem;
    z-index: 2;
    will-change: transform;
    background: #e8eaef;
    border-bottom: 2px solid #2f3759;
    padding: 0;
    min-width: 0;
    /* непрерывная линия под всей строкой */
    box-shadow: 0 2px 0 0 #2f3759;
}


/* Gender legend */
.la2028-gender-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.la2028-gender-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.la2028-gender-legend-item::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    border-radius: 1.5px;
}

.la2028-gender-legend-item.la2028-gl-men { color: #1e40af; }
.la2028-gender-legend-item.la2028-gl-men::before { background: #3b82f6; }

.la2028-gender-legend-item.la2028-gl-women { color: #be185d; }
.la2028-gender-legend-item.la2028-gl-women::before { background: #ec4899; }

.la2028-gender-legend-item.la2028-gl-mixed { color: #0b7a00; }
.la2028-gender-legend-item.la2028-gl-mixed::before { background: #0b7a00; }

/* Sport filter dropdown */
.la2028-sport-filter {
    position: relative;
}

.la2028-sport-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.la2028-sport-filter-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.la2028-sport-filter-arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.85em;
}

.la2028-sf-open .la2028-sport-filter-arrow {
    transform: rotate(180deg);
}

.la2028-sf-open .la2028-sport-filter-btn {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.la2028-sport-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 220px;
    max-height: 360px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    flex-direction: column;
}

.la2028-sf-open .la2028-sport-filter-dropdown {
    display: flex;
}

.la2028-sport-filter-list {
    overflow-y: auto;
    max-height: 280px;
    padding: 0.4rem 0;
}

.la2028-sf-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}

.la2028-sf-item:hover {
    background: #f3f4f6;
}

.la2028-sf-checkbox {
    width: 15px;
    height: 15px;
    accent-color: #2f3759;
    flex-shrink: 0;
    cursor: pointer;
}

.la2028-sport-filter-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.la2028-sf-clear,
.la2028-sf-apply {
    flex: 1;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
}

.la2028-sf-clear {
    color: #6b7280;
    background: #fff;
    border-color: #d1d5db;
}

.la2028-sf-clear:hover {
    background: #f3f4f6;
}

.la2028-sf-apply {
    color: #fff;
    background: #2f3759;
    border-color: #2f3759;
}

.la2028-sf-apply:hover {
    background: #3d4a73;
}

/* Toggle details button */
.la2028-toggle-details {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-left: auto;
    white-space: nowrap;
}

.la2028-toggle-details:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.la2028-toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.85em;
}

.la2028-details-hidden .la2028-toggle-icon {
    transform: rotate(-90deg);
}

/* Hidden details state */
.la2028-details-hidden .la2028-desc-item,
.la2028-details-hidden .la2028-event-type {
    display: none;
}

.la2028-details-hidden .la2028-gender-legend {
    opacity: 0.4;
    pointer-events: none;
}

/* Wider day columns when details are visible */
.la2028-schedule-page:not(.la2028-details-hidden) .la2028-table thead tr:first-child th.la2028-day-row,
.la2028-schedule-page:not(.la2028-details-hidden) .la2028-table tbody td[data-date],
.la2028-schedule-page:not(.la2028-details-hidden) .la2028-table .la2028-cell-schedule {
    min-width: 9.4rem;
}


@media (max-width: 768px) {
    .la2028-toolbar {
        gap: 0.3rem 0.6rem;
        justify-content: space-between;
    }

    .la2028-toolbar-tz {
        display: none;
    }

    .la2028-gender-legend {
        width: 100%;
    }

    .la2028-sport-filter,
    .la2028-toggle-details {
        flex: 0 0 auto;
    }

    .la2028-table thead tr:first-child th.la2028-th-merged,
    .la2028-table tbody td.la2028-sport-venue-cell,
    .la2028-table tbody tr.la2028-zone-row td.la2028-zone-cell {
        min-width: 90px;
        width: 90px;
    }

    .la2028-table thead tr:first-child th.la2028-day-row,
    .la2028-table tbody td[data-date] {
        min-width: 7.5rem;
    }

    .la2028-table th,
    .la2028-table td {
        padding: 0.35rem 0.25rem;
    }
}
