/* ══════════════════════════════════════════
   India Metro Guide — Minimalist Design System
   ══════════════════════════════════════════ */

:root {
    /* Core palette — muted, sophisticated */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;

    --accent: #6366f1;
    --success: #059669;
    --success-light: #ecfdf5;
    --danger: #dc2626;
    --warning: #d97706;
    --warning-light: #fffbeb;

    /* Neutrals */
    --white: #ffffff;
    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --bg-body: var(--gray-50);
    --bg-card: var(--white);
    --bg-elevated: var(--white);
    --border-color: var(--gray-200);
    --border-light: var(--gray-100);

    /* Spacing */
    --space-xs: .25rem;
    --space-sm: .5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows — very subtle */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);

    /* Transitions */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --transition: all .2s var(--ease);
    --transition-slow: all .35s var(--ease);

    /* Gradient */
    --gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #6366f1 100%);
    --gradient-subtle: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #1e293b;
    --border-color: #334155;
    --border-light: #1e293b;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --primary-light: rgba(37,99,235,.15);
    --primary-50: rgba(37,99,235,.1);
    --shadow-xs: 0 1px 2px rgba(0,0,0,.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.25);
    --shadow: 0 2px 8px rgba(0,0,0,.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.35);
}
[data-theme="dark"] body { background: var(--bg-body); color: var(--text-primary); }
[data-theme="dark"] .card,
[data-theme="dark"] .search-box { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .navbar { background: var(--bg-card) !important; border-color: var(--border-color); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-primary);
}
[data-theme="dark"] .hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
[data-theme="dark"] .dropdown-menu { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .dropdown-item { color: var(--text-secondary); }
[data-theme="dark"] .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .table { color: var(--text-primary); }
[data-theme="dark"] .accordion-button { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .accordion-button:not(.collapsed) { background: var(--primary-light); }
[data-theme="dark"] .accordion-item { border-color: var(--border-color); background: var(--bg-card); }
[data-theme="dark"] .accordion-body { background: var(--bg-card); color: var(--text-secondary); }
[data-theme="dark"] .footer { background: #020617 !important; }
[data-theme="dark"] .city-card { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .city-card:hover { color: var(--text-primary); }
[data-theme="dark"] .station-link { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }
[data-theme="dark"] .station-link:hover { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .stat-card { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .info-metric { background: var(--bg-body); border-color: var(--border-color); }
[data-theme="dark"] .suggestions-dropdown { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .suggestion-item { border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .suggestion-item span { color: var(--text-primary); }
[data-theme="dark"] .suggestion-item:hover { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .suggestion-item:hover span { color: var(--primary); }
[data-theme="dark"] .suggestion-item .line-badge { background: var(--bg-body); color: var(--text-muted); }
[data-theme="dark"] .badge.bg-light { background: var(--bg-body) !important; color: var(--text-secondary) !important; }
[data-theme="dark"] .bg-light { background: var(--bg-body) !important; }
[data-theme="dark"] .bg-white { background: var(--bg-card) !important; }
[data-theme="dark"] .text-dark { color: var(--text-primary) !important; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .border-bottom { border-color: var(--border-color) !important; }
[data-theme="dark"] .table-light { background: var(--bg-body); }
[data-theme="dark"] .table-bordered { border-color: var(--border-color); }
[data-theme="dark"] .table-bordered td,
[data-theme="dark"] .table-bordered th { border-color: var(--border-color); }
[data-theme="dark"] .content-article { color: var(--text-secondary); }
[data-theme="dark"] .content-article h2,
[data-theme="dark"] .content-article h3 { color: var(--text-primary); }
[data-theme="dark"] .content-article table th { background: var(--bg-body); }
[data-theme="dark"] .content-article table th,
[data-theme="dark"] .content-article table td { border-color: var(--border-color); }

/* Dark mode — Bootstrap overrides for text visibility */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
[data-theme="dark"] .h1, [data-theme="dark"] .h2, [data-theme="dark"] .h3,
[data-theme="dark"] .h4, [data-theme="dark"] .h5, [data-theme="dark"] .h6 {
    color: var(--text-primary);
}
[data-theme="dark"] p, [data-theme="dark"] li, [data-theme="dark"] span,
[data-theme="dark"] label, [data-theme="dark"] .form-label,
[data-theme="dark"] .form-check-label {
    color: var(--text-secondary);
}
[data-theme="dark"] .fw-bold, [data-theme="dark"] .fw-semibold {
    color: var(--text-primary);
}
[data-theme="dark"] .card-body, [data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer { color: var(--text-primary); }
[data-theme="dark"] .list-group-item {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
[data-theme="dark"] .list-group-item strong,
[data-theme="dark"] .list-group-item b { color: var(--text-primary); }
[data-theme="dark"] .alert { color: var(--text-primary); }
[data-theme="dark"] .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}
[data-theme="dark"] .form-text { color: var(--text-muted) !important; }
[data-theme="dark"] .input-group-text {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
[data-theme="dark"] .card-title { color: var(--text-primary) !important; }
[data-theme="dark"] .text-body { color: var(--text-primary) !important; }
[data-theme="dark"] .text-secondary { color: var(--text-secondary) !important; }
[data-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.city-card):not(.station-link) {
    color: var(--primary);
}
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
[data-theme="dark"] .table > :not(caption) > * > * { color: var(--text-primary); background-color: transparent; }
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255,255,255,.02); }
[data-theme="dark"] hr { border-color: var(--border-color); opacity: .3; }
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder { color: var(--text-muted); }
[data-theme="dark"] .btn-outline-primary { color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-color); }
[data-theme="dark"] .btn-light { background: var(--bg-body); color: var(--text-primary); border-color: var(--border-color); }

/* ── Base ── */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.65;
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Navbar ── */
.navbar {
    background: var(--bg-elevated) !important;
    border-bottom: 1px solid var(--border-light);
    padding: .6rem 0;
    transition: var(--transition);
    z-index: 1040;
}
.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}
.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.navbar-brand i { font-size: 1.1rem; }
.navbar-brand-logo {
    height: 28px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.nav-link {
    font-weight: 500;
    font-size: .88rem;
    color: var(--text-secondary) !important;
    padding: .5rem .75rem !important;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}
.nav-link:hover { color: var(--primary) !important; background: var(--primary-50); }
.nav-link.active { color: var(--primary) !important; }

.dropdown-menu {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: .4rem;
    box-shadow: var(--shadow-md);
    max-height: 360px;
    overflow-y: auto;
}
.dropdown-item {
    font-size: .85rem;
    padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.dropdown-item:hover { background: var(--primary-50); color: var(--primary); }

/* Dark mode toggle */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: .95rem;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* ── Hero ── */
.hero {
    background: var(--gradient);
    color: #fff;
    padding: 2.5rem 0;
    position: relative;
}
.hero h1 { font-weight: 700; font-size: 1.75rem; line-height: 1.2; }
.hero .lead { opacity: .9; font-size: .95rem; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: .74rem;
    font-weight: 600;
    padding: .35rem .8rem;
    border-radius: var(--radius-full, 999px);
    margin-bottom: 1.25rem;
}
.hero-badge i { color: #4ade80; }
.hero-quick-cities {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .85rem;
    font-size: .82rem;
}
.hero-quick-cities-label {
    color: rgba(255,255,255,.85);
    font-weight: 600;
}
.hero-quick-cities a {
    color: #fff;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    padding: .25rem .7rem;
    border-radius: var(--radius-full, 999px);
    text-decoration: none;
    transition: var(--transition);
}
.hero-quick-cities a:hover {
    background: rgba(255,255,255,.28);
}

/* ── Search Box ── */
.search-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}
.search-box-heading {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: .85rem;
}
.search-box .form-control,
.search-box .form-select {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    padding: .65rem .9rem;
    font-size: .9rem;
    transition: var(--transition);
    background: var(--bg-card);
}
.search-box .form-control:focus,
.search-box .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Autocomplete ── */
.suggestions-dropdown {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 1060;
    max-height: 280px;
    overflow-y: auto;
    width: 100%;
    min-width: 260px;
    box-shadow: var(--shadow-md);
}
.suggestion-item {
    padding: .55rem .9rem;
    cursor: pointer;
    font-size: .88rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    transition: var(--transition);
    color: var(--text-primary);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--primary-50); color: var(--primary); }
.suggestion-item.active { background: var(--primary-50); color: var(--primary); }
.suggestion-item .line-badge {
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
}
.suggestion-item .station-name { flex: 1; min-width: 0; }
.suggestion-item .suggestion-line-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.suggestion-item .suggestion-content { flex: 1; min-width: 0; overflow: hidden; }
.suggestion-item .suggestion-station-name {
    font-weight: 600; font-size: .88rem; color: var(--text-primary);
}
.suggestion-item .suggestion-city-name {
    font-weight: 400; color: var(--text-muted); font-size: .82rem;
}
.suggestion-item .suggestion-nearby {
    font-size: .75rem; color: var(--text-muted); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] .suggestion-item .suggestion-nearby { color: var(--text-muted); }
[data-theme="dark"] .suggestion-item .suggestion-city-name { color: var(--text-muted); }
.suggestions-dropdown:empty { display: none; }

/* .card clips overflow by default (for the line-strip decoration on city/route cards);
   a card that hosts an autocomplete dropdown needs to opt back out or the dropdown gets clipped.
   Uses .card.card-overflow-visible (two classes) so it reliably beats plain .card regardless of
   source order — a single-class override here would silently lose the cascade tie. */
.card.card-overflow-visible { overflow: visible; }

/* Route finder row alignment */
.search-box .row.align-items-end .form-label { white-space: nowrap; }
@media (max-width: 767.98px) {
    .suggestions-dropdown { width: 100% !important; left: 0; }
}

/* ── Cards ── */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    transition: var(--transition);
    overflow: hidden;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-100);
}

/* ── Stat Card ── */
.stat-card {
    text-align: center;
    padding: 1.25rem .75rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .25rem;
    font-weight: 500;
}
.stat-card-icon {
    display: block;
    font-size: 1.1rem;
    color: var(--primary);
    opacity: .55;
    margin-bottom: .4rem;
}
.why-metro-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 1.3rem;
}

/* ── Info Metric ── */
.info-metric {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: .85rem;
    transition: var(--transition);
}
.info-metric:hover { border-color: var(--primary-100); }
.info-metric .metric-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .2rem;
    font-weight: 500;
}
.info-metric .metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ── City Card ── */
.city-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 1.25rem;
    transition: var(--transition);
    height: 100%;
    position: relative;
}
.city-card-badge {
    position: absolute;
    top: .75rem;
    right: .75rem;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-50);
    padding: .25rem .55rem;
    border-radius: var(--radius-full, 999px);
}
.city-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--text-primary);
}
.city-card .city-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: .75rem;
}

