/**
 * Cultouring - Explorer View CSS
 *
 * Premium magazine-quality cultural-tourism directory.
 * Maya highlands aesthetic: cinematic, warm, sophisticated.
 *
 * Architecture:
 *   - Cassiopeia full-width breakout (CAL-120 / CAL-162)
 *   - Sticky header: search + home + near-me + count
 *   - Category filter pills (scrollable, active gradient state)
 *   - Split layout: sidebar (place cards) + Leaflet map
 *   - Mobile-first breakpoints: 480 / 640 / 768 / 1024 / 1280
 *
 * @package  com_cultouring
 * @since    1.0.0
 */

/* Self-hosted fonts — MILPA DIGITAL */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../fonts/fraunces-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'Inter';    font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/inter-wght-normal.woff2') format('woff2-variations'); }

/* =========================================================================
   DESIGN TOKENS — "MILPA DIGITAL" (jade/terracotta/cream/gold)
   ========================================================================= */
:root {
    /* Brand: Maya highlands palette */
    --ct-ex-navy:          #1A1511;
    --ct-ex-deep:          #16504a;
    --ct-ex-teal-700:      #16504a;
    --ct-ex-teal-600:      #1C5C52;
    --ct-ex-teal-400:      #3a9a86;
    --ct-ex-teal-50:       #eef6f3;
    --ct-ex-forest:        #114c4c;
    --ct-ex-amber:         #C4901A;
    --ct-ex-amber-dark:    #b0811a;
    --ct-ex-terra:         #C8583A;
    --ct-ex-stucco:        #F5F0E8;
    --ct-ex-white:         #ffffff;
    --ct-ex-ink:           #1A1511;
    --ct-ex-muted:         #5C4A3A;
    --ct-ex-border:        #DDD5C8;
    --ct-ex-border-light:  #EDE8DE;

    /* Typography */
    --ct-ex-font:          'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ct-ex-font-display:  'Fraunces', 'Times New Roman', Georgia, serif;

    /* Gradients */
    --ct-ex-grad-header:   linear-gradient(135deg, #1A1511 0%, #16504a 55%, #1C5C52 100%);
    --ct-ex-grad-teal:     linear-gradient(135deg, #1C5C52, #16504a);
    --ct-ex-grad-amber:    linear-gradient(135deg, #C4901A, #b0811a);
    --ct-ex-grad-card:     linear-gradient(180deg, rgba(26,21,17,0) 40%, rgba(26,21,17,0.82) 100%);

    /* Shadows — layered for depth */
    --ct-ex-shadow-xs:     0 1px 2px rgba(0,0,0,0.06);
    --ct-ex-shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --ct-ex-shadow-md:     0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.07);
    --ct-ex-shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.07);
    --ct-ex-shadow-xl:     0 20px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.08);
    --ct-ex-shadow-teal:   0 8px 24px -6px rgba(13,148,136,0.45);
    --ct-ex-shadow-amber:  0 8px 24px -6px rgba(245,158,11,0.45);

    /* Geometry */
    --ct-ex-radius-sm:     8px;
    --ct-ex-radius:        14px;
    --ct-ex-radius-lg:     20px;
    --ct-ex-radius-pill:   999px;
    --ct-ex-sidebar-w:     440px;

    /* Motion */
    --ct-ex-ease:          cubic-bezier(0.4, 0, 0.2, 1);
    --ct-ex-transition:    all 0.28s var(--ct-ex-ease);
    --ct-ex-transition-fast: all 0.18s var(--ct-ex-ease);
}

/* =========================================================================
   CASSIOPEIA FULL-WIDTH OVERRIDE (CAL-120 / CAL-162)
   Target: parent .site-grid that *contains* .ct-explorer
   ========================================================================= */
.site-grid:has(.ct-explorer),
.container-component:has(.ct-explorer) {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
}
.site-grid:has(.ct-explorer) .container-sidebar-left,
.site-grid:has(.ct-explorer) .container-sidebar-right {
    display: none !important;
}

/* =========================================================================
   ROOT CONTAINER
   96 % viewport width on desktop, full breakout mechanism matching place.css
   ========================================================================= */
.ct-explorer {
    display: flex;
    flex-direction: column;
    /* Subtract sticky Cassiopeia nav (~60px) */
    height: calc(100vh - 60px);
    width: 100%;
    overflow: hidden;
    background: var(--ct-ex-stucco);
    color: var(--ct-ex-ink);
    font-family: var(--ct-ex-font);
    line-height: 1.55;
    /* Full-width breakout — mirrors place.css */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
}

