/* ============================================
   Страница маршрута — /transport/596a
   Карточки, сетки и плашки — из dashboard.css, бейдж номера — из transport.css.
   Цвета — токены tokens.css (переключаются темой); отдельные правила
   [data-theme="dark"] — только для полупрозрачных подложек.
   ============================================ */

/* =============================
   КОРОТКО О МАРШРУТЕ
   ============================= */
.route-facts {
    padding: 1.25rem;
}

.route-facts__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
}

.route-facts__item dt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.route-facts__item dt > i {
    color: var(--accent-primary);
}

.route-facts__item dd {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.route-facts__muted {
    font-weight: 400;
    color: var(--text-secondary);
}

.route-facts__link {
    font-weight: 500;
    color: var(--accent-primary);
    text-decoration: none;
}

.route-facts__link:hover {
    text-decoration: underline;
}

/* =============================
   АКТУАЛЬНОСТЬ ДАННЫХ
   ============================= */
.route-actuality {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(17, 139, 138, 0.08);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

[data-theme="dark"] .route-actuality {
    background: rgba(45, 212, 191, 0.1);
}

.route-actuality > i {
    margin-top: 0.15rem;
    color: var(--accent-primary);
}

.route-actuality a {
    color: var(--accent-primary);
    font-weight: 600;
}

/* =============================
   НАПРАВЛЕНИЯ: РАСПИСАНИЕ И ОСТАНОВКИ
   ============================= */
.route-schedule,
.route-stops {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
}

.route-direction-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

.route-schedule__from {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.route-schedule__day {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.route-schedule__day + .route-schedule__day {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.route-schedule__day-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.route-schedule__edges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0;
    color: var(--text-secondary);
}

.route-schedule__edges strong {
    color: var(--text-primary);
}

.route-schedule__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.route-schedule__table th {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.route-schedule__table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.route-schedule__table tr:last-child td {
    border-bottom: 0;
}

/* Направление интервального маршрута без своих строк: «ходит по интервалу» вместо предупреждения */
.route-schedule__interval-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
}

.route-schedule__interval-note > i {
    margin-top: 0.15rem;
    color: var(--accent-primary);
}

/* Точное расписание: время каждого рейса плиткой (пригородные 605, 618, 664) */
.route-departures {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.route-departures__item {
    padding: 0.35rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(17, 139, 138, 0.06);
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

[data-theme="dark"] .route-departures__item {
    background: rgba(45, 212, 191, 0.08);
}

/* Остановки двух направлений — вкладки «в сторону …» в одной карточке */
.route-stops__tabs {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.route-stops__tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    text-align: left;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.route-stops__tab:hover {
    color: var(--text-primary);
}

.route-stops__tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
}

.route-stops__tab:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
}

.route-stops__tab-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.route-stops__tab.active .route-stops__tab-label {
    color: var(--accent-primary);
}

.route-stops__tab-to {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.route-stops__direction {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
    .route-stops__tab {
        transition: none;
    }
}

/* Остановки: вертикальная линия с точками, крупные — заметнее */
.route-stops__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.route-stops__item {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.6rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.route-stops__item::before {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.route-stops__item:first-child::before {
    top: 50%;
}

.route-stops__item:last-child::before {
    bottom: 50%;
}

.route-stops__item::after {
    content: "";
    position: absolute;
    left: calc(0.4rem - 4px);
    top: calc(50% - 5px);
    width: 10px;
    height: 10px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    background: var(--bg-card);
}

.route-stops__item--major {
    font-weight: 700;
}

.route-stops__item--major::after {
    left: calc(0.4rem - 6px);
    top: calc(50% - 7px);
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
}

/* =============================
   КАРТА СЛЕВА, ОСТАНОВКИ СПРАВА
   На широком экране карта прилипает под шапкой (sticky-top, ~135px),
   пока справа прокручиваются остановки обоих направлений.
   Уже 992px — одна колонка: карта, под ней остановки.
   ============================= */
.route-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
}

.route-layout__map {
    position: sticky;
    top: 9.5rem;
}

.route-layout__stops {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.route-map {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.route-map__canvas {
    width: 100%;
    height: clamp(420px, calc(100vh - 14rem), 640px);
}

@media (max-width: 992px) {
    .route-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-layout__map {
        position: static;
    }

    .route-map__canvas {
        height: 420px;
    }
}

.route-map__status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* =============================
   ДРУГИЕ МАРШРУТЫ
   ============================= */
.dash-grid a.route-other {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
}

.dash-grid a.route-other:hover,
.dash-grid a.route-other:focus-visible {
    color: var(--text-primary);
    box-shadow: var(--card-shadow-hover);
}

.route-other__title {
    font-weight: 600;
    line-height: 1.35;
}

.route-other__meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.route-other__all {
    color: var(--accent-primary);
    text-decoration: none;
}

.route-other__all:hover {
    text-decoration: underline;
}

/* =============================
   АДАПТИВ
   ============================= */
@media (max-width: 576px) {
    .route-facts,
    .route-schedule,
    .route-stops {
        padding: 1rem;
    }

    .route-facts__list {
        grid-template-columns: 1fr;
    }

    .route-map__canvas {
        height: 320px;
    }
}
