/* ==========================================================================
   Страница «Чемпионат» / «Архив игр»
   ========================================================================== */

.archive-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.archive-page__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.archive-page__title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    color: #003366;
    font-weight: 700;
}

.archive-page__subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* --- Переключатель: Текущий чемпионат / Архив --- */
.archive-view-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem;
    background: #e8eef5;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.archive-view-tabs__link {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.archive-view-tabs__link:hover {
    color: #003366;
}

.archive-view-tabs__link.is-active {
    background: #fff;
    color: #003366;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.12);
}

/* --- Навигация по сезонам (только в режиме «Архив») --- */
.archive-season-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.archive-season-nav__link {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    transition: all 0.2s;
}

.archive-season-nav__link:hover {
    border-color: #003366;
    color: #003366;
}

.archive-season-nav__link.is-active {
    background: #003366;
    border-color: #003366;
    color: #fff;
}

/* --- Список матчей --- */
.archive-games-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.archive-page__media-hint {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: #f0f4f8;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #475569;
    text-align: center;
}

.archive-page__media-hint a {
    color: #046bd2;
    font-weight: 600;
}

.archive-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #64748b;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* --- Карточка матча --- */
.match-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.08);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.match-card:hover {
    box-shadow: 0 8px 24px rgba(0, 51, 102, 0.12);
}

.match-card__meta {
    text-align: center;
    width: 100%;
}

.match-card__date {
    font-weight: 600;
    color: #003366;
    font-size: 0.95rem;
}

.match-card__tournament {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* Сетка: домашняя команда | счёт | гостевая — на всех экранах */
.match-card__teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
}

.match-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    min-width: 0;
}

.match-card__team--home {
    justify-self: end;
}

.match-card__team--away {
    justify-self: start;
}

.match-card__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.match-card__logo--placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.match-card__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.3;
}

.match-card__score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    min-width: 88px;
}

.match-card__score {
    font-size: 1.75rem;
    font-weight: 700;
    color: #003366;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.match-card__score--vs {
    font-size: 1.25rem;
    color: #94a3b8;
}

.match-card__protocol {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: #046bd2;
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}

.match-card__protocol:hover {
    background: #045cb4;
}

.match-card__badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
}

.match-card__badge--upcoming {
    background: #fef3c7;
    color: #b45309;
}

/* --- Блок медиа: Видео / События --- */
.archive-media {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.archive-media__title {
    font-size: 1.5rem;
    color: #003366;
    margin-bottom: 1rem;
    text-align: center;
}

.media-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.media-tabs__btn {
    padding: 0.6rem 1.5rem;
    border: none;
    background: #e8eef5;
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.media-tabs__btn:hover {
    color: #003366;
}

.media-tabs__btn.is-active {
    background: #003366;
    color: #fff;
}

.media-panel {
    display: none;
}

.media-panel.is-active {
    display: block;
}

/* Видео-сетка */
.archive-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.archive-video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.archive-video-card .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.archive-video-card .video-wrapper iframe,
.archive-video-card .video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.archive-video-card__info {
    padding: 1rem;
}

.archive-video-card__info h3 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.archive-video-card__date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Карточки событий (фотоотчёты) */
.archive-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.event-game-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.event-game-card:hover {
    border-color: #003366;
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.1);
    transform: translateY(-2px);
}

.event-game-card__match {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.event-game-card__date {
    font-size: 0.85rem;
    color: #64748b;
}

.event-game-card__hint {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: #046bd2;
}

.event-game-card--no-photos {
    cursor: default;
    opacity: 0.75;
}

.event-game-card--no-photos:hover {
    transform: none;
    border-color: #e2e8f0;
    box-shadow: none;
}

/* Модальное окно фотоотчёта */
.photo-report-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.85);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.photo-report-modal.is-open {
    display: flex;
}

.photo-report-modal__dialog {
    background: #fff;
    border-radius: 14px;
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.photo-report-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.photo-report-modal__title {
    font-size: 1.1rem;
    color: #003366;
    font-weight: 600;
    padding-right: 1rem;
}

.photo-report-modal__close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
}

.photo-report-modal__close:hover {
    color: #003366;
}

.photo-report-modal__body {
    padding: 1.25rem;
    overflow-y: auto;
}

.photo-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.photo-report-grid img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.photo-report-grid img:hover {
    transform: scale(1.02);
}

.photo-report-modal__footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.photo-report-modal__footer a {
    color: #046bd2;
    font-weight: 500;
}

.photo-report-empty {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}

/* Лайтбокс одного фото */
.photo-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.photo-lightbox.is-open {
    display: flex;
}

.photo-lightbox img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.photo-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

/* Кнопка НХЛ */
.archive-page .btn-nhl {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.1rem;
    background: #003366;
    color: #fff !important;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.archive-page .btn-nhl:hover {
    background: #004488;
}

/* --- Адаптив --- */
@media (max-width: 640px) {
    .archive-page {
        padding: 1.25rem 1rem 3rem;
    }

    .archive-view-tabs__link {
        font-size: 0.85rem;
        padding: 0.65rem 0.5rem;
    }

    .match-card {
        padding: 1rem;
    }

    .match-card__teams {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 0.35rem 0.4rem;
    }

    .match-card__team {
        flex-direction: column;
        gap: 0.35rem;
    }

    .match-card__logo,
    .match-card__logo--placeholder {
        width: 44px;
        height: 44px;
    }

    .match-card__name {
        font-size: 0.68rem;
        line-height: 1.25;
        hyphens: auto;
    }

    .match-card__score-block {
        min-width: 56px;
        gap: 0.4rem;
    }

    .match-card__score {
        font-size: 1.35rem;
    }

    .match-card__protocol {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
        white-space: nowrap;
    }

    .match-card__badge {
        font-size: 0.65rem;
    }

    .archive-videos-grid,
    .archive-events-grid {
        grid-template-columns: 1fr;
    }
}

/* Десктоп: логотип и название в одну линию у краёв */
@media (min-width: 641px) {
    .match-card__team--home {
        flex-direction: row-reverse;
        text-align: right;
    }

    .match-card__team--away {
        flex-direction: row;
        text-align: left;
    }
}
