/* ============================
   Property Card Grid Widget
   ============================ */

.pcw-wrapper {
    width: 100%;
    overflow: visible;
}

/* ============================
   Filter Bar
   ============================ */

/* Outer scroll track — full width, clips horizontally */
.pcw-filter-bar-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 36px;
    text-align: center;
}

.pcw-filter-bar-scroll::-webkit-scrollbar {
    display: none;
}

/* Intermediate wrapper — shrinks to fit the pill */
.pcw-filter-bar-inner {
    display: inline-block;
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

/* Pill — content-width on desktop */
.pcw-filter-bar {
    display: flex;
    width: auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    background-color: #0d1b3e;
    border-radius: 50px;
    padding: 10px 10px;
    white-space: nowrap;
    box-sizing: border-box;
}

.pcw-filter-bar .pcw-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.pcw-filter-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    padding: 8px 20px 12px;
    border-radius: 50px;
    letter-spacing: 0.01em;
    transition: color 0.25s ease;
    outline: none;
    white-space: nowrap;
    font-family: inherit;
}

.pcw-filter-btn::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 2px;
    background-color: #e8c84a;
    transition: width 0.25s ease;
}

.pcw-filter-btn.pcw-active {
    color: #e8c84a;
    background: transparent !important;
    background-color: transparent !important;
}

.pcw-filter-btn.pcw-active::after {
    width: calc(100% - 40px);
}

.pcw-filter-btn:hover,
.pcw-filter-btn:focus,
.pcw-filter-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.pcw-filter-btn:hover:not(.pcw-active) {
    color: rgba(255,255,255,0.75);
}

.pcw-filter-btn:hover:not(.pcw-active)::after {
    width: calc(100% - 40px);
    background-color: rgba(255,255,255,0.5);
}

/* ============================
   Grid Layout
   ============================ */
.pcw-grid {
    display: grid;
    width: 100%;
}

.pcw-grid.pcw-col-1 { grid-template-columns: 1fr; }
.pcw-grid.pcw-col-2 { grid-template-columns: repeat(2, 1fr); }
.pcw-grid.pcw-col-3 { grid-template-columns: repeat(3, 1fr); }
.pcw-grid.pcw-col-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================
   Card Base
   ============================ */
.pcw-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

a.pcw-card,
a.pcw-card:hover,
a.pcw-card:focus,
a.pcw-card:visited {
    text-decoration: none;
    font-weight: 400;
}

.pcw-card.pcw-card-visible {
    opacity: 1;
}

.pcw-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ============================
   Card Image
   ============================ */
.pcw-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.pcw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.pcw-card:hover .pcw-card-image img {
    transform: scale(1.04);
}

/* ============================
   Category Badge
   ============================ */
.pcw-card-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: #e8c84a;
    color: #0d1b3e;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: capitalize;
    letter-spacing: 0.03em;
    z-index: 2;
    pointer-events: none;
}

/* ============================
   Card Body
   ============================ */
.pcw-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ============================
   Card Title
   ============================ */
.pcw-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ============================
   Card Location
   ============================ */
.pcw-card-location {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666666;
    margin: 0;
}

.pcw-location-pin {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.pcw-location-text {
    line-height: 1.3;
}

/* ============================
   Card Subtitle (project name)
   ============================ */
.pcw-card-subtitle {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #0d1b3e;
    margin: -4px 0 6px 0;
}

/* ============================
   Card Description
   ============================ */
.pcw-card-description {
    font-weight: 400;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: #555555;
    margin: 6px 0 0 0;
    white-space: pre-line;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
    .pcw-grid.pcw-col-4,
    .pcw-grid.pcw-col-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* TABLET: pill stretches full container width */
    .pcw-filter-bar-scroll {
        text-align: center;
    }
    .pcw-filter-bar-inner {
        display: block;
        width: 100%;
    }
    .pcw-filter-bar {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box;
        overflow: visible;
    }
    /* Buttons spread evenly across the pill */
    .pcw-filter-bar .pcw-filter-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    /* MOBILE: pill fits content, never wider than screen */
    .pcw-filter-bar-inner {
        display: block;
        width: auto;
        max-width: 100%;
    }
    .pcw-filter-bar {
        display: inline-flex !important;
        width: auto !important;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 16px;
        padding: 8px 8px;
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .pcw-filter-bar::-webkit-scrollbar {
        display: none;
    }
    /* Buttons natural size, no stretching */
    .pcw-filter-bar .pcw-filter-btn {
        flex: 0 0 auto;
    }
    .pcw-filter-btn {
        font-size: 13px;
        padding: 6px 14px 10px;
    }
}

@media (max-width: 480px) {
    .pcw-filter-bar {
        border-radius: 12px;
        padding: 6px 6px;
        gap: 2px;
    }
    .pcw-filter-btn {
        font-size: 12px;
        padding: 6px 12px 10px;
    }
    .pcw-grid.pcw-col-2,
    .pcw-grid.pcw-col-3,
    .pcw-grid.pcw-col-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================
   Sub-project grid: same card size for any column count.
   Cards are capped at --pcw-card-max (default 440px), centered,
   and shrink evenly only when the screen is too narrow.
   ============================ */
.pcw-subgrid .pcw-grid { justify-content: center; }
.pcw-subgrid .pcw-grid.pcw-col-1 { grid-template-columns: minmax(0, var(--pcw-card-max, 440px)); }
.pcw-subgrid .pcw-grid.pcw-col-2 { grid-template-columns: repeat(2, minmax(0, var(--pcw-card-max, 440px))); }
.pcw-subgrid .pcw-grid.pcw-col-3 { grid-template-columns: repeat(3, minmax(0, var(--pcw-card-max, 440px))); }
.pcw-subgrid .pcw-grid.pcw-col-4 { grid-template-columns: repeat(4, minmax(0, var(--pcw-card-max, 440px))); }

@media (max-width: 1024px) {
    .pcw-subgrid .pcw-grid.pcw-col-3,
    .pcw-subgrid .pcw-grid.pcw-col-4 { grid-template-columns: repeat(2, minmax(0, var(--pcw-card-max, 440px))); }
}
@media (max-width: 600px) {
    .pcw-subgrid .pcw-grid.pcw-col-2,
    .pcw-subgrid .pcw-grid.pcw-col-3,
    .pcw-subgrid .pcw-grid.pcw-col-4 { grid-template-columns: minmax(0, 1fr); }
    .pcw-subgrid .pcw-grid.pcw-col-1 { grid-template-columns: minmax(0, 1fr); }
}
