/* ==========================================================
   TDS — Listing v2.0
   Views:
   - /properties-search/
   - /property-type/...
   ========================================================== */

:root {
    --tds-dark: #172033;
    --tds-gold: #C69C6D;
    --tds-gold-hover: #B78B5A;
    --tds-bg: #F7F5F1;
    --tds-soft: rgba(23,32,51,.62);
    --tds-line: rgba(23,32,51,.10);
    --tds-container: 1180px;
}

/* 01. RH cleanup */

body.page-template-properties-search .rh_header,
body.tax-property-type .rh_header,
body.tax-property-city .rh_header,
body.tax-property-status .rh_header,
body.tax-property-feature .rh_header,
body.post-type-archive-property .rh_header,
body.page-template-properties-search .rh_mod_header,
body.tax-property-type .rh_mod_header,
body.tax-property-city .rh_mod_header,
body.tax-property-status .rh_mod_header,
body.tax-property-feature .rh_mod_header,
body.post-type-archive-property .rh_mod_header,
body.page-template-properties-search .rh_banner,
body.tax-property-type .rh_banner,
body.tax-property-city .rh_banner,
body.tax-property-status .rh_banner,
body.tax-property-feature .rh_banner,
body.post-type-archive-property .rh_banner,
.rh_page__sidebar,
.rh_page__controls,
.rh_pagination__stats {
    display: none !important;
}

/* 02. Hero */

.tds-listing-hero {
    position: relative;
    min-height: 520px;
    padding-bottom: 76px;
    background-image:
        linear-gradient(90deg, rgba(15,23,42,.78), rgba(15,23,42,.42), rgba(15,23,42,.12)),
        url('/wp-content/themes/realhomes-child/assets/images/targ-hero.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.tds-listing-hero__inner {
    width: min(var(--tds-container), calc(100% - 64px));
    min-height: 520px;
    margin: 0 auto;
    padding-top: 92px;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tds-listing-hero__inner span {
    margin-bottom: 18px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tds-gold);
}

.tds-listing-hero__inner h1 {
    margin: 0;
    max-width: 780px;
    font-family: var(--font-heading);
    font-size: clamp(58px, 5vw, 86px);
    line-height: .94;
    font-weight: 800;
    letter-spacing: -.055em;
    color: #fff;
}

/* 03. Search */

.tds-listing-search-wrap {
    position: relative;
    z-index: 30;
    margin-top: -88px;
    padding-bottom: 38px;
    background: linear-gradient(to bottom, transparent 0 44px, var(--tds-bg) 44px 100%);
}

.tds-listing-search-wrap .targ-search {
    width: min(var(--tds-container), calc(100% - 64px));
    margin: 0 auto !important;
}

.tds-listing-search-wrap .targ-search__form {
    box-shadow: 0 26px 80px rgba(15,23,42,.16);
}

.tds-listing-search-wrap .rh_prop_search {
    display: none !important;
}

/* 04. Map */

.tds-map-shell {
    width: min(var(--tds-container), calc(100% - 64px));
    margin: 30px auto 38px !important;
}

.tds-map-toggle {
    width: 100%;
    min-height: 72px;
    padding: 0 28px;

    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 18px;
    align-items: center;

    border: 0;
    border-radius: 24px;
    background: #fff;
    color: var(--tds-dark);
    font-family: var(--font-heading);
    cursor: pointer;
    box-shadow: 0 18px 50px rgba(15,23,42,.08);
}

.tds-map-toggle span,
.tds-map-toggle strong {
    font-size: 15px;
    font-weight: 800;
}

.tds-map-toggle em {
    padding: 8px 13px;
    border-radius: 999px;
    background: var(--tds-bg);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
    color: rgba(23,32,51,.66);
}

.tds-map-toggle strong {
    justify-self: end;
}

.tds-map-toggle strong::after {
    content: " ↓";
}

.tds-map-toggle--open strong::after {
    content: " ↑";
}

.rh_map.tds-map-collapsed {
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    transition: all .28s ease;
}

.rh_map.tds-map-collapsed.tds-map-open {
    height: 430px !important;
    max-height: 430px !important;
    margin-top: 24px;
    opacity: 1;
    border-radius: 24px;
    overflow: hidden !important;
    background: var(--tds-bg);
}

/* filtrujemy tylko kafelki, nie markery */
.tds-map-shell .leaflet-tile-pane {
    filter: grayscale(.18) saturate(.48) contrast(.9) brightness(1.06) sepia(.08) !important;
}

.tds-map-shell .leaflet-marker-icon,
.tds-map-shell .marker-cluster,
.tds-map-shell .marker-cluster div {
    filter: none !important;
}

.tds-map-shell .leaflet-popup-content-wrapper {
    border-radius: 22px !important;
    border-bottom: 4px solid var(--tds-gold) !important;
    box-shadow: 0 24px 70px rgba(15,23,42,.18) !important;
}

.tds-map-shell .leaflet-popup-tip {
    background: var(--tds-gold) !important;
}

.tds-map-shell .leaflet-control-zoom {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 18px !important;
    z-index: 9999 !important;
}

.tds-map-shell .leaflet-control-zoom a {
    width: 42px !important;
    height: 42px !important;
    line-height: 39px !important;
    background: #fff !important;
    color: var(--tds-dark) !important;
    border: 1px solid var(--tds-line) !important;
    font-size: 28px !important;
    font-weight: 800 !important;
}

.tds-map-shell .leaflet-control-zoom a:hover {
    background: var(--tds-gold) !important;
    color: #fff !important;
}

/* 05. Toolbar */

.tds-listing-toolbar {
    width: min(var(--tds-container), calc(100% - 64px));
    margin: 0 auto 30px !important;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.tds-listing-toolbar__stats {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--tds-soft);
}

.tds-listing-toolbar__stats span {
    color: var(--tds-gold);
    font-weight: 800;
}

.tds-sort {
    position: relative;
    z-index: 80;
}

.tds-sort__trigger {
    min-width: 280px;
    height: 58px;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    border: 1px solid var(--tds-line);
    border-radius: 18px;
    background: #fff;
    color: var(--tds-dark);
    font-family: var(--font-heading);
    cursor: pointer;
    box-shadow: 0 16px 44px rgba(15,23,42,.08);
}

.tds-sort__trigger span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(23,32,51,.48);
}

