/*
Theme Name: AP Studio Architektury
Theme URI: https://apstudio.pl
Author: Aleksandra Piątek Studio Architektury
Description: Elegancki, minimalistyczny szablon dla studia architektury wnętrz
Version: 2.8.1
License: GNU General Public License v2 or later
Text Domain: ap-studio
Tags: portfolio, architecture, minimal, one-page
*/

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background-color: #ffffff;
    color: #222222;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =============================================
   SITE HEADER
============================================= */
.site-header {
    display: flex;
    align-items: center;
    padding: 28px 50px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-line {
    flex: 1;
    height: 1px;
    background-color: #222;
    margin-right: 50px;
    min-width: 80px;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 48px;
}

.main-navigation ul li a {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #888;
    transition: color 0.2s, font-weight 0.1s;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a,
.main-navigation ul li.current_page_ancestor > a {
    color: #111;
    font-weight: 700;
}

/* Hamburger mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: #222;
    transition: all 0.3s;
}

/* =============================================
   SITE CONTENT
============================================= */
.site-content {
    flex: 1 0 auto;
    min-height: 0;
}

/* =============================================
   HOME PAGE
============================================= */
body.home {
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

body.admin-bar {
    min-height: calc(100svh - 32px);
}

body.admin-bar.home {
    height: calc(100svh - 32px);
}

body.home .site-header {
    flex: 0 0 auto;
}

body.home .site-content {
    flex: 1 1 auto;
    min-height: 0;
}

body.home .site-main,
body.home .home-layout {
    height: 100%;
    min-height: 0;
}

body.home .site-footer {
    flex: 0 0 auto;
}

.home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 85px);
}

.home-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 50px 50px 50px 50px;
}

.home-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #888;
    line-height: 2.2;
}

.home-contact-box {
    display: inline-block;
    border: 1px solid #222;
    padding: 16px 28px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #222;
    margin-top: 28px;
    width: fit-content;
}

.home-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 1vw, 18px);
    overflow: hidden;
    height: 100%;
    background: #fff;
}

.home-hero-img {
    position: relative;
    overflow: hidden;
    height: 100%;
    background: #f0eeec;
}

.home-hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.025);
    transition: opacity 1.1s ease, transform 6s ease;
    will-change: opacity, transform;
}

.home-hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.home-hero-slide.is-pixel-ready {
    opacity: 1;
    transform: scale(1);
    transition: none;
}

.home-pixel-transition {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
}

.home-pixel-tile {
    position: absolute;
    display: block;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(0.22);
    transform-origin: center;
    animation: home-pixel-reveal 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: opacity, transform, filter;
}

@keyframes home-pixel-reveal {
    0% {
        opacity: 0;
        transform: scale(0.22);
        filter: saturate(0.65) brightness(1.3);
    }

    55% {
        opacity: 1;
        transform: scale(0.86);
        filter: saturate(0.85) brightness(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1.035);
        filter: none;
    }
}

.home-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.home-hero-placeholder span {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #aaa;
    text-transform: uppercase;
}

/* =============================================
   OFERTA PAGE
============================================= */
.oferta-layout {
    padding: 50px 60px 80px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: start;
}

.service-card-title {
    border: 1px solid #c0bcb8;
    padding: 28px 20px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #444;
    line-height: 2.1;
    margin-bottom: 28px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card ul {
    list-style: disc;
    padding-left: 1.3em;
}

.service-card ul li {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    font-style: italic;
    color: #555;
    line-height: 1.85;
    margin-bottom: 16px;
}

/* =============================================
   O MNIE PAGE
============================================= */
.about-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.4fr);
    gap: clamp(40px, 5vw, 70px);
    padding: clamp(28px, 5vh, 50px) 50px;
    align-items: stretch;
}

.about-photo {
    min-width: 0;
    overflow: hidden;
}

.about-photo img {
    width: 100%;
    height: 100%;
    max-height: calc(100svh - 270px);
    object-fit: cover;
}

