/*
 * Hometown Communities — Theme Overrides
 * Updated for Houzez 4.3.5
 *
 * Organization:
 * 1. Design tokens and utilities
 * 2. Header, navigation, and translation
 * 3. Global layout and buttons
 * 4. Agents, maps, and community components
 * 5. Listings and property lightbox
 * 6. Property header and previous/next navigation
 * 7. Forms, footer, BetterDocs, and specialty sections
 * 8. Social links
 *
 * Notes:
 * - Hometown branding and site-specific behavior are preserved.
 * - Listing selectors are scoped to Houzez 4.3.5 markup where possible.
 * - !important is retained only where theme/plugin specificity requires it.
 */

/* ========================================================================== 
   1. Design tokens and utilities
   ========================================================================== */

:root {
    --hc-primary: #609ab4;
    --hc-primary-hover: #66afcf;
    --hc-primary-bright: #76b5d1;
    --hc-primary-border: #99b8c6;
    --hc-accent: #ffa861;
    --hc-accent-hover: #f88c33;
    --hc-text: #000000;
    --hc-border: #e0e0e0;
    --hc-border-soft: #f0f0f0;
    --hc-role-border: #d4e1e7;
    --hc-menu-soft: #fff1e6;
    --hc-white: #ffffff;
    --hc-black: #000000;
}

