/* The theme supplies the same image URL as the apartment listing.
 * Render it without a price, scaled to fit without cropping or distortion.
 * Keep the original link and Google Maps controls intact.
 */
/* Bed and bath are solid Font Awesome 5 glyphs. A regular (400) override
 * leaves them blank, while the regular user glyph still appears.
 * Restore the existing glyphs without changing their size, colour or spacing.
 */
:is(.liste_appartement, .listing_bien_single) .items_appart .card__details :is(.fa-bed, .fa-bath, .fa-user),
:is(.liste_appartement, .listing_bien_single) .items_appart .card__details :is(.fa-bed, .fa-bath, .fa-user)::before,
#map_biens .content_info_marker .cart_detail_marker :is(.fa-bed, .fa-bath, .fa-user),
#map_biens .content_info_marker .cart_detail_marker :is(.fa-bed, .fa-bath, .fa-user)::before {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

#map_biens .content_info_marker .property_iw__price {
    display: none !important;
}

/* The extra width makes the photograph larger while keeping the card compact.
 * Only our property bubbles receive this class; other map controls are untouched.
 */
#map_biens .gm-style-iw-c.two-be-apart-compact-bubble {
    width: 240px;
    max-width: min(240px, calc(100vw - 32px)) !important;
    padding: 4px !important;
    box-sizing: border-box;
}

#map_biens .two-be-apart-compact-bubble > .gm-style-iw-d {
    overflow: auto !important;
}

/* Keep Google's own button and its close/focus/marker listeners.
 * Absolute positioning removes its 48px header row without moving DOM nodes.
 */
#map_biens .two-be-apart-compact-bubble > .gm-style-iw-chr {
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    position: static;
}

/* Google's empty heading has its own 17px top padding. */
#map_biens .two-be-apart-compact-bubble > .gm-style-iw-chr > .gm-style-iw-ch:empty {
    display: none;
}

#map_biens .two-be-apart-compact-bubble > .gm-style-iw-chr > button.gm-ui-hover-effect {
    position: absolute !important;
    top: auto !important;
    right: 4px !important;
    bottom: 4px !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    z-index: 1;
}

#map_biens .two-be-apart-compact-bubble > .gm-style-iw-chr > button.gm-ui-hover-effect > span {
    width: 18px !important;
    height: 18px !important;
    margin: 5px !important;
}

#map_biens .two-be-apart-compact-bubble > .gm-style-iw-chr > button.gm-ui-hover-effect:focus-visible {
    outline: 2px solid #1f2c38;
    outline-offset: -2px;
}

#map_biens .content_info_marker a.card_image_marker {
    display: block;
    height: auto;
    min-height: 0;
    background-size: 0 0;
    background-repeat: no-repeat;
}

#map_biens .content_info_marker a.card_image_marker::after {
    content: "";
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-image: inherit;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f3f3f1;
}

#map_biens .content_info_marker .property-iw__title {
    padding: 6px 4px 2px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#map_biens .content_info_marker .cart_detail_marker {
    margin: 0;
    min-height: 28px;
    padding: 0 36px 0 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Nightly rates are shown only for WordPress short-stay properties. This also
 * prevents a monthly rate from flashing before the card script has run.
 */
:is(.liste_appartement, .listing_bien_single) .items_appart:not(.two-be-apart-nightly) .title-and-about-appart .price {
    display: none !important;
}

/* Approved option 2: a compact, rounded anthracite overlay, including related cards. */
:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart {
    width: max-content;
    max-width: calc(100% - 24px);
    left: 12px;
    bottom: 12px;
    padding: 11px 14px;
    box-sizing: border-box;
    color: #fff;
    background: rgba(24, 33, 39, .92);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

/* The same details are accessible when a visitor follows the links by keyboard. */
:is(.liste_appartement, .listing_bien_single) .items_appart:focus-within .title-and-about-appart {
    opacity: 1;
    transform: translateX(0);
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .card__title {
    margin: 0 0 6px;
    padding: 0;
    line-height: 1.2;
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .card__title a {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: clip;
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .card__details {
    gap: 14px;
    line-height: 1.4;
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .card__details span {
    letter-spacing: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .price {
    margin-top: 5px;
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .price p {
    margin: 0;
    line-height: 1.4;
}

:is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart .formatted_price {
    font-size: 12px;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
}

@media (max-width: 900px) {
    :is(.liste_appartement, .listing_bien_single) .items_appart .title-and-about-appart {
        left: 8px;
        bottom: 8px;
        max-width: calc(100% - 16px);
        padding: 10px;
    }
}

/* Reuse the map's exact marker path at the former directions icon's 22px height.
 * Keep the existing anchor and event handlers, including dynamically added cards.
 */
:is(.liste_appartement, .listing_bien_single) .items_appart a.link_to_map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #000;
}

:is(.liste_appartement, .listing_bien_single) .items_appart a.link_to_map .fa-directions {
    display: none !important;
}

:is(.liste_appartement, .listing_bien_single) .items_appart a.link_to_map::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    background-color: #000;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -59.831 36.864 55.296'%3E%3Cpath d='M27.648-41.399q0-3.816-2.7-6.516t-6.516-2.7-6.516 2.7-2.7 6.516 2.7 6.516 6.516 2.7 6.516-2.7 2.7-6.516zm9.216 0q0 3.924-1.188 6.444l-13.104 27.864q-.576 1.188-1.71 1.872t-2.43.684-2.43-.684-1.674-1.872l-13.14-27.864q-1.188-2.52-1.188-6.444 0-7.632 5.4-13.032t13.032-5.4 13.032 5.4 5.4 13.032z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -59.831 36.864 55.296'%3E%3Cpath d='M27.648-41.399q0-3.816-2.7-6.516t-6.516-2.7-6.516 2.7-2.7 6.516 2.7 6.516 6.516 2.7 6.516-2.7 2.7-6.516zm9.216 0q0 3.924-1.188 6.444l-13.104 27.864q-.576 1.188-1.71 1.872t-2.43.684-2.43-.684-1.674-1.872l-13.14-27.864q-1.188-2.52-1.188-6.444 0-7.632 5.4-13.032t13.032-5.4 13.032 5.4 5.4 13.032z'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

:is(.liste_appartement, .listing_bien_single) .items_appart a.link_to_map:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
}

/* Desktop catalogue: distribute the available width 70/30 after the theme's
 * 10px gutter. Keep its three columns, photo height and cover cropping.
 * Match the theme's breakpoint so tablet/mobile layouts remain unchanged.
 */
@media (min-width: 1024px) {
    body .nos_appartements > .listing_biens {
        flex-basis: calc(70% - 7px);
        min-width: 0;
    }

    body .nos_appartements > .google_map_appartements {
        flex-basis: calc(30% - 3px);
        min-width: 0;
    }
}
