/* ============================================================
   portfolio-slider.css
   Portfolio Grid + Slider + Info Panels
   bereinigte Fassung für das bestehende HTML mit .card / .slide
   ============================================================ */

:root {
    --radius: 4px;
}

/* ----- Seitenkopf ----- */
.portfolio-header {
    max-width: 1600px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem;
}

.portfolio-header h1 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    line-height: 1.05;
    color: var(--color-text);
    margin-bottom: 0.6rem;
}

.portfolio-header p {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.5;
    color: #777;
    margin-bottom: 0;
}

/* ----- Wrapper ----- */
.portfolio-grid-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem 4.5rem;
}

/* ----- Grid ----- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: clamp(220px, 22vw, 320px);
    grid-auto-flow: dense;
    gap: 14px;
}

/* Kartenformate */
.card.portrait {
    grid-row: span 2;
}

.card.landscape {
    grid-column: span 2;
}

.card.landscape-tall {
    grid-row: span 2;
}

/* ----- Karte ----- */
.card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: #f4f4f1;
    transition: box-shadow 0.3s ease;
}

.card.info-open {
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 5;
}

/* ----- Slides ----- */
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide.active {
    opacity: 1;
}

.slide.contain {
    background-size: contain;
    background-color: #ffffff;
}

/* Video-Slide */
.slide video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Abdunklung unten für Metazeile */
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.62) 0%,
        rgba(0, 0, 0, 0.16) 28%,
        rgba(0, 0, 0, 0.04) 45%,
        transparent 65%
    );
    z-index: 2;
    pointer-events: none;
}

/* ----- Dots ----- */
.slide-dots {
    position: absolute;
    right: 0.85rem;
    bottom: 0.7rem;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.slide-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.42);
    transition: transform 0.25s ease, background 0.25s ease;
}

.slide-dots span.active {
    background: #fff;
    transform: scale(1.35);
}

.card[data-count="1"] .slide-dots {
    display: none;
}

/* ----- Vorderseite unten ----- */
.card-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.95rem 1rem 0.8rem;
}

.card-project {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.22;
    color: #fff;
}

.card-tag {
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ----- Hinweis im Seitenkopf ----- */
.info-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1;
    vertical-align: -4px;
}

/* ----- Info-Button ----- */
.info-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.8rem;
    z-index: 4;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.info-btn:hover {
    background: #c52d18;
    transform: scale(1.04);
}

/* ----- Info-Panel ----- */
.card-info {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.2rem 1.2rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: auto;
    transform: translateY(100%);
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.info-open .card-info {
    transform: translateY(0);
}

.card-info .info-label {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0;
}

.card-info .info-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.18rem;
    line-height: 1.28;
    color: var(--color-text);
    margin: 0 1.5rem 0.15rem 0;
}

.card.portrait .card-info .info-title,
.card.landscape .card-info .info-title {
    font-size: 1.3rem;
}

.card-info .info-text {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.65;
    color: #4f4f4f;
    margin: 0;
}

.card-info .info-label + .info-text {
    margin-top: 0.05rem;
}

.card-info .info-label a {
    color: var(--color-accent);
    text-decoration: none;
    font-style: normal;
}

.card-info .info-label a:hover {
    text-decoration: underline;
}

.card-info .info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.5rem;
}

.card-info .info-tags span {
    font-family: var(--font-sans);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #f0f0ee;
    color: #777;
    padding: 2px 8px;
    border-radius: 2px;
}

/* optionale Bildreihe im Info-Panel */
.info-imgs {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 0.6rem;
}

.info-imgs img {
    height: 64px;
    width: auto;
    object-fit: cover;
    border-radius: 2px;
}

/* ----- Schließen ----- */
.close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.8rem;
    z-index: 11;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #eeeeec;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
    background: #ddddda;
    transform: scale(1.04);
}

.close-btn svg {
    width: 9px;
    height: 9px;
    fill: #666;
}

/* ----- Placeholderfarben ----- */
.ph-1  { background-color: #9ea8b8; }
.ph-2  { background-color: #b8a89e; }
.ph-3  { background-color: #a8b8a8; }
.ph-4  { background-color: #1a1a1a; }
.ph-5  { background-color: #E9331C; }
.ph-6  { background-color: #3C2F8F; }
.ph-7  { background-color: #c4a882; }
.ph-8  { background-color: #7a9aaa; }
.ph-9  { background-color: #b8b0c4; }
.ph-10 { background-color: #4a6858; }
.ph-11 { background-color: #c4b8a8; }
.ph-12 { background-color: #8a7868; }

/* ----- Responsive ----- */
@media (max-width: 1100px) {
    .portfolio-header,
    .portfolio-grid-wrap {
        max-width: 100%;
    }

    .portfolio-header {
        padding-top: 3rem;
    }

    .portfolio-header h1 {
        font-size: clamp(2.2rem, 5vw, 3.3rem);
    }

    .portfolio-grid {
        grid-auto-rows: clamp(200px, 24vw, 280px);
    }
}

@media (max-width: 760px) {
    .portfolio-header {
        padding: 2.2rem 1rem 1.5rem;
    }

    .portfolio-grid-wrap {
        padding: 0 1rem 3rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 34vw;
        gap: 10px;
    }

    .card.landscape {
        grid-column: span 2;
    }

    .card.portrait {
        grid-row: span 2;
    }

    .card-info {
        padding: 1rem;
    }

    .card-info .info-title {
        font-size: 1.08rem;
    }

    .card.portrait .card-info .info-title,
    .card.landscape .card-info .info-title {
        font-size: 1.14rem;
    }

    .card-info .info-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .card-project {
        font-size: 0.92rem;
    }

    .card-tag {
        font-size: 0.6rem;
    }
}

@media (max-width: 520px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .card,
    .card.portrait,
    .card.landscape,
    .card.landscape-tall {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 320px;
    }

    .card.portrait {
        min-height: 420px;
    }

    .card.landscape,
    .card.landscape-tall {
        min-height: 300px;
    }

    .card--blaues-kreuz {
        order: -1;
    }

    .card--eigenbroedel {
        order: 999;
    }

    .portfolio-header h1 {
        font-size: 2.1rem;
    }

    .portfolio-header p {
        font-size: 1rem;
    }
}