/* ============================================================
   Locations Map Page - Fullscreen Map Styles
   ============================================================ */

.locations-map-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px); /* Full viewport minus navbar */
}

/* Breadcrumbs bar - compact */
.locations-map-breadcrumbs {
    flex-shrink: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.35rem 0;
}

.locations-map-breadcrumbs .breadcrumb {
    margin-bottom: 0;
    font-size: 0.85rem;
}

/* Map title banner */
.locations-map-title-banner {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 123, 255, 0.12);
}

.locations-map-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: -0.02em;
}

.locations-map-title i {
    color: #1a73e8;
}

.locations-map-subtitle {
    font-size: 0.88rem;
    color: #5f6c7b;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    .locations-map-title {
        font-size: 1.1rem;
    }
    .locations-map-subtitle {
        font-size: 0.78rem;
    }
}

/* Map takes remaining space */
.locations-map-container {
    flex: 1;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

/* Ensure the view wrapper fills its parent */
.locations-map-container .locations-map-view-wrapper {
    height: 100%;
    width: 100%;
}

/* Override map-locations-wrapper to fill parent */
.locations-map-container .map-locations-wrapper {
    height: 100% !important;
}

/* Map container fills available space */
.locations-map-container .map-container {
    height: 100% !important;
    min-height: unset !important;
}

.locations-map-container .map-locations-map {
    min-height: unset !important;
    height: 100% !important;
}

/* Map info / counters - position at bottom */
.locations-map-container .map-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    padding: 0.4rem 0.75rem !important;
    margin: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.locations-map-container .map-info .card {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.locations-map-container .map-info .card .p-3 {
    padding: 0 !important;
}

.locations-map-container .map-info .legend-inline {
    margin-bottom: 0.25rem !important;
}

/* Footer shows normally below the map */

/* Reduce carousel sidebar top margin on this page */
.locations-map-container .map-carousel-sidebar {
    margin-top: 0 !important;
}

.locations-map-container .map-carousel-details {
    margin-top: 7px !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

/* Ensure details content scrolls with smooth overflow */
.locations-map-container .map-details-content {
    overflow-y: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Custom scrollbar for details panel */
.locations-map-container .map-details-content::-webkit-scrollbar {
    width: 6px;
}

.locations-map-container .map-details-content::-webkit-scrollbar-track {
    background: transparent;
}

.locations-map-container .map-details-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.locations-map-container .map-details-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ============================================================
   Category Chips - Full-width bar at top of map
   ============================================================ */
.locations-map-container .map-category-chips-container {
    position: absolute ;
    top: 0 ;
    left: 0 ;
    right: 0 ;
    z-index: 10600 ;
    max-width: 100% ;
    width: 100% ;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0px 15px !important;
    pointer-events: auto ;
    display: none !important;
}

/* Show chips only when a marker is selected (sidebar open) */
.locations-map-container .map-category-chips-container.chips-visible {
    display: block !important;
}

/* Scroll wrapper: flex row with arrows + scrollable chips */
.locations-map-container .map-category-chips-scroll {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 0;
}

/* Chips wrapper fills remaining space and scrolls */
.locations-map-container .map-category-chips-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 12px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.locations-map-container .map-category-chips-wrapper::-webkit-scrollbar {
    display: none;
}

/* Scroll arrow buttons */
.locations-map-container .map-chips-scroll-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    z-index: 2;
    padding: 0;
    color: #333;
    font-size: 14px;
    transition: background 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.locations-map-container .map-chips-scroll-btn:hover {
    background: #e8eaed;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.locations-map-container .map-chips-scroll-btn.visible {
    display: flex;
}

.locations-map-container .map-chips-scroll-btn-left {
    margin-left: 6px;
}

.locations-map-container .map-chips-scroll-btn-right {
    margin-right: 6px;
}

/* Contain sidebar within map container instead of fixed viewport */
.locations-map-container .map-mobile-carousel.desktop-mode {
    position: absolute !important;
    top: 48px !important;
    bottom: 0 !important;
    left: 0 !important;
    height: auto !important;
    max-height: none !important;
}

/* Dark mode */
.dark .locations-map-container .map-category-chips-container {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .locations-map-container .map-chips-scroll-btn {
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.dark .locations-map-container .map-chips-scroll-btn:hover {
    background: #334155;
}

/* ============================================================
   Mobile Adjustments
   ============================================================ */
@media (max-width: 767.98px) {
    .locations-map-page {
        height: calc(100vh - 56px);
    }

    .locations-map-breadcrumbs {
        padding: 0.25rem 0;
    }

    .locations-map-breadcrumbs .breadcrumb {
        font-size: 0.78rem;
    }
}

/* Large screens - slightly more breathing room */
@media (min-width: 1200px) {
    .locations-map-page {
        height: calc(100vh - 60px);
    }
}

/* ============================================================
   Summer Promo Section
   ============================================================ */
.map-promo-section {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-promo-bg {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    will-change: transform;
    transition: transform 0.1s linear;
    z-index: 0;
}

.map-promo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 40, 80, 0.55) 0%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
}

.map-promo-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 60px 40px;
    text-align: center;
}

.map-promo-text {
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-size: 2.2rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.45;
    color: #ffffff;
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 0, 0, 0.25);
    margin: 0;
    letter-spacing: 0.01em;
}

@media (max-width: 991.98px) {
    .map-promo-section {
        min-height: 280px;
    }
    .map-promo-text {
        font-size: 1.6rem;
    }
    .map-promo-content {
        padding: 40px 24px;
    }
}

@media (max-width: 575.98px) {
    .map-promo-section {
        min-height: 220px;
    }
    .map-promo-text {
        font-size: 1.25rem;
    }
    .map-promo-content {
        padding: 30px 16px;
    }
}

/* ============================================================
   Article Images Gallery Grid
   ============================================================ */
.map-gallery-section {
    padding: 0;
    background: #111;
}

.map-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.map-gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

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

.map-gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.75);
}

.map-gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 12px 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.map-gallery-item-title {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* "+N photos" overlay on last visible item */
.map-gallery-item-more {
    position: relative;
}

.map-gallery-item-remaining {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.map-gallery-item-remaining span {
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.map-gallery-item-remaining small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin-top: 4px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

@media (max-width: 991.98px) {
    .map-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 575.98px) {
    .map-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    .map-gallery-item-title {
        font-size: 0.75rem;
    }
}

/* ============================================================
   Gallery Lightbox
   ============================================================ */
.map-gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.map-gallery-lightbox.active {
    display: flex;
}

.map-gallery-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.map-gallery-lightbox-close:hover {
    opacity: 1;
}

.map-gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.map-gallery-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.map-gallery-lightbox-prev {
    left: 20px;
}

.map-gallery-lightbox-next {
    right: 20px;
}

.map-gallery-lightbox-body {
    text-align: center;
    max-width: 90vw;
    max-height: 85vh;
}

.map-gallery-lightbox-body img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.map-gallery-lightbox-caption {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 14px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.map-gallery-lightbox-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 6px;
}

@media (max-width: 575.98px) {
    .map-gallery-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    .map-gallery-lightbox-prev {
        left: 8px;
    }
    .map-gallery-lightbox-next {
        right: 8px;
    }
    .map-gallery-lightbox-caption {
        font-size: 0.9rem;
        padding: 0 16px;
    }
}
