/* ============================================
   BSH Tour - Modern Styles
   2026 Spring Workshop
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - UBC Blue + UBC Gold */
    --primary-color: #002145;
    --primary-dark: #001830;
    --primary-light: #0055b7;
    --accent-color: #edc95e;
    --accent-soft: rgba(237, 201, 94, 0.12);
    --accent-medium: rgba(237, 201, 94, 0.22);

    /* Surfaces */
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --surface-sunken: #f1f5f9;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Layout */
    --sidebar-width: clamp(560px, 40vw, 720px);

    /* Shadows - Layered for depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(237, 201, 94, 0.25);

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

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-brand: "Gotham", "Montserrat", "Open Sans", "Segoe UI", Arial, sans-serif;
    --font-body: "Open Sans", "Montserrat", "Segoe UI", Arial, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Main Layout
   ============================================ */

.tour-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1000;
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

/* Header */
.sidebar-header {
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Subtle pattern */
.sidebar-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-xl)) var(--space-md);
    padding: 0.72rem var(--space-xl);
    background: rgba(250, 248, 242, 0.98);
    border-bottom: 1px solid rgba(0, 33, 69, 0.12);
    margin-bottom: var(--space-md);
}

.logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transition: opacity var(--duration-fast) ease;
}

.logo-link:hover {
    opacity: 0.88;
}

.logo-image {
    display: block;
    width: 186px;
    height: auto;
}

.logo-back-link {
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: none;
    transition: color var(--duration-fast) ease, opacity var(--duration-fast) ease;
    opacity: 0.8;
}

.logo-back-link:hover {
    color: var(--primary-color);
    opacity: 1;
}

.sidebar-header h1 {
    position: relative;
    font-family: var(--font-brand);
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.subtitle {
    position: relative;
    font-family: var(--font-brand);
    font-size: var(--text-sm);
    opacity: 0.85;
    font-weight: 500;
}

/* Header actions */
.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.stop-indicator {
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.stops-btn {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.stops-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-progress {
    margin-top: var(--space-md);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--surface-sunken);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: var(--shadow-inner);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--accent-color));
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out-expo);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Progress bar sits inside header */

/* ============================================
   Stops Drawer
   ============================================ */

.stops-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 20, 45, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) ease;
    z-index: 5;
}

.stops-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.stops-drawer {
    position: absolute;
    inset: 0;
    background: var(--surface);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-out-expo);
    z-index: 6;
    display: flex;
    flex-direction: column;
}

.stops-drawer.open {
    transform: translateY(0);
}

.stops-drawer-header {
    padding: var(--space-lg) var(--space-xl) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
}

.stops-drawer-header h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.stops-drawer-header p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.drawer-close {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.drawer-close:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.stop-navigator-list {
    display: grid;
    gap: var(--space-sm);
    overflow-y: auto;
    padding: var(--space-md) var(--space-xl) var(--space-xl);
    flex: 1;
}

.stop-navigator-list::-webkit-scrollbar {
    width: 6px;
}

.stop-navigator-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.stop-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all var(--duration-fast) ease;
}

.stop-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.stop-card.active {
    border-color: var(--accent-color);
    background: var(--accent-soft);
    box-shadow: var(--shadow-sm);
}

.stop-card-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--surface-sunken);
    border: 1px solid var(--border-color);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.stop-card.active .stop-card-index {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: transparent;
}

.stop-card-text {
    flex: 1;
    min-width: 0;
}

.stop-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.stop-card-location {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

.stop-card-arrow {
    color: var(--text-tertiary);
    transition: transform var(--duration-fast) ease;
}

.stop-card:hover .stop-card-arrow {
    transform: translateX(3px);
    color: var(--primary-light);
}

/* ============================================
   Stop Content Area
   ============================================ */

.stop-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar styling */
.stop-content::-webkit-scrollbar {
    width: 6px;
}

.stop-content::-webkit-scrollbar-track {
    background: transparent;
}

.stop-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.stop-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Stop Header Section */
.stop-header {
    padding: var(--space-lg) var(--space-xl) var(--space-md);
}

.stop-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    font-size: var(--text-sm);
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-md), 0 2px 8px rgba(0, 85, 183, 0.25);
}