.tds-sort__trigger strong {
    font-size: 15px;
    font-weight: 800;
}

.tds-sort__trigger::after {
    content: "↓";
    color: rgba(23,32,51,.58);
}

.tds-sort--open .tds-sort__trigger::after {
    content: "↑";
}

.tds-sort__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 280px;
    padding: 10px;

    display: none;

    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15,23,42,.16);
}

.tds-sort--open .tds-sort__menu {
    display: grid;
    gap: 4px;
}

.tds-sort__menu button {
    width: 100%;
    padding: 14px;

    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--tds-dark);

    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.tds-sort__menu button:hover {
    background: var(--tds-bg);
}

/* 06. Listing layout */

.page-template-properties-search .rh_section--flex,
.tax-property-type .rh_section--flex,
.tax-property-city .rh_section--flex,
.tax-property-status .rh_section--flex,
.tax-property-feature .rh_section--flex,
.post-type-archive-property .rh_section--flex {
    background: var(--tds-bg);
}

.page-template-properties-search #properties-listing,
.tax-property-type #properties-listing,
.tax-property-city #properties-listing,
.tax-property-status #properties-listing,
.tax-property-feature #properties-listing,
.post-type-archive-property #properties-listing {
    padding: 0 !important;
    margin: 0 !important;
}

.page-template-properties-search .rh_page__main,
.tax-property-type .rh_page__main,
.tax-property-city .rh_page__main,
.tax-property-status .rh_page__main,
.tax-property-feature .rh_page__main,
.post-type-archive-property .rh_page__main {
    width: min(var(--tds-container), calc(100% - 64px)) !important;
    max-width: var(--tds-container) !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.page-template-properties-search .rh_page__listing,
.tax-property-type .rh_page__listing,
.tax-property-city .rh_page__listing,
.tax-property-status .rh_page__listing,
.tax-property-feature .rh_page__listing,
.post-type-archive-property .rh_page__listing {
    display: grid !important;
    gap: 24px !important;
    width: 100% !important;
}

/* 07. Property card */

.tds-list-card {
    width: 100%;
    display: grid;
    grid-template-columns: 360px 1fr;

    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15,23,42,.08);
    transition: transform .22s ease, box-shadow .22s ease;
}

.tds-list-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(15,23,42,.14);
}