/* ── Station Link ── */
.station-link {
    display: flex;
    align-items: center;
    padding: .6rem .75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    font-size: .88rem;
    font-weight: 500;
    transition: var(--transition);
    background: var(--bg-card);
}
.station-link:hover {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary);
    transform: translateX(2px);
}
.station-link i:last-child { color: var(--gray-400); margin-left: auto; font-size: .65rem; }

/* ── Line Colors ── */
.line-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: .4rem;
    flex-shrink: 0;
}
.line-strip {
    height: 5px;
    border-radius: 3px;
}

/* ── Line Filter Pills ── */
.line-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.line-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}
.line-pill:hover { border-color: var(--primary); color: var(--primary); }
.line-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Route Timeline ── */
.route-timeline { position: relative; padding-left: 32px; }
.route-stop { position: relative; padding-bottom: 1.15rem; }
.route-stop:last-child { padding-bottom: 0; }
.route-stop::before {
    content: '';
    position: absolute;
    left: -18px; top: 20px; bottom: -4px;
    width: 2px;
    background: var(--border-color);
}
.route-stop:last-child::before { display: none; }
.route-stop .stop-dot {
    position: absolute;
    left: -26px; top: 4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2.5px solid var(--bg-card);
    box-shadow: 0 0 0 1.5px var(--gray-300);
}
.route-stop:first-child .stop-dot { box-shadow: 0 0 0 2px var(--success); background: var(--success); }
.route-stop:last-child .stop-dot  { box-shadow: 0 0 0 2px var(--danger); background: var(--danger); }
.route-stop .stop-name { font-weight: 600; font-size: .92rem; }
.route-stop .stop-meta { font-size: .78rem; color: var(--text-muted); }
.route-stop .interchange-badge {
    display: inline-block;
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--warning-light);
    color: #92400e;
    font-weight: 600;
}

