/* ====== Directory (cards) ====== */
.gcd-dir-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%
}

.gcd-dir {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%
}

.gcd-card {
    border: 1px solid #e5e9f2;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.gcd-card .gcd-pad {
    padding: 14px
}

/* Slightly more breathing room below titles inside cards */
.gcd-card .gcd-title {
    margin: 0 0 .55rem;
}

.gcd-title {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    line-height: 1.25;
    color: #111827;
    /* Reserve at least two lines of height for consistent card alignment */
    min-height: calc(2 * 1.25 * 1em);
    display: block;
}

.gcd-muted {
    color: #6b7280
}

.gcd-row {
    margin: .15rem 0
}

.gcd-media {
    position: relative;
    aspect-ratio: 16/9;
    background: #f2f4f7
}

.gcd-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.gcd-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #111827;
    color: #fff;
    font-size: .78rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    opacity: .92
}

/* Make boosted & premium cards span the whole grid row (1 per line) */
.gcd-card--boosted {
    grid-column: 1 / -1
}

.gcd-card--premium {
    grid-column: 1 / -1
}

/* --- Chips (default 2-up) --- */
.gcd-card .gcd-chip-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-bottom: .75rem;
}

.gcd-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .75rem;
    border-radius: 9999px;
    border: 1px solid var(--gcd-border, rgba(0, 0, 0, .12));
    background: var(--gcd-chip-bg, #f7f7f9);
    font-size: .7rem;
    line-height: 1;
    font-weight: 600;
    min-height: 2.25rem;
    text-align: center
}

.gcd-chip__label {
    opacity: .75;
    margin-right: .4rem
}

.gcd-chip__value {
    font-variant-numeric: tabular-nums
}

.gcd-chip__icon {
    margin-right: .4rem;
    flex: 0 0 auto
}

/* Base chip colors */
.gcd-chip--nqs {
    background: #eef7ff;
    border-color: #cfe7ff
}

.gcd-chip--vac {
    background: #eefaf2;
    border-color: #d1f0dc
}

.gcd-chip--vac.is-yes {
    background: #eefaf2;
    border-color: #d1f0dc;
    color: #064e3b
}

.gcd-chip--vac.is-no {
    background: #fff1f2;
    border-color: #ffe4e6;
    color: #7f1d1d
}

.gcd-chip--vac.is-unknown {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151;
}

.gcd-chip--lic {
    background: #f7f7ff;
    border-color: #e6e6ff
}

.gcd-chip--hrs {
    background: #f1f5ff;
    border-color: #dfe7ff
}

/* ====== BOOSTED layout (chips full width, then two columns: details | map) ====== */
.gcd-card--boosted .gcd-inner {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    grid-template-areas:
        "chips chips"
        "details map";
    column-gap: 16px;
    align-items: stretch;
}

/* Chips strip spans both columns; force 4 chips per row on desktop, 2×2 on mobile */
.gcd-card--boosted .gcd-chips {
    grid-area: chips;
    padding: 14px 14px 0
}

.gcd-card--boosted .gcd-chips .gcd-chip-row {
    grid-template-columns: repeat(4, minmax(0, 1fr))
}

@media (max-width:720px) {
    .gcd-card--boosted .gcd-chips .gcd-chip-row {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

/* Left column: details */
.gcd-card--boosted .gcd-details {
    grid-area: details;
    padding: 0 14px 14px
}

/* Right column: map fills the column */
.gcd-card--boosted .gcd-map {
    grid-area: map;
    position: relative;
    min-height: 320px;
    padding: 14px;
    border-left: 1px solid #e5e9f2;
    background: #f8fafc
}

.gcd-card--boosted .gcd-map__inner {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    overflow: hidden
}

.gcd-card--boosted .gcd-map__inner iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block
}

.gcd-card--boosted .gcd-map__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #6b7280;
    background: #fff
}

/* Stack on smaller screens; divider above map instead of left border */
@media (max-width:900px) {
    .gcd-card--boosted .gcd-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "chips"
            "details"
            "map";
    }

    .gcd-card--boosted .gcd-map {
        border-left: 0;
        border-top: 1px solid #e5e9f2
    }
}

/* ====== PREMIUM card styling & layout ====== */
.gcd-card--premium {
    position: relative;
    border: 0;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, #8b5cf6, #06b6d4, #22c55e) border-box;
    border: 2px solid transparent;
    box-shadow: 0 10px 24px rgba(17, 24, 39, .08), 0 2px 6px rgba(17, 24, 39, .06);
    transition: transform .12s ease;
}

.gcd-card--premium:hover {
    transform: translateY(-1px);
}

.gcd-card--premium .gcd-inner {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    grid-template-areas:
        "badge badge"
        "chips chips"
        "details map";
    column-gap: 16px;
    align-items: stretch;
}

/* Badge row (gold chip) */
.gcd-card--premium .gcd-badge {
    grid-area: badge;
    display: flex;
    padding: 12px 14px 0
}

.gcd-card--premium .gcd-badge--right {
    justify-content: flex-start
}

.gcd-card--premium .gcd-badge--left {
    justify-content: flex-start
}