/* =========================================================================
   STICKY HEADER
   Dark-gradient bar with glass overlay on scroll; pill strip underneath
   ========================================================================= */
.ct-explorer-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--ct-ex-grad-header);
    box-shadow: 0 2px 12px rgba(26,26,46,0.35);
    flex-shrink: 0;
    /* Prevent Cassiopeia sticky nav from double-stacking */
    isolation: isolate;
}

.ct-explorer-header-inner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    min-height: 60px;
}

/* --- Home button --- */
.ct-explorer-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.18);
    transition: var(--ct-ex-transition-fast);
    backdrop-filter: blur(8px);
}
.ct-explorer-home-btn:hover,
.ct-explorer-home-btn:focus-visible {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.3);
}

/* --- Search form & box --- */
.ct-explorer-search-form {
    flex: 1;
    min-width: 0;
    max-width: 520px;
}

.ct-explorer-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.22);
    border-radius: var(--ct-ex-radius-pill);
    padding: 0 1rem;
    transition: var(--ct-ex-transition-fast);
    backdrop-filter: blur(12px);
    min-height: 44px;
}
.ct-explorer-search-box:focus-within {
    background: rgba(255,255,255,0.2);
    border-color: var(--ct-ex-teal-400);
    box-shadow: 0 0 0 3px rgba(45,212,191,0.25);
}

.ct-explorer-search-icon {
    flex-shrink: 0;
    color: rgba(255,255,255,0.6);
    pointer-events: none;
}

.ct-explorer-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 0.625rem 0;
    outline: none;
    min-width: 0;
}
.ct-explorer-search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

/* --- Near Me button --- */
.ct-explorer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border-radius: var(--ct-ex-radius-pill);
    border: 1.5px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ct-ex-transition-fast);
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    backdrop-filter: blur(8px);
}
.ct-explorer-btn:hover,
.ct-explorer-btn:focus-visible {
    background: rgba(255,255,255,0.2);
    border-color: var(--ct-ex-teal-400);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(45,212,191,0.2);
}
.ct-explorer-btn--locating {
    opacity: 0.55;
    pointer-events: none;
}

.ct-explorer-btn-primary {
    background: var(--ct-ex-grad-teal);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--ct-ex-shadow-teal);
}
.ct-explorer-btn-primary:hover,
.ct-explorer-btn-primary:focus-visible {
    filter: brightness(1.1);
    color: #fff;
}

/* --- Results count pill --- */
.ct-explorer-results-count {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
    letter-spacing: 0.01em;
    padding: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.08);
    border-radius: var(--ct-ex-radius-pill);
    border: 1px solid rgba(255,255,255,0.12);
}
.ct-explorer-results-count strong {
    color: var(--ct-ex-amber);
    font-weight: 700;
    font-size: 0.9rem;
}

/* =========================================================================
   CATEGORY FILTER PILLS
   Scrollable strip; active gets gradient fill
   ========================================================================= */
.ct-explorer-pills {
    display: flex;
    gap: 0.4rem;
    padding: 0 1.25rem 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.ct-explorer-pills::-webkit-scrollbar { display: none; }

.ct-explorer-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--ct-ex-radius-pill);
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.82);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--ct-ex-transition-fast);
    white-space: nowrap;
    scroll-snap-align: start;
    min-height: 32px;
    letter-spacing: 0.01em;
    backdrop-filter: blur(6px);
}
.ct-explorer-pill:hover,
.ct-explorer-pill:focus-visible {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.45);
    color: #fff;
}

/* Active: use the per-category color if set, otherwise teal gradient */
.ct-explorer-pill--active {
    background: var(--ct-ex-grad-teal) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(13,148,136,0.4);
    font-weight: 700;
}

.ct-explorer-pill-count {
    font-size: 0.7rem;
    opacity: 0.72;
    font-weight: 500;
}

/* =========================================================================
   MAIN LAYOUT: sidebar (cards) + map
   ========================================================================= */
.ct-explorer-layout {
    display: grid;
    grid-template-columns: var(--ct-ex-sidebar-w) 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.ct-explorer-sidebar {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--ct-ex-white);
    border-right: 1px solid var(--ct-ex-border);
    /* Subtle inset shadow toward the map */
    box-shadow: inset -4px 0 12px rgba(26,26,46,0.04);
    scrollbar-width: thin;
    scrollbar-color: var(--ct-ex-border) transparent;
}
.ct-explorer-sidebar::-webkit-scrollbar { width: 5px; }
.ct-explorer-sidebar::-webkit-scrollbar-track { background: transparent; }
.ct-explorer-sidebar::-webkit-scrollbar-thumb { background: var(--ct-ex-border); border-radius: 99px; }

