/* ==========================================================================
   PAGE TYPE: PROJECT
   Shared by gemeinde, ngobusiness, schulprojekte and diaspora
   (template: app/views/pages/project.php).
   ========================================================================== */

/* --- Slides: the main project as a stack of cards ---------------------------
   From 600px each card sticks below the header, slightly lower than the one
   before, and the next card slides over it — a deck that builds up while
   scrolling. Phones show the cards one after another: there a card fills
   most of the screen, and the stack would mostly hide the next one.
   Screens too short for a whole card scroll them one after another, too. */
.slides {
    padding-bottom: clamp(0.5rem, 2vw, 2rem);
}

.slides__list {
    display: grid;
    gap: clamp(1rem, 5svh, 3.5rem);
}

.slide {
    --stack-top: calc(var(--header-height) + 0.75rem + var(--i, 0) * 0.75rem);
    scroll-margin-top: var(--stack-top);
}

@media (min-width: 600px) and (min-height: 560px) {
    .slide {
        position: sticky;
        top: var(--stack-top);
    }
}

.slide__card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: 0 0 0 1px var(--color-line);
}

@media (min-width: 600px) {
    .slide__card {
        box-shadow: 0 0 0 1px var(--color-line), 0 -20px 40px -30px rgba(36, 36, 36, 0.45);
    }
}

.slide__media {
    position: relative;
    order: -1;
    height: clamp(10rem, 30svh, 24rem);
    background: var(--mist);
}

@media (max-width: 599px) {
    .slide__media {
        height: auto;
        aspect-ratio: 16 / 10;
    }
}

.slide__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide__body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: clamp(1.25rem, 0.6rem + 2.8vw, 3.5rem);
}

.slide__label {
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-accent-text);
}

.slide__title {
    font-size: var(--text-display-md);
}

.slide__text {
    max-width: 40ch;
    margin-top: clamp(0.625rem, 0.5rem + 0.6vw, 0.875rem);
    color: var(--color-text-muted);
}

@media (min-width: 900px) {
    .slide__card {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        height: clamp(28rem, calc(100svh - var(--stack-top) - 2.5rem), 44rem);
    }

    .slide__media {
        order: 0;
        height: auto;
    }

    /* Photo left on every second card. */
    .slide:nth-child(even) .slide__media {
        order: -1;
    }

    .slide__body {
        justify-content: space-between;
    }

    .slide__text {
        font-size: var(--text-lead);
    }
}

/* --- Features: text and photo side by side, alternating sides --------------- */
.features {
    display: grid;
    gap: clamp(2.75rem, 1.5rem + 5.56vw, 7rem);
}

.feature__inner {
    display: grid;
    align-items: center;
    gap: clamp(1.25rem, 0.75rem + 2.2vw, 3rem);
}

@media (min-width: 900px) {
    .feature__inner {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        column-gap: clamp(2.5rem, 5vw, 5.5rem);
    }

    .feature--reverse .feature__inner {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }

    .feature--reverse .feature__media {
        order: 2;
    }
}

.feature__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    background: var(--mist);
}

.feature__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The photo's own short title, set on the photo. */
.feature__caption {
    position: absolute;
    inset: auto 0 0;
    padding: 5rem clamp(1.25rem, 0.75rem + 2vw, 2.5rem) clamp(1.25rem, 0.75rem + 1.6vw, 2.25rem);
    background: linear-gradient(to top, rgba(18, 18, 18, 0.7), rgba(18, 18, 18, 0));
    color: var(--white);
    font-family: var(--font-display);
    font-size: var(--text-display-sm);
    line-height: var(--leading-display);
    text-transform: uppercase;
}

.feature__title {
    margin-bottom: clamp(0.75rem, 0.6rem + 0.7vw, 1.25rem);
    font-size: var(--text-display-md);
}

.feature__text {
    max-width: 50ch;
    color: var(--color-text-muted);
}

.feature__text + .feature__text {
    margin-top: 1rem;
}

.feature__text strong {
    color: var(--color-text);
}
