/* =========================================================
   Realizacje — Biel Stal
   Jasny nagłówek i galeria. Lightbox kadru.
   ========================================================= */

.tg-realpage {
    background-color: var(--tg-base);
    color: var(--tg-ink);
}

.tg-realpage__hero,
.tg-realpage__intro,
.tg-realpage__filters,
.tg-realpage__gallery,
.tg-realpage__cta {
    opacity: 0;
    transform: translateY(14px);
}

.tg-realpage.is-in .tg-realpage__hero {
    animation: tg-rise 0.72s var(--tg-ease-out) forwards;
}

.tg-realpage.is-in .tg-realpage__intro {
    animation: tg-rise 0.72s var(--tg-ease-out) 0.08s forwards;
}

.tg-realpage.is-in .tg-realpage__filters {
    animation: tg-rise 0.72s var(--tg-ease-out) 0.12s forwards;
}

.tg-realpage.is-in .tg-realpage__gallery {
    animation: tg-rise 0.72s var(--tg-ease-out) 0.18s forwards;
}

.tg-realpage.is-in .tg-realpage__cta {
    animation: tg-rise 0.72s var(--tg-ease-out) 0.28s forwards;
}

/* ——— Nagłówek ——— */

.tg-realpage__hero {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    width: min(var(--adcore-section-max), calc(100% - (2 * var(--adcore-gutter))));
    height: auto;
    min-height: 0;
    margin: clamp(1.75rem, 4vh, 3rem) auto 0;
    overflow: visible;
    background: transparent;
    color: var(--tg-ink);
}

.tg-realpage__scrim {
    display: none;
}

.tg-realpage__photo {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 42%;
    border-radius: 1.35rem;
    background-color: var(--tg-surface);
}

.tg-realpage__hero-inner.adcore-wrap {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    text-align: left;
    color: var(--tg-ink);
}

.tg-realpage__eyebrow {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tg-accent);
}

.tg-realpage__eyebrow::before {
    content: "";
    width: 1.35rem;
    height: 2px;
    flex-shrink: 0;
    background-color: var(--tg-accent);
}

.tg-realpage__title {
    margin: 0 0 1.35rem;
    max-width: 12em;
    font-size: clamp(2.15rem, 4vw, 3.35rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-wrap: balance;
    color: var(--tg-ink);
}

.tg-realpage__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem 1.25rem;
}

.tg-realpage__hero .tg-link {
    color: var(--tg-muted);
}

.tg-realpage__hero .tg-link:hover,
.tg-realpage__hero .tg-link:focus-visible {
    color: var(--tg-accent);
}

/* ——— Intro ——— */

.tg-realpage__intro {
    max-width: 40rem;
    margin: clamp(1.75rem, 4vh, 3rem) auto 0;
    text-align: center;
}

.tg-realpage__intro .tg-realpage__title {
    margin: 0 auto 1rem;
    max-width: none;
}

.tg-realpage__intro .tg-realpage__eyebrow {
    justify-content: center;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 1.1rem;
}

.tg-realpage__mission {
    margin: 0;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.025em;
    text-align: center;
    text-wrap: pretty;
}

/* ——— Filtr glass ——— */

.tg-realpage__filters {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: clamp(1.65rem, 3.4vh, 2.35rem) auto clamp(2.6rem, 5.2vh, 3.85rem);
}

.tg-realpage__filter {
    --tg-filter-pad: 0.3rem;
    --tg-filter-x: 0px;
    --tg-filter-w: 0px;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    max-width: 100%;
    padding: var(--tg-filter-pad);
    overflow-x: auto;
    scrollbar-width: none;
    border: 1px solid rgba(46, 54, 62, 0.12);
    border-radius: var(--tg-pill);
    background-color: var(--tg-surface);
    box-shadow: none;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.tg-realpage__filter::-webkit-scrollbar {
    display: none;
}

.tg-realpage__filter-thumb {
    position: absolute;
    z-index: 0;
    top: var(--tg-filter-pad);
    bottom: var(--tg-filter-pad);
    left: 0;
    width: var(--tg-filter-w);
    border-radius: var(--tg-pill);
    background-color: var(--tg-accent);
    border: 1px solid transparent;
    box-shadow: none;
    pointer-events: none;
    transform: translateX(var(--tg-filter-x));
    transition: transform 0.45s var(--tg-ease), width 0.45s var(--tg-ease);
}

.tg-realpage__filter-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 2.65rem;
    margin: 0;
    padding: 0.55rem 0.95rem;
    border: 0;
    border-radius: var(--tg-pill);
    background: transparent;
    color: var(--tg-muted);
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 0.3s var(--tg-ease);
}