.ct-explorer-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem;
    flex: 1;
}

/* =========================================================================
   PLACE CARD — magazine card with image + gradient overlay + hover lift
   ========================================================================= */
.ct-explorer-card {
    border-radius: var(--ct-ex-radius);
    border: 1.5px solid var(--ct-ex-border);
    overflow: hidden;
    background: var(--ct-ex-white);
    transition: var(--ct-ex-transition);
    cursor: pointer;
    margin-bottom: 0.75rem;
    position: relative;
    /* Hardware-accelerate the hover lift */
    will-change: transform, box-shadow;
}
.ct-explorer-card:last-child { margin-bottom: 0; }

/* Hover state: lift + teal accent border */
.ct-explorer-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ct-ex-shadow-xl), 0 0 0 1.5px var(--ct-ex-teal-600);
    border-color: var(--ct-ex-teal-600);
    z-index: 2;
}

/* Active (synced to map marker click) */
.ct-explorer-card--active {
    border-color: var(--ct-ex-teal-600);
    box-shadow: var(--ct-ex-shadow-xl), 0 0 0 2px var(--ct-ex-teal-600);
    transform: translateY(-2px);
}

/* Focus ring for keyboard nav */
.ct-explorer-card:focus-visible {
    outline: 2px solid var(--ct-ex-teal-600);
    outline-offset: 2px;
}

/* --- Card image region --- */
.ct-explorer-card-img {
    position: relative;
    height: 175px;
    overflow: hidden;
    /* Cinematic gradient fallback when no photo */
    background: linear-gradient(135deg, var(--ct-ex-forest) 0%, var(--ct-ex-navy) 50%, var(--ct-ex-deep) 100%);
}
.ct-explorer-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 6s ease;
}
.ct-explorer-card:hover .ct-explorer-card-img img {
    transform: scale(1.04);
}

/* Cinematic gradient overlay — adds depth on all cards */
.ct-explorer-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ct-ex-grad-card);
    pointer-events: none;
    opacity: 0.65;
    transition: opacity 0.3s var(--ct-ex-ease);
}
.ct-explorer-card:hover .ct-explorer-card-img::after {
    opacity: 0.45;
}

/* --- Featured badge (star) --- */
.ct-explorer-badge-featured {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    background: var(--ct-ex-grad-amber);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: var(--ct-ex-radius-pill);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245,158,11,0.45);
    z-index: 3;
}

/* --- Card body --- */
.ct-explorer-card-body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Category eyebrow */
.ct-explorer-card-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    /* color set via inline style from PHP per category */
    line-height: 1;
}

/* Title */
.ct-explorer-card-title {
    font-family: var(--ct-ex-font-display);
    letter-spacing: -0.015em;
    font-size: 1.06rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
    color: var(--ct-ex-ink);
    /* Clamp to 2 lines to keep uniform card height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Description */
.ct-explorer-card-desc {
    font-size: 0.82rem;
    color: var(--ct-ex-muted);
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta row: phone + distance */
.ct-explorer-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--ct-ex-muted);
    flex-wrap: wrap;
    margin-top: 0.15rem;
}
.ct-explorer-card-phone,
.ct-explorer-card-distance {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* CTA link */
.ct-explorer-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ct-ex-teal-600);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--ct-ex-transition-fast);
    margin-top: 0.2rem;
    width: fit-content;
    /* Always at least 44px touch height via parent padding */
}
.ct-explorer-card-link:hover,
.ct-explorer-card-link:focus-visible {
    color: var(--ct-ex-teal-700);
    gap: 0.55rem;
}
.ct-explorer-card-link:focus-visible {
    outline: 2px solid var(--ct-ex-teal-600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* =========================================================================
   MAP PANEL
   ========================================================================= */
.ct-explorer-map {
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: var(--ct-ex-navy);
}

/* Floating map toggle (mobile only) */
.ct-explorer-map-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    padding: 0.7rem 1.5rem;
    border-radius: var(--ct-ex-radius-pill);
    background: var(--ct-ex-grad-header);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.22);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--ct-ex-shadow-xl);
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    backdrop-filter: blur(12px);
    transition: var(--ct-ex-transition-fast);
    min-height: 48px;
}
.ct-explorer-map-toggle:hover,
.ct-explorer-map-toggle:focus-visible {
    background: var(--ct-ex-grad-teal);
    border-color: transparent;
    box-shadow: var(--ct-ex-shadow-teal);
}
.ct-explorer-map-toggle:focus-visible {
    outline: 2px solid var(--ct-ex-teal-400);
    outline-offset: 3px;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */
.ct-explorer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3.5rem 2rem;
    flex: 1;
}
.ct-explorer-empty-icon {
    color: var(--ct-ex-muted);
    opacity: 0.35;
    margin-bottom: 1.25rem;
}
.ct-explorer-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ct-ex-ink);
    margin: 0 0 0.5rem;
}
.ct-explorer-empty-desc {
    font-size: 0.9rem;
    color: var(--ct-ex-muted);
    margin: 0 0 2rem;
    max-width: 320px;
    line-height: 1.55;
}

