/* =========================================
   GALERIE
========================================= */

.gallery-hero {
    padding: clamp(3.5rem, 7vw, 7rem) 10vw;
    background-color: var(--paper);
}

.gallery-eyebrow {
    margin: 0 0 1.3rem;
    color: var(--moss);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.gallery-hero h1 {
    margin: 0;
    color: var(--green);
    font-size: clamp(2.6rem, 6.5vw, 6.5rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    overflow-wrap: anywhere;
}

.gallery-hero h1 em {
    font-weight: 400;
}

.gallery-hero > p:last-child {
    max-width: 50ch;
    margin: 2rem 0 0;
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.8;
}

.gallery-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.7rem;
    min-width: 0;
    margin: 0;
    padding: 1rem 10vw;
    border: 0;
    background-color: var(--beige);
}

.gallery-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--green);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.gallery-filter > span {
    padding: 0.3rem 0;
    border-bottom: 1px solid transparent;
}

.gallery-filter input:checked + span {
    border-bottom-color: var(--green);
}

.gallery-filter input:focus-visible + span {
    outline: 2px solid var(--green);
    outline-offset: 5px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1fr);
    grid-template-rows: clamp(240px, 24vw, 350px) clamp(200px, 18vw, 260px) clamp(260px, 27vw, 390px) clamp(220px, 20vw, 280px);
    grid-auto-rows: clamp(220px, 20vw, 300px);
    gap: 1rem;
    padding: clamp(3rem, 5vw, 5rem) 7vw;
    background-color: var(--cream);
}

.gallery-item {
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.gallery-item--featured {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item--wide {
    grid-column: span 2;
}

.gallery-item__link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--sage);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item--featured img {
    object-position: right center;
}

.gallery-item--sky img {
    object-position: center 40%;
}

.gallery-item__open {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    background-color: var(--paper);
    color: var(--green);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    opacity: 0;
}

.gallery-item__link:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 4px;
}

.gallery-item__link:focus-visible .gallery-item__open {
    opacity: 1;
}

/* Gleiche Kategorien wie in Figma, ohne JavaScript. */
.gallery-content:has(#category-healing:checked) .gallery-item:not([data-category="healing"]),
.gallery-content:has(#category-pferde:checked) .gallery-item:not([data-category="pferde"]),
.gallery-content:has(#category-natur:checked) .gallery-item:not([data-category="natur"]) {
    display: none;
}

.gallery-content:has(input:not(#category-all):checked) .gallery-grid {
    grid-template-rows: none;
    grid-auto-rows: auto;
    align-items: start;
}

.gallery-content:has(input:not(#category-all):checked) .gallery-item {
    grid-column: auto;
    grid-row: auto;
}

.gallery-content:has(input:not(#category-all):checked) .gallery-item img {
    height: auto;
}

@media (hover: hover) and (pointer: fine) {

    .gallery-item__link:hover img {
        transform: scale(1.025);
    }

    .gallery-item__link:hover .gallery-item__open {
        opacity: 1;
    }

}

@media (max-width: 900px) {

    .gallery-hero,
    .gallery-filters {
        padding-left: 7vw;
        padding-right: 7vw;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 330px 300px 330px 290px;
    }

    .gallery-item--featured {
        grid-row: auto;
    }

    .gallery-item--wide {
        grid-column: auto;
    }

}

@media (max-width: 560px) {

    .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: auto;
        gap: 0.8rem;
    }

    .gallery-item--featured {
        grid-column: auto;
    }

    .gallery-item img {
        height: auto;
    }

}

@media (hover: none) {

    .gallery-item__open {
        opacity: 1;
    }

}

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

    .gallery-item img,
    .footer-social-link span {
        transition: none;
    }

    .gallery-item__link:hover img,
    .footer-social-link:hover span {
        transform: none;
    }

}
