/* ==========================================================================
   Abbas Abad World Heritage Guide - 2026 Mobile App Design System
   ========================================================================== */

:root {
    /* Safe Area Insets for iOS & Android notched screens */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Typography */
    --font-fa: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;
    --font-en: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Light Theme Tokens (Heritage Editorial) */
    --bg-app: #F9F8F3;
    --surface: #FFFFFF;
    --surface-elevated: rgba(255, 255, 255, 0.85);
    --surface-translucent: rgba(249, 248, 243, 0.82);
    --surface-card: #FFFFFF;
    --text-primary: #1C221E;
    --text-secondary: #657369;
    --text-muted: #8E9B92;
    --border-subtle: rgba(28, 34, 30, 0.08);
    --border-card: rgba(28, 34, 30, 0.06);

    /* Brand Accent Colors */
    --forest-primary: #1B3B30;
    --forest-light: #2A5446;
    --forest-soft: rgba(27, 59, 48, 0.08);
    --gold-accent: #C5A16A;
    --gold-light: rgba(197, 161, 106, 0.15);
    --gold-solid: #AC7848;

    /* Navigation Dimensions */
    --header-height: 60px;
    --tabbar-height: 64px;

    /* Spring Animation Curves */
    --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme (OLED Night Mode) */
body.dark {
    --bg-app: #0D110F;
    --surface: #141A17;
    --surface-elevated: rgba(20, 26, 23, 0.88);
    --surface-translucent: rgba(13, 17, 15, 0.85);
    --surface-card: #18201C;
    --text-primary: #F1F4F2;
    --text-secondary: #9BA9A0;
    --text-muted: #627268;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.06);
    --forest-primary: #2F6352;
    --forest-light: #3E806B;
    --forest-soft: rgba(47, 99, 82, 0.22);
    --gold-accent: #E0BA7E;
    --gold-light: rgba(224, 186, 126, 0.16);
}

/* Optimized High Contrast (Direct Sunlight Mode) */
body.high-contrast {
    --bg-app: #FFFFFF !important;
    --surface: #FFFFFF !important;
    --surface-elevated: #FFFFFF !important;
    --surface-translucent: #FFFFFF !important;
    --surface-card: #FFFFFF !important;
    --text-primary: #000000 !important;
    --text-secondary: #000000 !important;
    --text-muted: #1a1a1a !important;
    --border-subtle: #000000 !important;
    --border-card: #000000 !important;
    --forest-primary: #000000 !important;
    --forest-light: #000000 !important;
    --forest-soft: #F0F0F0 !important;
    --gold-accent: #000000 !important;
}

body.high-contrast .bottom-tab-bar,
body.high-contrast .audio-island,
body.high-contrast .sheet-modal,
body.high-contrast .stop-card,
body.high-contrast .deck-card,
body.high-contrast .settings-card,
body.high-contrast .quick-chip,
body.high-contrast .stat-chip,
body.high-contrast .home-crest-badge {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

body.high-contrast .home-primary-cta,
body.high-contrast .btn-primary-action,
body.high-contrast .control-play-large,
body.high-contrast .island-play-btn {
    background: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #000000 !important;
}

body.high-contrast .tab-item.active {
    color: #000000 !important;
    font-weight: 800 !important;
}

body.high-contrast .tab-item.active .tab-icon {
    stroke: #000000 !important;
    stroke-width: 2.6 !important;
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Form Controls & Button Font Inheritance (Fix missing fonts) */
button, input, select, textarea {
    font-family: var(--font-fa);
}

body.en button, body.en input, body.en select, body.en textarea {
    font-family: var(--font-en);
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-fa);
    font-size: 16px;
    line-height: 1.7;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Font Sizing Engine (Working across whole app) */
html[data-font-size="small"] {
    font-size: 14px;
}
html[data-font-size="medium"] {
    font-size: 16px;
}
html[data-font-size="large"] {
    font-size: 19px;
}

html[data-font-size="small"] .editorial-body,
html[data-font-size="small"] .stop-desc,
html[data-font-size="small"] .transcript-box-body,
html[data-font-size="small"] .home-hero-subtitle {
    font-size: 13.5px !important;
}

html[data-font-size="medium"] .editorial-body,
html[data-font-size="medium"] .stop-desc,
html[data-font-size="medium"] .transcript-box-body,
html[data-font-size="medium"] .home-hero-subtitle {
    font-size: 15.5px !important;
}

html[data-font-size="large"] .editorial-body,
html[data-font-size="large"] .stop-desc,
html[data-font-size="large"] .transcript-box-body,
html[data-font-size="large"] .home-hero-subtitle {
    font-size: 19px !important;
    line-height: 2 !important;
}

html[data-font-size="large"] .home-hero-title,
html[data-font-size="large"] .stop-hero-title {
    font-size: 120% !important;
}

body.en {
    direction: ltr;
    font-family: var(--font-en);
}

/* Allow text selection inside article content */
article, p, h1, h2, h3, h4, .editorial-body {
    user-select: text;
    -webkit-user-select: text;
}

/* Active touch feedback micro-interaction */
button, .tab-item, .stop-card, .btn-action, .theme-btn, .pill-chip {
    transition: transform 0.15s var(--ease-spring), opacity 0.15s, background-color 0.2s;
}

button:active, .tab-item:active, .stop-card:active, .btn-action:active, .theme-btn:active {
    transform: scale(0.96);
}

/* ==========================================================================
   Top App Header (Translucent Glass Bar)
   ========================================================================== */
#app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--surface-translucent);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-group {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.unesco-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--gold-accent);
    margin-bottom: 1px;
}

.unesco-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-accent);
    box-shadow: 0 0 6px var(--gold-accent);
}

