.gallery-teaser {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gallery-teaser .section-title {
    margin-bottom: 12px;
}

.gallery-teaser .section-subtitle {
    margin: 0 0 22px;
}

.gallery-teaser-image {
    display: block;
    width: min(100%, 520px);
    max-height: 300px;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 67, 82, 0.12);
}

.gallery-link,
.gallery-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    margin-top: 20px;
    padding: 10px 24px;
    border: 1px solid #176b5b;
    border-radius: 999px;
    background: #dff5ef;
    color: #176b5b;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gallery-link:hover,
.gallery-back-link:hover {
    transform: translateY(-2px);
    background: #c8eee4;
}

.gallery-header {
    padding: clamp(110px, 16vw, 160px) 5vw 42px;
    background: linear-gradient(145deg, #effaf6, #ffffff);
    text-align: center;
}

.gallery-header .section-title {
    margin: 8px 0 12px;
}

.gallery-header > p:last-child {
    color: #52616b;
}

.gallery-kicker {
    color: var(--heading-green);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.gallery-page {
    padding-top: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(8px, 2vw, 16px);
}

.gallery-item {
    display: block;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    aspect-ratio: 1;
    background: #dcebe7;
    box-shadow: 0 5px 16px rgba(0, 67, 82, 0.1);
    cursor: zoom-in;
}

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

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.05);
}

.gallery-item:focus-visible {
    outline-offset: 4px;
}

.gallery-back-link {
    display: flex;
    width: fit-content;
    margin: 32px auto 0;
}

.gallery-modal-content {
    width: min(94vw, 1100px);
    max-width: 1100px;
    max-height: 92vh;
    padding: 54px 24px 24px;
    overflow: visible;
    background: rgba(0, 26, 32, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-modal-body {
    width: 100%;
}

.gallery-modal-body h2 {
    margin: 0 0 16px;
    padding: 0 48px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: clamp(1rem, 3vw, 1.4rem);
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
}

.gallery-modal-content .modal-close {
    top: 10px;
    right: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.gallery-modal-image {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: calc(92vh - 145px);
    margin: 0 auto;
    object-fit: contain;
}

@media (max-width: 760px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .gallery-item {
        border-radius: 8px;
    }
}

@media (max-width: 380px) {
    .gallery-grid {
        gap: 5px;
    }
}
