/* --- БАЗОВЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    --navy-blue: #0f172a;
    --navy-light: #1e293b;
    --accent-orange: #ea580c;
    --accent-orange-hover: #c2410c;
    --accent-red: #dc2626;
    --bg-light: #f1f5f9;
    --white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-soft: 0 10px 25px -5px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.1);
    --border-radius: 12px;
}

/* --- СБРОС И БАЗА --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    overflow-x: hidden;
    /* Убираем border-top и добавляем padding, чтобы контент не заезжал под фиксированную полосу */
    padding-top: 15px; 
}

/* Фиксированная полоса сверху */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 15px;
    background-color: var(--navy-blue);
    z-index: 9999;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

/* Основной макет (Sidebar + Content) */
.site-wrapper {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px;
    gap: 32px;
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* предотвращает переполнение контента из-за flex */
    width: 100%;
    max-width: 100vw;
}

.site-main {
    flex-grow: 1;
    min-width: 0;
    width: 100%;
}

/* --- БОКОВОЕ МЕНЮ (SIDEBAR) --- */
.site-sidebar {
    width: 300px;
    flex-shrink: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 35px;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo-block {
    padding-left: 20px;
}

.logo-block .logo {
    display: block;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
    color: var(--navy-blue);
    line-height: 1.2;
}

.logo-block .slogan {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--navy-blue);
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    background-color: var(--navy-blue);
    padding: 32px 24px;
    border-radius: var(--border-radius);
}

.mobile-nav-header {
    display: none;
}

.nav-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.nav-group:last-child {
    margin-bottom: 0;
}

.nav-heading {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding-left: 2px;
}

.nav-group ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-nav a {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    transition: color 0.2s;
    line-height: 1.2;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--white);
}

.footer-nav-group ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-nav-group h4 {
    margin-bottom: 16px;
    color: var(--white);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- ОСНОВНОЙ КОНТЕНТ (DASHBOARD) --- */
main {
    width: 100%;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--navy-blue);
    margin-bottom: 24px;
    hyphens: auto;
    -webkit-hyphens: auto;
    word-break: break-word; 
}

.hero-title {
    hyphens: auto;
    -webkit-hyphens: auto;
    word-break: break-word; 
}

.hero-picture {
    display: block;
    width: 100%;
    margin-bottom: 32px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hero-cover {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.alert-banner {
    background-color: #fff7ed;
    border-left: 4px solid var(--accent-orange);
    padding: 16px 20px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-bottom: 32px;
    font-size: 15px;
    color: #9a3412;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
}

/* --- КАРТОЧКИ --- */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy-blue);
    margin-bottom: 0;
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.contact-links {
    margin: 16px 0;
}

.contact-links .tel {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-blue);
    word-break: break-all;
}

.contact-links .hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- РАСПИСАНИЕ (ВНУТРИ КАРТОЧЕК) --- */
.mini-schedule {
    margin-bottom: 20px;
}

.mini-schedule li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 14px;
    font-weight: 500;
}

.mini-schedule li:last-child {
    border-bottom: none;
}

.status.on-time {
    color: #16a34a;
}

.status.delayed {
    color: var(--accent-red);
}

/* --- ИНФРАСТРУКТУРА --- */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-content: start;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-light);
    padding: 10px 12px;
    border-radius: 8px;
}

/* --- КНОПКИ --- */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border: none;
    margin-top: auto;
    display: inline-block;
}

.btn-primary {
    background-color: var(--accent-orange);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--accent-orange-hover);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--navy-light);
    color: var(--navy-light);
}

.btn-outline:hover {
    background-color: var(--navy-light);
    color: var(--white);
}

/* --- РАЗДЕЛИТЕЛЬ --- */
.section-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 48px 0;
}

/* --- SEO ЖУРНАЛЬНАЯ ВЕРСТКА (markdown контент) --- */
.page-content {
    max-width: 800px;
    /* Узкая колонка для идеальной читаемости */
    margin: 0 auto;
    background: var(--white);
    padding: 48px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

/* --- ГЛАВНАЯ СТРАНИЦА (HOME AGGREGATOR) --- */
.home-hero {
    background: linear-gradient(135deg, var(--navy-blue) 0%, var(--navy-light) 100%);
    border-radius: var(--border-radius);
    padding: 64px 40px;
    margin-bottom: 48px;
    color: var(--white);
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.home-hero .hero-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.home-hero .hero-subtitle {
    font-size: 18px;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

.home-stations-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--navy-blue);
    margin-bottom: 24px;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.station-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.station-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.station-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.station-card .card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e2e8f0;
}

.station-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.station-card:hover .card-image img {
    transform: scale(1.05);
}

.station-card .card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.station-card .card-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy-blue);
    margin-bottom: 12px;
}