.tg-realpage__filter-btn:hover,
.tg-realpage__filter-btn:focus-visible {
    color: var(--tg-ink);
}

.tg-realpage__filter-btn.is-active {
    color: #fff;
}

.tg-realpage__filter-btn:focus-visible {
    outline: 2px solid var(--tg-accent);
    outline-offset: 3px;
}

.tg-realpage__filter-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tg-realpage__empty {
    margin: 0 auto 2rem;
    max-width: 28rem;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--tg-muted);
}

/* ——— Galeria ——— */

.tg-realpage__gallery {
    padding-bottom: clamp(2rem, 4vh, 3rem);
}

.tg-realpage__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2.25rem, 5vw, 3.75rem) clamp(1.5rem, 3vw, 2.5rem);
    transition:
        opacity 0.34s var(--tg-ease),
        transform 0.34s var(--tg-ease);
}

.tg-realpage__grid.is-swap {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.tg-realpage__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tg-realpage__card[hidden] {
    display: none;
}

.tg-realpage__shot {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--tg-radius-lg);
    background-color: var(--tg-surface);
    cursor: pointer;
    color: inherit;
}

.tg-realpage__shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 48%;
    transition: filter 0.45s var(--tg-ease);
}

.tg-realpage__shot:hover img,
.tg-realpage__shot:focus-visible img {
    filter: brightness(1.07);
}

.tg-realpage__shot:focus-visible {
    outline: 2px solid var(--tg-accent);
    outline-offset: 4px;
}

.tg-realpage__chips {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    pointer-events: none;
}

.tg-realpage__chip {
    margin: 0;
    padding: 0.55rem 0.8rem 0.5rem;
    border-radius: var(--tg-radius);
    background-color: rgba(7, 7, 7, 0.72);
    border: 1px solid rgba(245, 245, 247, 0.14);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
}

.tg-realpage__count {
    position: absolute;
    left: 1.1rem;
    bottom: 1.1rem;
    margin: 0;
    padding: 0.45rem 0.7rem;
    border-radius: var(--tg-pill);
    background-color: rgba(7, 7, 7, 0.72);
    border: 1px solid rgba(245, 245, 247, 0.14);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    pointer-events: none;
}

.tg-realpage__body {
    padding: 1.25rem 0.15rem 0.15rem;
}

.tg-realpage__name {
    margin: 0 0 0.95rem;
    font-size: clamp(1.2rem, 1.7vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--tg-muted);
    transition: color 0.35s var(--tg-ease);
}

@media (min-width: 1024px) {
    .tg-realpage__card:hover .tg-realpage__name,
    .tg-realpage__card:focus-within .tg-realpage__name {
        color: var(--tg-ink);
    }
}

.tg-realpage__points {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--tg-line);
}

.tg-realpage__points li {
    padding: 0.8rem 0;
    font-size: var(--tg-fs-body);
    font-weight: 400;
    line-height: 1.5;
    color: var(--tg-muted);
    border-bottom: 1px solid var(--tg-line);
    transition: color 0.3s var(--tg-ease);
}

.tg-realpage__points li:hover {
    color: var(--tg-ink);
}

/* ——— CTA ——— */

.tg-realpage__cta {
    padding-block: clamp(2rem, 4.5vh, 3rem) clamp(5rem, 10vh, 8rem);
}

.tg-realpage__cta .adcore-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
}

/* ——— Lightbox ——— */

