/* ==========================================================================
   bwc_wohnanlagen — Frontend Styles
   Erweitert das bwc_sitepackage (Bootstrap 5.3). Keine Overrides der
   Sitepackage-Klassen — eigene .bwc-* Namespace.
   ========================================================================== */
/* bs variablen */
.bwc-wohnanlagen-list, .bwc-wohnanlage-detail {
    --bs-border-color:#000;
    --bs-border-radius: 0;
}


/* ---------- Filterbar ---------- */
.bwc-filterbar .dropdown-menu {
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
}
.bwc-filter-dropdown__wide {
    min-width: 320px;
}
/*
 * Badge uebernimmt immer die Farben des Buttons (btn-outline-dark wechselt
 * beim Oeffnen von hell/dunkel auf dunkel/hell) — per inherit folgt der
 * Badge automatisch jedem Zustand.
 */
.bwc-filter-dropdown .dropdown-toggle .badge {
    font-size: 0.7em;
    background-color: inherit !important;
    color: inherit;
}

/* ---------- Tile grid ---------- */
.bwc-tile {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
/*.bwc-tile:focus-within,
.bwc-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}*/
.bwc-tile__image-wrap {
    display: block;
    overflow: hidden;
}
.bwc-tile__image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}
/*
.bwc-tile:hover .bwc-tile__image {
    transform: scale(1.04);
}
    */
.bwc-tile__image--placeholder {
    background-color: var(--bs-secondary-bg);
    aspect-ratio: 3 / 2;
}
.bwc-tile__title {
    line-height: 1.3;
}

/* ---------- Video-Karten ---------- */
.bwc-video-card {
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
/*.bwc-video-card:focus-visible,
.bwc-video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}*/
.bwc-video-card__media {
    overflow: hidden;
    background-color: #000;
    aspect-ratio: 16 / 9;
}
.bwc-video-card__poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease-in-out;
}
/*.bwc-video-card:hover .bwc-video-card__poster {
    transform: scale(1.04);
}*/
.bwc-video-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.bwc-video-card__title {
    line-height: 1.3;
}

/* ---------- Hero (Detailseite) ---------- */
.bwc-hero {
    margin-bottom: 0;
}
.bwc-hero__inner {
    align-items: stretch;
}
.bwc-hero__image {
	flex: 1 1 calc(100% / 12 * 8);
	overflow: hidden;
}
.bwc-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 12 / 7;
}
.bwc-hero__img {
  clip-path: polygon(
    0 0,
    calc(100% - 130px) 0,
    100% 300px,
    100% 100%,
    0 100%
  );
}


.bwc-hero__info {
	flex: 1 1 calc(100% / 12 * 4);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 240px;
}
.bwc-hero__icon {
    color: #000;
    flex-shrink: 0;
}
.bwc-hero__address {
    line-height: 1.4;
}

/* ---------- Breadcrumb ---------- */
.bwc-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

/* ---------- Amenity list ---------- */
.bwc-amenity-list {
    margin-bottom: 0;
}
.bwc-amenity-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.25rem;
}
.bwc-amenity-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--bs-body-color);
}

/* ---------- Gallery & Lightbox ---------- */
.bwc-gallery__btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    overflow: hidden;
    transition: transform 0.2s ease-in-out;
}
.bwc-gallery__btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}
.bwc-gallery__btn:hover img {
    transform: scale(1.04);
}
.bwc-gallery__btn img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}
.bwc-gallery__item--video {
    position: relative;
}
.bwc-gallery__play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
.bwc-lightbox .modal-content {
    background-color: rgba(0, 0, 0, 0.92);
}
.bwc-lightbox .modal-body {
    overflow: hidden;
}
.bwc-lightbox__carousel {
    background-color: #000;
}
.bwc-lightbox__img {
    max-height: 80vh;
    width: 100%;
    object-fit: contain;
    background-color: #000;
}
.bwc-lightbox__caption {
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.95em;
}
.bwc-lightbox__counter {
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95em;
}
.bwc-lightbox .carousel-control-prev,
.bwc-lightbox .carousel-control-next {
    width: 8%;
    opacity: 0.85;
}
.bwc-lightbox .carousel-control-prev:hover,
.bwc-lightbox .carousel-control-next:hover {
    opacity: 1;
}
.bwc-lightbox .carousel-control-prev-icon,
.bwc-lightbox .carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-size: 100% 100%;
}

@media (max-width: 575.98px) {
    .bwc-lightbox .carousel-control-prev,
    .bwc-lightbox .carousel-control-next {
        width: 12%;
    }
    .bwc-lightbox__img {
        max-height: 70vh;
    }
}