.stop-title {
    font-family: var(--font-brand);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.stop-location {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.stop-location svg {
    flex-shrink: 0;
    color: var(--primary-light);
}

/* Quick facts row */
.stop-facts {
    padding: var(--space-md) var(--space-xl) var(--space-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.85));
    border-bottom: 1px solid var(--border-color);
}

.stop-facts-title {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.stop-facts .stop-stats {
    gap: var(--space-sm);
}

/* Quick Stats */
.stop-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--surface-sunken);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    border: 1px solid var(--border-color);
    transition: all var(--duration-fast) ease;
}

.stat-badge:hover {
    border-color: var(--accent-color);
    background: var(--accent-soft);
}

.stat-badge-label {
    color: var(--text-secondary);
}

.stat-badge-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Hero Image
   ============================================ */

.stop-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--surface-sunken), var(--border-color));
    overflow: hidden;
}

.stop-hero.expandable {
    cursor: zoom-in;
}

.stop-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out-expo);
}

.stop-hero:hover img {
    transform: scale(1.02);
}

.stop-hero-action {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.35rem 0.6rem;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--duration-fast) ease;
}

.stop-hero.expandable:hover .stop-hero-action {
    opacity: 1;
    transform: translateY(0);
}

.stop-hero-action svg {
    width: 14px;
    height: 14px;
}

.stop-hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    color: white;
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Placeholder state */
.stop-hero.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.stop-hero.placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* ============================================
   Section Tabs
   ============================================ */

.section-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: 0 var(--space-xl);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.section-tabs::-webkit-scrollbar {
    display: none;
}

.section-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    white-space: nowrap;
    position: relative;
}

.section-tab:hover {
    color: var(--text-primary);
    background: var(--surface-sunken);
}

.section-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--accent-color);
}

.section-tab svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    flex-shrink: 0;
}

.section-tab.active svg {
    opacity: 1;
}

/* ============================================
   Section Panels
   ============================================ */

.section-panels {
    position: relative;
}

.section-panel {
    display: none;
    padding: var(--space-xl);
    animation: fadeSlideIn var(--duration-normal) var(--ease-out-expo);
}

.section-panel.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Content Typography */
.section-content {
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--text-primary);
}

.section-content p {
    margin-bottom: var(--space-md);
}

.section-content p:last-child {
    margin-bottom: 0;
}

.section-content h4 {
    font-family: var(--font-brand);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--space-xl) 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.section-content h4:first-child {
    margin-top: 0;
}

.section-content ul,
.section-content ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.section-content li {
    margin-bottom: var(--space-sm);
}

/* ============================================
   Key Points Card
   ============================================ */

.key-points {
    background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunken));
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    border: 1px solid var(--accent-medium);
    box-shadow: var(--shadow-sm);
}

.key-points-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-light);
    margin-bottom: var(--space-md);
}

.key-points-title svg {
    width: 18px;
    height: 18px;
}

.key-points ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-points li {
    position: relative;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
}

.key-points li:last-child {
    margin-bottom: 0;
}

.key-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================
   Gallery
   ============================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.gallery-item {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--surface-sunken);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.gallery-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out-expo);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: var(--space-xs);
    padding: var(--space-md);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-caption {
    color: white;
    font-size: var(--text-sm);
    font-weight: 500;
}

.gallery-item-expand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gallery-item-expand svg {
    width: 14px;
    height: 14px;
}

/* Placeholder gallery item */
.gallery-item.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    background: var(--surface);
}

.gallery-item.placeholder svg {
    width: 32px;
    height: 32px;
    color: var(--text-tertiary);
}

/* Empty gallery message */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

.gallery-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* ============================================
   Highlights
   ============================================ */

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
}

.highlight-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.highlight-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.highlight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.highlight-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--primary-color);
    font-weight: 700;
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
}

.highlight-meta {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(0, 85, 183, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.highlight-card h3 {
    font-family: var(--font-brand);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   Lightbox
   ============================================ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) ease;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.lightbox-caption {
    text-align: center;
    color: white;
    padding: var(--space-md);
    font-size: var(--text-base);
}

.lightbox-counter {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    margin-top: var(--space-xs);
}

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-nav.prev {
    left: var(--space-lg);
}

.lightbox-nav.next {
    right: var(--space-lg);
}

/* ============================================
   Resources Cards
   ============================================ */

.resources-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.resource-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--duration-fast) ease;
}

.resource-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.resource-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    transition: all var(--duration-fast) ease;
}

