/* =========================================
   1. ZMIENNE I REZETOWANIE STYLÓW (BAZA)
   ========================================= */
:root {
    --primary-black: #000000;      
    --accent-gold: #c5a059;       
    --accent-gold-hover: #e2c275; 
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --font-main: 'Inter', sans-serif;
}

html, body {
    margin: 0; padding: 0; font-family: var(--font-main);
    color: var(--white); line-height: 1.6; background-color: var(--primary-black); overflow-x: hidden;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-blue { color: var(--accent-gold) !important; }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.text-white { color: #ffffff !important; }
.mt-20 { margin-top: 20px; display: inline-block; }

/* Przyciski */
.btn { padding: 16px 35px; border-radius: 4px; font-weight: 700; letter-spacing: 1px; font-size: 0.9rem; text-decoration: none; transition: all 0.3s; text-transform: uppercase; display: inline-block; text-align: center; cursor: pointer; border: none; }
.btn-ghost { background-color: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background-color: var(--white); color: var(--primary-black); transform: translateY(-3px); }

/* =========================================
   2. LOADER
   ========================================= */
.page-loader { position: fixed !important; top: 0; left: 0; width: 100%; height: 100%; background-color: #000000 !important; z-index: 10001 !important; display: flex !important; justify-content: center; align-items: center; transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s !important; }
.page-loader.hidden { opacity: 0 !important; visibility: hidden !important; }
.loader-logo { width: 180px; max-width: 80vw; height: auto; transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out !important; }
.page-loader.hidden .loader-logo { transform: scale(0.85); opacity: 0; }

/* =========================================
   3. NAGŁÓWEK I NAWIGACJA
   ========================================= */
.main-header { position: fixed !important; top: 0 !important; left: 0 !important; width: 100% !important; z-index: 9999 !important; background-color: transparent !important; transition: height 0.3s ease-in-out, background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out !important; display: flex !important; align-items: center !important; height: 110px !important; border: none !important; outline: none !important; }
.main-header.scrolled { background-color: rgba(0, 0, 0, 0.95) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; height: 85px !important; box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important; }
.header-container { width: 100% !important; display: flex !important; justify-content: space-between !important; align-items: center !important; }
.logo a { display: flex; align-items: center; }
.header-logo-img { 
    max-height: 75px; /* Znacznie powiększone logo (wcześniej 45px) */
    width: auto; 
    transition: all 0.3s ease-in-out; 
}

.main-header.scrolled .header-logo-img { 
    max-height: 55px; /* Większe logo po zjechaniu w dół (wcześniej 35px) */
}

.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links a { color: var(--white) !important; text-decoration: none !important; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.5px; transition: color 0.3s; }
.nav-links a.active, .nav-links a:hover { color: var(--accent-gold) !important; font-weight: 800 !important; background: none !important; }

.header-socials { display: flex; gap: 20px; align-items: center; }
.header-socials .social-icon { display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease; }
.header-socials .social-icon svg { color: var(--accent-gold) !important; fill: var(--accent-gold) !important; }
.header-socials .social-icon:hover { transform: translateY(-2px); }

.hamburger { display: none; cursor: pointer; border: none; background: transparent; padding: 10px; z-index: 1001; }
.hamburger-box { width: 30px; height: 24px; display: inline-block; position: relative; }
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { width: 30px; height: 3px; background-color: var(--white); position: absolute; border-radius: 3px; transition: transform 0.3s ease, background-color 0.3s ease; }
.hamburger-inner { top: 50%; transform: translateY(-50%); }
.hamburger-inner::before { content: ''; top: -10px; left: 0; }
.hamburger-inner::after { content: ''; top: 10px; left: 0; }
.hamburger.is-active .hamburger-inner { background-color: transparent; }
.hamburger.is-active .hamburger-inner::before { transform: translateY(10px) rotate(45deg); }
.hamburger.is-active .hamburger-inner::after { transform: translateY(-10px) rotate(-45deg); }

/* =========================================
   4. HERO PODSTRONY
   ========================================= */
.subpage-hero { position: relative; height: 450px; display: flex; align-items: center; justify-content: center; text-align: center; padding-top: 80px; background-color: var(--primary-black); background-size: cover !important; background-position: center !important; border-top: none !important; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6)); z-index: 1; }
.subpage-hero-content { position: relative; z-index: 10; }
.subpage-hero h1 { color: var(--white); font-size: 3.5rem; font-weight: 800; margin-top: 10px; }
.gold-label { display: block; color: var(--accent-gold) !important; text-transform: uppercase; font-weight: 700; letter-spacing: 2px; margin-bottom: 10px; }
.section-header-centered { text-align: center; margin-bottom: 80px; }
.main-section-title { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 20px; color: var(--white); }
.gold-line-separator { width: 80px; height: 2px; background-color: var(--accent-gold); margin: 0 auto; }
.portfolio-group { padding: 100px 0; }
.dark-bg { background-color: rgb(10, 10, 10); }

/* =========================================
   5. KONTROLKI PORTFOLIO (Filtry i Widok)
   ========================================= */
.portfolio-controls-wrapper { display: flex; flex-direction: column; align-items: center; gap: 25px; margin-bottom: 60px; }
.portfolio-filters { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.filter-btn { background: transparent; color: var(--white); border: 1px solid rgba(255, 255, 255, 0.2); padding: 10px 25px; border-radius: 30px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.3s ease; }
.filter-btn:hover, .filter-btn.active { border-color: var(--accent-gold); color: var(--accent-gold); }
.portfolio-views { display: flex; align-items: center; gap: 10px; }
.view-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 2px; color: #a0a0a0; margin-right: 10px; }
.view-btn { background: transparent; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--white); width: 42px; height: 42px; border-radius: 6px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s ease; }
.view-btn svg { width: 22px; height: 22px; }
.view-btn:hover, .view-btn.active { border-color: var(--accent-gold); background-color: var(--accent-gold); color: var(--primary-black); }

/* =========================================
   6. SIATKA PROJEKTÓW I KARTY
   ========================================= */
.projects-grid { display: grid; gap: 60px; transition: opacity 0.4s ease; grid-template-columns: 1fr; }

/* BAZOWY WYGLĄD KARTY (Zabezpieczony dla telefonów) */
.project-card { 
    background-color: #11151c; 
    border: 1px solid rgba(197, 160, 89, 0.15); 
    border-radius: 12px; 
    padding: 30px 20px; 
    display: flex; 
    flex-direction: column; /* Domyślnie w pionie dla bezpieczeństwa! */
    gap: 30px; 
    width: 100%;
    box-sizing: border-box;
}

.project-card.hidden { display: none !important; }

.project-gallery, .project-info { width: 100%; box-sizing: border-box; flex: 0 0 auto; }
.main-gallery-img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; transition: opacity 0.2s ease-in-out; cursor: zoom-in; }

