/* =========================================================
   REALIZACJE PODSTRONA — Termo Garaż
   Galeria kafelków ze specyfikacją. Lightbox kadru.
   ========================================================= */

body:has(.tg-realpage__hero) {
    padding-top: 0;
}

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

.tg-realpage__hero,
.tg-realpage__intro,
.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__gallery {
    animation: tg-rise 0.72s var(--tg-ease-out) 0.14s forwards;
}

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

/* ——— Hero ——— */

.tg-realpage__hero {
    position: relative;
    display: grid;
    height: clamp(22rem, 50vh, 32rem);
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
    background-color: #101010;
    color: #fff;
}

.tg-realpage__photo,
.tg-realpage__scrim,
.tg-realpage__hero-inner {
    grid-area: 1 / 1;
    min-height: 0;
}

.tg-realpage__photo,
.tg-realpage__scrim {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tg-realpage__photo {
    display: block;
    object-fit: cover;
    object-position: 50% 42%;
}

.tg-realpage__scrim {
    background:
        linear-gradient(180deg, rgba(7, 7, 7, 0.62) 0%, rgba(7, 7, 7, 0.38) 28%, rgba(7, 7, 7, 0.42) 48%, rgba(7, 7, 7, 0.93) 100%);
    pointer-events: none;
}

.tg-realpage__hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    height: 100%;
    box-sizing: border-box;
    text-align: center;
    padding-block: calc(var(--header-height, 4rem) + clamp(0.5rem, 1.5vh, 0.85rem)) clamp(1.5rem, 3.2vh, 2rem);
}

.tg-realpage__eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 0 0 1.1rem;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tg-faint);
}

.tg-realpage__hero .tg-realpage__eyebrow {
    color: rgba(245, 245, 247, 0.72);
}

.tg-realpage__eyebrow::before,
.tg-realpage__eyebrow::after {
    content: "";
    width: clamp(1.5rem, 4vw, 2.5rem);
    height: 1px;
    background-color: var(--tg-line-strong);
}

.tg-realpage__hero .tg-realpage__eyebrow::before,
.tg-realpage__hero .tg-realpage__eyebrow::after {
    background-color: rgba(245, 245, 247, 0.35);
}

.tg-realpage__title {
    margin: 0 0 clamp(1.5rem, 3.2vh, 1.85rem);
    max-width: 14em;
    font-size: clamp(2.05rem, 4.4vw, 3.15rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

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

.tg-realpage__hero .tg-link {
    color: rgba(245, 245, 247, 0.78);
}

.tg-realpage__hero .tg-link:hover,
.tg-realpage__hero .tg-link:focus-visible {
    color: #fff;
}

/* ——— Intro ——— */

.tg-realpage__intro {
    max-width: 40rem;
    margin: clamp(5.5rem, 11vh, 8rem) auto clamp(3.5rem, 7vh, 4.75rem);
    text-align: center;
}

.tg-realpage__intro .tg-realpage__eyebrow {
    margin: 0 0 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;
}

/* ——— 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);
}

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

.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: var(--tg-ink);
    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: var(--tg-ink);
    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: 0.975rem;
    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: var(--tg-ink);
    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: var(--tg-ink);
}

.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: var(--tg-faint);
    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 {
        height: auto;
        min-height: clamp(22rem, 50vh, 32rem);
    }

    .tg-realpage__scrim {
        background:
            linear-gradient(
                180deg,
                rgba(7, 7, 7, 0.74) 0%,
                rgba(7, 7, 7, 0.46) 24%,
                rgba(7, 7, 7, 0.58) 52%,
                rgba(7, 7, 7, 0.98) 100%
            );
    }

    .tg-realpage__hero-inner {
        justify-content: center;
        padding-block: calc(var(--header-height, 4rem) + 0.5rem) 1.5rem;
    }

    .tg-realpage__intro {
        margin: clamp(4.25rem, 8vh, 6rem) auto clamp(2.75rem, 5.5vh, 3.5rem);
    }

    .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__hero-inner {
        padding-block: calc(var(--header-height, 4rem) + 0.45rem) 1.35rem;
    }

    .tg-realpage__title {
        font-size: 1.75rem;
        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: 5.5rem auto 3.5rem;
    }

    .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__points li {
        font-size: 0.9375rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-realpage__hero,
    .tg-realpage__intro,
    .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__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 {
        transition: none;
    }
}