#app-header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--forest-soft);
    color: var(--forest-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.header-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Main Router View Container
   ========================================================================== */
.main-content {
    padding-top: calc(var(--header-height) + var(--safe-top));
    padding-bottom: calc(var(--tabbar-height) + 80px + var(--safe-bottom));
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    min-height: 100vh;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    color: var(--text-muted);
    font-size: 14px;
    gap: 14px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--forest-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   2026 Floating Glass Bottom Tab Bar
   ========================================================================== */
.bottom-tab-bar {
    position: fixed;
    bottom: calc(14px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    height: var(--tabbar-height);
    background: var(--surface-elevated);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--border-subtle);
    border-radius: 28px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    padding: 0 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 120;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 20px;
    position: relative;
    font-family: inherit;
}

.tab-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    transition: transform 0.2s var(--ease-spring), stroke 0.2s;
}

.tab-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    transition: color 0.2s;
    font-family: inherit;
}

.tab-item.active {
    color: var(--forest-primary);
}

.tab-item.active .tab-icon {
    transform: translateY(-2px);
    stroke: var(--forest-primary);
    stroke-width: 2.2;
}

body.dark .tab-item.active {
    color: var(--gold-accent);
}
body.dark .tab-item.active .tab-icon {
    stroke: var(--gold-accent);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

/* ==========================================================================
   2026 Dynamic Island Floating Mini-Player
   ========================================================================== */
.audio-island {
    position: fixed;
    bottom: calc(var(--tabbar-height) + 26px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    background: var(--surface-elevated);
    backdrop-filter: blur(30px) saturate(190%);
    -webkit-backdrop-filter: blur(30px) saturate(190%);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
    z-index: 110;
    display: none;
    overflow: hidden;
    cursor: pointer;
    animation: islandSlideUp 0.35s var(--ease-spring);
}

.audio-island.visible {
    display: block;
}

@keyframes islandSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.audio-island-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}

.island-art-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
}