/* === WIDOKI DLA KOMPUTERÓW (powyżej 992px) === */
@media (min-width: 993px) {
    /* Tryb 1: Jeden pod drugim na całą szerokość */
    .projects-grid.view-mode-1 .project-card { flex-direction: row; padding: 40px; gap: 50px; }
    .projects-grid.view-mode-1 .project-card.reverse { flex-direction: row-reverse; }
    .projects-grid.view-mode-1 .project-gallery { flex: 0 0 55%; width: 55%; }
    .projects-grid.view-mode-1 .project-info { flex: 1; width: 45%; }
    .projects-grid.view-mode-1 .main-gallery-img { height: 400px; aspect-ratio: auto; }

    /* Tryb 2: Dwa obok siebie */
    .projects-grid.view-mode-2 { grid-template-columns: 1fr 1fr; gap: 40px; }
    .projects-grid.view-mode-2 .project-card { flex-direction: column; padding: 30px; gap: 30px; }
    .projects-grid.view-mode-2 .main-gallery-img { height: 320px; aspect-ratio: auto; }
}

/* =========================================
   7. WNĘTRZE KARTY (Miniatury, Opisy, 3D)
   ========================================= */
.aspect-16-9 { aspect-ratio: 16/9 !important; height: auto !important; }

.gallery-thumbnails { display: flex; gap: 15px; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--accent-gold) #1a1a1a; margin-top: 15px; }
.gallery-thumbnails::-webkit-scrollbar { height: 6px; }
.gallery-thumbnails::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 10px; }
.gallery-thumbnails::-webkit-scrollbar-thumb { background: var(--accent-gold); border-radius: 10px; }
.thumb-wrapper { flex: 0 0 calc(33.333% - 10px); position: relative; border-radius: 6px; overflow: hidden; scroll-snap-align: start; cursor: pointer; }
.thumb { width: 100%; height: 90px; object-fit: cover; display: block; opacity: 0.5; border: 2px solid transparent; transition: all 0.3s ease; border-radius: 6px; }
.thumb:hover { opacity: 0.8; }
.thumb.active { opacity: 1; border-color: var(--accent-gold); }
.thumb-wrapper::after { content: attr(data-label); position: absolute; bottom: 5px; right: 5px; background-color: rgba(0,0,0,0.8); color: var(--accent-gold); padding: 2px 8px; font-size: 0.7rem; font-weight: 700; border-radius: 3px; pointer-events: none; }

