/**
 * Immobilien Showcase Widget Styles.
 */

/* ================================================
   Wrapper
   ================================================ */
.pi-showcase-wrap {
    width: 100%;
}

/* ================================================
   Header
   ================================================ */
.pi-showcase-header {
    margin-bottom: 40px;
}

.pi-showcase-subtitle {
    display: block;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d4a843;
    margin-bottom: 10px;
}

.pi-showcase-title {
    font-size: 2.2em;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
}

.pi-showcase-title em {
    font-style: italic;
    font-weight: 700;
}

/* ================================================
   Grid – Base
   ================================================ */
.pi-showcase-grid {
    display: grid;
    gap: 20px;
}

/* ================================================
   Layout: Gleichmäßig (Equal)
   ================================================ */
.pi-showcase-layout-equal.pi-showcase-cols-1 {
    grid-template-columns: 1fr;
}

.pi-showcase-layout-equal.pi-showcase-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.pi-showcase-layout-equal.pi-showcase-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.pi-showcase-layout-equal.pi-showcase-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ================================================
   Layout: Featured Links
   1. Karte groß links (2 Zeilen), Rest rechts gestapelt
   ================================================ */
.pi-showcase-layout-featured-left {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: 200px 200px;
}

.pi-showcase-layout-featured-left .pi-showcase-card {
    height: 100% !important;
    min-height: 0;
}

.pi-showcase-layout-featured-left .pi-showcase-card:first-child {
    grid-row: 1 / 3;
}

/* ================================================
   Layout: Featured Rechts
   Letzte Karte groß rechts (2 Zeilen), Rest links gestapelt
   ================================================ */
.pi-showcase-layout-featured-right {
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: 200px 200px;
}

.pi-showcase-layout-featured-right .pi-showcase-card {
    height: 100% !important;
    min-height: 0;
}

.pi-showcase-layout-featured-right .pi-showcase-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.pi-showcase-layout-featured-right .pi-showcase-card:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / 3;
}

.pi-showcase-layout-featured-right .pi-showcase-card:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

/* Wenn 4+ Karten: ab der 4. normal darunter */
.pi-showcase-layout-featured-right .pi-showcase-card:nth-child(n+4) {
    grid-column: auto;
    grid-row: auto;
}

/* ================================================
   Layout: Featured Oben
   1. Karte volle Breite oben, Rest darunter in gleichen Spalten
   ================================================ */
.pi-showcase-layout-featured-top {
    grid-template-columns: repeat(3, 1fr);
}

.pi-showcase-layout-featured-top .pi-showcase-card:first-child {
    grid-column: 1 / -1;
    height: 450px !important;
}

.pi-showcase-layout-featured-top .pi-showcase-card:not(:first-child) {
    height: 300px !important;
}

/* ================================================
   Layout: Abwechselnd (Zigzag)
   Reihe 1: groß (2/3) + klein (1/3)
   Reihe 2: klein (1/3) + groß (2/3)
   ================================================ */
.pi-showcase-layout-zigzag {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 380px;
}

.pi-showcase-layout-zigzag .pi-showcase-card {
    height: 100% !important;
    min-height: 0;
}

/* Karten 1, 5, 9... → groß (2 Spalten) */
.pi-showcase-layout-zigzag .pi-showcase-card:nth-child(4n+1) {
    grid-column: span 2;
}

/* Karten 2, 6, 10... → klein (1 Spalte) */
.pi-showcase-layout-zigzag .pi-showcase-card:nth-child(4n+2) {
    grid-column: span 1;
}

/* Karten 3, 7, 11... → klein (1 Spalte) */
.pi-showcase-layout-zigzag .pi-showcase-card:nth-child(4n+3) {
    grid-column: span 1;
}

/* Karten 4, 8, 12... → groß (2 Spalten) */
.pi-showcase-layout-zigzag .pi-showcase-card:nth-child(4n+4) {
    grid-column: span 2;
}

/* ================================================
   Card – Base
   ================================================ */
.pi-showcase-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2a;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pi-showcase-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.15) 40%,
        rgba(0, 0, 0, 0.75) 100%
    );
    z-index: 1;
    transition: background 0.3s ease;
    pointer-events: none;
}

.pi-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    color: #ffffff !important;
    text-decoration: none !important;
}

.pi-showcase-card:hover::before {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.2) 40%,
        rgba(0, 0, 0, 0.8) 100%
    );
}

