/*
 * Götterfunken – case page navigation
 * Loaded on the four case pages only.
 *   .gf-back  – "← All cases" in the hero (replaces the plain "Cases" label)
 *   .gf-next  – "Next case" teaser before the footer
 * Link behaviour (return to the exact project on the homepage) lives in
 * static-effects.js: initCaseBackLinks / restoreWorkPosition.
 */

/* ── A) Back link in the hero ─────────────────────────────────────────────── */
.gf-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
}
/* Override the theme reset (a:hover { color: #336 }, a:visited { text-decoration: underline }) */
.gf-back,
.gf-back:hover,
.gf-back:active,
.gf-back:visited,
.gf-next__link,
.gf-next__link:hover,
.gf-next__link:active,
.gf-next__link:visited {
    color: inherit;
    text-decoration: none;
}
.gf-back__arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}
.gf-back:hover .gf-back__label,
.gf-back:focus-visible .gf-back__label {
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 0.06em;
}
.gf-back:hover .gf-back__arrow {
    transform: translateX(-0.25em);
}
.gf-back:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 0.2em;
    border-radius: 2px;
}

/* ── D) Next case teaser ──────────────────────────────────────────────────── */
.gf-next {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: clamp(360px, 70vh, 760px);
    padding-block: clamp(32px, 6vw, 80px);
    /* Same inset as the case content: 1140px centred, at least 2rem */
    padding-inline: max(2rem, calc((100% - 1140px) / 2));
    overflow: hidden;
    background: #282828;
    color: #fff;
    isolation: isolate;
}
.gf-next__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}
.gf-next__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gf-next__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.78) 100%);
}
.gf-next__eyebrow {
    margin: 0 0 0.2em;
    font-family: "Rubik", "Rubik Fallback", sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.7rem);
    font-weight: 400;
    line-height: 1.2;
}
.gf-next__title {
    margin: 0;
    font-family: "Poppins", "Poppins Fallback", sans-serif;
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    font-weight: 800;
    line-height: 1.02;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
/* Stretched link: the whole teaser is clickable */
.gf-next__link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25em;
}
.gf-next__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
}
.gf-next__arrow {
    display: inline-block;
    font-weight: 400;
    transition: transform 0.3s ease;
}
.gf-next:hover .gf-next__media img {
    transform: scale(1.035);
}
.gf-next:hover .gf-next__arrow {
    transform: translateX(0.18em);
}
.gf-next__link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 0.12em;
}
.gf-next__all {
    position: relative;
    z-index: 1; /* above the stretched link */
    align-self: flex-start;
    margin-top: clamp(20px, 3vw, 36px);
    font-family: "Rubik", "Rubik Fallback", sans-serif;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
}

@media (prefers-reduced-motion: reduce) {
    .gf-back__arrow,
    .gf-next__media img,
    .gf-next__arrow {
        transition: none;
    }
    .gf-next:hover .gf-next__media img {
        transform: none;
    }
}