.tds-list-card__image {
    position: relative;
    display: block;
    min-height: 260px;
    overflow: hidden;
    background: #EAE7E2;
}

.tds-list-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.tds-list-card:hover .tds-list-card__image img {
    transform: scale(1.035);
}

.tds-list-card__badge {
    position: absolute;
    left: 20px;
    top: 20px;

    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: var(--tds-dark);

    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
}

.tds-list-card__content {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 34px;
    padding: 34px;
}

.tds-list-card__main h2 {
    margin: 0;
    max-width: 540px;
    font-family: var(--font-heading);
    font-size: 28px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -.035em;
}

.tds-list-card__main h2 a {
    color: var(--tds-dark);
    text-decoration: none;
}

.tds-list-card__main h2 a:hover {
    color: var(--tds-gold);
}

.tds-list-card__excerpt {
    max-width: 540px;
    margin: 18px 0 0;
    font-family: var(--font-heading);
    font-size: 16px;
    line-height: 1.6;
    color: var(--tds-soft);
}

.tds-list-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.tds-list-card__meta span {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--tds-bg);
    color: rgba(23,32,51,.72);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
}

.tds-list-card__side {
    border-left: 1px solid var(--tds-line);
    padding-left: 30px;
}

.tds-list-card__status {
    margin: 0 0 10px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    color: rgba(23,32,51,.68);
}

.tds-list-card__price {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--tds-dark);
}

.tds-list-card__rate {
    margin: 12px 0 0;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--tds-gold);
}

.tds-list-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 28px;
    min-height: 46px;
    padding: 0 20px;

    border-radius: 999px;
    background: var(--tds-dark);
    color: #fff;
    text-decoration: none;

    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
}

.tds-list-card__button:hover {
    background: var(--tds-gold);
    color: #fff;
}

/* 08. Pagination */

.rh_pagination {
    width: min(var(--tds-container), calc(100% - 64px));
    margin: 42px auto 0 !important;
}

/* 09. Scroll top */

body #scroll-top,
body #scroll-top:hover,
body #scroll-top:focus {
    background: var(--tds-gold) !important;
    color: #fff !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 40px rgba(15,23,42,.18) !important;
}

body #scroll-top:hover {
    background: var(--tds-gold-hover) !important;
}

/* 10. Mobile */

@media (max-width: 900px) {
    .tds-list-card {
        grid-template-columns: 1fr;
    }

    .tds-list-card__image {
        min-height: 260px;
    }

    .tds-list-card__content {
        grid-template-columns: 1fr;
    }

    .tds-list-card__side {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid var(--tds-line);
        padding-top: 24px;
    }
}

@media (max-width: 767px) {
    .tds-listing-hero {
        min-height: 430px;
        padding-bottom: 72px;
    }

    .tds-listing-hero__inner {
        width: calc(100% - 40px);
        min-height: 430px;
        justify-content: flex-end;
        padding-top: 0;
        padding-bottom: 92px;
    }

    .tds-listing-hero__inner h1 {
        font-size: 44px;
    }

    .tds-listing-search-wrap {
        margin-top: -58px;
        padding-bottom: 30px;
    }

    .tds-listing-search-wrap .targ-search,
    .tds-map-shell,
    .tds-listing-toolbar,
    .page-template-properties-search .rh_page__main,
    .tax-property-type .rh_page__main,
    .tax-property-city .rh_page__main,
    .tax-property-status .rh_page__main,
    .tax-property-feature .rh_page__main,
    .post-type-archive-property .rh_page__main,
    .rh_pagination {
        width: calc(100% - 40px) !important;
    }

    .tds-map-toggle {
        min-height: 64px;
        padding: 0 20px;
        border-radius: 20px;
        grid-template-columns: 1fr auto;
    }

    .tds-map-toggle em {
        display: none;
    }

    .rh_map.tds-map-collapsed.tds-map-open {
        height: 340px !important;
        max-height: 340px !important;
    }

    .tds-listing-toolbar {
        display: block;
    }

    .tds-sort {
        margin-top: 18px;
    }

    .tds-sort__trigger,
    .tds-sort__menu {
        width: 100%;
        min-width: 0;
    }

    .tds-list-card {
        border-radius: 24px;
    }

    .tds-list-card__content {
        padding: 24px;
    }

    .tds-list-card__main h2 {
        font-size: 24px;
    }

    .tds-list-card__price {
        font-size: 27px;
    }
}