.about-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

.about-content ul {
    list-style: disc;
    padding-left: 1.4em;
}

.about-content ul li {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(0.9rem, 1.8vh, 1.05rem);
    font-style: italic;
    color: #555;
    line-height: 1.6;
    margin-bottom: clamp(9px, 1.6vh, 16px);
}

@media (min-width: 769px) {
    .about-content ul {
        columns: 2;
        column-gap: clamp(28px, 3vw, 50px);
    }

    .about-content ul li {
        break-inside: avoid;
    }

    .about-photo > div {
        height: 100%;
        max-height: calc(100svh - 270px);
        min-height: 320px;
        padding-bottom: 0 !important;
    }
}

/* =============================================
   GALERIA PAGE
============================================= */
.gallery-layout {
    padding: 10px 50px 70px;
}

/* Override WordPress native gallery */
.gallery-layout .gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 0 !important;
}

.gallery-layout .gallery-item {
    margin: 0 !important;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.gallery-layout .gallery-icon,
.gallery-layout .gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

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

.gallery-layout .gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-layout .gallery-caption {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.8rem;
    font-style: italic;
    color: #888;
    padding: 6px 2px;
}

/* Manual gallery grid (gdy użytkownik dodaje przez ACF lub custom fields) */
.ap-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.ap-gallery-grid .ap-gallery-item {
    overflow: hidden;
    aspect-ratio: 4/3;
}

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

.ap-gallery-grid .ap-gallery-item:hover img {
    transform: scale(1.04);
}

/* =============================================
   KONTAKT PAGE
============================================= */
.kontakt-layout {
    padding: clamp(28px, 6vh, 60px) 50px clamp(32px, 7vh, 70px);
    max-width: 900px;
}

.kontakt-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #111;
    line-height: 1.55;
    margin-bottom: clamp(22px, 4vh, 40px);
}

.kontakt-intro ul {
    list-style: disc;
    padding-left: 1.4em;
    margin-bottom: clamp(22px, 4vh, 40px);
}

.kontakt-intro ul li {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    font-style: italic;
    color: #555;
    line-height: 1.8;
    margin-bottom: 14px;
}

.contact-boxes {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.contact-box-item {
    border: 1px solid #222;
    padding: 18px 36px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    color: #222;
    white-space: nowrap;
    max-width: 100%;
}

.contact-box-label {
    color: #888;
    margin-right: 10px;
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
    padding: 28px 50px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
}

.footer-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #aaa;
    line-height: 2;
}

.footer-copy {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: #ccc;
}

