/**
 * Datei: style.css
 * Modul: bb-listings
 *
 * Funktionen:
 * - Grid + Listenlayout
 * - Line-Clamp über CSS-Variablen
 * - Kategorie/Ort/Preis/Fav responsive & stabil
 * - Tag-System (Kategorien / Stadt / Bundesland)
 */

/* =====================================================================
   1) GRID-LAYOUT
   ===================================================================== */
.mietp-listings-grid {
    display: grid;
    grid-gap: 20px;
}

.mietp-listings-grid[data-columns="6"] { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.mietp-listings-grid[data-columns="5"] { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.mietp-listings-grid[data-columns="4"] { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mietp-listings-grid[data-columns="3"] { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.mietp-listings-grid[data-columns="2"] { grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); }
.mietp-listings-grid[data-columns="1"] { grid-template-columns: 1fr; }

/* =====================================================================
   2) BOX
   ===================================================================== */
.listing-box {
    background: #fff;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s ease;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.listing-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* =====================================================================
   3) BILD
   ===================================================================== */
.listing-thumb-wrap img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    display: block;
}

/* Wichtig: Bildcontainer darf auch nicht schrumpfen */
.listing-row .listing-thumb-wrap {
    flex-shrink: 0; /* verhindert Schrumpfen des Containers */
}

/* =====================================================================
   4) META (Kategorie + Standort)
   ===================================================================== */
.listing-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 4px;
    font-size: 0.9rem;
    color: #666;
    min-height: 1.2em;
}

.listing-cat,
.listing-loc {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.listing-cat {
    -webkit-line-clamp: var(--clamp-category, 1);
}
.listing-loc {
    text-align: right;
    -webkit-line-clamp: var(--clamp-location, 1);
}

.listing-meta:not(:has(.listing-cat)) { gap: 0 !important; }
.listing-meta:not(:has(.listing-cat)):not(:has(.listing-loc)) {
    display: none !important;
}

/* Links */
.listing-cat a {
    color: #0073aa;
    text-decoration: none;
}
.listing-cat a:hover {
    text-decoration: underline;
}

.listing-row .listing-meta {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
}

/* =====================================================================
   5) TITEL / UNTERTITEL / BESCHREIBUNG
   ===================================================================== */
.listing-title {
    margin: 6px 10px 0 10px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--clamp-title, 1);
}

.listing-title a {
    color: var(--color-1);
    text-decoration: none;
}
.listing-title a:hover {
    text-decoration: underline;
}

.listing-subtitle {
    margin: 4px 10px 0 10px;
    font-size: 0.9rem;
    color: #666;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--clamp-subtitle, 1);
}

.listing-desc {
    margin: 4px 10px 0 10px;
    font-size: 0.9rem;
    color: #444;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--clamp-desc, 2);
}

/* Titelhöhe für Grid stabil halten */
.mietp-listings-grid .listing-title {
    min-height: calc(1.3em * var(--clamp-title, 1));
}

/* =====================================================================
   6) FOOTER (Preis + Fav/Admin)
   ===================================================================== */
.listing-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 10px;
    font-size: 0.95rem;
}

.listing-footer:not(:has(.listing-price)) { gap: 0 !important; }
.listing-footer:not(:has(.listing-price)) .listing-fav { justify-self: end; }
.listing-footer:not(:has(.listing-price)):not(:has(.listing-fav)) {
    display: none !important;
}

/* Preis */
.listing-price {
    font-weight: 600;
    color: #222;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--clamp-price, 1);
}

.listing-price .price-line {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.price-prefix,
.price-suffix {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.2;
}

.price-value {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Herz */
.fav-icon {
    cursor: pointer;
    color: #999;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}
.fav-icon:hover { color: #e33; }

/* =====================================================================
   7) LISTEN-LAYOUT
   ===================================================================== */
.mietp-listings-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.listing-row {
    display: flex;
    gap: 20px;
    padding: 12px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.listing-row:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.listing-row img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0; /* verhindert Schrumpfen */
}

/* 2-spaltiges Listenlayout */
.mietp-listings-list[data-columns="2"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.listing-row .listing-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

/* =====================================================================
   8) RESPONSIVE BREAKPOINTS
   ===================================================================== */
@media (max-width: 992px) and (min-width: 577px) {
    .listing-row img {
        width: 160px;
        height: 120px;
    }
}

@media (max-width: 576px) {
    .listing-row {
        flex-direction: column;
    }

    .listing-row img {
        width: 100%;
        height: 200px;
    }
}

/* =====================================================================
   9) TAG SYSTEM (Kategorien / Stadt / Bundesland)
   ===================================================================== */
.mp-tags-wrapper {
    border: 1px solid #ccc;
    padding: 6px;
    border-radius: 6px;
    background: #fff;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.mp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mp-tag {
    background: #e9f4ff;
    color: #006699;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    display
