/* ============================================================
   County Properties page (Home/CountyProperties?id={County}) - redesign.
   ONE template for every county. Navy hero with the dynamic county name,
   a floating search bar, and homepage-style property cards.

   Ported from the ui_changes redesign (which reused its
   SearchTypePropertyCSS for this page). Re-scoped here as a page-only
   stylesheet: every selector requires the .county-properties-page class
   on the #countyPage wrapper, so nothing can affect other views (the
   SearchTypeProperty page keeps its own copy when it gets ported).

   Typography: unlike the ui_changes original, this port declares NO
   font-family anywhere - all text inherits the site's existing
   'Source Sans Pro' stack. Sizes/weights/spacing are kept as designed.
   Everything stays CMS/id-driven - presentation only.
   ============================================================ */

#countyPage.county-properties-page {
    --stp-heading: #252525;
    --stp-text: #707070;
    --stp-green: #21b389;
    --stp-green-dark: #1a9873;
    --stp-navy: #16233a;
    --stp-navy-deep: #0e1826;
    --stp-card: #ffffff;
    --stp-border: #e8e4dc;
    background: #F5F6F7;
    color: var(--stp-text);
    /* fill the light-gray down to the footer on short (empty) pages and give
       breathing room below the content (kept modest so the empty state
       doesn't leave a large blank band above the footer - matches
       SearchTypeProperty). */
    min-height: 50vh;
    padding-bottom: 18px;
}

/* ---------- Banner (dynamic county name) ---------- */
/* Simplified banner matching HomeCounties: heading + green underline + count
   on the page's light background (no navy hero block). The underline copies
   the homepage section-heading accent (60x3px #30caa0, centered). */
.county-properties-page .stp-hero {
    padding: 40px 24px 26px;
    text-align: center;
}

.county-properties-page .stp-hero h1 {
    position: relative;
    font-size: clamp(1.7rem, 4vw, 2.15rem);
    font-weight: 800;
    color: #333333;
    margin: 0;
    padding-bottom: 14px;
    text-transform: capitalize;
}

    .county-properties-page .stp-hero h1::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: #30caa0;
        border-radius: 2px;
    }

/* ---------- Search bar (floats up into the hero bottom edge) ---------- */
#countyPage.county-properties-page #searchProperty.spads {
    padding: 0;
}

#countyPage.county-properties-page #searchProperty > .container {
    max-width: 100%;
    padding: 0;
}

#countyPage.county-properties-page .filter-search {
    /* No width cap of its own: the inner Bootstrap .container (same element
       that sizes the grid below) sizes and centers the navy panel, so the
       panel's edges line up exactly with the card grid. */
    margin: 6px 0 34px !important;
    position: relative;
    z-index: 5;
}

/* Navy search panel: the three white inputs + green SEARCH button sit inside
   a rounded navy strip (site navy #244565), with even padding all around. */
#countyPage.county-properties-page .filter-form {
    background: #244565 !important;
    border: none;
    border-radius: 8px;
    padding: 24px;
    box-shadow: none !important;
}

    #countyPage.county-properties-page .filter-form .row {
        margin: 0;
        display: flex;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 14px;
    }

    #countyPage.county-properties-page .filter-form [class*="col-"] {
        padding: 0;
        display: flex;
        align-items: center;
        min-width: 0;
    }

    /* Proportional flex sizes instead of Bootstrap's percentage widths: the
       percentages sum to 100% and ignore the 14px gaps, which pushed the
       SEARCH column out past the panel's right padding. flex-basis 0 makes
       the gaps come out of the shared space so everything stays inside. */
    #countyPage.county-properties-page .filter-form .col-md-4 {
        flex: 4 1 0%;
    }

    #countyPage.county-properties-page .filter-form .col-md-3 {
        flex: 3 1 0%;
    }

    #countyPage.county-properties-page .filter-form .col-md-2 {
        flex: 2 1 0%;
        min-width: 132px;
    }

    #countyPage.county-properties-page .filter-form input.inputWidth {
        width: 100%;
        box-sizing: border-box;
        border: none;
        outline: none;
        background: #fff;
        border-radius: 6px;
        padding: 13px 14px;
        font-size: .9rem;
        color: var(--stp-heading);
    }

    #countyPage.county-properties-page .filter-form .site-btn {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        background: var(--stp-green) !important;
        color: #fff !important;
        border: none;
        border-radius: 6px;
        padding: 13px 24px;
        font-size: .9rem;
        font-weight: 700;
        cursor: pointer;
        transition: background-color .15s ease;
    }

        #countyPage.county-properties-page .filter-form .site-btn:hover {
            background: var(--stp-green-dark) !important;
        }