/* ── Section Headings ── */
.section-heading {
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: .65rem;
    color: var(--text-primary);
}
.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: var(--primary);
    border-radius: 2px;
}
.section-heading.text-center::after { left: 50%; transform: translateX(-50%); }

/* ── Station Search ── */
.station-search {
    position: relative;
    margin-bottom: 1rem;
}
.station-search input {
    width: 100%;
    padding: .6rem 1rem .6rem 2.5rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: .88rem;
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-primary);
}
.station-search input:focus { border-color: var(--primary); }
.station-search i {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
}

/* ── Badges ── */
.badge-line {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
}

/* ── FAQ / Accordion ── */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius) !important;
    margin-bottom: .5rem;
    overflow: hidden;
}
.accordion-button {
    font-weight: 600;
    font-size: .9rem;
    padding: .85rem 1.1rem;
    background: var(--bg-card);
}
.accordion-button:not(.collapsed) { background: var(--primary-50); color: var(--primary); }
.accordion-button:focus { box-shadow: none; border-color: transparent; }
.accordion-body { font-size: .88rem; line-height: 1.7; color: var(--text-secondary); }

/* ── Footer ── */
.footer { font-size: .85rem; background: var(--gray-900) !important; }
.footer h5, .footer h6 { letter-spacing: .01em; font-size: .9rem; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a {
    color: rgba(255,255,255,.45);
    text-decoration: none;
    transition: var(--transition);
    font-size: .82rem;
}
.footer-links a:hover { color: #fff; }

/* ── Ad Container ── */
.ad-container {
    margin: .5rem 0;
    text-align: center;
    overflow: hidden;
    min-height: 0;
}

/* ── Back to Top ── */
#backToTop {
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: none;
    width: 40px; height: 40px;
    font-size: .85rem;
}
#backToTop.show { opacity: 1; visibility: visible; }

/* ── Swap Button ── */
.swap-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-size: .85rem;
}
.swap-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* ── Content Article ── */
.content-article { font-size: .92rem; line-height: 1.8; color: var(--text-secondary); }
.content-article h2 { font-size: 1.2rem; font-weight: 700; margin: 1.5rem 0 .65rem; color: var(--text-primary); }
.content-article h3 { font-size: 1.05rem; font-weight: 600; margin: 1.15rem 0 .5rem; color: var(--text-primary); }
.content-article p { margin-bottom: .85rem; }
.content-article ul, .content-article ol { margin-bottom: .85rem; padding-left: 1.15rem; }
.content-article li { margin-bottom: .3rem; }
.content-article table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.content-article table th,
.content-article table td { padding: .55rem .7rem; border: 1px solid var(--border-color); font-size: .85rem; }
.content-article table th { background: var(--gray-50); font-weight: 600; }

