/*
 * maklermodul estate details. Adjust the look with the custom properties, e.g.
 * .mm-estate { --mm-accent: #0a6c74; } (.mm-map--list for the estate map element)
 */
.mm-estate,
.mm-map--list,
.mm-map__empty {
    --mm-accent: #1f5f8b;
    --mm-muted: color-mix(in srgb, currentColor 62%, transparent);
    --mm-border: color-mix(in srgb, currentColor 14%, transparent);
    --mm-surface: color-mix(in srgb, currentColor 4%, transparent);
    --mm-radius: 6px;
    --mm-gap: 32px;
    --mm-badge-bg: rgb(0 0 0 / 72%);
    --mm-badge-text: #fff;
    --mm-reserved: #9a5b00;
    --mm-sold: #8a1c1c;
    --mm-new: #1d6b3a;
}

.mm-estate__back {
    margin: 0 0 12px;
}

.mm-estate__back a::before {
    content: "← ";
}

.mm-estate__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    margin: 0 0 6px;
}

.mm-estate .mm-badge {
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--mm-badge-bg);
    color: var(--mm-badge-text);
    font-size: .8125rem;
}

.mm-estate .mm-badge--reserved {
    background: var(--mm-reserved);
}

.mm-estate .mm-badge--sold {
    background: var(--mm-sold);
}

.mm-estate .mm-badge--new {
    background: var(--mm-new);
}

.mm-estate__type,
.mm-estate__place {
    color: var(--mm-muted);
}

.mm-estate__title {
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}

.mm-estate__place {
    margin: 0;
}

.mm-estate__distance {
    margin: 2px 0 0;
    color: var(--mm-accent);
    font-weight: 600;
}

/* Gallery: large first image, thumbnails next to/below it */
.mm-estate__gallery {
    margin-top: 20px;
}

.mm-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-gallery__item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--mm-radius);
    background: var(--mm-surface);
}

.mm-gallery__item--main {
    grid-column: span 2;
    grid-row: span 2;
}

.mm-gallery__item:nth-child(n + 6) {
    display: none;
}

.mm-gallery figure,
.mm-gallery a {
    display: block;
    height: 100%;
    margin: 0;
}

.mm-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Further images stay in the markup for the lightbox */
.mm-gallery__more {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(0 0 0 / 45%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    pointer-events: none;
}

.mm-estate__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: var(--mm-gap);
    align-items: start;
    margin-top: 24px;
}

.mm-estate__layout:not(:has(.mm-estate__aside)) {
    grid-template-columns: minmax(0, 1fr);
}

.mm-estate__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    margin: 0;
    padding: 16px 20px;
    border-radius: var(--mm-radius);
    background: var(--mm-surface);
}

.mm-estate__facts div {
    display: flex;
    flex-direction: column-reverse;
}

.mm-estate__facts dt {
    color: var(--mm-muted);
    font-size: .875rem;
}

.mm-estate__facts dd {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.mm-estate__facts div:first-child dd {
    color: var(--mm-accent);
}

.mm-estate__teaser {
    margin: 20px 0 0;
    font-size: 1.125rem;
}

.mm-estate__section {
    margin-top: 32px;
}

.mm-estate__section h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.mm-estate__text ul {
    padding-left: 1.25em;
}

.mm-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0 32px;
    margin: 0;
}

.mm-details div {
    display: flex;
    flex-wrap: wrap; /* the value moves below the label if both do not fit */
    justify-content: space-between;
    gap: 0 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--mm-border);
}

.mm-details dt {
    color: var(--mm-muted);
}

