/* ============================================================
   CoPray City Split-View Layout
   Used on /lang/Country/map/church/{city} pages
   ============================================================ */

/* ── Top bar (language dropdown sits outside split wrapper) ── */
.split-top-bar {
    max-width: 100%;
    padding: 8px 20px 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ── Main split container ── */
.split-wrapper {
    display: flex;
    height: calc(100vh - 64px);   /* subtract navbar height */
    overflow: hidden;
    max-width: 100%;
}

/* ── Left panel: scrollable cards ── */
.cards-panel {
    width: 40%;
    overflow-y: auto;
    padding: 16px 20px;
    background: #fff;
    border-right: 1px solid #e8e0d5;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

/* ── Right panel: sticky map ── */
.map-panel {
    width: 60%;
    position: relative;
    flex-shrink: 0;
}

.map-panel #map {
    height: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ── City heading inside cards panel ── */
.city-h1 {
    font-size: 1.3em;
    font-weight: 700;
    color: #85512D;
    margin: 8px 0 4px;
    line-height: 1.3;
}

.city-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Church count badge ── */
.city-count-badge {
    display: inline-block;
    background: linear-gradient(135deg, #C9A168, #85512D);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

/* ── Category filter links ── */
.category-links {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #faf6f0;
    border-radius: 12px;
    border: 1px solid #e8ddd0;
}

.category-links-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 7px;
}

.category-link {
    display: inline-block;
    background: white;
    border: 1px solid #C9A168;
    color: #85512D;
    padding: 3px 9px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin: 3px 3px 3px 0;
    transition: background 0.15s, color 0.15s;
}

.category-link:hover {
    background: #C9A168;
    color: white;
    text-decoration: none;
}

.category-link.active {
    background: #85512D;
    color: white;
    border-color: #85512D;
    text-decoration: none;
}

/* ── Church cards ── */
.church-card {
    display: flex;
    gap: 12px;
    border-radius: 20px;
    border: 2px solid #e8e0d5;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    background: white;
}

.church-card:hover {
    border-color: #C9A168;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(201,161,104,0.2);
}

.church-card.active {
    border: 2px solid red;
    background: rgba(201, 161, 104, 0.06);
    box-shadow: 0 2px 8px rgba(201,161,104,0.25);
}

.church-card-img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.church-card-img-placeholder {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    background: linear-gradient(135deg, #C9A168, #85512D);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 26px;
}

.church-card-body {
    flex: 1;
    min-width: 0;
}

.church-card-name {
    font-weight: 700;
    font-size: 13px;
    color: #85512D;
    margin-bottom: 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.church-card-type {
    display: inline-block;
    background: rgba(201, 161, 104, 0.15);
    color: #85512D;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.church-card-address {
    font-size: 11px;
    color: #888;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.church-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.church-card-link {
    display: inline-block;
    background: #1a1a1a;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.church-card-link:hover {
    background: #85512D;
    color: white;
    text-decoration: none;
}

/* ── "Load more" trigger ── */
.load-more-cards {
    display: block;
    width: 100%;
    padding: 10px;
    background: #faf6f0;
    border: 1px dashed #C9A168;
    border-radius: 12px;
    color: #85512D;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}

.load-more-cards:hover {
    background: rgba(201,161,104,0.1);
}

/* ── Filter row inside cards panel ── */
.cards-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.cards-filter-row .search-container {
    max-width: 100%;
    width: 100%;
    margin-bottom: 0;
}

.cards-filter-row .type-filter-dropdown {
    flex-shrink: 0;
}

/* ── View-on-map overlay button (mobile only) ── */
.view-on-map-btn {
    display: none;
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    background: rgba(20, 20, 20, 0.88);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    z-index: 500;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    transition: background 0.2s;
}
.view-on-map-btn:hover {
    background: rgba(0,0,0,1);
}

/* ── Mobile: map thumbnail first, then listing ── */
@media (max-width: 768px) {
    .split-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    /* Map thumbnail at TOP */
    .map-panel {
        order: -1;
        width: 100%;
        height: 200px;
        position: relative;
        overflow: hidden;
        flex-shrink: 0;
    }

    .map-panel.map-expanded {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 9999;
        overflow: visible;
    }

    .map-panel #map {
        height: 200px !important;
        border-radius: 0 !important;
        pointer-events: none;
        filter: blur(4px);
        opacity: 0.5;
        transition: filter 0.3s, opacity 0.3s;
    }

    .map-panel.map-expanded #map {
        height: 100% !important;
        pointer-events: all;
        filter: none !important;
        opacity: 1 !important;
    }

    /* Close button repositioned inside fullscreen map */
    .map-panel.map-expanded .view-on-map-btn {
        display: flex !important;
        bottom: 16px;
        top: auto;
        left: 16px;
        transform: none;
    }

    /* Cards listing below */
    .cards-panel {
        width: 100%;
        border-right: none;
        border-top: 1px solid #e8e0d5;
        max-height: none;
        overflow-y: visible;
    }

    .view-on-map-btn {
        display: flex;
    }
}

/* ── Country navigation section (replaces old flag section) ── */
.country-nav-section {
    background: #faf6f0;
    border-top: 1px solid #e8ddd0;
    padding: 28px 0 20px;
}

.cnav-card {
    background: white;
    border: 2px solid #e8e0d5;
    border-radius: 18px;
    padding: 16px 12px 14px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cnav-card.active {
    border-color: #C9A168;
    box-shadow: 0 2px 12px rgba(201,161,104,0.2);
}

.cnav-card:hover {
    border-color: #C9A168;
}

.cnav-flag {
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.cnav-name {
    font-size: 13px;
    font-weight: 700;
    color: #85512D;
    margin-bottom: 10px;
}

.cnav-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.cnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.cnav-btn.churches {
    background: #f0ebe4;
    color: #85512D;
    border: 1px solid #C9A168;
}

.cnav-btn.churches:hover {
    background: #C9A168;
    color: white;
    text-decoration: none;
}

.cnav-btn.saints {
    background: #85512D;
    color: white;
    border: 1px solid #85512D;
}

.cnav-btn.saints:hover {
    background: #6b3f1e;
    color: white;
    text-decoration: none;
}