/* ---------- Wohnform-Tabs ---------- */
.bwc-wohnform-tabs {
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bwc-wohnform-tabs .btn {
    min-width: 120px;
}

/* ---------- Wohneinheit-Karte ---------- */
.bwc-wohneinheit {
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 130px) 0, 100% 300px, 100% 100%, 0 100%);
    transition: opacity 0.2s ease-in-out;
}
.bwc-wohneinheit[hidden] {
    display: none !important;
}
.bwc-wohneinheit__hint {
    font-size: 0.9em;
}

/* Eigenes Grid (ersetzt bootstrap row/col, damit Subgrid funktioniert) */
.bwc-wohneinheit__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.bwc-wohneinheit__col-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.bwc-wohneinheit__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .bwc-wohneinheit__row {
        grid-template-columns: 1fr 1fr;
    }
    /* Eckdaten immer ueber die volle Breite, unter beiden Spalten */
    .bwc-wohneinheit__facts {
        grid-column: 1 / -1;
    }
    .bwc-wohneinheit__col-right {
        align-self: start;
    }

    /*
     * Bildloser Fall: Subgrid koppelt nur header (Zeile 1) und body (Zeile 2)
     * ueber beide Spalten, damit die Ausstattung rechts exakt auf Hoehe der
     * Description (= body-Start) beginnt. Der linke Block (description, hint)
     * fliesst dabei unabhaengig von der Laenge der Ausstattungsliste.
     * Parent-Zeilen: 1=header  2=body  3=facts
     */
    .bwc-wohneinheit__row--no-image {
        grid-template-rows: auto auto auto;
    }
    .bwc-wohneinheit__row--no-image > .bwc-wohneinheit__col-left,
    .bwc-wohneinheit__row--no-image > .bwc-wohneinheit__col-right {
        grid-row: 1 / 3;
        display: grid;
        grid-template-rows: subgrid;
        row-gap: 1rem;
    }
    .bwc-wohneinheit__row--no-image .bwc-wohneinheit__header          { grid-row: 1; align-self: start; }
    .bwc-wohneinheit__row--no-image .bwc-wohneinheit__body            { grid-row: 2; align-self: start; }
    .bwc-wohneinheit__row--no-image .bwc-wohneinheit__amenities-right { grid-row: 2; align-self: start; }
    .bwc-wohneinheit__row--no-image .bwc-wohneinheit__facts           { grid-row: 3; }
}

/* Bild: randlos oben/rechts (article hat p-4 = 1.5rem) */
.bwc-wohneinheit__image-wrap {
    margin-top: -1.5rem;
    margin-right: -1.5rem;
}
.bwc-wohneinheit__image {
    width: 100%;
    height: auto;
    display: block;
}

/* Eckdaten: 2-spaltig, Gap identisch zum Hauptraster */
.bwc-fact-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
    margin-bottom: 0;
}
.bwc-fact-list__col {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    align-content: start;
}
.bwc-fact-list__item {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    border-bottom: 1px solid #000;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}
.bwc-fact-list__item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.bwc-fact-list dt {
    font-weight: 600;
    align-self: start;
}
.bwc-fact-list dd {
    margin: 0;
    align-self: start;
}

/* ---------- Contacts Box ---------- */
.bwc-contacts__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .bwc-contacts__row {
        grid-template-columns: 1fr 1fr;
    }
}
.bwc-contacts__col .bwc-contacts__content {
    /* tt_content-Output kann eigene Margins haben – reset für Konsistenz */
}
.bwc-contacts__col .bwc-contacts__content > :first-child {
    margin-top: 0;
}
.bwc-contacts__col .bwc-contacts__content > :last-child {
    margin-bottom: 0;
}

/* ---------- Loading-State ---------- */
.bwc-wohnanlagen-results[aria-busy="true"] {
    opacity: 0.5;
    pointer-events: none;
}
.bwc-wohnanlagen-results[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* ---------- Empty state ---------- */
.bwc-no-results {
    border: 1px dashed var(--bs-border-color);
    background-color: transparent;
}

/* ---------- Mobile-Adjustments ---------- */
@media (max-width: 991.98px) {
    .bwc-wohneinheit,
    .bwc-contacts {
        clip-path: none;
    }
}
@media (max-width: 767.98px) {
    .bwc-hero__inner {
        flex-direction: column;
    }
    .bwc-wohneinheit__image-wrap {
        margin-top: 0;
        margin-right: 0;
    }
    .bwc-fact-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .bwc-tile,
    .bwc-tile__image,
    .bwc-gallery__btn,
    .bwc-gallery__btn img,
    .bwc-wohneinheit {
        transition: none;
    }
}
