/* ==========================================================================
   Listings / Projects Page Styles
   ========================================================================== */

.listings-page {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: inherit;
}

.listings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.listings-hero {
    height: 30vh;
    min-height: 80px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;

    display: flex;
    align-items: center;
    justify-content: center;
}

.listings-hero-overlay {
    width: 100%;
    text-align: center;
    color: #f5f4f4;
    padding: 20px;
    box-sizing: border-box;
}

.listings-section {
    padding: 50px 0 80px;
}

/* --------------------------------------------------------------------------
   Filter Tabs
   -------------------------------------------------------------------------- */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 45px;
    flex-wrap: wrap;
}

.tab-btn {
    background-color: #ffffff;
    border: 1.5px solid #0f3ba4;
    color: #0f3ba4;
    padding: 10px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover,
.tab-btn.active {
    background-color: #ffffff;
    color: #0f3ba4;
    border-color: #0f3ba4;
    box-shadow: 0 4px 14px rgba(15, 59, 164, 0.2);
}

/* --------------------------------------------------------------------------
   Projects Grid & Cards
   -------------------------------------------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.project-card {
    background: #eef7ff; /* Soft light blue container background */
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.card-address {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0 0 10px 0;
    text-transform: capitalize;
}

.card-desc {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* Tags & Approvals Block */
.card-footer-info {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.approval-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.tags-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    background-color: #000000;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Load More Button
   -------------------------------------------------------------------------- */
.load-more-wrap {
    text-align: center;
    margin-top: 50px;
}

.btn-load-more {
    background-color: #1e3a8a; /* Dark navy blue from mockup */
    color: #ffffff;
    border: none;
    padding: 12px 40px;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.btn-load-more:hover {
    background-color: #1d4ed8;
}

/* --------------------------------------------------------------------------
   Responsive Layout
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .filter-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }
}

/* Hide load more container by default */
.load-more-wrap {
    text-align: center;
    margin-top: 50px;
    display: none; /* Controlled by JS */
}

/* Responsive Visibility */
.mobile-only {
    display: none;
}
.desktop-only {
    display: flex;
}

@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
}

/* Custom Dropdown Styling */
.filter-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.filter-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #050505;
    background-color: #f5f5f5;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    border-color: #ffffff;
}

.filter-select-wrapper .select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 11px;
    color: #ffffff;
}

/* ============================================================
   Mobile Project Filter - Custom Dropdown
   ============================================================ */

.custom-dropdown {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 40px;
    z-index: 100;
}

/* Dropdown trigger */
.dropdown-trigger {
    width: 100%;
    min-height: 48px;
    padding: 12px 45px 12px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #ffffff;
    color: #0f172a;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
    outline: none;

    box-sizing: border-box;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}

.dropdown-trigger:hover,
.custom-dropdown.open .dropdown-trigger {
    border-color: #0f3ba4;
    box-shadow: 0 4px 14px rgba(15, 59, 164, 0.12);
}

.selected-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Arrow */
.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);
    color: #0f3ba4;

    transition: transform 0.25s ease;
}

.custom-dropdown.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;

    width: 100%;
    margin: 0;
    padding: 6px 0;

    list-style: none;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);

    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

/* Open state */
.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Individual options */
.dropdown-item {
    padding: 12px 16px;

    color: #334155;
    background: #ffffff;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #0f3ba4;
}

/* Selected option */
.dropdown-item.active {
    background: #eef4ff;
    color: #0f3ba4;
    font-weight: 600;
}

/* ============================================================
   Mobile Only
   ============================================================ */

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

@media (max-width: 767px) {

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .custom-dropdown {
        width: calc(100% - 30px);
        max-width: 320px;
        margin: 0 auto 35px;
    }

    .dropdown-trigger {
        min-height: 50px;
        font-size: 15px;
        border-radius: 10px;
    }

    .dropdown-item {
        padding: 13px 16px;
        font-size: 14px;
    }
}