.resource-card:hover .resource-card-icon {
    background: var(--accent-medium);
}

.resource-card-content {
    flex: 1;
    min-width: 0;
}

.resource-card-title {
    font-family: var(--font-brand);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.resource-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.resource-card-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: all var(--duration-fast) ease;
    margin-top: var(--space-xs);
}

.resource-card:hover .resource-card-arrow {
    transform: translateX(4px);
    color: var(--primary-light);
}

/* ============================================
   Navigation
   ============================================ */

.tour-nav {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.04);
}

.nav-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.65rem 1rem;
    font-size: var(--text-base);
    font-weight: 500;
    font-family: var(--font-brand);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
}

.nav-btn:hover:not(:disabled)::before {
    opacity: 0.05;
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md), 0 2px 8px rgba(0, 85, 183, 0.25);
}

.nav-btn.primary:hover:not(:disabled) {
    box-shadow: var(--shadow-lg), 0 4px 12px rgba(0, 85, 183, 0.35);
    transform: translateY(-1px);
}

.nav-btn.primary:hover:not(:disabled)::before {
    opacity: 0;
}

.nav-btn svg {
    transition: transform var(--duration-fast) ease;
}

.nav-btn:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.nav-btn:first-child:hover:not(:disabled) svg {
    transform: translateX(-2px);
}

.nav-btn-icon {
    display: inline-flex;
    align-items: center;
}

.nav-btn.prev {
    justify-content: flex-start;
}

.nav-btn.next {
    justify-content: flex-end;
}

.nav-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    gap: 2px;
}

.nav-btn.prev .nav-btn-text {
    align-items: flex-start;
    text-align: left;
}

.nav-btn.next .nav-btn-text {
    align-items: flex-end;
    text-align: right;
}

.nav-btn-label {
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.nav-btn-title {
    font-size: var(--text-sm);
    font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */

.sidebar-footer {
    padding: 0.4rem var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--surface-sunken);
    text-align: center;
}

.sidebar-footer p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.sidebar-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Map Container
   ============================================ */

.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
    background: var(--surface-sunken);
}

#map {
    width: 100%;
    height: 100%;
}

/* Map Actions */
.map-actions {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 600;
}

.map-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    width: 42px;
    height: 42px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    transition: all var(--duration-fast) ease;
}

.map-action:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: var(--surface);
}

.map-action::after {
    content: attr(aria-label);
    position: absolute;
    right: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: var(--text-xs);
    font-weight: 600;
    color: white;
    background: rgba(2, 33, 69, 0.86);
    padding: 0.22rem 0.5rem;
    border-radius: var(--radius-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast) ease;
}

.map-action:hover::after,
.map-action:focus-visible::after {
    opacity: 1;
}

.map-action svg {
    flex-shrink: 0;
}

/* Marker tooltips */
.leaflet-tooltip.marker-tooltip {
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
}

.leaflet-tooltip.marker-tooltip::before {
    border-top-color: var(--primary-color);
}

/* Custom Markers */
.custom-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-lg), 0 2px 10px rgba(0, 85, 183, 0.3);
    color: white;
    font-weight: 700;
    font-size: 14px;
    transition: all var(--duration-fast) var(--ease-out-back);
    cursor: pointer;
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl), 0 4px 15px rgba(0, 85, 183, 0.4);
}

.custom-marker.active {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-light));
    transform: scale(1.15);
    box-shadow: var(--shadow-xl), 0 0 0 4px var(--accent-soft), 0 4px 20px rgba(237, 201, 94, 0.35);
}

/* Pulsing effect for active marker */
.custom-marker.active::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* POI Markers (informational pins — bus stops, buildings) */
.poi-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 150ms ease;
}

.poi-marker:hover {
    transform: scale(1.15);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    transition: all var(--duration-fast) ease;
}

.mobile-toggle:hover {
    background: var(--surface-sunken);
}

/* ============================================
   Keyboard Shortcuts Hint
   ============================================ */

.keyboard-hint {
    position: absolute;
    bottom: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    z-index: 500;
}

.keyboard-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-sm);
    background: var(--surface-sunken);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   Leaflet Overrides
   ============================================ */

.leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(4px);
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: var(--surface-sunken) !important;
}