.project-category { font-size: 0.85rem; color: var(--accent-gold); font-weight: 700; letter-spacing: 1.5px; display: block; margin-bottom: 10px; text-transform: uppercase; }
.project-title { font-size: 2rem; font-weight: 800; color: var(--white); line-height: 1.2; margin-bottom: 25px; }
.project-details-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.project-details-list li { font-size: 1.05rem; color: #cccccc; line-height: 1.6; }
.project-details-list strong { color: var(--white); }
.gold-check { color: var(--accent-gold); margin-right: 8px; font-weight: bold; }

.main-image-wrapper { position: relative; width: 100%; border-radius: 8px; overflow: hidden; }
.main-image-wrapper.in-progress .main-gallery-img { filter: brightness(0.35) grayscale(40%); }
.progress-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; z-index: 5; pointer-events: none; padding: 20px;}
.main-image-wrapper:not(.in-progress) .progress-overlay { display: none; }
.progress-title { color: var(--accent-gold); font-size: 1.6rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 15px; text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8); }
.progress-date { color: var(--white); font-size: 1rem; font-weight: 600; background-color: rgba(11, 17, 26, 0.85); padding: 8px 20px; border-radius: 4px; border: 1px solid rgba(197, 160, 89, 0.3); backdrop-filter: blur(4px); }

.project-tour-container { width: 100%; margin-top: 20px; height: 0; overflow: hidden; opacity: 0; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 8px; border: 1px solid transparent; }
.project-tour-container.show { height: 500px; opacity: 1; margin-top: 30px; border-color: rgba(197, 160, 89, 0.4); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.project-tour-container iframe { width: 100%; height: 100%; border-radius: 8px; display: block; }

/* =========================================
   STATUSY MIESZKAŃ (Sprzedane, Zarezerwowane, Do sprzedaży)
   ========================================= */
.project-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -10px; /* Zbliża status do tytułu powyżej */
    margin-bottom: 25px; /* Odsuwa od listy pod spodem */
}

/* Szary - Sprzedane */
.status-sold {
    color: #9ca3af;
    background-color: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Złoty/Żółty - Zarezerwowane */
.status-reserved {
    color: var(--accent-gold);
    background-color: rgba(197, 160, 89, 0.1);
    border: 1px solid rgba(197, 160, 89, 0.3);
}

/* Zielony - Do sprzedaży */
.status-forsale {
    color: #4ade80; /* Ładny, jasny odcień zielonego */
    background-color: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
}
/* =========================================
   8. LIGHTBOX (POWIĘKSZANIE)
   ========================================= */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 21, 28, 0.98); z-index: 100000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; backdrop-filter: blur(8px); }
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-content { max-width: 90%; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8); transform: scale(0.95); transition: transform 0.3s ease; object-fit: contain; }
.lightbox.active .lightbox-content { transform: scale(1); }
.lightbox-close { position: absolute; top: 20px; right: 40px; color: #a0a0a0; font-size: 50px; font-weight: 300; cursor: pointer; transition: color 0.3s; line-height: 1; z-index: 100001; }
.lightbox-close:hover { color: var(--accent-gold); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: var(--white); font-size: 40px; font-weight: 300; cursor: pointer; user-select: none; padding: 15px 25px; transition: color 0.3s, background-color 0.3s; z-index: 100001; background: rgba(11, 17, 26, 0.4); border-radius: 8px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--accent-gold); background: rgba(11, 17, 26, 0.9); }
.lightbox-prev { left: 40px; }
.lightbox-next { right: 40px; }