/* =============================================
   LIGHTBOX (Fancybox override)
============================================= */
.fancybox__container {
    z-index: 9999;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 1100px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .oferta-layout { padding: 40px 40px 60px; }
    .gallery-layout .gallery,
    .ap-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .site-header {
        padding: 18px 24px;
        flex-wrap: wrap;
        gap: 14px;
    }

    .header-line { display: none; }

    .main-navigation {
        width: 100%;
        display: none;
    }

    .main-navigation.is-open { display: block; }

    .main-navigation ul {
        flex-direction: column;
        gap: 16px;
        padding: 10px 0;
    }

    .nav-toggle { display: flex; }

    .home-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .home-right {
        height: auto;
        min-height: 0;
        order: -1;
    }

    .home-left { padding: 28px 24px; }

    .about-layout,
    .oferta-layout,
    .kontakt-layout,
    .gallery-layout {
        padding-left: 24px;
        padding-right: 24px;
    }

    .about-layout { grid-template-columns: 1fr; gap: 30px; }

    .services-grid { grid-template-columns: 1fr; gap: 36px; }

    .gallery-layout .gallery,
    .ap-gallery-grid { grid-template-columns: repeat(2, 1fr); }

    .kontakt-heading { font-size: 1rem; letter-spacing: 0.15em; }

    .contact-boxes { flex-direction: column; }

    .contact-box-item {
        width: 100%;
        padding: 16px 24px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .site-footer {
        padding: 20px 24px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        min-height: calc(100svh - 46px);
    }

    body.admin-bar.home {
        height: calc(100svh - 46px);
    }
}

@media (max-width: 480px) {
    .gallery-layout .gallery,
    .ap-gallery-grid { grid-template-columns: 1fr; }
    .home-right { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-slide {
        transition: none;
    }
}

/* =============================================
   O MNIE — JASNE TŁO I PROSTSZA TYPOGRAFIA
============================================= */
body.ap-about-page .site-content,
body.ap-about-page .about-layout {
    background: #ffffff;
}

body.ap-about-page .about-photo,
body.ap-about-page .about-photo > .about-photo-placeholder {
    background: #ffffff;
}

body.ap-about-page .about-content {
    align-self: stretch;
    padding: clamp(24px, 3.4vw, 44px);
    border: 1px solid rgba(37, 34, 31, 0.16);
    background: #f4f1ed;
}

body.ap-about-page .about-content ul {
    padding-left: 0;
    list-style: none;
    column-rule-color: rgba(37, 34, 31, 0.14);
}

body.ap-about-page .about-content ul li,
.offer-panel__details li,
.service-card ul li,
.kontakt-intro ul li {
    position: relative;
    padding-left: 18px;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.78rem, 0.86vw, 0.9rem);
    font-style: normal;
    font-weight: 300;
    letter-spacing: 0.01em;
    line-height: 1.72;
}

body.ap-about-page .about-content ul li::before {
    content: '—';
    position: absolute;
    top: 0;
    left: 0;
    color: #9a7861;
}

body.ap-about-page .about-content ul li::marker {
    content: '';
}

@media (max-width: 768px) {
    body.ap-about-page .about-content {
        padding: 24px 22px;
    }
}

/* =============================================
   OFERTA — RÓWNE PASY / VIEWPORT FIT
============================================= */
@media (min-width: 901px) {
    body.ap-offer-page {
        height: 100vh;
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    body.admin-bar.ap-offer-page {
        height: calc(100svh - 32px);
    }

    body.ap-offer-page .site-header,
    body.ap-offer-page .site-footer {
        flex: 0 0 auto;
    }

    body.ap-offer-page .site-content {
        flex: 1 1 auto;
        min-height: 0;
    }

    body.ap-offer-page .offer-page-main {
        height: 100%;
        min-height: 0;
    }
}

.offer-shell {
    --offer-ink: #25221f;
    --offer-soft: #f4f1ed;
    --offer-warm: #d8ccc0;
    --offer-dark: #2f2b28;
    --offer-accent: #9a7861;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: clamp(20px, 3vh, 36px) var(--ap-gutter) clamp(22px, 3.2vh, 38px);
}

.offer-heading {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(17px, 2.5vh, 27px);
}

.offer-heading__index {
    color: var(--offer-accent);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.offer-heading h1 {
    margin: 0;
    color: var(--offer-ink);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    line-height: 1;
    text-transform: uppercase;
}

.offer-heading__line {
    width: clamp(40px, 5vw, 78px);
    height: 1px;
    background: #d4cec7;
}

.offer-grid {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(37, 34, 31, 0.22);
}

.offer-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(86px, 0.65fr) minmax(0, 1.35fr);
    min-width: 0;
    min-height: 0;
    padding: clamp(22px, 2.7vw, 42px);
    overflow: hidden;
    border-right: 1px solid rgba(37, 34, 31, 0.22);
    background: var(--offer-soft);
    color: var(--offer-ink);
    isolation: isolate;
    transition: color 450ms ease;
}

.offer-panel:nth-child(2) {
    background: var(--offer-warm);
}

.offer-panel:last-child {
    border-right: 0;
}

.offer-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--offer-dark);
    transform: translateY(101%);
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.offer-panel:hover {
    color: #f8f4ef;
}

.offer-panel:hover::before {
    transform: translateY(0);
}

.offer-panel__meta {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.4vw, 22px);
    min-width: 0;
}

