/* ==========================================
   GALLERY PAGE STYLES
   ========================================== */

/* Page Header - tylko tlo galerii (struktura wspolna w main.css) */
.page-header-bg {
    background-image: url('../img/IMG_20240411_121251.jpg');
}

/* Filter Section */
.gallery-filter {
    background: var(--bg-light);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--bg-gray);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.filter-info h2 {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.filter-info p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.filter-buttons {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.85rem;
    border: 2px solid var(--bg-gray);
    border-radius: var(--radius-full);
    background: var(--bg-white);
    color: var(--text-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: var(--text-dark);
}

/* Gallery Section */
.gallery-section {
    padding: var(--spacing-xl) 0;
    background: var(--bg-white);
}

/* Masonry Grid */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    grid-auto-flow: dense;
}

.gallery-photo {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 350px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    background: var(--bg-gray);
}

.gallery-photo:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.gallery-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.gallery-photo:hover img {
    transform: scale(1.1);
}

/* Photo Overlay */
.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-md);
    opacity: 0;
    transition: var(--transition-normal);
}

.gallery-photo:hover .photo-overlay {
    opacity: 1;
}

.photo-info {
    color: var(--text-light);
}

.photo-info h3 {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.photo-info p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-zoom {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
    transform: scale(0.8);
}

.gallery-photo:hover .btn-zoom {
    opacity: 1;
    transform: scale(1);
}

.btn-zoom:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.btn-zoom svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-light);
    transition: stroke var(--transition-fast);
}

.btn-zoom:hover svg {
    stroke: var(--text-dark);
}

/* Hiding filtered items */
.gallery-photo.hidden {
    display: none;
}

/* ==========================================
   LIGHTBOX
   ========================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.lightbox-caption {
    text-align: center;
    color: var(--text-light);
    margin-top: var(--spacing-sm);
    font-size: 1.1rem;
}

.lightbox-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(90deg);
    color: var(--text-dark);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-prev {
    left: var(--spacing-md);
}

.lightbox-next {
    right: var(--spacing-md);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-light);
    transition: stroke var(--transition-fast);
}

.lightbox-prev:hover svg,
.lightbox-next:hover svg {
    stroke: var(--text-dark);
}

/* ==========================================
   SEKCJA OPISOWA (SEO) POD GALERIA
   ========================================== */

.gallery-seo {
    background: var(--bg-light);
    padding: var(--spacing-xl) 0;
}

.gallery-seo-inner {
    max-width: 820px;
    margin: 0 auto;
}

.gallery-seo h2 {
    font-family: var(--font-primary);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: var(--spacing-md);
    line-height: 1.25;
}

.gallery-seo p {
    color: var(--text-gray);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-sm);
}

.gallery-seo a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.gallery-seo a:hover {
    color: var(--text-dark);
}

/* ==========================================
   REALIZACJE TEASER SECTION
   ========================================== */

.realizacje-teaser {
    background: var(--bg-light);
    padding: var(--spacing-xl) 0;
    position: relative;
}

.teaser-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.teaser-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: #C0BCBC;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.teaser-icon svg {
    width: 40px;
    height: 40px;
    stroke: #000;
    stroke-width: 2;
}

.teaser-content h2 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.teaser-content p {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.teaser-features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    flex-wrap: wrap;
}

.teaser-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.teaser-feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.teaser-feature svg {
    width: 24px;
    height: 24px;
    stroke: #000;
    flex-shrink: 0;
}

.teaser-feature span {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--text-dark);
}

.teaser-content .btn-hero {
    margin-top: var(--spacing-md);
    display: inline-flex;
    align-items: center;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

@media (max-width: 1024px) {
    .gallery-masonry {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .filter-buttons {
        justify-content: center;
    }

    .gallery-filter {
        position: static;
    }

    .gallery-masonry {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .gallery-photo {
        height: 300px;
    }

    .teaser-content h2 {
        font-size: 2rem;
    }

    .teaser-features {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .teaser-feature {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .lightbox-prev {
        left: var(--spacing-xs);
    }

    .lightbox-next {
        right: var(--spacing-xs);
    }

    .lightbox-close {
        top: var(--spacing-xs);
        right: var(--spacing-xs);
    }
}

@media (max-width: 600px) {
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .lightbox-content img {
        max-height: 70vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev svg,
    .lightbox-next svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .teaser-content h2 {
        font-size: 1.75rem;
    }

    .teaser-content p {
        font-size: 1rem;
    }
}

/* Odslanianie zdjec po kolei przy scrollu.
   Klasy dodaje js/gallery.js: najpierw .reveal-init (chowa), potem .visible
   (pokazuje) gdy zdjecie wejdzie w ekran. Bez JS klasy nie wchodza, wiec
   zdjecia sa normalnie widoczne (tresc nie znika, gdy JS padnie).
   Tylko opacity - transform zostaje wolny dla efektu hover (uniesienie). */
.gallery-photo.reveal-init {
    opacity: 0;
    transition: none; /* poczatkowe ukrycie natychmiast - bez migniecia */
}

.gallery-photo.reveal-init.visible {
    opacity: 1;
    /* animuj samo pojawienie; transform/box-shadow zostaja dla efektu hover */
    transition: opacity 0.45s ease, transform var(--transition-normal), box-shadow var(--transition-normal);
}