#island-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Soundwave Equalizer Animation */
.equalizer-bars {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.audio-island.playing .equalizer-bars {
    opacity: 1;
}

.equalizer-bars span {
    width: 3px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 3px;
}

.audio-island.playing .equalizer-bars span:nth-child(1) {
    animation: eqBounce 0.8s ease-in-out infinite alternate;
}
.audio-island.playing .equalizer-bars span:nth-child(2) {
    animation: eqBounce 0.6s ease-in-out 0.2s infinite alternate;
}
.audio-island.playing .equalizer-bars span:nth-child(3) {
    animation: eqBounce 0.9s ease-in-out 0.4s infinite alternate;
}

@keyframes eqBounce {
    0% { height: 4px; }
    100% { height: 16px; }
}

.island-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.island-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.island-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.island-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.island-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--forest-primary);
    color: #FFFFFF;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.island-play-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.island-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.island-progress-track {
    width: 100%;
    height: 3px;
    background: var(--border-subtle);
    position: relative;
}

.island-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--forest-primary);
    transition: width 0.25s linear;
    position: absolute;
    right: 0;
    top: 0;
}

body.en .island-progress-fill {
    right: auto;
    left: 0;
}

body.dark .island-progress-fill {
    background: var(--gold-accent);
}

/* ==========================================================================
   Full-Screen / Bottom Modal Sheets (Apple iOS Style)
   ========================================================================== */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: none;
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth);
}

.sheet-overlay.active {
    display: block;
    opacity: 1;
}

.sheet-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-radius: 28px 28px 0 0;
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.22);
    z-index: 210;
    transform: translateY(105%);
    transition: transform 0.38s var(--ease-spring);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
}

.sheet-modal.active {
    transform: translateY(0);
}

.sheet-handle-bar {
    width: 100%;
    padding: 10px 0 6px;
    display: grid;
    place-items: center;
    cursor: grab;
}

.sheet-handle {
    width: 38px;
    height: 4.5px;
    border-radius: 4px;
    background: var(--border-subtle);
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 22px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.sheet-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.sheet-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--forest-soft);
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    font-size: 14px;
    cursor: pointer;
}

/* Audio Player Expanded Sheet */
.audio-modal {
    max-height: 85vh;
}

.audio-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px 10px;
}

.sheet-header-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-accent);
}

.sheet-speed-btn {
    background: var(--forest-soft);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
}

.audio-sheet-body {
    padding: 10px 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audio-art-disc-wrapper {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    margin: 10px auto 18px;
    background: #000;
}

#audio-sheet-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-sheet-titles {
    text-align: center;
    width: 100%;
    margin-bottom: 14px;
}

.audio-sheet-titles h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
}

.audio-sheet-titles p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.audio-sheet-scrubber {
    width: 100%;
    margin-bottom: 16px;
}

.audio-sheet-scrubber input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-subtle);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.audio-sheet-scrubber input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--forest-primary);
    border: 2.5px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.scrubber-times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: inherit;
    color: var(--text-muted);
    margin-top: 6px;
    direction: rtl;
}

body.en .scrubber-times {
    direction: ltr;
}

.audio-sheet-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
    margin-bottom: 20px;
}

.control-play-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--forest-primary);
    color: #FFFFFF;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(27, 59, 48, 0.35);
}

.control-play-large svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.control-skip-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--forest-soft);
    border: none;
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.control-skip-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Transcript Inside Sheet */
.audio-sheet-transcript-box {
    width: 100%;
    background: var(--forest-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 12px 16px;
}

.transcript-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.transcript-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transcript-title-svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Local SVG Helpers */
.theme-svg, .lang-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.stat-svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    flex-shrink: 0;
}

.badge-svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.quick-chip-svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.chevron-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s var(--ease-spring);
}

.transcript-box-header.open .chevron-icon {
    transform: rotate(180deg);
}

.transcript-box-body {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 14px;
    line-height: 1.8;
}

.transcript-box-body.open {
    display: block;
}

/* Settings Sheet Content */
.settings-sheet-content {
    padding: 16px 20px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 14px 16px;
}