.offer-panel__number,
.offer-panel__label {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.52rem, 0.58vw, 0.6rem);
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.offer-panel__number {
    color: var(--offer-accent);
}

.offer-panel__label {
    overflow: hidden;
    color: inherit;
    opacity: 0.62;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-panel__title {
    display: flex;
    align-items: flex-end;
    min-height: 0;
    margin: 0;
    padding: clamp(22px, 3.8vh, 42px) 0 clamp(18px, 2.7vh, 28px);
    border-bottom: 1px solid rgba(37, 34, 31, 0.22);
    color: inherit;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.66rem, 0.82vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    line-height: 1.75;
    text-transform: uppercase;
}

.offer-panel:hover .offer-panel__title {
    border-color: rgba(255, 255, 255, 0.24);
}

.offer-panel__details {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 21px);
    min-height: 0;
    margin: clamp(18px, 2.8vh, 30px) 0 0;
    padding: 0;
    list-style: none;
}

.offer-panel__details li {
    position: relative;
    margin: 0;
    padding-left: 18px;
    color: inherit;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.76rem, 1.35vh, 0.88rem);
    font-style: normal;
    font-weight: 300;
    letter-spacing: 0.01em;
    line-height: 1.65;
}

.offer-panel__details li::before {
    content: '—';
    position: absolute;
    top: 0;
    left: 0;
    color: var(--offer-accent);
}

.offer-panel__mark {
    position: absolute;
    right: clamp(14px, 1.7vw, 28px);
    bottom: clamp(-22px, -1.2vw, -8px);
    z-index: -1;
    color: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(5.5rem, 9vw, 9rem);
    font-weight: 300;
    letter-spacing: -0.09em;
    line-height: 1;
    opacity: 0.16;
    pointer-events: none;
    -webkit-text-stroke: 1px rgba(50, 43, 38, 0.58);
}

.offer-panel:hover .offer-panel__mark {
    -webkit-text-stroke-color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 901px) and (max-height: 720px) {
    .offer-shell {
        padding-top: 16px;
        padding-bottom: 18px;
    }

    .offer-heading {
        margin-bottom: 14px;
    }

    .offer-panel {
        padding: 19px clamp(20px, 2.4vw, 34px);
    }

    .offer-panel__title {
        padding-top: 18px;
        padding-bottom: 15px;
    }

    .offer-panel__details {
        gap: 9px;
        margin-top: 14px;
    }

    .offer-panel__details li {
        font-size: clamp(0.76rem, 1.7vh, 0.9rem);
        line-height: 1.38;
    }
}