/* Empty state - shown when the county has no visible properties.
   Matches SearchTypeProperty's .stp-empty notice. */
#countyPage.county-properties-page .stp-empty {
    max-width: 640px;
    margin: 34px auto 48px;
    padding: 16px 24px;
    text-align: center;
    background: #fdecec;
    border: 1px solid #f5c2c7;
    border-radius: 10px;
}

    #countyPage.county-properties-page .stp-empty p {
        margin: 0;
        font-size: .95rem;
        font-weight: 600;
        color: #d9534f;
    }

/* ---------- Grid + cards (homepage Featured-Properties style) ---------- */
#countyPage.county-properties-page .feature-section {
    background: transparent !important;
    padding: 0 !important;
}

    #countyPage.county-properties-page .feature-section > .container {
        max-width: 1200px;
        padding: 0 24px 30px;
    }

#countyPage.county-properties-page .feature-item.card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--stp-card);
    border: 1px solid var(--stp-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(16, 24, 40, .05);
    transition: transform .15s ease, box-shadow .15s ease;
}

    #countyPage.county-properties-page .feature-item.card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 44px rgba(16, 24, 40, .13);
    }

    #countyPage.county-properties-page .feature-item.card > a:first-child {
        display: block;
    }

#countyPage.county-properties-page .feature-pic {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    height: auto; /* override the theme's fixed 250px so aspect-ratio drives it */
    aspect-ratio: 16 / 11;
    min-height: 0;
    background-color: #e8e8e8;
}

/* the anchor that wraps the photo must be full width too. */
#countyPage.county-properties-page .feature-item.card > a {
    display: block;
    width: 100%;
}

/* Real <img> so the photo zooms on hover (was a CSS background before) - force
   full-fill so it never leaves a gap on wider (responsive) cards. */
#countyPage.county-properties-page .feature-item.card .feature-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    display: block;
    transition: transform .35s ease;
}

#countyPage.county-properties-page .feature-item.card:hover .feature-img {
    transform: scale(1.07);
}

/* Diagonal green corner ribbon (clipped into a triangle by the photo).
   Resets the theme's own .ribbon / .ribbon span (which is a 130x130 box with
   its OWN rotate on the span - that double-rotated ours to vertical). */
#countyPage.county-properties-page .ribbon {
    position: absolute;
    top: 16px;
    left: -34px;
    width: auto;
    height: auto;
    overflow: visible;
    transform: rotate(-45deg);
    z-index: 3;
}

    #countyPage.county-properties-page .ribbon span {
        position: static;
        display: block;
        width: auto;
        min-width: 140px;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
        line-height: 1.5;
        padding: 5px 40px;
        background: var(--stp-green) !important;
        color: #fff;
        font-size: .62rem;
        font-weight: 800;
        letter-spacing: .05em;
        text-transform: uppercase;
        text-align: center;
        box-shadow: 0 2px 6px rgba(16, 24, 40, .22);
    }

        /* theme adds triangle "tails" under the ribbon span - drop them. */
        #countyPage.county-properties-page .ribbon span::before,
        #countyPage.county-properties-page .ribbon span::after {
            display: none !important;
        }

#countyPage.county-properties-page .feature-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
    border: none;
}

