/* =========================================================
 * ARTLINE PORTFOLIO CARDS
 *
 * Slider-Engine:
 * transform: translate3d()
 *
 * Kein scrollLeft / kein Scroll-Snap.
 * ========================================================= */

.artline-portfolio {
    --apc-radius: 1.5625rem;
    --apc-orange: #f36f21;
    --apc-badge-bg: #ffb78f;
    --apc-shadow: 0 0.3125rem 1.25rem 0.3125rem rgba(0, 0, 0, 0.25);

    width: 100%;
    box-sizing: border-box;
}

.artline-portfolio--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;

    width: 100%;
    max-width: 68.75rem;
    margin-inline: auto;
}

.artline-portfolio--grid .artline-portfolio__item {
    display: flex;
    min-width: 0;
}

.artline-portfolio--grid .apc-card {
    width: 100%;
    min-height: 0;
}

.apc-carousel {
    --apc-card-width: 27.3125rem;
    --apc-gap: 1.5rem;

    width: 100%;
    max-width: 100%;

    overflow: hidden;
}


.apc-carousel__viewport {
    width: 100%;

    overflow: hidden;

    cursor: grab;

    user-select: none;

    touch-action: pan-y;

    -webkit-user-select: none;
}


.apc-carousel.is-dragging .apc-carousel__viewport {
    cursor: grabbing;
}


.apc-carousel__track {
    display: flex;
    align-items: stretch;

    gap: var(--apc-gap);

    width: max-content;

    padding: 1.25rem 0 2rem;

    box-sizing: border-box;

    will-change: transform;

    backface-visibility: hidden;

    transform: translate3d(0, 0, 0);
}


.apc-carousel__slide {
    flex: 0 0 var(--apc-card-width);

    width: var(--apc-card-width);
    min-width: var(--apc-card-width);

    opacity: 0.8;

    transform: scale(0.99);

    transition:
        opacity 0.35s ease,
        transform 0.35s ease;

    backface-visibility: hidden;

    transform-origin: center center;
}


.apc-carousel__slide.is-visible {
    opacity: 1;
}


.apc-carousel__slide.is-active {
    transform: scale(1);
}


.apc-card {
    display: flex;
    flex-direction: column;

    height: 100%;
    min-height: 38rem;

    overflow: hidden;

    background: #fff;

    border-radius: var(--apc-radius);

    box-shadow: var(--apc-shadow);

    color: #111;

    text-decoration: none !important;
}


.apc-card--default {
    min-height: 0;
}


.apc-card:hover,
.apc-card:focus {
    color: #111;

    text-decoration: none !important;
}


.apc-card__media {
    position: relative;

    aspect-ratio: 1.55 / 1;

    overflow: hidden;

    background: #f3f3f3;
}


.apc-card__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    pointer-events: none;

    -webkit-user-drag: none;
}


.apc-card__badge {
    position: absolute;

    top: 1.25rem;
    left: 1.25rem;

    z-index: 2;

    display: inline-flex;
    align-items: center;

    min-height: 2.5rem;

    max-width: calc(100% - 2.5rem);

    padding: 0.625rem 1rem;

    border-radius: 999rem;

    background: var(--apc-badge-bg);

    color: var(--apc-badge-color, #111);

    font-size: 0.875rem;
    font-weight: 700;

    line-height: 1.15;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.apc-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    padding: 1.5rem 1.75rem 1.75rem;
}


.apc-card__title {
    margin: 0 0 0.75rem;

    color: #000;

    font-size: 2.2rem;
    font-weight: 700;

    line-height: 1.12;

    overflow-wrap: anywhere;
}


.apc-card__subtitle {
    margin-bottom: 1.75rem;

    color: #000;

    font-size: 1.25rem;
    font-weight: 700;

    line-height: 1.35;
}


.apc-card__bottom {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 1rem;

    margin-top: auto;
}


.apc-card__meta {
    display: flex;
    flex-direction: column;

    gap: 0.625rem;

    min-width: 0;
}


.apc-card__meta-row {
    display: flex;
    align-items: center;

    gap: 0.625rem;

    font-size: 1rem;

    line-height: 1.25;
}


.apc-meta-icon {
    display: inline-flex;

    flex: 0 0 2rem;

    align-items: center;
    justify-content: center;

    width: 2rem;
    height: 2rem;

    border-radius: 50%;

    background: #ffd9c7;

    color: var(--apc-orange);
}


.apc-meta-icon svg {
    width: 1.125rem;
    height: 1.125rem;

    fill: none;

    stroke: currentColor;

    stroke-width: 2;

    stroke-linecap: round;
    stroke-linejoin: round;
}


.apc-card__price {
    display: flex;

    flex: 0 0 auto;

    flex-direction: column;

    align-items: flex-end;

    text-align: right;
}


.apc-card__price-prefix {
    margin-bottom: 0.1875rem;

    font-size: 1rem;

    line-height: 1.2;

    white-space: nowrap;
}


.apc-card__price-value {
    font-size: 2.5rem;
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;
}


.apc-debug {
    padding: 0.75rem 1rem;

    border: 1px solid #d63638;

    background: #fff3f3;

    color: #7a1d1d;

    font: 14px / 1.4 monospace;
}


@media (max-width: 64rem) {

    .apc-carousel {
        --apc-card-width: 23rem;
        --apc-gap: 1.25rem;
    }

}


@media (max-width: 47.9375rem) {

    .artline-portfolio--grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

}


/* =========================================================
 * MOBILE CARD LAYOUT
 * Bis 40rem (~640px):
 * Bild → Badge → Titel → Untertitel → Meta-Infos → Preis
 * ========================================================= */
@media (max-width: 40rem) {

    .apc-carousel {
        --apc-card-width: calc(100vw - 3rem);
        --apc-gap: 1rem;
    }

    .apc-carousel__track {
        padding: 1rem 0 1.75rem;
    }

    /* Mobile Karte wie im Referenzbild:
       Bild → Badge → Titel → Untertitel → Ort → Dauer → Preis rechts unten. */
    .artline-portfolio--carousel .apc-card {
        min-height: 33rem;
    }

    .artline-portfolio--grid .apc-card {
        min-height: 0;
        height: auto;
    }

    .apc-card__media {
        aspect-ratio: 1.45 / 1;
    }

    .apc-card__badge {
        top: 1rem;
        left: 1rem;
    }

    .apc-card__body {
        padding: 1.75rem 1.5rem 1.5rem;
    }

    .apc-card__title {
        /* Mobile: Abstand zum Untertitel bewusst kompakter. */
        margin-bottom: 0.5rem;
        font-size: 2rem;
        line-height: 1.12;
    }

    .apc-card__subtitle {
        margin-bottom: 2rem;
        font-size: 1.125rem;
        line-height: 1.3;
    }

    .apc-card__bottom {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        /* Abstand zwischen Meta-Infos (Ort/Dauer) und Preis auf Mobile.
           1.25rem = 20px bei 16px Root-Schriftgröße. */
        gap: 1.25rem;
        margin-top: 0;
    }

    .apc-card__meta {
        order: 1;
        gap: 0.75rem;
    }

    .apc-card__price {
        order: 2;
        align-self: flex-end;
        margin-top: 0;
        text-align: right;
    }

    .apc-card__price-prefix {
        font-size: 1rem;
    }

    .apc-card__price-value {
        font-size: 2.5rem;
        line-height: 1;
    }

}


@media (prefers-reduced-motion: reduce) {

    .apc-carousel__track,
    .apc-carousel__slide {
        transition-duration: 0.01ms !important;
    }

}