@media (max-width: 900px) {
    .offer-shell {
        height: auto;
        padding-top: 30px;
        padding-bottom: 54px;
    }

    .offer-grid {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .offer-panel {
        grid-template-columns: minmax(145px, 0.8fr) minmax(0, 1.2fr);
        grid-template-rows: auto auto;
        padding: 28px;
        border-right: 0;
        border-bottom: 1px solid rgba(37, 34, 31, 0.22);
    }

    .offer-panel:last-child {
        border-bottom: 0;
    }

    .offer-panel__meta {
        grid-column: 1 / -1;
        margin-bottom: 24px;
    }

    .offer-panel__title {
        align-items: flex-start;
        padding: 0 26px 0 0;
        border-right: 1px solid rgba(37, 34, 31, 0.22);
        border-bottom: 0;
    }

    .offer-panel__details {
        margin: 0;
        padding-left: 26px;
    }
}

@media (max-width: 600px) {
    .offer-panel {
        display: flex;
        flex-direction: column;
        padding: 25px 22px;
    }

    .offer-panel__meta {
        margin-bottom: 0;
    }

    .offer-panel__title {
        width: 100%;
        padding: 25px 0 19px;
        border-right: 0;
        border-bottom: 1px solid rgba(37, 34, 31, 0.22);
    }

    .offer-panel__details {
        margin-top: 21px;
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offer-panel,
    .offer-panel::before {
        transition: none;
    }
}

/* =============================================
   REALIZATIONS GALLERY + VERTICAL OFFER BANDS
============================================= */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gallery-category-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(8px, 0.8vw, 12px);
    margin-bottom: clamp(22px, 3.5vh, 38px);
}

.gallery-filter {
    min-height: 54px;
    padding: 12px 16px;
    border: 1px solid var(--ap-line);
    background: transparent;
    color: var(--ap-muted);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
    transition: color var(--ap-transition), background var(--ap-transition), border-color var(--ap-transition);
}

.gallery-filter:hover {
    border-color: var(--ap-ink);
    color: var(--ap-ink);
}

.gallery-filter.is-active {
    border-color: var(--ap-ink);
    background: var(--ap-ink);
    color: var(--ap-white);
}

.realizations-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 0.9vw, 14px);
}

.realization-gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    background: #ebe7e2;
}

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

.realization-gallery-item.is-revealed {
    animation: ap-gallery-reveal 440ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.realization-gallery-item a,
.realization-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
}

.realization-gallery-item img {
    object-fit: cover;
    transition: transform 750ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease;
}

.realization-gallery-item:hover img {
    filter: saturate(0.86);
    transform: scale(1.035);
}

@keyframes ap-gallery-reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Oferta jako trzy wysokie pasy, nawiązujące do kadrów strony głównej. */
.oferta-layout {
    padding-bottom: clamp(28px, 4.5vh, 50px);
}

.oferta-layout .page-heading {
    margin-bottom: clamp(22px, 3vh, 34px);
}

.oferta-layout .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
    border-top: 1px solid var(--ap-line);
    border-bottom: 1px solid var(--ap-line);
}

.oferta-layout .service-card {
    display: flex;
    flex-direction: column;
    min-height: clamp(420px, calc(100svh - 340px), 620px);
    padding: clamp(30px, 3.4vw, 52px);
    overflow: hidden;
    border: 0;
    border-right: 1px solid var(--ap-line);
    background: transparent;
    transition: background var(--ap-transition);
}

.oferta-layout .service-card:nth-child(2) {
    background: transparent;
}

.oferta-layout .service-card:nth-child(3) {
    background: transparent;
    border-right: 0;
}

.oferta-layout .service-card::before {
    top: clamp(24px, 3vw, 38px);
    right: clamp(28px, 3.4vw, 52px);
    left: auto;
    color: transparent;
    font-size: clamp(3.8rem, 5.7vw, 6rem);
    font-weight: 300;
    letter-spacing: -0.06em;
    line-height: 1;
    opacity: 0.72;
    -webkit-text-stroke: 1px rgba(140, 117, 99, 0.45);
}

.oferta-layout .service-card:hover {
    border-color: var(--ap-line);
    background: #f0ece7;
    transform: none;
}

.oferta-layout .service-card-title {
    min-height: 0;
    margin: clamp(88px, 12vh, 118px) 0 0;
    padding: 0 0 28px;
    border-color: var(--ap-line);
    font-size: 0.68rem;
}

.oferta-layout .service-card ul {
    margin-top: clamp(28px, 4vh, 42px);
}

.oferta-layout .service-card ul li {
    color: #494641;
    font-size: clamp(0.94rem, 1.25vw, 1.05rem);
    line-height: 1.65;
}