.tg-realpage-lb {
    --lb-pad: clamp(0.75rem, 2.4vmin, 1.5rem);
    --lb-side: 2.75rem;
    position: fixed;
    inset: 0;
    z-index: 100050;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--lb-pad);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.28s var(--tg-ease),
        visibility 0.28s var(--tg-ease);
}

.tg-realpage-lb.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.tg-realpage-lb__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(7, 7, 7, 0.88);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    cursor: pointer;
}

.tg-realpage-lb__panel {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    width: 100%;
    height: 100%;
    min-height: 0;
    pointer-events: none;
}

.tg-realpage-lb__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.tg-realpage-lb__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    height: 100%;
    max-width: calc(100% - 7.5rem);
    min-width: 0;
    min-height: 0;
}

.tg-realpage-lb__figure img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--tg-radius);
    opacity: 1;
    transition: opacity 0.22s var(--tg-ease);
    pointer-events: auto;
}

.tg-realpage-lb__figure img.is-swap {
    opacity: 0;
}

.tg-realpage-lb__close,
.tg-realpage-lb__nav {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--lb-side);
    height: var(--lb-side);
    padding: 0;
    border: 1px solid rgba(245, 245, 247, 0.14);
    border-radius: 50%;
    background-color: rgba(20, 20, 24, 0.72);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.3s var(--tg-ease);
}

.tg-realpage-lb__close:hover,
.tg-realpage-lb__nav:hover,
.tg-realpage-lb__close:focus-visible,
.tg-realpage-lb__nav:focus-visible {
    background-color: rgba(245, 245, 247, 0.12);
}

.tg-realpage-lb__close:focus-visible,
.tg-realpage-lb__nav:focus-visible {
    outline: 2px solid var(--tg-accent);
    outline-offset: 3px;
}

.tg-realpage-lb__close {
    position: absolute;
    top: 0;
    right: 0;
}

.tg-realpage-lb__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 0.35rem;
    text-align: center;
    pointer-events: none;
}

.tg-realpage-lb__caption {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
}

.tg-realpage-lb__counter {
    margin: 0;
    padding: 0.35rem 0.75rem;
    border-radius: var(--tg-pill);
    background-color: rgba(20, 20, 24, 0.72);
    border: 1px solid rgba(245, 245, 247, 0.12);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    pointer-events: auto;
}

.tg-realpage-lb.is-single .tg-realpage-lb__nav,
.tg-realpage-lb.is-single .tg-realpage-lb__counter {
    visibility: hidden;
    pointer-events: none;
}

body.tg-realpage-lb-open {
    overflow: hidden;
}

/* =========================================================
   Breakpointy 1450 / 1201 / 1024 / 768 / 375
   ========================================================= */

@media (max-width: 1200px) {
    .tg-realpage__title {
        font-size: clamp(2rem, 4.4vw, 3rem);
    }
}

@media (max-width: 1023px) {
    .tg-realpage__hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.35rem;
        margin-top: 1.35rem;
    }

    .tg-realpage__photo,
    .tg-realpage__hero-inner.adcore-wrap {
        grid-column: 1;
    }

    .tg-realpage__hero-inner.adcore-wrap {
        grid-row: 1;
        align-items: center;
        text-align: center;
        padding: 0;
    }

    .tg-realpage__photo {
        grid-row: 2;
        max-width: 36rem;
        justify-self: center;
    }

    .tg-realpage__eyebrow,
    .tg-realpage__actions {
        justify-content: center;
    }

    .tg-realpage__title {
        margin-inline: auto;
    }

    .tg-realpage__intro {
        margin: clamp(2.25rem, 5vh, 3.25rem) auto 0;
    }

    .tg-realpage__filters {
        margin: 1.5rem auto 2.75rem;
    }

    .tg-realpage__grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .tg-realpage__body,
    .tg-realpage__name,
    .tg-realpage__points {
        text-align: center;
    }

    .tg-realpage__name {
        color: var(--tg-ink);
    }

    .tg-realpage__cta {
        padding-block: clamp(1.5rem, 3.5vh, 2.25rem) clamp(4.25rem, 8vh, 6.5rem);
    }
}