.card-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card-desc {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

.theme-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    background: var(--forest-soft);
    border: 1.5px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
}

.theme-btn.active {
    border-color: var(--forest-primary);
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.font-scale-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.font-btn {
    padding: 8px;
    background: var(--forest-soft);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
}

.font-btn.active {
    background: var(--surface);
    border-color: var(--forest-primary);
}

.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch-toggle {
    width: 44px;
    height: 24px;
    accent-color: var(--forest-primary);
    cursor: pointer;
}

.settings-info-badge {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

/* ==========================================================================
   Home Screen Overhaul (Editorial 2026 Presentation)
   ========================================================================== */
.home-screen-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
}

.home-hero-editorial {
    position: relative;
    width: 100%;
    min-height: 72vh;
    border-radius: 0 0 32px 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px 22px calc(30px + var(--safe-bottom));
    background: #0f1612;
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
    transform: scale(1.03);
    transition: transform 7s ease-out;
}

.home-hero-editorial:hover .home-hero-bg {
    transform: scale(1.08);
}

.home-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 23, 18, 0.25) 0%, rgba(13, 23, 18, 0.85) 75%, rgba(13, 23, 18, 0.98) 100%);
}

.home-hero-content {
    position: relative;
    z-index: 10;
    color: #FFFFFF;
}

.home-crest-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(197, 161, 106, 0.22);
    border: 1px solid rgba(197, 161, 106, 0.4);
    color: #F1D4A1;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.home-hero-title {
    font-size: clamp(28px, 7vw, 42px);
    font-weight: 900;
    line-height: 1.25;
    margin: 0 0 10px;
    color: #FFFFFF;
}

.home-hero-subtitle {
    font-size: 15px;
    color: #E2E8E4;
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 90%;
}

.tour-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 100px;
}

.home-primary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--gold-accent);
    color: #172B23;
    font-family: inherit !important;
    font-size: 16px;
    font-weight: 800;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(197, 161, 106, 0.38);
}

.home-primary-cta svg {
    width: 20px;
    height: 20px;
}

body.fa .home-primary-cta svg {
    transform: rotate(180deg);
}

/* Home Section Titles */
.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.home-section-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.section-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--forest-primary);
    text-decoration: none;
    cursor: pointer;
}

body.dark .section-link {
    color: var(--gold-accent);
}

/* Horizontal Snap Reel for Stops */
.stops-horizontal-reel {
    display: flex;
    gap: 14px;
    padding: 4px 20px 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.stops-horizontal-reel::-webkit-scrollbar { display: none; }

.reel-stop-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.reel-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #222;
}

.reel-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reel-card-eyebrow {
    font-size: 11px;
    font-weight: 800;
    color: var(--gold-accent);
}

.reel-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quick Practical Badges on Home */
.home-quick-chips {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
}
.home-quick-chips::-webkit-scrollbar { display: none; }

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

/* ==========================================================================
   Stops Directory Screen (/guide)
   ========================================================================== */
.directory-page-wrap {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.directory-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.directory-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
}

.directory-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Home Stops Section (Same cards layout as /guide) */
.home-stops-section {
    padding: 0 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.home-stops-section .home-section-header {
    padding: 0 0 4px;
}

.stops-modern-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stop-modern-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.stop-modern-thumb-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: #222;
}

.stop-modern-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stop-num-pill {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(18, 36, 28, 0.88);
    backdrop-filter: blur(4px);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
}

body.en .stop-num-pill {
    right: auto;
    left: 4px;
}

.stop-modern-info {
    flex: 1;
    min-width: 0;
}

.stop-modern-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.stop-modern-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-meter-chip {
    font-size: 11px;
    font-weight: 700;
    color: var(--forest-primary);
    background: var(--forest-soft);
    padding: 2px 7px;
    border-radius: 8px;
    white-space: nowrap;
}

.stop-modern-sub {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-modern-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--forest-soft);
    display: grid;
    place-items: center;
    color: var(--forest-primary);
    flex-shrink: 0;
}