.gcd-card--premium .gcd-chip--badge {
    background: linear-gradient(135deg, #f59e0b, #fbbf24, #f59e0b);
    border: 0;
    color: #111827;
    box-shadow: 0 4px 12px rgba(17, 24, 39, .12);
    font-weight: 800
}

/* Premium chips row */
.gcd-card--premium .gcd-chips {
    grid-area: chips;
    padding: 10px 14px 0
}

.gcd-card--premium .gcd-chip-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem
}

@media (max-width:720px) {
    .gcd-card--premium .gcd-chip-row {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

/* Premium chip accents */
.gcd-card--premium .gcd-chip:not(.gcd-chip--premium) {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, .06);
    font-size: .75rem;
    min-height: 2.4rem;
}

/* Premium marker chip */
.gcd-card--premium .gcd-chip--premium {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.gcd-card--premium .gcd-chip--premium .gcd-chip__icon {
    color: #fff;
    opacity: .95;
    margin-right: .4rem;
}

.gcd-card--premium .gcd-chip--nqs {
    background: #eef2ff;
    border-color: #e0e7ff;
    color: #4338ca
}

.gcd-card--premium .gcd-chip--vac.is-yes {
    background: #ecfdf5;
    border-color: #d1fae5;
    color: #065f46
}

.gcd-card--premium .gcd-chip--vac.is-no {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b
}

.gcd-card--premium .gcd-chip--lic {
    background: #fff7ed;
    border-color: #ffedd5;
    color: #9a3412
}

.gcd-card--premium .gcd-chip--hrs {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1d4ed8
}

/* Premium details & map */
.gcd-card--premium .gcd-details {
    grid-area: details;
    padding: 0 14px 14px
}

.gcd-card--premium .gcd-title {
    font-size: 1.18rem;
    line-height: 1.25;
    margin-top: .25rem
}

.gcd-card--premium .gcd-map {
    grid-area: map;
    position: relative;
    min-height: 320px;
    padding: 14px;
    background: #f8fafc;
    border-left: 1px solid #eef2f7
}

.gcd-card--premium .gcd-map__inner {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    overflow: hidden
}

.gcd-card--premium .gcd-map__inner iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block
}

.gcd-card--premium .gcd-map__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #6b7280;
    background: #fff
}

/* Premium mobile stack */
@media (max-width:860px) {
    .gcd-card--premium .gcd-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "badge"
            "chips"
            "details"
            "map";
    }

    .gcd-card--premium .gcd-map {
        border-left: 0;
        border-top: 1px solid #eef2f7;
        min-height: 240px
    }
}

/* Pager */
.gcd-pager {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: center
}

/* ====== Filter Bar ====== */
.gcd-filterbar {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 14px
}

/* Reset odd global text justification inside our filter bar only */
.gcd-filterbar,
.gcd-filterbar * {
    text-align: left !important;
    text-justify: auto !important
}

.gcd-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    align-items: start;
}

.gcd-filter-item label {
    display: block;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111827
}

/* Inputs (search box look) */
.gcd-filter-item select,
.gcd-filter-item input[type="search"] {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

/* Filter actions row */
.gcd-filter-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: 10px
}

.gcd-filter-actions .button {
    height: 34px;
    line-height: 32px;
    padding: 0 12px
}

/* Active chips row */
.gcd-active {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    font-size: .92rem;
    color: #374151;
    margin-top: 8px
}

.gcd-active .tag {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: .2rem .55rem;
    background: #f9fafb
}

/* ====== Generic Dropdown (details) used by ALL facets ====== */
.gcd-dd {
    position: relative
}

.gcd-dd summary {
    list-style: none;
    cursor: pointer;
    user-select: none
}

.gcd-dd summary::-webkit-details-marker {
    display: none
}

.gcd-dd__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-weight: 500;
    color: #111827;
}

.gcd-dd__chev {
    margin-left: 8px;
    transition: transform .15s ease
}

.gcd-dd[open] .gcd-dd__chev {
    transform: rotate(180deg)
}

.gcd-dd__menu {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
    padding: 10px;
    max-height: 300px;
    overflow: auto;
    z-index: 5;
}

.gcd-dd__opt {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin: .25rem 0
}

.gcd-dd__opt input {
    margin: 0
}

.gcd-dd__footer {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 8px
}

@media (max-width:480px) {
    .gcd-filter-row {
        grid-template-columns: 1fr
    }

    .gcd-card .gcd-chip-row {
        gap: .4rem
    }

    .gcd-chip {
        padding: .45rem .6rem;
        font-size: .82rem
    }
}

/* ====== Meta rows (icon + text) for address/phone ====== */
.gcd-meta {
    display: grid;
    gap: .45rem;
    margin-top: .8rem;
}

.gcd-meta-row {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    color: #111827;
}

.gcd-meta-ico {
    display: inline-flex;
    width: 1.05em;
    height: 1.05em;
    line-height: 1;
    opacity: .8;
    margin-top: .15em;
    /* nudge to align with first text line */
}

.gcd-meta-ico svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    display: block;
}

.gcd-meta-text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ====== Uniform 2-line blocks for alignment ====== */
/* Reserve two lines for the ADDRESS (first meta row) before the phone line */
.gcd-meta .gcd-meta-row:first-child .gcd-meta-text {
    line-height: 1.4;
    min-height: calc(2 * 1.4 * 1em);
    display: inline-block;
}

/* Slight icon nudge for the two-line address block */
.gcd-meta .gcd-meta-row:first-child .gcd-meta-ico {
    margin-top: .2em;
}