#countyPage.county-properties-page .feature-title {
    text-align: left !important;
    padding: 18px 20px 2px;
    min-height: 0 !important;
}

    #countyPage.county-properties-page .feature-title h6 {
        font-size: .9rem;
        font-weight: 700;
        color: var(--stp-heading);
        margin: 0 0 14px;
        display: flex;
        align-items: flex-start;
        gap: 6px;
        line-height: 1.4;
    }

        #countyPage.county-properties-page .feature-title h6 .fa {
            color: var(--stp-green-dark) !important;
            margin-top: 3px;
            flex-shrink: 0;
        }

#countyPage.county-properties-page .room-info-warp {
    padding: 0 20px;
}

/* Single divider above the specs. The theme puts a border-top on .room-info;
   keep that ONE (re-colored) and remove the extra border on the inner .row. */
#countyPage.county-properties-page .room-info {
    border-top: 1px solid var(--stp-border) !important;
    padding-top: 14px;
}

    #countyPage.county-properties-page .room-info .row {
        border-top: none;
        padding-top: 0;
        margin: 0;
    }

#countyPage.county-properties-page .PDMAin {
    float: none;
    width: 33.333%;
    padding: 0 6px 12px 0 !important;
    margin: 0;
    overflow: visible;
}

    #countyPage.county-properties-page .PDMAin .pdCnntent h5 {
        font-size: .58rem !important;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--stp-text);
        font-weight: 600;
        margin: 0 0 2px;
    }

    #countyPage.county-properties-page .PDMAin .pdCnntent p {
        font-size: .8rem;
        font-weight: 700;
        color: var(--stp-heading);
        margin: 0;
    }

        /* Empty CMS spec value -> subtle em dash instead of a blank gap. */
        #countyPage.county-properties-page .PDMAin .pdCnntent p:empty::after {
            content: "\2014";
            color: #c4c0b8;
            font-weight: 400;
        }

/* Green price bar pinned to the card bottom. */
#countyPage.county-properties-page .room-price {
    display: block;
    margin-top: auto;
    background: var(--stp-green) !important;
    color: #fff !important;
    text-align: center;
    padding: 14px 13px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -.01em;
    text-decoration: none !important;
}

    #countyPage.county-properties-page .room-price:hover {
        background: var(--stp-green-dark) !important;
        color: #fff !important;
    }

/* ---------- Empty state (minimal, lightly styled) ---------- */
#countyPage.county-properties-page .stp-empty {
    max-width: 640px;
    margin: 34px auto 48px;
    padding: 16px 24px;
    text-align: center;
    background: #fdecec;
    border: 1px solid #f5c2c7;
    border-radius: 10px;
}

    #countyPage.county-properties-page .stp-empty p {
        margin: 0;
        font-size: .95rem;
        font-weight: 600;
        color: #d9534f;
    }

/* Neutralize the leftover top padding the old .spad rule added. */
#countyPage.county-properties-page .spad {
    padding-top: 0 !important;
}

/* No tooltips on the spec values (Type/Financing/Garage/...). The inline
   page script also strips the title attributes; this only covers tooltips
   spawned inside the page wrapper (scoped - the ui_changes original used a
   bare global .tooltip rule, re-scoped here so it can't leak). */
#countyPage.county-properties-page .tooltip {
    display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    #countyPage.county-properties-page .filter-form .row {
        flex-wrap: wrap;
    }

    #countyPage.county-properties-page .filter-form [class*="col-"] {
        flex: 1 1 100%;
        width: 100%;
    }

    /* Stacked layout: kill the legacy 20px input margins so every field is
       exactly as wide as the SEARCH button and the flex gap alone controls
       the (tightened) spacing between fields. */
    #countyPage.county-properties-page .filter-form input.inputWidth {
        margin: 0 !important;
    }

    #countyPage.county-properties-page .filter-form .row {
        gap: 20px;
    }

    #countyPage.county-properties-page .filter-form .site-btn {
        justify-content: center;
    }
}