/* =========================================================================
   PAGINATION
   Style Joomla's generated pagination markup
   ========================================================================= */
.ct-explorer-pagination {
    padding: 1.25rem 1rem 0.75rem;
    text-align: center;
    border-top: 1px solid var(--ct-ex-border-light);
    flex-shrink: 0;
}

/* Joomla pagination list */
.ct-explorer-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ct-explorer-pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    border-radius: var(--ct-ex-radius-sm);
    border: 1.5px solid var(--ct-ex-border);
    background: var(--ct-ex-white);
    color: var(--ct-ex-ink);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--ct-ex-transition-fast);
}
.ct-explorer-pagination .page-item .page-link:hover {
    border-color: var(--ct-ex-teal-600);
    color: var(--ct-ex-teal-600);
    background: var(--ct-ex-teal-50);
}
.ct-explorer-pagination .page-item.active .page-link {
    background: var(--ct-ex-grad-teal);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--ct-ex-shadow-teal);
}
.ct-explorer-pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* =========================================================================
   SKELETON PLACEHOLDERS
   ========================================================================= */
.ct-explorer-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}
.ct-explorer-skeleton-card {
    border-radius: var(--ct-ex-radius);
    overflow: hidden;
    border: 1.5px solid var(--ct-ex-border);
    background: var(--ct-ex-white);
}
.ct-explorer-skeleton {
    background: linear-gradient(
        90deg,
        #f1f5f9 25%,
        #e8edf4 50%,
        #f1f5f9 75%
    );
    background-size: 400% 100%;
    animation: ct-ex-shimmer 1.6s ease-in-out infinite;
}
.ct-explorer-skeleton-img  { height: 175px; }
.ct-explorer-skeleton-body { padding: 0.85rem 1rem 1rem; }
.ct-explorer-skeleton-title {
    height: 16px;
    width: 68%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.ct-explorer-skeleton-text {
    height: 12px;
    width: 90%;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.ct-explorer-skeleton-text--short { width: 48%; }

@keyframes ct-ex-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ct-hidden { display: none !important; }

/* =========================================================================
   LEAFLET POPUP STYLING
   ========================================================================= */
.ct-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: var(--ct-ex-radius);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--ct-ex-shadow-xl);
    border: 1px solid rgba(255,255,255,0.08);
}
.ct-popup-wrapper .leaflet-popup-content {
    margin: 0;
    min-width: 240px;
    max-width: 300px;
}
.ct-popup-wrapper .leaflet-popup-tip-container { display: none; }

.ct-popup-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}
.ct-popup-content { padding: 0.85rem 1rem 1rem; }
.ct-popup-cat {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.25rem;
}
.ct-popup-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ct-ex-ink);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}
.ct-popup-phone {
    font-size: 0.78rem;
    color: var(--ct-ex-muted);
    margin-bottom: 0.5rem;
}
.ct-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ct-ex-teal-600);
    text-decoration: none;
    transition: var(--ct-ex-transition-fast);
}
.ct-popup-link:hover { color: var(--ct-ex-teal-700); text-decoration: underline; }

/* Popup inner */
.ct-popup { width: 100%; }
.ct-popup-inner {
    display: flex;
    flex-direction: column;
    background: var(--ct-ex-white);
}

/* =========================================================================
   RESPONSIVE — MOBILE FIRST
   ========================================================================= */

/* --- ≥ 640px: tablet-ish, 2-col cards inside sidebar when fullscreen --- */
@media (min-width: 640px) {
    .ct-explorer-header-inner { padding: 0.75rem 1.5rem; gap: 0.75rem; }
    .ct-explorer-pills        { padding: 0 1.5rem 0.85rem; gap: 0.45rem; }
}

