/* Theme: Modern Travel Command Center */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f4f6fb;
    --bg-gradient: linear-gradient(135deg, #f9fbff 0%, #eef3ff 40%, #edf9f7 100%);
    --panel: #ffffff;
    --panel-soft: #f8f9fd;
    --panel-dark: #0f172a;
    --fg: #0f172a;
    --fg-muted: #5f6b7c;
    --accent: #ff6b4a;
    --accent-2: #2563eb;
    --border: #e2e8f0;
    --radius: 18px;
    --container: 1200px;
    --header-height: 68px;
    --shadow-card: 0 20px 50px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 25px 50px rgba(15, 23, 42, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { display: block; max-width: 100%; border-radius: var(--radius); }

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: var(--fg);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* -------------------------------------------------------------------
   Navigation (Sticky Top - Modern Standard)
------------------------------------------------------------------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-mark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent);
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--fg-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg-muted);
    padding: 8px 14px;
    border-radius: 999px;
}

.nav-links a:hover {
    color: var(--accent-2);
    background: rgba(37, 99, 235, 0.08);
}

.nav-cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-2);
    background: rgba(37,99,235,0.1);
    padding: 8px 16px;
    border-radius: 999px;
}

/* -------------------------------------------------------------------
   Hero Header
------------------------------------------------------------------- */
.hero-header {
    background: radial-gradient(circle at top left, rgba(255,107,74,0.18), transparent 45%) , radial-gradient(circle at top right, rgba(37,99,235,0.12), transparent 55%), var(--panel);
    padding: 32px 0 18px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.hero-shell {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    align-items: stretch;
}

.hero-main h1 {
    font-size: 2.6rem;
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-main p {
    color: var(--fg-muted);
    font-size: 1.05rem;
}

.hero-lead {
    max-width: 560px;
}

.hero-eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-panel {
    background: var(--panel-dark);
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.hero-panel h3 {
    color: #fff;
    margin-bottom: 16px;
}

.hero-panel ul {
    list-style: disc;
    margin-left: 18px;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.5;
}

/* -------------------------------------------------------------------
   Route Overview
------------------------------------------------------------------- */
.route-overview {
    padding: 40px 0 20px;
}

.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.panel-heading h2 {
    font-size: 1.8rem;
}

.panel-text {
    max-width: 480px;
    color: var(--fg-muted);
    font-size: 0.95rem;
}

.route-flow-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.route-step {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 210px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.route-step:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.15);
}

.timeline-days {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.route-item {
    font-size: 1.1rem;
    font-weight: 700;
    background: none;
    border: none;
    text-align: left;
    color: var(--fg);
    cursor: pointer;
    padding: 0;
    margin-bottom: 4px;
}

.route-step-meta {
    font-size: 0.9rem;
    color: var(--fg-muted);
    margin-bottom: 16px;
    flex-grow: 1;
}

.route-card-bottom {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    font-size: 0.8rem;
    color: var(--fg-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto; /* Push to bottom of card */
}

.route-hotel {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.route-hotel a {
    color: var(--accent);
    font-weight: 500;
}

.route-hotel a:hover {
    text-decoration: underline;
}

.route-note {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--fg-muted);
    letter-spacing: 0.02em;
}

/* Budget Section */
.budget-section {
    background: #fff;
    padding: 60px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.budget-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.05);
}

.budget-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 600px;
}

.budget-table th {
    background: var(--panel-dark);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 18px 24px;
    text-align: left;
}

.budget-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    font-size: 0.95rem;
}

.budget-table tr:last-child td {
    border-bottom: none;
    background: rgba(37, 99, 235, 0.05);
    font-weight: 700;
    color: var(--accent-2);
    font-size: 1.1rem;
}

.budget-note {
    font-size: 0.9rem;
    color: var(--fg-muted);
    margin-top: 16px;
    background: var(--panel-soft);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

/* Hotel Meta Tags */
.hotel-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.spec-tag {
    font-size: 0.75rem;
    background: rgba(241, 245, 249, 0.8);
    color: var(--fg-muted);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.hotel-booking-info {
    margin-top: auto; /* Ensure it sits at the bottom of the main content area */
    margin-bottom: 16px;
    font-size: 0.85rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 8px;
    color: #166534;
}

.hotel-booking-info strong {
    display: block;
    margin-bottom: 2px;
    color: #15803d;
    font-weight: 600;
}

.hotel-booking-info.not-booked {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.hotel-booking-info.not-booked strong {
    color: #b91c1c;
}

/* -------------------------------------------------------------------
   Map Section
------------------------------------------------------------------- */
.map-section {
    padding: 60px 0 80px;
}

.map-section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

#map {
    height: 520px;
    width: 100%;
    border-radius: 28px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 45px rgba(15,23,42,0.12);
}

/* Map Legend Compact */
.map-legend {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    line-height: 1.4;
}

.map-legend h4 {
    font-size: 0.9rem;
    margin-bottom: 8px !important;
}

.map-legend div {
    margin-bottom: 4px !important;
}

/* -------------------------------------------------------------------
   Itinerary (Timeline)
------------------------------------------------------------------- */
.itinerary-section {
    background: var(--panel-soft);
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.itinerary-section h2 {
    font-size: 2rem;
    margin-bottom: 48px;
    text-align: center;
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin: 0 auto;
    max-width: 860px;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(255,107,74,0.3), rgba(37,99,235,0.3));
}

.timeline-item {
    display: flex;
    gap: 20px;
    position: relative;
    align-items: flex-start;
}

.timeline-marker {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15,23,42,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--accent-2);
    flex-shrink: 0;
    font-size: 1rem;
}

.timeline-content {
    flex: 1;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 16px 35px rgba(15,23,42,0.08);
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.timeline-content .date {
    font-size: 0.85rem;
    color: var(--accent-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 16px;
}

.btn-expand {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-expand:hover {
    border-color: var(--fg);
    background: var(--panel-soft);
}

.expanded-content {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.expanded-content.show { display: block; }

.location-link {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

.location-link:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------
   Gallery (Standard Grid)
------------------------------------------------------------------- */
.gallery-section {
    padding: 80px 0;
}

.gallery-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.gallery-intro {
    text-align: center;
    color: var(--fg-muted);
    margin-bottom: 36px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    min-height: 320px;
    box-shadow: 0 25px 40px rgba(15,23,42,0.12);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.gallery-card-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    color: #fff;
    background: linear-gradient(180deg, transparent 25%, rgba(0,0,0,0.85) 100%);
}

.gallery-card-info h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.gallery-card-info p {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* -------------------------------------------------------------------
   Checklist & Docs
------------------------------------------------------------------- */
.documents-section, .checklist-section {
    padding: 70px 0;
    border-top: 1px solid var(--border);
    background: var(--panel-soft);
}

.checklist-section {
    background: var(--bg);
}

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

.doc-category, .checklist-group {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 30px rgba(15,23,42,0.08);
}

.checklist {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.checklist li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: block;
}

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

/* -------------------------------------------------------------------
   Modal
------------------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
    background: #fff;
    width: 92%; max-width: 940px;
    max-height: 90vh;
    border-radius: 32px;
    padding: 28px;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-topbar {
    position: sticky;
    top: 0;
    margin: -28px -28px 24px -28px;
    padding: 20px 28px 16px 28px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    z-index: 10;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.modal-topbar h2 {
    margin: 0;
    font-size: 1.5rem;
    padding-right: 48px; /* Space for close button */
    line-height: 1.3;
    margin-top: 4px;
}

.modal-close {
    position: sticky;
    top: 12px;
    margin-left: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 4px 16px rgba(15,23,42,0.08);
    z-index: 20;
    touch-action: manipulation;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: scale(1.05);
    border-color: #94a3b8;
}

.modal-close:active {
    transform: scale(0.95);
    background: #e2e8f0;
}

.modal-close svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5px;
    display: block;
}

.modal-description-text {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--fg);
}

#modalImage img {
    border-radius: var(--radius);
    margin-bottom: 16px;
    max-height: 60vh;
    object-fit: contain;
    width: auto;
    margin: 0 auto 16px;
    display: block;
    box-shadow: var(--shadow-lg);
}

/* Gallery Navigation */
.modal-gallery {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid var(--border);
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    color: var(--fg);
    transition: all 0.2s;
}

.gallery-nav:hover {
    background: var(--panel-soft);
    transform: translateY(-50%) scale(1.1);
    color: var(--accent);
}

.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }

.gallery-counter {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
}

/* Modified Modal Layout: Stacked for better space usage */
.modal-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-map-wrapper {
    width: 100%;
    height: auto;
    margin: 8px 0 24px 0;
    order: -1; /* Map appears before Wiki content */
}

.modal-map {
    height: 350px; /* Taller map for better visibility */
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(15,23,42,0.08);
    overflow: hidden;
}

/* Text Contrast Improvements */
.modal-content {
    color: #000000; /* Force pure black for maximum readability */
}

#modalDescription {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #1a1a1a;
    font-weight: 500;
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

/* Gallery Text Visibility - "Visible regardless of background" */
.gallery-card-info {
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.95) 90%); /* Darker gradient */
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* Strong shadow */
}

.gallery-card-info h3, .gallery-card-info p {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Route Step Interactivity */
.route-step {
    cursor: pointer;
    border: 1px solid transparent; /* Prep for hover */
}

.route-step:hover {
    border-color: var(--accent);
    background: #fff;
}

/* Prevent double-click issues on the button inside */
.route-item {
    pointer-events: none; /* Let the parent handle the click */
}
.modal-wiki h3 {
    font-size: 1.1rem;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--fg);
}

.modal-wiki a {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
    margin-top: 4px;
}

.modal-wiki a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
    background-color: rgba(37, 99, 235, 0.05);
}

