/*
 * The property card a map pin opens - Figma card 1:165.
 *
 * A 335 Off-White panel: image with the stay's type over it, then the
 * destination label, title, the bed and guest line and View Stay. There is no
 * bubble, tail or padding around it, which is why it is drawn on a
 * google.maps.OverlayView and not in an InfoWindow - see createStayCard() in
 * assets/js/map-base.js.
 *
 * Shared by all three listing maps: the homepage map, the destinations listing
 * and the destination archives. It is enqueued with the shared map bootstrap
 * rather than with any one of them.
 */

/*
 * The overlay positions itself by setting left/top to its pin, so the card is
 * anchored by its own bottom centre from here. `hidden` is what closing sets -
 * the element stays in the float pane and is emptied.
 */
.map-stay-popup {
    position: absolute;
    width: 335px;
    transform: translate(-50%, -100%);
    border-radius: 3.429px;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.map-stay-popup[hidden] {
    display: none;
}

.map-stay-popup-close {
    position: absolute;
    top: 4px;
    right: 8px;
    z-index: 2;
    border: 0;
    background: none;
    padding: 0 4px;
    font-family: var(--font-secondary);
    font-size: 24px;
    line-height: 1;
    color: var(--color-offwhite);
    cursor: pointer;
}

.map-stay-card {
    background: var(--color-offwhite);
    display: flex;
    flex-direction: column;
    width: 335px;
    max-width: 100%;
}

.map-stay-card-media {
    position: relative;
    height: 225px;
    overflow: hidden;
}

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

.map-stay-card-type,
.map-stay-card-label {
    font-family: var(--font-secondary);
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.map-stay-card-type {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(33, 37, 41, 0.4);
    color: var(--color-offwhite);
    padding: 3.429px 6.857px;
}

/* The card's own spacing is the spacing; nothing inherits a paragraph margin. */
.map-stay-card p {
    margin: 0;
}

/*
 * The frame's 24 gap is between the label/title/amenities group and the CTA,
 * not between every line - inside the group it is 8 from the label and 4 from
 * the title. A flat gap of 24 spread that across all four and left the card
 * far taller than the frame draws it.
 */
.map-stay-card-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 24px 18px;
}

.map-stay-card-label {
    align-self: flex-start;
    background: var(--color-white-100);
    color: var(--color-shark);
    padding: 6px 8px;
}

.map-stay-card-title {
    font-family: var(--font-primary);
    /* Lyon ships a real 700, so the frame's Bold H3 is a cut and not a synth. */
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-shark);
    margin: 8px 0 0;
}

.map-stay-card-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-secondary);
    font-size: 18px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--color-shark);
    margin: 4px 0 0;
}

.map-stay-card-cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    /* The frame's one 24 gap, from the copy block to the CTA. */
    margin-top: 24px;
    gap: 8px;
    font-family: var(--font-secondary);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--color-shark);
}

.map-stay-card-cta .icon-cta-arrow {
    width: 15px;
    height: 15px;
    flex: none;
}

/*
 * Cluster counts are drawn as an SVG the API rasterises into a marker icon
 * (clusterIcon() in assets/js/map-base.js), because no stylesheet reaches
 * inside a marker. Shark and Off-White are literals there for that reason.
 */

/* X-Small devices (portrait phones, less than 576px) */
@media (max-width: 576px) {
    .map-stay-popup {
        width: 280px;
    }

    .map-stay-card {
        width: 280px;
    }

    .map-stay-card-media {
        height: 188px;
    }

    .map-stay-card-title {
        font-size: 24px;
    }

    .map-stay-card-amenities {
        font-size: 16px;
    }
}