/* ── Breadcrumb ── */
.breadcrumb { background: transparent; font-size: .82rem; margin-bottom: 0; }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-secondary); }

/* ── Scroll Reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Recent Searches ── */
.recent-searches {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .75rem;
}
.recent-search-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: .78rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}
.recent-search-item:hover { border-color: var(--primary); color: var(--primary); }

/* ── Share / Print Buttons ── */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* ── Station Nav (Prev/Next) ── */
.station-nav {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
}
.station-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: .85rem;
    transition: var(--transition);
}
.station-nav a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.station-nav a.next { justify-content: flex-end; text-align: right; }

/* ── Toast Notification ── */
.toast-notification {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: .6rem 1.25rem;
    border-radius: var(--radius);
    background: var(--gray-900);
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: var(--transition-slow);
    pointer-events: none;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Tighter spacing — reduce blank spaces ── */
section.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
section.py-4 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
.mb-5 { margin-bottom: 1.75rem !important; }
.content-article { margin-bottom: 1rem !important; }
.ad-container { margin: .75rem 0; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .hero { padding: 2rem 0; }
    .hero h1 { font-size: 1.5rem; }
    .search-box { padding: 1.15rem; }
    .section-heading { font-size: 1.2rem; }
    .dropdown-menu { max-height: 280px; }
    section.py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
}

@media (max-width: 767.98px) {
    .hero { padding: 1.5rem 0; }
    .hero h1 { font-size: 1.3rem; }
    .hero .lead { font-size: .88rem; }
    .stat-card .stat-value { font-size: 1.3rem; }
    .info-metric .metric-value { font-size: 1rem; }
    .content-article { font-size: .88rem; }
    .ad-container { min-height: 50px; margin: .5rem 0; }
    .station-nav { flex-direction: column; }
    section.py-5 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
    section.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .section-heading { font-size: 1.1rem; margin-bottom: 1rem; }
    .mb-5 { margin-bottom: 1.25rem !important; }
    .mb-4 { margin-bottom: .85rem !important; }
    .card-body { padding: .85rem !important; }
}

@media (max-width: 575.98px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    .search-box { padding: .85rem; }
    .hero h1 { font-size: 1.15rem; }
    .city-card { padding: 1rem; }
    .hero { padding: 1.25rem 0; }
}

/* ── Print ── */
@media print {
    nav, footer, .ad-container, #backToTop, .theme-toggle { display: none !important; }
    .hero { background: #fff !important; color: #000 !important; padding: 1rem 0; }
    body { background: #fff; }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Station Picker (click-to-open, type-to-filter) ── */
.station-picker {
    position: relative;
}
.station-picker-label {
    display: block;
    font-weight: 600;
    font-size: .82rem;
    margin-bottom: .3rem;
    color: var(--text-secondary);
}
.station-picker-field {
    position: relative;
}
.station-picker-input-wrap {
    position: relative;
}
.station-picker-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
    pointer-events: none;
}
.station-picker-input {
    width: 100%;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    padding: .65rem .9rem .65rem 2.3rem;
    font-size: .9rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}
.station-picker-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
/* City-filter pills sit directly under the field, always visible — no extra click needed
   to reach them, and nothing here is hidden inside a collapsible panel. */
.station-picker-city-pills-row {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-top: .55rem;
    scrollbar-width: none;
}
.station-picker-city-pills-row::-webkit-scrollbar { display: none; }
.station-picker-city-pill {
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: var(--radius-full, 999px);
    transition: var(--transition);
    white-space: nowrap;
}
.station-picker-city-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.station-picker-city-pill.active {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}
/* Results is a normal absolute dropdown anchored to the field — it only ever needs to
   size itself, never a whole overlay/bottom-sheet, so it can't overflow the viewport the
   way a full-screen panel could on small screens. */
.station-picker-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: .4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg, var(--shadow-md));
    z-index: 1070;
    max-height: 320px;
    overflow-y: auto;
}
.station-picker-results.show {
    display: block;
}
.station-picker-item {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .65rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.station-picker-item:hover,
.station-picker-item.active {
    background: var(--primary-50);
}
.station-picker-item-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}
.station-picker-item-text {
    flex: 1;
    min-width: 0;
}
.station-picker-item-name {
    font-weight: 700;
    font-size: .92rem;
    color: var(--text-primary);
}
.station-picker-item-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.station-picker-empty,
.station-picker-loading {
    padding: 1rem;
    text-align: center;
    font-size: .85rem;
    color: var(--text-muted);
}
@media (max-width: 576px) {
    .station-picker-results {
        max-height: 50vh;
    }
    .station-picker-city-pills-row {
        padding-top: .45rem;
    }
}

/* ── City Page: In-Page Quick Nav ── */
.city-quicknav {
    position: sticky;
    top: 64px; /* sits just below .navbar */
    z-index: 900;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.city-quicknav-scroll {
    display: flex;
    gap: .3rem;
    overflow-x: auto;
    padding: .6rem 0;
    scrollbar-width: none;
}
.city-quicknav-scroll::-webkit-scrollbar { display: none; }
.city-quicknav-scroll a {
    flex-shrink: 0;
    padding: .4rem .9rem;
    border-radius: var(--radius-full);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}
.city-quicknav-scroll a:hover {
    background: var(--primary-50);
    color: var(--primary);
}

/* ── City Page: Attraction Cards (horizontal scroll) ── */
.attraction-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: .75rem;
    margin: 0 -.25rem;
    padding-left: .25rem;
    padding-right: .25rem;
}
.attraction-scroll::-webkit-scrollbar { height: 6px; }
.attraction-scroll::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.attraction-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.attraction-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-100);
}
.attraction-card-img {
    height: 140px;
    background: var(--gray-100);
    overflow: hidden;
}
.attraction-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.attraction-card:hover .attraction-card-img img { transform: scale(1.05); }
.attraction-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    opacity: .4;
    background: var(--gray-100);
}
.attraction-card-body { padding: .85rem; }
.attraction-card-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.attraction-card-sub {
    font-size: .76rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}
.attraction-card-cta {
    font-size: .74rem;
    font-weight: 600;
    color: var(--primary);
}
@media (max-width: 576px) {
    .attraction-card { flex-basis: 210px; }
    .attraction-card-img { height: 120px; }
}

/* ── Route Map Viewer ── */
.map-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}
.map-viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    color: #fff;
    flex-wrap: wrap;
    gap: .5rem;
}
.map-viewer-title {
    font-weight: 600;
    font-size: .95rem;
}
.map-viewer-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.map-viewer-actions button,
.map-viewer-btn {
    background: rgba(255, 255, 255, .12);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}
.map-viewer-actions button:hover,
.map-viewer-btn:hover {
    background: rgba(255, 255, 255, .22);
}
#mapViewerZoomLabel {
    color: #fff;
    font-size: .8rem;
    min-width: 42px;
    text-align: center;
}
.map-viewer-canvas {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.map-viewer-canvas img {
    max-width: 90%;
    max-height: 90%;
    transition: transform .05s linear;
    user-select: none;
}
@media (max-width: 576px) {
    .map-viewer-title { display: none; }
}