@media (max-width: 900px) {
    .gallery-category-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .realizations-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .oferta-layout .services-grid {
        grid-template-columns: 1fr;
    }

    .oferta-layout .service-card {
        min-height: 0;
        padding: 30px;
        border-right: 0;
        border-bottom: 1px solid var(--ap-line);
    }

    .oferta-layout .service-card:last-child {
        border-bottom: 0;
    }

    .oferta-layout .service-card::before {
        top: 24px;
        right: 30px;
        font-size: 3.8rem;
    }

    .oferta-layout .service-card-title {
        margin-top: 68px;
    }

    .oferta-layout .service-card ul {
        margin-top: 26px;
    }
}

@media (max-width: 520px) {
    .gallery-filter {
        min-height: 56px;
    }

    .realizations-gallery {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 360px) {
    .gallery-category-filters {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .realization-gallery-item.is-revealed {
        animation: none;
    }
}

/* =============================================
   VISUAL REFINEMENT
============================================= */
:root {
    --ap-ink: #1c1b19;
    --ap-muted: #77736e;
    --ap-soft: #a9a39c;
    --ap-line: #dedad4;
    --ap-paper: #fbfaf8;
    --ap-white: #ffffff;
    --ap-accent: #8c7563;
    --ap-gutter: clamp(24px, 4vw, 60px);
    --ap-transition: 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

::selection {
    background: #ded4ca;
    color: var(--ap-ink);
}

body {
    background: var(--ap-paper);
    color: var(--ap-ink);
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
    outline: 1px solid var(--ap-ink);
    outline-offset: 5px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    padding: 10px 14px;
    background: var(--ap-ink);
    color: var(--ap-white);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transform: translateY(-150%);
    transition: transform var(--ap-transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-main {
    width: 100%;
    animation: ap-page-enter 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ap-page-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.site-header {
    padding: clamp(22px, 2.2vw, 28px) var(--ap-gutter);
    background: rgba(251, 250, 248, 0.94);
    border-bottom: 1px solid rgba(222, 218, 212, 0.62);
    backdrop-filter: blur(14px);
}

.header-line {
    margin-right: clamp(28px, 4vw, 58px);
    background: linear-gradient(90deg, var(--ap-ink), var(--ap-line));
}

.main-navigation ul {
    gap: clamp(24px, 3vw, 48px);
}

.main-navigation ul li a {
    position: relative;
    display: block;
    padding: 3px 0 7px;
    color: var(--ap-muted);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    transition: color var(--ap-transition);
}

.main-navigation ul li a::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: var(--ap-ink);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--ap-transition);
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a,
.main-navigation ul li.current_page_ancestor > a {
    color: var(--ap-ink);
    font-weight: 500;
}

.main-navigation ul li a:hover::after,
.main-navigation ul li.current-menu-item > a::after,
.main-navigation ul li.current_page_item > a::after,
.main-navigation ul li.current_page_ancestor > a::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Shared page heading */
.page-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(28px, 4vh, 48px);
}

.page-heading::after {
    content: '';
    width: clamp(38px, 5vw, 76px);
    height: 1px;
    background: var(--ap-line);
}

.page-heading h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    line-height: 1;
    text-transform: uppercase;
}

.page-index {
    color: var(--ap-accent);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.14em;
}

/* Home */
.home-layout {
    grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
}

.home-left {
    padding: clamp(32px, 5vw, 64px) var(--ap-gutter);
}

.home-logo-text {
    color: var(--ap-muted);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    line-height: 2;
}

.home-contact-box {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    margin-top: 26px;
    padding: 14px 20px;
    border-color: var(--ap-line);
    background: transparent;
    color: var(--ap-ink);
    transition: color var(--ap-transition), background var(--ap-transition), border-color var(--ap-transition);
}

.home-contact-box span {
    color: var(--ap-soft);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: color var(--ap-transition);
}

.home-contact-box strong {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.12em;
}

.home-contact-box:hover {
    border-color: var(--ap-ink);
    background: var(--ap-ink);
    color: var(--ap-white);
}

.home-contact-box:hover span {
    color: #c9c4be;
}

.home-right {
    gap: clamp(14px, 1.35vw, 24px);
}

.home-hero-img {
    background: #ebe7e2;
}

/* Offer */
.oferta-layout {
    padding: clamp(34px, 5vh, 56px) var(--ap-gutter) clamp(52px, 8vh, 90px);
}

.services-grid {
    counter-reset: ap-services;
    gap: clamp(28px, 3vw, 48px);
}

.service-card {
    position: relative;
    padding-top: 22px;
    border-top: 1px solid var(--ap-line);
    counter-increment: ap-services;
    transition: border-color var(--ap-transition), transform var(--ap-transition);
}

.service-card::before {
    content: '0' counter(ap-services);
    position: absolute;
    top: 25px;
    left: 0;
    color: var(--ap-accent);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.56rem;
    letter-spacing: 0.12em;
}

.service-card:hover {
    border-color: var(--ap-ink);
    transform: translateY(-4px);
}

.service-card-title {
    min-height: 92px;
    margin: 0 0 20px;
    padding: 0 0 22px 36px;
    justify-content: flex-start;
    border: 0;
    border-bottom: 1px solid rgba(222, 218, 212, 0.75);
    color: var(--ap-ink);
    font-size: 0.64rem;
    line-height: 1.85;
    text-align: left;
}

.service-card ul {
    padding: 0;
    list-style: none;
}

.service-card ul li {
    position: relative;
    padding-left: 18px;
    color: #55514c;
    font-size: 1rem;
    line-height: 1.68;
    margin-bottom: 15px;
}

.service-card ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--ap-accent);
}

/* About */
.about-layout {
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.38fr);
    column-gap: clamp(42px, 5vw, 76px);
    row-gap: clamp(20px, 3vh, 32px);
    padding: clamp(30px, 4.5vh, 48px) var(--ap-gutter) clamp(46px, 7vh, 76px);
}

