/* ── Gallery: minimal, zuverlässig ── */

.gallery-page {
    padding-top: 72px;
    padding-bottom: 0;
    background: #fff;
    color: var(--text-body, #374151);
}

.gallery-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 5% 3rem;
}

.gallery-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.gallery-back-link:hover { color: var(--accent-orange, #c96a2b); }

.gallery-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.gallery-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--text-heading, #111827);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.gallery-lead {
    font-size: 1.05rem;
    color: var(--text-secondary, #6b7280);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.gallery-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--brand-border, #e5e7eb);
    border-radius: 4px;
    background: #fff;
    color: var(--text-heading, #111827);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    letter-spacing: 0.02em;
}

.gallery-filter-btn:hover {
    border-color: var(--accent-orange, #c96a2b);
    color: var(--accent-orange, #c96a2b);
}

.gallery-filter-btn.is-active {
    background: var(--accent-orange, #c96a2b);
    border-color: var(--accent-orange, #c96a2b);
    color: #fff;
}

.gallery-filter-empty {
    text-align: center;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 2rem;
}

.gallery-grid {
    --gallery-gap: 20px;
    transition: opacity 0.25s ease, min-height 0.25s ease;
}

.gallery-grid--justified {
    display: flex;
    flex-direction: column;
    gap: var(--gallery-gap);
    position: relative;
}

.gallery-justified-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--gallery-gap);
    width: 100%;
    min-height: 1px;
}

.gallery-grid.is-reflowing {
    pointer-events: none;
}

.gallery-grid--justified .gallery-item {
    position: relative;
    position: relative;
    display: block;
    flex: 0 0 auto;
    height: 100%;
    padding: 0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f3f4f6;
    text-align: left;
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transform: translateZ(0);
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-grid--justified .gallery-item:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
    border-color: transparent;
}

.gallery-item-img {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f3f4f6;
}

.gallery-item-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.gallery-grid--justified .gallery-item:hover .gallery-item-img img {
    transform: scale(1.07);
}

.gallery-item-wa {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    background: #25D366;
    color: #fff !important;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.gallery-item-wa:hover {
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

@media (hover: hover) and (pointer: fine) {
    .gallery-item:hover .gallery-item-wa {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: none) {
    .gallery-item-wa {
        opacity: 1;
        transform: none;
        top: auto;
        bottom: 0.65rem;
        right: 0.65rem;
    }
}

.gallery-ref-pill {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    padding: 0.3rem 0.65rem;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-ref-meta {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.gallery-ref-cat {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.35rem;
}

.gallery-ref-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0.3rem;
}

.gallery-ref-material {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-orange, #c96a2b);
    margin-bottom: 0.25rem;
}

.gallery-ref-location {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
}

.gallery-ref-size {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.2rem;
}

@media (hover: hover) and (pointer: fine) {
    .gallery-grid--justified .gallery-item:hover .gallery-ref-meta {
        opacity: 1;
        transform: translateY(0);
    }

    .gallery-grid--justified .gallery-item:hover .gallery-ref-pill {
        opacity: 0;
    }
}

@media (hover: none) {
    .gallery-ref-meta { display: none; }
}

.gallery-footer-back {
    display: none;
}

/* Lightbox — moderner Vollbildmodus */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: #0a0f0d;
}

.gallery-lightbox[hidden] { display: none; }

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(201, 106, 43, 0.12) 0%, transparent 55%),
        linear-gradient(160deg, #0f1612 0%, #060908 100%);
    cursor: pointer;
}

.gallery-lightbox__shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(0.75rem, 2vw, 1.25rem) clamp(0.75rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem);
    box-sizing: border-box;
}

.gallery-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

.gallery-lightbox__counter {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.gallery-lightbox__close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.gallery-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.gallery-lightbox__body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr min(340px, 34vw);
    grid-template-rows: 1fr;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    align-items: stretch;
}

.gallery-lightbox__figure-wrap {
    position: relative;
    min-height: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__figure {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.gallery-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
}

.gallery-lightbox__panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
    padding: clamp(1rem, 2vw, 1.35rem);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-y: auto;
}

.gallery-lightbox__cat {
    display: inline-block;
    align-self: flex-start;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(201, 106, 43, 0.18);
    border: 1px solid rgba(201, 106, 43, 0.35);
    color: #e8a56a;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.gallery-lightbox__title {
    margin: 0;
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
}

.gallery-lightbox__desc {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.68);
}

.gallery-lightbox__meta {
    margin: 0.25rem 0 0;
    padding: 0.85rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.gallery-lightbox__meta-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.65rem;
    align-items: baseline;
}

.gallery-lightbox__meta dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.gallery-lightbox__meta dd {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.4;
}

.gallery-lightbox__material {
    color: var(--accent-orange, #c96a2b);
}

.gallery-lightbox__actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: auto;
    padding-top: 0.85rem;
}

.gallery-lightbox__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    background: var(--accent-orange, #c96a2b);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.gallery-lightbox__cta--wa {
    background: #25D366;
}

.gallery-lightbox__cta--call {
    background: var(--accent-orange, #c96a2b);
    border: none;
}

.gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-lightbox__nav:hover {
    background: rgba(0, 0, 0, 0.72);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: translateY(-50%) scale(1.04);
}

.gallery-lightbox__nav--prev {
    left: 0.85rem;
}

.gallery-lightbox__nav--next {
    right: 0.85rem;
}

/* Legacy selectors entfernt — alte .gallery-lightbox__stage Regeln ersetzt */

/* Conversion zone */
.gallery-conversion-zone {
    --conv-bg-top: #f3f0ea;
    --conv-bg-bottom: #ebe4d8;
    background: linear-gradient(180deg, var(--conv-bg-top) 0%, var(--conv-bg-bottom) 100%);
    color: var(--text-heading, #111827);
    padding: 4.5rem 5%;
    text-align: center;
    border-top: 0.5px solid rgba(201, 106, 43, 0.22);
    position: relative;
}

.gallery-conversion-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(201, 106, 43, 0.2) 50%, transparent 100%);
    pointer-events: none;
}

.gallery-conversion-inner {
    max-width: 640px;
    margin: 0 auto;
}

.gallery-conversion-zone h2 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    color: var(--text-heading, #111827);
    margin-bottom: 0.85rem;
}

.gallery-conversion-lead {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1.35rem;
}

.gallery-conversion-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    background: #25D366;
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
}

.gallery-conversion-wa:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.45);
    color: #fff !important;
}

.gallery-conversion-hint {
    margin-top: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 900px) {
    .gallery-lightbox__body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        overflow-y: auto;
        align-content: start;
    }

    .gallery-lightbox__figure-wrap {
        min-height: min(52vh, 420px);
        max-height: 55vh;
    }

    .gallery-lightbox__nav {
        width: 40px;
        height: 40px;
    }

    .gallery-lightbox__nav--prev {
        left: 0.5rem;
    }

    .gallery-lightbox__nav--next {
        right: 0.5rem;
    }

    .gallery-lightbox__panel {
        max-height: none;
    }

    .gallery-lightbox__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .gallery-lightbox__cta {
        flex: 1 1 calc(50% - 0.3rem);
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .gallery-conversion-zone {
        padding: 2.5rem 4%;
    }

    .gallery-conversion-inner {
        padding: 0;
    }

    .gallery-conversion-wa {
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .gallery-back-link {
        margin-bottom: 1rem;
    }

    .filter-controls {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-filter-btn {
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    .gallery-lightbox__shell {
        padding: 0.5rem 0.65rem 0.85rem;
    }

    .gallery-lightbox__figure {
        min-height: 42vh;
        border-radius: 12px;
    }

    .gallery-lightbox__panel {
        border-radius: 12px;
        padding: 1rem;
    }

    .gallery-lightbox__meta-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .gallery-lightbox__actions {
        flex-direction: column;
    }

    .gallery-lightbox__cta {
        width: 100%;
        flex: none;
    }
}