/* =========================================
   9. STOPKA I SOCIAL MEDIA
   ========================================= */
.social-prompt-bar { background-color: var(--accent-gold); padding: 60px 0; color: var(--primary-black); }
.social-prompt-bar h3 { font-size: 2rem; font-weight: 800; margin-bottom: 15px; }
.social-prompt-bar p { font-size: 1.1rem; max-width: 700px; margin: 0 auto 30px auto; font-weight: 500; }
.social-prompt-links { display: flex; justify-content: center; gap: 20px; }
.social-btn { display: flex; align-items: center; gap: 10px; padding: 14px 28px; background-color: var(--primary-black); color: var(--white); border-radius: 4px; font-weight: 700; text-decoration: none; transition: transform 0.3s; }
.social-btn:hover { transform: translateY(-3px); }

.main-footer { background-color: #000000 !important; color: #9ca3af; padding: 80px 0 20px; font-size: 0.9rem; border-top: 2px solid var(--accent-gold); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.5fr; gap: 30px; margin-bottom: 60px; }
.footer-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.footer-col h3 { color: var(--white); font-size: 1rem; font-weight: 800; margin-bottom: 25px; letter-spacing: 1px; text-transform: uppercase; width: 100%; }
.about-col p { margin-bottom: 25px; line-height: 1.8; }
.footer-social-links { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-top: 20px; }
.footer-social-item { display: flex; align-items: center; gap: 12px; color: var(--accent-gold) !important; text-decoration: none; font-weight: 600; transition: all 0.3s ease; }
.footer-social-item:hover { color: var(--white) !important; transform: translateY(-3px); }
.footer-social-item svg { flex-shrink: 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; }
.footer-links li { margin-bottom: 15px; }
.footer-links a { color: #9ca3af; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: var(--white); }
.footer-contact-info { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: flex-start; }
.footer-contact-info li { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; line-height: 1.6; text-align: left; }
.footer-contact-info svg { color: var(--accent-gold); flex-shrink: 0; margin-top: 3px; }
.footer-bottom { display: flex; justify-content: center; align-items: center; padding-top: 25px; border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.8rem; }
.footer-logo-img { max-height: 55px; width: auto; }

/* Usunięcie kursora lupy dla zdjęć w trakcie realizacji */
.main-image-wrapper.in-progress .main-gallery-img {
    cursor: default !important;
}

/* =========================================
   10. MEDIA QUERIES (TELEFONY I TABLETY)
   ========================================= */

   /* === WIDOKI DLA KOMPUTERÓW (powyżej 992px) === */
@media (min-width: 993px) {
    /* Tryb 1: Jeden pod drugim na całą szerokość */
    .projects-grid.view-mode-1 .project-card { 
        flex-direction: row; 
        padding: 40px; 
        gap: 50px; 
        flex-wrap: wrap; /* KLUCZOWE: Pozwala ukrytemu oknu 3D spaść bezpiecznie do nowej linii! */
    }
    .projects-grid.view-mode-1 .project-card.reverse { 
        flex-direction: row-reverse; 
    }
    
    /* Precyzyjne ułamki - odejmujemy wielkość przerwy (gap), by elementy idealnie zmieściły się w jednej linii */
    .projects-grid.view-mode-1 .project-gallery { 
        flex: 0 0 calc(55% - 25px); 
        width: calc(55% - 25px); 
    }
    .projects-grid.view-mode-1 .project-info { 
        flex: 0 0 calc(45% - 25px); 
        width: calc(45% - 25px); 
    }
    .projects-grid.view-mode-1 .main-gallery-img { 
        height: 400px; 
        aspect-ratio: auto; 
    }

    /* Gwarancja, że po kliknięciu okno spaceru zajmie 100% szerokości pod spodem */
    .projects-grid.view-mode-1 .project-tour-container {
        flex: 0 0 100%;
    }

    /* Tryb 2: Dwa obok siebie */
    .projects-grid.view-mode-2 { grid-template-columns: 1fr 1fr; gap: 40px; }
    .projects-grid.view-mode-2 .project-card { flex-direction: column; padding: 30px; gap: 30px; }
    .projects-grid.view-mode-2 .main-gallery-img { height: 320px; aspect-ratio: auto; }
}
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* Mobilny nagłówek i menu */
    /* Nagłówek mobilny i ukrycie sociali */
    .header-socials { display: none !important; }
    .hamburger { display: block; }
    
    /* Podstawowy, zamknięty stan menu */
    .nav-links { 
        display: flex !important; 
        position: absolute !important; 
        top: 100% !important; 
        left: 0 !important; 
        width: 100% !important; 
        background-color: rgba(11, 17, 26, 0.98) !important; 
        backdrop-filter: blur(12px) !important; 
        -webkit-backdrop-filter: blur(12px) !important; 
        flex-direction: column !important; 
        gap: 0 !important; 
        padding: 0 !important; 
        margin: 0 !important; 
        max-height: 0; 
        overflow: hidden; 
        transition: max-height 0.4s ease !important; 
    }

    /* KLUCZOWA ZMIANA: Otwarte menu */
    .nav-links.is-open { 
        /* Wymusza dokładne dopasowanie do treści lub ekranu, blokuje ucinanie */
        max-height: calc(100vh - 85px) !important; 
        overflow-y: auto !important; 
        padding-bottom: 0 !important; /* Usuwa czarną dziurę na dole! */
        border-bottom: 1px solid rgba(197, 160, 89, 0.4) !important; /* Eleganckie złote odcięcie */
        box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    }

    /* Style pojedynczych zakładek */
    .nav-links li { 
        width: 100% !important; 
        height: 65px !important; 
        margin: 0 !important; 
        padding: 0 !important; 
        list-style: none !important; 
        flex-shrink: 0; 
    }
    
    .nav-links a { 
        display: flex !important; 
        justify-content: center !important; 
        align-items: center !important; 
        width: 100% !important; 
        height: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important; 
        font-size: 0.95rem !important; 
        font-weight: 700 !important; 
        color: var(--white) !important; 
        line-height: 1 !important; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important; 
        text-decoration: none !important;
    }
    
    .nav-links li:last-child a { 
        border-bottom: none !important; 
    }
    /* Nagłówki, filtry i projekty na mobilce */
    .subpage-hero h1 { font-size: 2.2rem; }
    .project-title { font-size: 1.6rem; }
    .portfolio-views { display: none !important; } /* Wyłączamy zmianę widoku */
    .portfolio-controls-wrapper { margin-bottom: 30px; }
    .filter-btn { font-size: 0.85rem; padding: 8px 16px; margin-bottom: 5px; }
    
    .project-card { padding: 20px !important; gap: 20px !important; }
    .thumb-wrapper { flex: 0 0 calc(40% - 5px); }
    .thumb { height: 80px; }
    .project-tour-container.show { height: 350px; }

    /* Lightbox */
    .lightbox-close { top: 15px; right: 20px; font-size: 40px; }
    .lightbox-prev, .lightbox-next { padding: 10px 15px; font-size: 30px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }

    /* Stopka */
    .social-prompt-links { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 50px; }
    .footer-col.contact-col h3 { text-align: center; }
    .footer-contact-info { align-items: center; text-align: center; }
}

/* =========================================
   DYNAMICZNE ROZCIĄGANIE POJEDYNCZYCH ZDJĘĆ
   ========================================= */
@media (min-width: 993px) {
    /* 1. Upewniamy się, że cała karta rozciąga obie kolumny do równej wysokości */
    .projects-grid.view-mode-1 .project-card {
        align-items: stretch !important; 
    }

    /* 2. Jeśli w galerii NIE MA diva z miniaturami, zdejmujemy sztywne ograniczenia */
    .projects-grid.view-mode-1 .project-gallery:not(:has(.gallery-thumbnails)) {
        height: auto;
    }

    /* 3. Rozciągamy wrapper (pojemnik ze zdjęciem i napisem) do 100% wysokości */
    .projects-grid.view-mode-1 .project-gallery:not(:has(.gallery-thumbnails)) .main-image-wrapper {
        flex-grow: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* 4. Zmuszamy samo zdjęcie do wypełnienia całego dostępnego miejsca */
    .projects-grid.view-mode-1 .project-gallery:not(:has(.gallery-thumbnails)) .main-gallery-img {
        flex-grow: 1;
        height: 100% !important;
        min-height: 400px;
        object-fit: cover;
    }
}