.about-layout .page-heading {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.about-photo {
    position: relative;
    background: #ebe7e2;
}

.about-photo::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.about-photo img {
    max-height: calc(100svh - 320px);
    transition: filter 700ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.about-photo:hover img {
    filter: saturate(0.86);
    transform: scale(1.012);
}

.about-photo > .about-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 320px;
    max-height: calc(100svh - 320px);
    background: #ebe7e2;
    padding: 30px;
    text-align: center;
}

.about-photo-placeholder span {
    color: var(--ap-soft);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    line-height: 2;
    text-transform: uppercase;
}

.about-content ul {
    column-rule: 1px solid rgba(222, 218, 212, 0.64);
}

.about-content ul li {
    color: #55514c;
}

.about-content ul li::marker {
    color: var(--ap-accent);
}

/* Gallery */
.gallery-layout {
    padding: clamp(30px, 4.5vh, 48px) var(--ap-gutter) clamp(52px, 7vh, 80px);
}

.gallery-layout .gallery,
.gallery-layout .wp-block-gallery,
.ap-gallery-grid {
    gap: clamp(7px, 0.8vw, 13px) !important;
}

.gallery-layout .wp-block-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    margin: 0 !important;
}

.gallery-layout .wp-block-gallery .wp-block-image {
    position: relative;
    width: auto !important;
    margin: 0 !important;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.gallery-layout .wp-block-gallery .wp-block-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-layout .wp-block-gallery .wp-block-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease;
}

.gallery-layout .gallery-item,
.ap-gallery-grid .ap-gallery-item {
    position: relative;
}

.gallery-layout .gallery-item img,
.ap-gallery-grid .ap-gallery-item img {
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease;
}

.gallery-layout .gallery-item:hover img,
.gallery-layout .wp-block-gallery .wp-block-image:hover img,
.ap-gallery-grid .ap-gallery-item:hover img {
    filter: saturate(0.84);
    transform: scale(1.035);
}

.gallery-empty {
    padding: clamp(70px, 12vh, 130px) 0;
    color: var(--ap-soft);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
}