/* Utils */
.ai-settings, .back-to-top { display: none; }

@media (max-width: 768px) {
    body { padding-top: var(--header-height); }
    .hero-shell { grid-template-columns: 1fr; }
    .route-flow-track { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .timeline { padding-left: 24px; }
    .modal-info { grid-template-columns: 1fr; }
    .modal-map-wrapper { position: static; }
    .nav { bottom: 0; top: auto; border-top: 1px solid var(--border); border-bottom: none; }
    body { padding-bottom: var(--header-height); }
}

/* Wiki Full Content Styling */
.wiki-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--fg);
    margin-top: 24px;
}

.wiki-content h2, .wiki-content h3, .wiki-content h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-2);
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.wiki-content p {
    margin-bottom: 16px;
}

.wiki-content ul, .wiki-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
    list-style: disc;
}

.wiki-content img {
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.wiki-content figure {
    margin: 24px 0;
    text-align: center;
    background: var(--panel-soft);
    padding: 12px;
    border-radius: 8px;
}

.wiki-content figcaption {
    font-size: 0.85rem;
    color: var(--fg-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Hide Wikipedia Clutter */
.wiki-content .infobox,
.wiki-content .sidebar,
.wiki-content .mw-editsection,
.wiki-content .hatnote,
.wiki-content .reference,
.wiki-content .noprint,
.wiki-content .thumb, /* Often floats awkwardly, hiding might be safer or flex */
.wiki-content table {
    /* We hide complex tables/infoboxes to keep it readable as a stream */
    display: none;
}

/* Exception: allow simple images if not wrapped in complex thumb/infobox structures that break layout */
/* But standard wiki images are often in .thumb. Let's try to show .thumb but unfloat it */
.wiki-content .thumb {
    display: block;
    float: none;
    clear: both;
    margin: 20px auto;
    width: 100%;
    text-align: center;
}
.wiki-content .thumbinner {
    margin: 0 auto;
    width: auto !important; /* Override inline width */
}
.modal-close {
    transform-origin: center;
}