/* Placeholder when no image */
.pi-showcase-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.pi-showcase-card-placeholder svg {
    width: 80px;
    height: 80px;
    opacity: 0.3;
}

/* ================================================
   Card Top (Badge + Arrow)
   ================================================ */
.pi-showcase-card-top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 18px;
}

.pi-showcase-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.78em;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.pi-showcase-status {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.78em;
    font-weight: 600;
    color: #ffffff;
    border-radius: 6px;
    margin-left: 8px;
}

.pi-showcase-status-reserviert {
    background-color: #f39c12;
}

.pi-showcase-status-verkauft {
    background-color: #e74c3c;
}

.pi-showcase-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transition: background 0.3s ease, transform 0.3s ease;
    margin-left: auto;
}

.pi-showcase-card:hover .pi-showcase-arrow {
    background: rgba(255, 255, 255, 0.3);
    transform: translate(2px, -2px);
}

/* ================================================
   Card Bottom (Type, Price, Meta)
   ================================================ */
.pi-showcase-card-bottom {
    position: relative;
    z-index: 2;
    padding: 18px 20px;
}

.pi-showcase-type {
    display: block;
    font-size: 0.82em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.pi-showcase-price {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.2;
}

.pi-showcase-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.pi-showcase-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
}

.pi-showcase-meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Featured card bigger text */
.pi-showcase-layout-featured-left .pi-showcase-card:first-child .pi-showcase-price,
.pi-showcase-layout-featured-right .pi-showcase-card:nth-child(2) .pi-showcase-price,
.pi-showcase-layout-featured-top .pi-showcase-card:first-child .pi-showcase-price,
.pi-showcase-layout-zigzag .pi-showcase-card:nth-child(4n+1) .pi-showcase-price,
.pi-showcase-layout-zigzag .pi-showcase-card:nth-child(4n+4) .pi-showcase-price {
    font-size: 1.8em;
}

.pi-showcase-layout-featured-left .pi-showcase-card:first-child .pi-showcase-type,
.pi-showcase-layout-featured-right .pi-showcase-card:nth-child(2) .pi-showcase-type,
.pi-showcase-layout-featured-top .pi-showcase-card:first-child .pi-showcase-type {
    font-size: 0.9em;
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 992px) {
    /* Equal layout */
    .pi-showcase-layout-equal.pi-showcase-cols-3,
    .pi-showcase-layout-equal.pi-showcase-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Featured left → big on top, 2 cols below */
    .pi-showcase-layout-featured-left {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .pi-showcase-layout-featured-left .pi-showcase-card:first-child {
        grid-column: 1 / -1;
        grid-row: auto;
        height: 350px !important;
    }

    .pi-showcase-layout-featured-left .pi-showcase-card:not(:first-child) {
        height: 250px !important;
    }

    /* Featured right → big on top, 2 cols below */
    .pi-showcase-layout-featured-right {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .pi-showcase-layout-featured-right .pi-showcase-card:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 1;
        height: 350px !important;
    }

    .pi-showcase-layout-featured-right .pi-showcase-card:nth-child(1),
    .pi-showcase-layout-featured-right .pi-showcase-card:nth-child(3) {
        grid-column: auto;
        grid-row: auto;
        height: 250px !important;
    }

    /* Featured top: 2 columns below */
    .pi-showcase-layout-featured-top {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-showcase-layout-featured-top .pi-showcase-card:first-child {
        grid-column: 1 / -1;
        height: 380px !important;
    }

    /* Zigzag → equal 2-col */
    .pi-showcase-layout-zigzag {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-showcase-layout-zigzag .pi-showcase-card {
        grid-column: auto !important;
        height: 320px !important;
    }

    .pi-showcase-title {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    /* All layouts → single column */
    .pi-showcase-layout-equal.pi-showcase-cols-2,
    .pi-showcase-layout-equal.pi-showcase-cols-3,
    .pi-showcase-layout-equal.pi-showcase-cols-4,
    .pi-showcase-layout-featured-left,
    .pi-showcase-layout-featured-right,
    .pi-showcase-layout-featured-top,
    .pi-showcase-layout-zigzag {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        grid-auto-rows: auto !important;
    }

    .pi-showcase-grid .pi-showcase-card {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 320px !important;
    }

    .pi-showcase-title {
        font-size: 1.5em;
    }

    .pi-showcase-price {
        font-size: 1.3em !important;
    }

    .pi-showcase-header {
        margin-bottom: 24px;
    }
}