.station-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.station-card .tags span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.station-card .btn {
    margin-top: auto;
}

.page-content h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    margin-top: 40px;
    color: var(--navy-blue);
    line-height: 1.3;
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content h3 {
    font-size: 20px;
    margin: 32px 0 16px;
    color: var(--navy-blue);
}

.page-content p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #475569;
}

.page-content p strong {
    color: var(--navy-light);
}

.page-content blockquote {
    font-size: 20px;
    font-style: italic;
    color: var(--navy-blue);
    border-left: 4px solid var(--accent-orange);
    padding-left: 20px;
    margin: 32px 0;
    background: #f8fafc;
    padding: 24px;
    border-radius: 0 8px 8px 0;
}

.page-content ul {
    margin-bottom: 24px;
    padding-left: 20px;
}

.page-content ul li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 12px;
}

.page-content ul li::before {
    content: "•";
    color: var(--accent-orange);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* --- ПОДВАЛ (FOOTER) --- */
.site-footer {
    background-color: var(--navy-blue);
    color: var(--text-muted);
    padding: 48px 0;
    margin-top: 64px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col .logo {
    color: var(--white);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 16px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: var(--white);
}

/* --- ВНУТРЕННЯЯ ПЕРЕЛИНКОВКА (INTERLINKS) --- */
.interlinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.interlink-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    color: var(--navy-blue);
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.interlink-card:hover {
    background: var(--navy-light);
    color: var(--white);
    border-color: var(--navy-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* --- АДАПТИВ (Медиа-запросы) --- */
@media (max-width: 992px) {

    .page-content,
    .intro-content,
    .dashboard-grid {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .seo-article table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-wrapper {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .site-sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 15px;
        padding: 16px 20px;
        overflow-y: visible;
        border-radius: 0;
        z-index: 999;
        background-color: var(--bg-light);
    }

    .sidebar-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        flex-wrap: nowrap;
    }

    .logo-block {
        padding-left: 0;
        flex-shrink: 1;
        min-width: 0;
    }

    .logo-block .logo {
        font-size: 18px;
        line-height: 1.1;
        margin-bottom: 2px;
    }

    .logo-block .slogan {
        font-size: 10px;
        line-height: 1;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-menu-toggle {
        display: block;
        flex-shrink: 0;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh; /* Высота экрана */
        background-color: var(--navy-blue);
        z-index: 10000;
        overflow-y: auto;
        transform: translateX(100%); /* Прячем вправо */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        border: none;
        border-radius: 0;
    }

    .main-nav.is-active {
        transform: translateX(0); /* Выезжает */
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 24px;
    }

    .mobile-nav-header .logo {
        color: var(--white);
        font-weight: 800;
        font-size: 18px;
        letter-spacing: 0.5px;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        color: var(--white);
        cursor: pointer;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.2s;
    }

    .mobile-menu-close:active {
        opacity: 0.7;
    }

    .nav-group {
        padding: 0 24px;
    }

    /* Увеличиваем кликабельную область ссылок в мобильном меню */
    .main-nav a {
        font-size: 16px;
        padding: 8px 0;
        display: block;
    }
}

/* --- FAQ ACCORDION --- */
.faq-section {
    margin-bottom: 48px;
    padding: 0 15px;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.faq-question {
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy-blue);
    cursor: pointer;
    list-style-type: none;
    position: relative;
    user-select: none;
    transition: background-color 0.2s;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 400;
    color: var(--accent-orange);
    transition: transform 0.3s;
}

details[open] .faq-question::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

details[open] .faq-question {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.faq-answer {
    padding: 24px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--white);
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    main {
        padding: 20px 0;
    }

    .container {
        padding: 0 16px;
    }

    .page-content {
        padding: 20px 16px;
        margin: 0;
    }

    .page-title {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .home-hero {
        padding: 40px 16px; /* Значительно меньше боковые отступы */
        margin-bottom: 32px;
    }

    .home-hero .hero-title {
        font-size: 28px; /* Немного меньше шрифт, чтобы длинные слова влезали */
        word-break: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-section {
        padding: 24px 16px;
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .info-grid {
        gap: 16px;
    }
}