.blur {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.role-card {
    cursor: pointer;
    border: 1px solid var(--hc-role-border);
    transition: border-color 0.3s ease;
}

.role-card--selected {
    border: 2px solid var(--hc-primary) !important;
}

.role-card:hover,
.role-card:focus-visible {
    border-color: var(--hc-primary-bright) !important;
}

.employer-grid a,
.employer-grid [data-ep-wrapper-link] {
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.employer-grid a:hover,
.employer-grid [data-ep-wrapper-link]:hover,
.employer-grid a:focus-visible,
.employer-grid [data-ep-wrapper-link]:focus-visible {
    border-color: var(--hc-primary-bright) !important;
}

.card-deck .card {
    background-color: var(--hc-white);
    box-shadow: none;
}

.block-wrap,
.sidebar-wrap,
.property-form-wrap,
.widget-wrap,
.agent-profile-wrap,
.agent-bio-wrap,
.agent-contacts-wrap {
    border-radius: 0 !important;
}

/* ========================================================================== 
   2. Header, navigation, and translation
   ========================================================================== */

.header-main-wrap {
    z-index: 10;
}

.header-v4 {
    background: var(--hc-white) !important;
    border: 1px solid var(--hc-border-soft);
}

.header-v4 .header-inner-wrap {
    margin-top: -1px;
}

/* Site-specific desktop top-bar alignment. */
#top-bar-nav {
    margin-left: -140px;
    text-align: right !important;
}

.main-nav .navbar-nav .nav-item .nav-item a,
.login-register .login-register-nav li .dropdown-menu .nav-item a {
    text-transform: capitalize;
}

.main-nav .navbar-nav .nav-item .nav-item a {
    font-family: "neulis-alt-regular";
}

.nav-mobile .main-nav .nav-item .dropdown-menu .nav-item > a {
    padding: 15px 15px 15px 40px;
    font-size: 14px;
    font-weight: 500;
}

/* GTranslate: target the selector itself instead of generated menu IDs. */
header li:has(.gt_selector) {
    position: relative;
    display: flex;
    align-self: center;
    align-items: center;
    padding-right: 15px;
}

header .gt_selector {
    height: fit-content;
}

.gt_selector {
    width: 100px !important;
    margin-left: 10px !important;
}

.nav-mobile li:has(.gt_selector) {
    padding-top: 15px;
}

.mysticky-welcomebar-fixed-wrap {
    min-height: 40px !important;
    padding: 10px 15px !important;
    text-align: center !important;
}

@media (max-width: 991.98px) {
    .slideout-menu {
        margin-bottom: 0;
        overflow-x: hidden;
    }
}

@media (max-width: 767.98px) {
    .top-bar-wrap {
        padding: 0 25px;
    }
}

@media (max-width: 480px) {
    .mysticky-welcomebar-fixed-wrap {
        flex-wrap: wrap;
    }

    .gt_selector {
        margin-top: 30px;
    }
}

/* ========================================================================== 
   3. Global layout and buttons
   ========================================================================== */

.pw-home-card-apply-btn,
.pw-btn-apply {
    color: var(--hc-white);
    background: var(--hc-accent);
    font-size: 15px;
    transition: background-color 0.2s ease;
}

.pw-home-card-apply-btn {
    right: 108px;
}

.pw-home-card-apply-btn:hover,
.pw-home-card-apply-btn:focus-visible,
.pw-home-card-apply-btn:active,
.pw-btn-apply:hover,
.pw-btn-apply:focus-visible,
.pw-btn-apply:active {
    color: var(--hc-white) !important;
    background: var(--hc-accent-hover) !important;
}

.btn-full-width-2,
.btn-full-width-3 {
    display: inline-block;
    width: 100%;
    padding: 10px 0;
    color: var(--hc-white) !important;
    font-family: "Unbounded";
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.btn-full-width-2 {
    background-color: var(--hc-accent);
}

.btn-full-width-2:hover,
.btn-full-width-2:focus-visible {
    background-color: var(--hc-accent-hover);
}

.btn-full-width-2 a,
.btn-full-width-2 a:hover,
.btn-full-width-2 a:focus-visible {
    color: var(--hc-white) !important;
}

.btn-full-width-3 {
    background-color: var(--hc-primary);
}

.btn-full-width-3:hover,
.btn-full-width-3:focus-visible {
    color: var(--hc-white) !important;
    background-color: var(--hc-primary-hover);
    text-decoration: none;
}

.btn-secondary,
.btn-call {
    color: var(--hc-text);
    background-color: transparent;
    border-color: var(--hc-primary-border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.btn-call:hover,
.btn-call:focus-visible {
    color: var(--hc-white);
    background-color: var(--hc-primary);
    border-color: var(--hc-primary);
}

.agency-btn-link {
    color: var(--hc-white);
    background-color: var(--hc-accent);
    border-color: var(--hc-accent);
}

.agency-btn-link:hover,
.agency-btn-link:focus-visible {
    color: var(--hc-white);
    background-color: var(--hc-accent-hover);
    border-color: var(--hc-accent-hover);
}

@media (max-width: 1201px) {
    .pw-home-card-btn-container {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 12px 0;
    }

    .pw-home-card-btn-container a.btn {
        position: static;
    }
}

@media (min-width: 992px) {
    .page-template-templatetemplate-search-php .list-view .item-body .item-date {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 991.98px) {
    .page-template-templatetemplate-search-php .pw-home-card-btn-container {
        margin-top: 12px;
        margin-bottom: 0;
    }
}

/* ========================================================================== 
   4. Agents, maps, and community components
   ========================================================================== */

.agent-list-wrap {
    border: 1px solid var(--hc-border-soft);
}

.agent-list-link:hover,
.agent-list-link:focus-visible {
    color: var(--hc-accent);
}

.agent-contacts-wrap .email a,
.agent-list-contact .email a {
    position: relative;
    visibility: hidden;
}

.agent-contacts-wrap .email a::after,
.agent-list-contact .email a::after {
    position: absolute;
    top: 0;
    right: 0;
    visibility: visible;
    content: "Send Message";
}

/* Preserve the site's custom role-label presentation. */
.agent-contacts-wrap li:nth-child(3) strong,
.agent-list-contact li:nth-child(3) strong,
.agent-contacts-wrap li:nth-child(4) strong {
    position: relative;
    visibility: hidden;
}

.agent-contacts-wrap li:nth-child(3) strong::after,
.agent-list-contact li:nth-child(3) strong::after,
.agent-contacts-wrap li:nth-child(4) strong::after {
    position: absolute;
    left: 0;
    visibility: visible;
    content: "Manager";
}

.agent-contacts-wrap li:nth-child(3) strong::after {
    top: -6px;
}

.agent-list-contact li:nth-child(3) strong::after {
    top: -3px;
}

.agent-contacts-wrap li:nth-child(4) strong::after {
    top: -40px;
}

.agent-nav-wrap {
    margin: 50px 5px !important;
}

.gm-style-iw-d[style] {
    padding: 10px !important;
}

@media (max-width: 500px) {
    .agent-profile-buttons:has(.pw-btn-apply) {
        flex-direction: column !important;
    }
}

@media (max-width: 767.98px) {
    .agent-profile-wrap {
        margin-top: 0;
        border: 1px solid var(--hc-border-soft);
    }
}

/* ========================================================================== 
   5. Listings and property lightbox
   ========================================================================== */

/*
 * Hometown listing namespace
 * --------------------------
 * The child theme adds .hc-listing-view through Houzez's
 * houzez_listing_view_class filter. Keep card overrides beneath this namespace
 * because Houzez reuses .item-header, .item-body, .item-wrap and price classes
 * throughout unrelated modules.
 */

/* Preserve Bootstrap's gy-4 spacing between list cards. The previous cleanup
   accidentally forced the list gutter to zero, causing cards to run together. */
.hc-listing-view.list-view.row.gy-4 {
    --bs-gutter-y: 1.5rem;
}

/* Island-style framed listing cards, but scoped only to Houzez listing views. */
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap.item-wrap-no-frame,
.hc-listing-view.grid-view > .item-listing-wrap > .item-wrap.item-wrap-no-frame {
    overflow: hidden;
    background: var(--hc-white);
    border: 1px solid var(--hc-border) !important;
}

/* Prevent long listing content from forcing the flex row wider than its card. */
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap > .d-flex > .item-body {
    min-width: 0;
}

/*
 * External listing images do not pass through WordPress thumbnail cropping.
 * Give list cards a predictable image viewport and crop the remote original
 * with object-fit instead of allowing portrait/landscape source ratios to
 * dictate each card's height.
 */
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap > .d-flex > .item-header {
    overflow: hidden;
}

.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .listing-image-wrap,
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .listing-gallery-wrap,
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .houzez-listing-carousel,
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .slick-list,
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .slick-track,
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .slide-img,
.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .slide-img > a.hover-effect {
    height: 100% !important;
}

.hc-listing-view.list-view > .item-listing-wrap > .item-wrap .item-header .slide-img img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* Standard list cards switch to a horizontal row at Bootstrap's md breakpoint. */
@media (min-width: 768px) {
    .hc-listing-view.list-view > .item-listing-wrap:not(.item-wrap-v1-half-map):not(.item-wrap-v2-half-map) > .item-wrap > .d-flex > .item-header {
        flex: 0 0 280px;
        align-self: stretch;
        width: 280px;
        height: 210px;
    }
}

/* Half-map cards remain stacked until Houzez's lg breakpoint. */
@media (min-width: 992px) {
    .hc-listing-view.list-view > .item-listing-wrap.item-wrap-v1-half-map > .item-wrap > .d-flex > .item-header,
    .hc-listing-view.list-view > .item-listing-wrap.item-wrap-v2-half-map > .item-wrap > .d-flex > .item-header {
        flex: 0 0 280px;
        align-self: stretch;
        width: 280px;
        height: 210px;
    }
}

/* Stacked cards use one consistent 4:3 media window. */
@media (max-width: 767.98px) {
    .hc-listing-view.list-view > .item-listing-wrap > .item-wrap > .d-flex > .item-header {
        width: 100%;
        aspect-ratio: 4 / 3;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hc-listing-view.list-view > .item-listing-wrap.item-wrap-v1-half-map > .item-wrap > .d-flex > .item-header,
    .hc-listing-view.list-view > .item-listing-wrap.item-wrap-v2-half-map > .item-wrap > .d-flex > .item-header {
        width: 100%;
        aspect-ratio: 4 / 3;
    }
}

/* Grid cards retain Hometown's minimum media height. */
.hc-listing-view.grid-view .item-listing-wrap .item-header {
    min-height: 200px !important;
}

.listing-v1 {
    padding: 0 15px;
}

/* Match Island's visual separation between the map and results pane. */
.half-map-right-wrap {
    padding: 0 !important;
    border-left: 1px solid var(--hc-border) !important;
}

.hc-listing-view .item-title {
    display: -webkit-box;
    max-width: 28ch !important;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.hc-listing-view .item-sub-price {
    margin-left: 0 !important;
}

.hc-listing-view .item-title a:hover,
.hc-listing-view .item-title a:focus-visible {
    color: var(--hc-accent-hover) !important;
}

/* Desktop list prices live in the card body. */
.hc-listing-view.list-view .item-body > .item-price-wrap {
    color: var(--hc-text) !important;
}

.hc-listing-view a.label-status.label:hover,
.hc-listing-view a.label-status.label:focus-visible {
    color: rgb(255 255 255 / 78%) !important;
}

.item-tool-dropdown-menu {
    background-color: var(--hc-primary);
}

.item-tool-dropdown-menu .dropdown-item:hover,
.item-tool-dropdown-menu .dropdown-item:focus-visible {
    background-color: var(--hc-accent);
}

.overlay-search-module-close .search-title {
    color: var(--hc-black);
}

.property-lightbox .modal-header {
    color: var(--hc-white);
    background-color: var(--hc-primary);
}

.lightbox-logo img {
    width: auto;
    max-width: 120px;
}

@media (max-width: 768px) {
    .half-map-right-wrap {
        border-left: 0 !important;
    }
}

@media (max-width: 575px) {
    .hc-listing-view.grid-view .item-listing-wrap {
        background: transparent;
    }
}

@media (max-width: 767.98px) {
    /* Houzez renders duplicate list-card labels in the image and body. */
    .hc-listing-view.list-view .item-body > .labels-wrap {
        display: none !important;
    }

    .hc-listing-view.list-view .item-header > .labels-wrap {
        display: block !important;
    }

    .listing-wrap {
        padding: 0 !important;
    }

    /* Keep edge-to-edge detail behavior scoped to property pages. */
    .single-property .bt-content-wrap,
    .single-property .col-lg-8,
    .single-property .col-md-12,
    .single-property .detail-wrap {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .single-property .detail-wrap {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .property-lightbox .modal-content {
        background-color: rgb(0 0 0 / 76%);
    }

    .property-lightbox .modal-header {
        border-bottom: 1px solid var(--hc-white);
    }

    .property-lightbox .modal-footer {
        background-color: var(--hc-primary) !important;
        border-top: 1px solid var(--hc-white) !important;
    }

    .property-lightbox .close,
    .lightbox-tools a {
        border-left: 1px solid var(--hc-white);
    }

    .lightbox-logo img {
        width: 60px;
        max-width: 60px;
    }
}

/* ========================================================================== 
   6. Property header and previous/next navigation
   ========================================================================== */

/* Houzez 4.3.5 uses .property-header-wrap with a separate title and price
   column. This replaces older title/price layout assumptions without a
   template override. */
.single-property .page-title-wrap .property-header-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px clamp(24px, 4vw, 64px);
    align-items: start !important;
    width: 100%;
}

.single-property .property-header-wrap > .property-title-wrap {
    min-width: 0;
}

.single-property .property-header-wrap .page-title {
    min-width: 0;
    margin: 0;
}

.single-property .property-header-wrap .page-title h1 {
    margin: 0;
    line-height: 1.1;
    overflow-wrap: break-word;
}

.single-property .property-header-wrap > .property-price-wrap {
    display: flex !important;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    text-align: right;
    list-style: none;
}

.single-property .property-header-wrap > .property-price-wrap > li {
    display: block;
    margin: 0 !important;
    white-space: nowrap;
}

.single-property .property-header-wrap .item-sub-price {
    margin-top: 4px !important;
    margin-left: 0 !important;
}

/* Hometown's Houzez 4.3.5 next/previous template includes an extra .container
   wrapper, so the grid selector is intentionally tailored to that markup. */
.property-nav-wrap {
    box-sizing: border-box;
    width: 100%;
    margin: 40px auto;
}

.property-nav-wrap > .container > .d-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: center;
}

.property-nav-wrap .prev-property,
.property-nav-wrap .next-property {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.property-nav-wrap .prev-property {
    justify-content: flex-start;
}

.property-nav-wrap .next-property {
    justify-content: flex-end;
    text-align: right;
}

.property-nav-wrap .prev-property > a:first-child,
.property-nav-wrap .next-property > a:last-child {
    display: block;
    flex: 0 0 clamp(110px, 14vw, 180px);
    width: clamp(110px, 14vw, 180px);
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: #f1f1f1;
    border-radius: 8px;
}

.property-nav-wrap img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.property-nav-wrap a:hover img,
.property-nav-wrap a:focus-visible img {
    transform: scale(1.04);
}

.property-nav-wrap .next-property img {
    margin-left: inherit;
}

.property-nav-wrap .property-nav-link {
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .single-property .page-title-wrap .property-header-wrap {
        column-gap: 32px;
    }
}

@media (max-width: 991px) {
    .property-nav-wrap {
        margin: 30px auto;
    }

    .property-nav-wrap > .container > .d-flex {
        gap: 16px;
    }

    .property-nav-wrap .prev-property > a:first-child,
    .property-nav-wrap .next-property > a:last-child {
        flex-basis: 110px;
        width: 110px;
    }
}

@media (max-width: 600px) {
    .property-nav-wrap {
        margin: 24px auto;
    }

    .property-nav-wrap > .container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .property-nav-wrap > .container > .d-flex {
        gap: 12px;
    }

    .property-nav-wrap .prev-property,
    .property-nav-wrap .next-property {
        gap: 8px;
    }

    .property-nav-wrap .prev-property > a:first-child,
    .property-nav-wrap .next-property > a:last-child {
        flex-basis: 64px;
        width: 64px;
        aspect-ratio: 4 / 3;
        border-radius: 5px;
    }

    .property-nav-wrap .property-nav-link {
        font-size: 14px;
    }
}

/* ========================================================================== 
   7. Forms, footer, BetterDocs, and specialty sections
   ========================================================================== */

.forminator-input-with-icon {
    margin-top: -22px !important;
}

/* Avoid tying the icon correction to one generated Forminator form ID. */
.forminator-ui.forminator-custom-form[data-design="default"]
    .forminator-input-with-icon
    [class*="forminator-icon-"] {
    top: 70% !important;
}

.ui-datepicker-calendar {
    background-color: var(--hc-white) !important;
    border-right: 1px solid #e9e9e9 !important;
    border-bottom: 1px solid #e9e9e9 !important;
    border-left: 1px solid #e9e9e9 !important;
}

.ui-corner-all {
    border-radius: 0 !important;
}

#block-7 {
    margin-top: 0;
    background: var(--hc-white);
}

#block-10 {
    padding: 20px 15px 30px !important;
}

#houzez_contact-2 {
    margin-top: 50px !important;
    padding: 20px !important;
    background: rgb(153 184 198 / 16%);
}

.adv-wrapper {
    margin: 0;
    text-align: left;
}

.widget ul:not(.item-amenities):not(.item-price-wrap):not(.contact-list):not(.dropdown-menu):not(.nav-tabs) li a {
    font-size: 14px;
    line-height: 1em;
}

.widget-read-more {
    padding: 10px;
    background-color: var(--hc-accent);
}

.widget-read-more a {
    color: var(--hc-white) !important;
}

.betterdocs-single-wraper .betterdocs-content-area .docs-listing-main {
    padding: 0;
}

.betterdocs-category-box-wrapper
    .betterdocs-category-box-inner-wrapper
    .betterdocs-single-category-wrapper
    .betterdocs-category-title {
    color: var(--hc-black) !important;
}

.betterdocs-category-box-wrapper
    .betterdocs-category-box-inner-wrapper
    .betterdocs-single-category-wrapper:hover
    .betterdocs-category-title {
    color: var(--hc-accent) !important;
}

.betterdocs-search-heading h3.subheading {
    font-family: "neulis-alt-regular" !important;
    letter-spacing: 0.02em !important;
}

.betterdocs-single-wrapper.betterdocs-single-layout-4
    .docs-single-title
    .betterdocs-entry-title {
    text-transform: capitalize;
}

.custom-menu-button {
    background-color: var(--hc-menu-soft);
}

.custom-menu-button a:hover,
.custom-menu-button a:focus-visible {
    color: var(--hc-accent-hover) !important;
}

.blog-posts-module-v3
    .blog-posts-module-v3-right-wrap
    .blog-post-item-v3
    .blog-post-title h3,
.property-item-widget .right-property-item-widget-wrap .item-price,
.property-item-widget .right-property-item-widget-wrap .item-title {
    font-family: "neulis-alt-regular";
}

.footer-top-wrap {
    padding: 40px 10px 20px;
}

.footer-copyright {
    font-size: 12px;
}

.footer-bottom-wrap {
    padding: 5px;
}

.footer-bottom-wrap-v3 .footer-social {
    margin-bottom: 0 !important;
}

@media (max-width: 767.98px) {
    .footer-bottom-wrap .d-flex .footer-copyright {
        margin-bottom: 0 !important;
    }
}

/* ========================================================================== 
   8. Social links
   ========================================================================== */

.btn-linkedin,
.icon-professional-network-linkedin {
    color: #007bb6 !important;
    font-size: 15px;
}

.btn-instagram,
.icon-social-instagram {
    background: radial-gradient(
        circle at 30% 107%,
        #fdf497 0%,
        #fdf497 5%,
        #fd5949 45%,
        #d6249f 60%,
        #285aeb 90%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 15px;
}

.btn-twitter,
.icon-social-media-twitter {
    color: #00acee !important;
    font-size: 15px;
}

.btn-facebook,
.icon-social-media-facebook {
    color: #007bb6 !important;
    font-size: 15px;
}

.btn-googleplus,
.icon-social-media-google-plus-1 {
    color: #dd4b39 !important;
    font-size: 15px;
}