/* --- ≥ 768px: split layout appears --- */
@media (min-width: 768px) {
    .ct-explorer-btn-label { display: inline; }
}

/* --- ≥ 1024px: wider sidebar --- */
@media (min-width: 1024px) {
    :root { --ct-ex-sidebar-w: 400px; }
    .ct-explorer-search-form { max-width: 480px; }
}

/* --- ≥ 1280px: 440px sidebar --- */
@media (min-width: 1280px) {
    :root { --ct-ex-sidebar-w: 440px; }
}

/* =========================================================================
   RESPONSIVE — MOBILE COLLAPSE (max-width)
   ========================================================================= */

/* < 768px: stack sidebar over map; show toggle button */
@media (max-width: 767.98px) {
    .ct-explorer-layout {
        grid-template-columns: 1fr;
        /* Sidebar takes ~55%, map takes rest on the default view */
    }
    .ct-explorer-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--ct-ex-border);
        max-height: 52vh;
    }
    .ct-explorer-map {
        min-height: 48vh;
    }
    .ct-explorer-map-toggle {
        display: inline-flex;
    }

    /* List-only mode */
    .ct-explorer--list-view .ct-explorer-map     { display: none; }
    .ct-explorer--list-view .ct-explorer-sidebar { max-height: calc(100% - 0px); flex: 1; border-bottom: none; }

    /* Map-only mode */
    .ct-explorer--map-view .ct-explorer-sidebar  { display: none; }
    .ct-explorer--map-view .ct-explorer-map      { flex: 1; min-height: 0; }
}

/* < 640px: compact header */
@media (max-width: 639.98px) {
    .ct-explorer-header-inner    { padding: 0.6rem 0.875rem; gap: 0.4rem; }
    .ct-explorer-pills           { padding: 0 0.875rem 0.65rem; gap: 0.35rem; }
    .ct-explorer-results-count   { display: none; }
    .ct-explorer-btn-label       { display: none; }
    .ct-explorer-btn             { padding: 0.5rem 0.65rem; }
    .ct-explorer-card-img        { height: 145px; }
    .ct-explorer-skeleton-img    { height: 145px; }
}

/* < 480px: minimal */
@media (max-width: 479.98px) {
    .ct-explorer-home-btn        { width: 40px; height: 40px; }
    .ct-explorer-card-body       { padding: 0.7rem 0.875rem 0.875rem; }
    .ct-explorer-card-title      { font-size: 0.93rem; }
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    .ct-explorer-skeleton { animation: none; }
    .ct-explorer-card-img img { transition: none !important; }
    .ct-explorer-card,
    .ct-explorer-pill,
    .ct-explorer-btn,
    .ct-explorer-card-link,
    .ct-explorer-map-toggle,
    .ct-explorer-home-btn,
    .ct-popup-link { transition: none !important; }
    .ct-explorer-card:hover { transform: none; }
}

/* =========================================================================
   SITE CHROME — Cassiopeia header harmonised with the "Milpa Digital" palette.
   (1) Hides the sitewide topbar mod_login form that dominated the top of every
       view and buried the hero. (2) Recolours the default indigo header band
       (#112855) to deep jade with cream Fraunces title. Literal hex so the block
       is self-contained regardless of which file's :root is present. CAL-271.
   ========================================================================= */
body.com_cultouring .container-topbar { display: none !important; }

body.com_cultouring header.container-header,
body.com_cultouring header.header {
    background: linear-gradient(180deg, #0c3a38 0%, #114c4c 100%) !important;
    border-bottom: 1px solid rgba(196, 144, 26, 0.30);
    box-shadow: 0 2px 18px -8px rgba(0, 0, 0, 0.45);
}
body.com_cultouring .navbar-brand .brand-logo,
body.com_cultouring .navbar-brand .brand-logo span {
    color: #F5F0E8 !important;
    font-family: 'Fraunces', Georgia, serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    text-decoration: none !important;
}
body.com_cultouring .navbar-brand .site-description {
    color: rgba(245, 240, 232, 0.74) !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-style: italic;
}
body.com_cultouring .container-nav .mod-menu > li > a {
    color: #F5F0E8 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-weight: 500;
}
body.com_cultouring .container-nav .mod-menu > li > a:hover,
body.com_cultouring .container-nav .mod-menu > li.current > a {
    color: #d9a52e !important;
}