.stop-modern-arrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
}

body.fa .stop-modern-arrow svg {
    transform: rotate(180deg);
}

/* ==========================================================================
   Stop Detail Screen Overhaul
   ========================================================================== */
.stop-detail-page {
    display: flex;
    flex-direction: column;
}

.stop-parallax-hero {
    position: relative;
    width: 100%;
    min-height: 48vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 20px 24px;
    background: #0f1612;
}

.stop-parallax-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stop-parallax-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(13, 23, 18, 0.7) 65%, var(--bg-app) 100%);
}

.stop-hero-overlay-content {
    position: relative;
    z-index: 10;
}

.stop-eyebrow-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.eyebrow-pill {
    background: rgba(197, 161, 106, 0.25);
    border: 1px solid rgba(197, 161, 106, 0.45);
    color: #F8DFC0;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 100px;
}

.stop-hero-title {
    font-size: clamp(24px, 6.5vw, 36px);
    font-weight: 900;
    color: #FFFFFF;
    margin: 0 0 4px;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.stop-hero-subtitle {
    font-size: 14px;
    color: #E2ECE5;
    margin: 0;
    opacity: 0.92;
}

/* Floating Action Pill Bar under Hero */
.stop-actions-bar {
    display: flex;
    gap: 10px;
    padding: 16px 20px 8px;
}

.btn-primary-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--forest-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 100px;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(27, 59, 48, 0.28);
    font-family: inherit;
}

.btn-primary-action svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}

.btn-secondary-action svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Editorial Story Article */
.editorial-article {
    padding: 12px 20px 24px;
}

.editorial-body {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-primary);
}

.editorial-body p {
    margin-bottom: 18px;
}

/* Gallery Carousel on Stop Detail */
.stop-gallery-section {
    padding: 8px 0 24px;
}

.gallery-section-title {
    padding: 0 20px;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
}

.gallery-carousel {
    display: flex;
    gap: 12px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.gallery-carousel::-webkit-scrollbar { display: none; }

.gallery-item-btn {
    flex: 0 0 200px;
    height: 140px;
    border-radius: 18px;
    overflow: hidden;
    border: none;
    padding: 0;
    cursor: pointer;
    scroll-snap-align: start;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.gallery-item-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Walking Tour Next / Prev Deck at Bottom */
.walking-deck {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px 24px;
    margin-top: 12px;
}

.deck-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 14px 18px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
}

.deck-info small {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-accent);
}

.deck-info strong {
    font-size: 15px;
    font-weight: 800;
}

.deck-btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--forest-primary);
    color: #FFFFFF;
    display: grid;
    place-items: center;
}

.deck-btn-circle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
}

body.fa .deck-btn-circle svg {
    transform: rotate(180deg);
}

/* Lightbox */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    z-index: 999;
    display: none;
    flex-direction: column;
}

#lightbox.active {
    display: flex;
}

#lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-top) + 16px) 20px 16px;
    color: #FFFFFF;
}

.lightbox-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: #FFFFFF;
    display: grid;
    place-items: center;
    cursor: pointer;
}

#lightbox-img-container {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 12px;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
}

/* Geolocation Alerts & Toasts */
.location-toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top) + 10px);
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    z-index: 150;
    pointer-events: none;
}

.location-toast {
    background: var(--surface-elevated);
    backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid var(--border-subtle);
    border-right: 4px solid var(--gold-accent);
    border-radius: 18px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    cursor: pointer;
    animation: toastPop 0.3s var(--ease-spring);
}

@keyframes toastPop {
    from { transform: translateY(-20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

body.en .location-toast {
    border-right: 1px solid var(--border-subtle);
    border-left: 4px solid var(--gold-accent);
}

.location-toast-title {
    font-size: 13px;
    font-weight: 800;
}

.location-toast-action {
    font-size: 11px;
    font-weight: 700;
    color: var(--forest-primary);
}

.location-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    cursor: pointer;
}
