:root {
    --primary: #1A365D; /* Elegant Deep Sea Blue */
    --accent: #D52B1E;  /* High-Contrast Tico Red */
    --text-color: #2D3748;
    --row-bg: #ffffff;
    --row-hover: #f8fafc;
    --body-bg: #f7fafc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: var(--body-bg);
    color: var(--text-color);
}

/* ==========================================================================
   GLOBAL NAVIGATION & HEADER LAYOUTS
   ========================================================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.2rem 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.logo { 
    font-weight: bold; 
    font-size: 1.3rem; 
    color: var(--primary); 
    letter-spacing: 0.5px; 
}
.nav-links a { 
    text-decoration: none; 
    color: var(--primary); 
    font-weight: 600; 
}
.nav-links a:hover { 
    color: var(--accent); 
}

.main-header { 
    text-align: center; 
    padding: 2.5rem 1rem 1rem; 
    background: white; 
}
.main-header h1 { 
    margin: 0 0 0.5rem 0; 
    color: var(--primary); 
    font-size: 2.2rem; 
}
.main-header p { 
    margin: 0; 
    color: #4A5568; 
    font-size: 1.1rem; 
}

/* ==========================================================================
   HOMEPAGE: TWO-COLUMN DASHBOARD HUB
   ========================================================================== */
.dashboard-hub {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.map-viewport { 
    width: 100%; 
}
.cr-map {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.map-pin { cursor: pointer; text-decoration: none; }
.map-pin circle { fill: var(--accent); transition: all 0.2s ease; }
.map-pin text { 
    font-family: sans-serif;
    font-size: 13px; 
    font-weight: bold; 
    fill: var(--primary); 
    opacity: 0; 
    transition: opacity 0.2s ease;
    pointer-events: none; 
}
.map-pin:hover circle { r: 13; fill: var(--primary); }
.map-pin:hover text { opacity: 1; }

/* ==========================================================================
   HOMEPAGE: CLICK-TO-MAXIMIZE ACCORDION DIRECTORY
   ========================================================================== */
.accordion-directory {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.accordion-directory h3 { 
    margin: 0 0 5px 0; 
    color: var(--primary); 
    font-size: 1.3rem; 
}

details.destination-row {
    background: var(--row-bg);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
details.destination-row:hover {
    background: var(--row-hover);
    border-color: #cbd5e1;
}
details.destination-row[open] {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.08);
}

summary.row-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
}
summary.row-header::-webkit-details-marker { display: none; }

.row-meta {
    font-size: 0.85rem;
    color: #718096;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
}
.expand-icon {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
details[open] .expand-icon { transform: rotate(90deg); }

.row-body {
    padding: 0 18px 18px 18px;
    border-top: 1px dashed #e2e8f0;
    background: #ffffff;
}
.row-body p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4a5568;
    margin: 12px 0;
}
.guide-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}
.guide-link:hover { text-decoration: underline; }

/* ==========================================================================
   CITY SUBPAGES: UNIFORM MEDIA-ROW THUMBNAIL LAYOUT
   ========================================================================== */
.mini-header {
    height: 90px;
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 5%;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.mini-header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 0.5px;
}
.back-link {
    color: white;
    text-decoration: none;
    margin-right: 25px;
    font-weight: bold;
    font-size: 1.1rem;
}

.content-container {
    max-width: 950px;
    margin: 2.5rem auto;
    padding: 0 20px;
}

/* 
   STRICT SAME SIZE ROW FRAME: 
   Enforcing a solid height bounds ensures every card scales identically on page load.
*/
.media-row {
    display: flex;
    background: white;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    align-items: stretch; /* Forces left thumbnail and right text columns to be equal height */
    height: 180px;        /* Locked height benchmark across all rows */
}

/* 
   Left Column: Block container holding the unclipped visual object.
*/
a.media-thumbnail {
    flex: 0 0 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f5f9; 
    padding: 12px;
    box-sizing: border-box;
    position: relative;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.2s ease;
}
a.media-thumbnail:hover {
    background: #e2e8f0;
}

/* Strict object constraint: Content fits safely without side cutting or clipping */
.media-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s ease;
}
a.media-thumbnail:hover img {
    transform: scale(1.03);
}

/* 
   CRITICAL VIDEO MARKER MECHANICS:
   Applies a high-visibility centered vector play icon over video types.
*/
a.media-thumbnail.video-type::before {
    content: "";
    position: absolute;
    width: 46px;
    height: 46px;
    background: rgba(213, 43, 30, 0.9); /* Pure Accent Tico Red */
    border: 3px solid white;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Elegant geometric CSS triangular play arrow inside the circle background */
a.media-thumbnail.video-type::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 15px solid white;
    margin-left: 4px; /* Shakes triangle right to be visually balanced in center */
    z-index: 6;
    transition: transform 0.2s ease;
}

/* Micro-interaction scaling animation on hover states */
a.media-thumbnail.video-type:hover::before {
    transform: scale(1.1);
    background: var(--primary);
}
a.media-thumbnail.video-type:hover::after {
    transform: scale(1.1);
}

/* Right Column Text Block Wrapper */
.media-text {
    padding: 1.5rem 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertical centering keeps text clean inside the locked height card */
    overflow: hidden;
}
.media-text h3 {
    margin: 0 0 8px 0;
    color: var(--primary);
    font-size: 1.25rem;
}
.media-text p {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #4a5568;
    margin: 0;
}

/* ==========================================================================
   GLOBAL RESPONSIVE VIEWPORT BREAKPOINTS
   ========================================================================== */
@media (max-width: 960px) {
    .dashboard-hub { grid-template-columns: 1fr; }
}

/* Clean fallback adjustments for smaller mobile viewports */
@media (max-width: 720px) {
    .media-row {
        flex-direction: column;
        height: auto; /* Allow growth on narrow phones to avoid cutting long blocks of text */
        align-items: stretch;
    }
    a.media-thumbnail {
        flex: none;
        width: 100%;
        height: 160px;
    }
    .media-text {
        padding: 1.5rem;
    }
}

.site-footer { text-align: center; padding: 2.5rem; color: #718096; font-size: 0.9rem; }

/* ==========================================================================
   RESTORED LIGHTBOX STYLES (For City Pages)
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: none; /* Hidden until clicked */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

/* The JavaScript adds this class to make it visible */
.lightbox.active {
    display: flex; 
}

#lb-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lb-content img, 
#lb-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Centers the old text-based ▶ icon over the video thumbnails */
.media-thumbnail {
    position: relative; 
}

.vid-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    pointer-events: none; /* Ensures your click registers on the thumbnail beneath it */
    z-index: 10;
}