/* ============================================
   Mobile Styles
   ============================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --mobile-map-height: 42vh;
        --space-lg: 1rem;
        --space-xl: 1.25rem;
    }

    .tour-container {
        flex-direction: column-reverse;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: calc(100vh - var(--mobile-map-height));
        max-height: calc(100vh - var(--mobile-map-height));
        border-radius: 0;
        box-shadow: var(--shadow-lg);
        transform: none;
    }

    .sidebar.expanded {
        transform: none;
    }

    /* Drag handle */
    .sidebar-header {
        cursor: default;
    }

    .sidebar-header::after {
        content: none;
    }

    .sidebar-header h1 {
        font-size: var(--text-xl);
    }

    .logo-image {
        width: 148px;
    }

    .logo-back-link {
        font-size: 0.62rem;
    }

    .map-container {
        height: var(--mobile-map-height);
    }

    .mobile-toggle {
        display: none;
    }

    .keyboard-hint {
        display: none;
    }

    /* Gallery 1 column */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Lightbox adjustments */
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .lightbox-nav.prev {
        left: var(--space-sm);
    }

    .lightbox-nav.next {
        right: var(--space-sm);
    }

    .lightbox-close {
        top: var(--space-md);
        right: var(--space-md);
        width: 44px;
        height: 44px;
    }

    /* Smaller stats */
    .stat-badge {
        font-size: var(--text-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .map-action::after {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        box-shadow: none;
    }

    .map-container {
        display: none;
    }

    .tour-nav,
    .mobile-toggle,
    .keyboard-hint,
    .section-tabs {
        display: none;
    }

    .section-panel {
        display: block !important;
        page-break-inside: avoid;
    }

    .stop-hero {
        max-height: 300px;
    }
}

/* ============================================
   Animations & Utilities
   ============================================ */

.fade-in {
    animation: fadeIn var(--duration-normal) var(--ease-out-expo);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp var(--duration-normal) var(--ease-out-expo);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}


/* ── Active Tab Tint ── */
.section-tab.active {
    background: rgba(237, 201, 94, 0.08);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* ── Rich Marker Tooltip ── */
.leaflet-tooltip.marker-tooltip-rich {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    box-shadow: var(--shadow-lg);
    font-size: var(--text-xs);
    max-width: 230px;
    opacity: 1 !important;
}

.leaflet-tooltip.marker-tooltip-rich::before {
    border-top-color: white;
}

.marker-popup strong {
    display: block;
    font-size: var(--text-sm);
    font-family: var(--font-brand);
    margin-bottom: 2px;
    color: var(--primary-color);
}

.marker-popup-location {
    display: block;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    margin-bottom: 4px;
}

.marker-popup-stat {
    display: inline-block;
    background: var(--accent-soft);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* ── Map Action Labels ── */
.map-action {
    gap: 0.35rem;
}

.map-action-label {
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}

/* ── Onboarding Toast ── */
.onboarding-toast {
    position: absolute;
    bottom: 60px;
    right: 16px;
    z-index: 700;
    background: var(--primary-color);
    color: white;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    max-width: 280px;
    line-height: 1.45;
    transition: opacity 400ms ease, transform 400ms ease;
}

.onboarding-toast.fade-out {
    opacity: 0;
    transform: translateY(8px);
}

/* ── Tour Completion Panel ── */
.tour-complete-panel {
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunken));
    border-radius: var(--radius-md);
    margin: 1rem;
}

.tour-complete-panel h3 {
    font-family: var(--font-brand);
    font-size: var(--text-lg);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tour-complete-panel p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tour-complete-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-family: var(--font-brand);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.tour-complete-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ── Content Readability ── */
.section-content {
    line-height: 1.8;
    letter-spacing: 0.01em;
}

.section-content p+p {
    margin-top: 1.15rem;
}

.section-content h4 {
    border-bottom-color: var(--accent-color);
    border-bottom-width: 2px;
}

/* ── Scroll Indicator ── */
.stop-content::before {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    height: 2px;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: 11;
}

.stop-content.scrolled::before {
    opacity: 1;
}

/* ── Mobile Improvements ── */
@media (max-width: 768px) {
    .map-action-label {
        display: none;
    }

    .map-action {
        width: 42px;
        height: 42px;
        padding: 0;
        gap: 0;
    }

    .onboarding-toast {
        bottom: 16px;
        right: 8px;
        left: 8px;
        max-width: none;
        font-size: var(--text-xs);
    }

    .progress-dot {
        width: 22px;
        height: 22px;
        font-size: 0.58rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