@media (max-width: 767px) {
    .tg-realpage__title {
        font-size: clamp(1.85rem, 8vw, 2.25rem);
        max-width: none;
    }

    .tg-realpage__actions,
    .tg-realpage__cta .adcore-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .tg-realpage .tg-btn {
        width: max-content;
        max-width: 100%;
    }

    .tg-realpage__intro {
        margin: 2.25rem auto 0;
    }

    .tg-realpage__filters {
        align-items: stretch;
        width: 100%;
        margin: 1.35rem auto 2.5rem;
    }

    .tg-realpage__filter {
        --tg-filter-pad: 0.28rem;
        align-self: stretch;
        width: 100%;
        max-width: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 0.85rem;
    }

    .tg-realpage__filter-btn {
        min-height: 2.5rem;
        padding: 0.5rem 0.9rem;
        font-size: 0.8125rem;
        letter-spacing: 0;
        scroll-snap-align: center;
    }

    .tg-realpage__mission {
        font-size: 1.2rem;
    }

    .tg-realpage__shot {
        border-radius: var(--tg-radius);
    }

    .tg-realpage__chips {
        top: auto;
        right: auto;
        bottom: 0.85rem;
        left: 0.85rem;
        flex-direction: row;
    }

    .tg-realpage__count {
        left: auto;
        right: 0.85rem;
        bottom: 0.85rem;
    }

    .tg-realpage__cta {
        padding-block: 2.25rem 5.25rem;
    }

    .tg-realpage-lb {
        --lb-pad: 0.85rem;
        --lb-side: 2.5rem;
        padding-top: calc(var(--lb-side) + 0.85rem);
    }

    .tg-realpage-lb__panel {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: minmax(0, 1fr) var(--lb-side) auto;
        gap: 0.7rem 0.5rem;
        align-items: stretch;
    }

    .tg-realpage-lb__stage,
    .tg-realpage-lb__meta {
        display: contents;
    }

    .tg-realpage-lb__figure {
        grid-column: 1 / -1;
        grid-row: 1;
        height: 100%;
        max-width: none;
        width: 100%;
    }

    .tg-realpage-lb__nav--prev {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        align-self: center;
    }

    .tg-realpage-lb__nav--next {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        align-self: center;
    }

    .tg-realpage-lb__counter {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        justify-self: center;
    }

    .tg-realpage-lb__caption {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .tg-realpage-lb.is-single .tg-realpage-lb__nav {
        display: none;
    }
}

@media (max-width: 479px) {
    .tg-realpage__title {
        font-size: 1.7rem;
    }

    .tg-realpage__filter-btn {
        padding-inline: 0.8rem;
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-realpage__hero,
    .tg-realpage__intro,
    .tg-realpage__filters,
    .tg-realpage__gallery,
    .tg-realpage__cta,
    .tg-realpage.is-in .tg-realpage__hero,
    .tg-realpage.is-in .tg-realpage__intro,
    .tg-realpage.is-in .tg-realpage__filters,
    .tg-realpage.is-in .tg-realpage__gallery,
    .tg-realpage.is-in .tg-realpage__cta,
    .tg-realpage-lb {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }

    .tg-realpage-lb__figure img,
    .tg-realpage__shot img,
    .tg-realpage__name,
    .tg-realpage__points li,
    .tg-realpage__filter-thumb,
    .tg-realpage__filter-btn,
    .tg-realpage__grid {
        transition: none;
    }

    .tg-realpage__grid.is-swap {
        opacity: 1;
        transform: none;
    }
}

.tg-realpage__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.15rem;
    margin-top: 1.15rem;
}

.tg-realpage__cats a,
.tg-realpage__cat a {
    color: var(--tg-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

.tg-realpage__cats a:hover,
.tg-realpage__cats a:focus-visible,
.tg-realpage__cat a:hover,
.tg-realpage__cat a:focus-visible {
    color: var(--tg-accent);
}

.tg-realpage__cat {
    margin: 0.85rem 0 0;
}

@media (max-width: 1023px) {
    .tg-realpage__cats {
        justify-content: center;
    }
}