/* Contact */
.kontakt-layout {
    width: 100%;
    max-width: 1080px;
    padding: clamp(30px, 4.5vh, 48px) var(--ap-gutter) clamp(48px, 7vh, 76px);
}

.kontakt-heading {
    max-width: 900px;
    color: var(--ap-ink);
    font-size: clamp(1.15rem, 2.1vw, 1.75rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    line-height: 1.5;
}

.kontakt-intro {
    max-width: 790px;
}

.kontakt-intro ul li {
    color: #55514c;
    font-size: 1rem;
    line-height: 1.65;
}

.contact-boxes {
    gap: 12px;
}

.contact-box-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 15px 24px;
    border-color: var(--ap-line);
    transition: color var(--ap-transition), background var(--ap-transition), border-color var(--ap-transition);
}

.contact-box-item:hover {
    border-color: var(--ap-ink);
    background: var(--ap-ink);
    color: var(--ap-white);
}

.contact-box-item:hover .contact-box-label {
    color: #c9c4be;
}

.contact-box-label {
    margin: 0;
    color: var(--ap-soft);
    transition: color var(--ap-transition);
}

/* Default content */
.default-layout {
    width: min(100%, 980px);
    padding: clamp(40px, 7vh, 80px) var(--ap-gutter);
}

.entry-title {
    margin-bottom: 30px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.entry-content > * + * {
    margin-top: 1.3em;
}

/* Footer */
.site-footer {
    padding: clamp(18px, 2.2vw, 26px) var(--ap-gutter);
    border-color: var(--ap-line);
    background: var(--ap-paper);
}

.footer-logo {
    color: var(--ap-muted);
    transition: color var(--ap-transition);
}

.footer-logo:hover {
    color: var(--ap-ink);
}

.footer-copy {
    color: var(--ap-soft);
}

@media (min-width: 901px) {
    .services-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 17px var(--ap-gutter);
    }

    .header-line {
        display: block;
        min-width: 0;
        margin-right: 18px;
    }

    .nav-toggle {
        display: flex;
        flex: 0 0 auto;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .main-navigation {
        display: block;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 500ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
    }

    .main-navigation.is-open {
        display: block;
        max-height: 420px;
        opacity: 1;
        pointer-events: auto;
    }

    .main-navigation ul {
        gap: 0;
        padding: 15px 0 5px;
        border-top: 1px solid var(--ap-line);
    }

    .main-navigation ul li a {
        padding: 10px 0;
        font-size: 0.66rem;
    }

    .main-navigation ul li a::after {
        width: 32px;
        right: auto;
    }

    .page-heading {
        margin-bottom: 28px;
    }

    .home-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .home-right {
        height: auto;
        min-height: 0;
        order: -1;
    }

    .home-left {
        padding: 20px var(--ap-gutter);
    }

    .home-logo-text {
        font-size: 0.64rem;
        line-height: 1.8;
    }

    .home-contact-box {
        gap: 14px;
        margin-top: 16px;
        padding: 11px 16px;
    }

    .about-layout {
        row-gap: 24px;
        padding-top: 30px;
        padding-bottom: 50px;
    }

    .about-layout .page-heading {
        grid-column: 1;
    }

    .about-photo img {
        height: auto;
        max-height: none;
        aspect-ratio: 4 / 5;
    }

    .about-content ul {
        column-rule: 0;
    }

    .gallery-layout .wp-block-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .service-card-title {
        min-height: 0;
    }

    .kontakt-heading br {
        display: none;
    }

    .site-footer {
        gap: 7px;
    }
}

@media (max-width: 480px) {
    .gallery-layout .wp-block-gallery {
        grid-template-columns: 1fr !important;
    }

    .page-heading::after {
        flex: 1;
        width: auto;
    }

    .contact-box-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-main {
        animation: none;
    }

    .service-card,
    .about-photo img,
    .gallery-layout img {
        transition: none;
    }
}