.mm-details dd {
    margin: 0 0 0 auto;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.mm-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.mm-features li {
    padding: 4px 12px;
    border: 1px solid var(--mm-border);
    border-radius: 999px;
}

.mm-features li::before {
    content: "✓ ";
    color: var(--mm-accent);
}

/* Energy efficiency scale A+ to H (colours as on German energy certificates) */
.mm-energy-scale {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 2px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.mm-energy-scale__class {
    padding: 6px 0;
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    text-align: center;
    opacity: .45;
}

.mm-energy-scale__class.is-active {
    outline: 3px solid currentColor;
    outline-offset: 1px;
    color: #000;
    opacity: 1;
}

.mm-energy-scale__class--1 { background: #00a651; }
.mm-energy-scale__class--2 { background: #4cb748; }
.mm-energy-scale__class--3 { background: #b2d235; }
.mm-energy-scale__class--4 { background: #fff200; color: #000; }
.mm-energy-scale__class--5 { background: #fdb913; color: #000; }
.mm-energy-scale__class--6 { background: #f37021; }
.mm-energy-scale__class--7 { background: #ed1c24; }
.mm-energy-scale__class--8 { background: #c4161c; }
.mm-energy-scale__class--9 { background: #8e1013; }

.mm-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-plans figure {
    margin: 0;
}

.mm-plans img {
    width: 100%;
    height: auto;
}

.mm-map {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    max-height: 420px;
    width: 100%;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
    background: var(--mm-surface);
    overflow: hidden;
}

.mm-map--loaded {
    display: block;
}

.mm-map__consent {
    max-width: 36em;
    padding: 24px;
    text-align: center;
}

.mm-map__consent p {
    margin: 0 0 12px;
    color: var(--mm-muted);
}

.mm-map__load,
.mm-embed__load {
    padding: 8px 16px;
    border: 0;
    border-radius: var(--mm-radius);
    background: var(--mm-accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.mm-map__always,
.mm-embed__always {
    margin-left: 8px;
    padding: 8px 16px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.mm-map__always[hidden],
.mm-embed__always[hidden] {
    display: none;
}

.mm-map__load:focus-visible,
.mm-map__always:focus-visible,
.mm-embed__load:focus-visible,
.mm-embed__always:focus-visible {
    outline: 2px solid var(--mm-accent);
    outline-offset: 2px;
}

.mm-map--list {
    aspect-ratio: 4 / 3;
    max-height: 560px;
}

.mm-map__empty,
.mm-map__error {
    margin: 0;
    padding: 24px;
    color: var(--mm-muted);
    text-align: center;
}

/* Markers of the estate map (Leaflet) */
.mm-map-pin {
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--mm-accent);
    box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
}

.mm-map-pin--approximate {
    background: color-mix(in srgb, var(--mm-accent) 45%, #fff);
}

.mm-map .marker-cluster-small,
.mm-map .marker-cluster-medium,
.mm-map .marker-cluster-large {
    background: color-mix(in srgb, var(--mm-accent) 30%, transparent);
}

.mm-map .marker-cluster div {
    background: var(--mm-accent);
    color: #fff;
    font: 500 12px/30px system-ui, sans-serif;
}

/* Popups of the estate map */
.mm-map-popup {
    width: 220px;
    font: 14px/1.4 system-ui, sans-serif;
}

.mm-map-popup p {
    margin: 0 0 4px;
}

.mm-map-popup__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5;
    margin: 0 0 8px;
    border-radius: 4px;
    object-fit: cover;
}

.mm-map-popup__title {
    font-weight: 500;
}

.mm-map-popup__title a {
    color: inherit;
    text-decoration: none;
}

.mm-map-popup__place {
    color: var(--mm-muted);
    font-size: 13px;
}

.mm-map-popup__price {
    font-variant-numeric: tabular-nums;
}

.mm-map-popup__more {
    display: inline-block;
    margin-top: 4px;
    color: var(--mm-accent);
}

.mm-map__note {
    margin: 8px 0 0;
    color: var(--mm-muted);
    font-size: .875rem;
}

/* Videos and virtual tours */
.mm-embed {
    margin: 0 0 16px;
}

.mm-embed__frame {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    width: 100%;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
    background: var(--mm-surface);
    overflow: hidden;
}

.mm-embed--tour .mm-embed__frame {
    aspect-ratio: 4 / 3;
    max-height: 560px;
}

.mm-embed__frame--loaded {
    display: block;
    border: 0;
}

.mm-embed__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.mm-embed__consent {
    max-width: 36em;
    padding: 24px;
    text-align: center;
}

.mm-embed__consent p {
    margin: 0 0 12px;
    color: var(--mm-muted);
}

.mm-embed__consent .mm-embed__link {
    margin: 12px 0 0;
    font-size: .875rem;
}

.mm-embed__link a {
    color: inherit;
}

.mm-embed figcaption {
    margin: 8px 0 0;
    color: var(--mm-muted);
    font-size: .875rem;
}

.mm-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-links li {
    padding: 8px 0;
    border-bottom: 1px solid var(--mm-border);
}

.mm-links a {
    color: var(--mm-accent);
}

/* Watchlist button */
.mm-estate__actions {
    margin: 12px 0 0;
}

.mm-watch--details {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.mm-watch--details[hidden] {
    display: none;
}

.mm-watch--details:focus-visible {
    outline: 2px solid var(--mm-accent);
    outline-offset: 2px;
}

.mm-watch--details .mm-watch__icon {
    fill: none;
    stroke: var(--mm-accent);
    stroke-width: 1.8;
}

.mm-watch--details[aria-pressed="true"] .mm-watch__icon {
    fill: var(--mm-accent);
}

.mm-documents {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-documents__item {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid var(--mm-border);
}

.mm-documents__type {
    color: var(--mm-muted);
    font-size: .8125rem;
}

.mm-estate__aside {
    position: sticky;
    top: 20px;
}

/* A form is usually taller than the viewport, sticky would hide its end */
.mm-estate__aside:has(.mm-inquiry) {
    position: static;
}

.mm-inquiry {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
}

.mm-estate__aside > .mm-inquiry:first-child {
    margin-top: 0;
}

.mm-inquiry h2 {
    margin: 0 0 12px;
    font-size: 1.125rem;
}

.mm-inquiry :is(input:not([type="checkbox"], [type="radio"], [type="submit"]), textarea, select) {
    box-sizing: border-box;
    width: 100%;
}

.mm-contact {
    padding: 20px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius);
}

.mm-contact h2 {
    margin: 0 0 12px;
    font-size: 1.125rem;
}

.mm-contact p {
    margin: 0;
}

.mm-contact__name {
    font-weight: 700;
}

.mm-contact__company {
    color: var(--mm-muted);
}

.mm-contact__channels {
    margin: 12px 0 0;
}

.mm-contact__channels div {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}

.mm-contact__channels dt {
    min-width: 4.5em;
    color: var(--mm-muted);
}

.mm-contact__channels dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 799px) {
    .mm-estate__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .mm-estate__aside {
        position: static;
    }

    .mm-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mm-gallery__item--main {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .mm-energy-scale__class {
        font-size: .6875rem;
    }
}
