/**
 * PyziTheme - portfolio.css (pyzitheme/assets/css/portfolio.css)
 * 
 * Styl dla portfolio, galerii wyrobów
 *
 * @package     PyziTheme
 * @subpackage  Assets/CSS
 * @author      Patryk Kowalski <p.kowalski@kamikstudio.pl>
 * @copyright   2025 KamikStudio & PyziPyzi
 * @license     Proprietary
 * @version     1.0.0
 * @since       1.0.0
 * 
 * Client: PyziPyzi - Domowe wyroby cukiernicze
 * Website: https://pyzipyzi.pl
 * 
 * This file is part of PyziTheme.
 * Unauthorized copying or distribution is prohibited.
 */

/* ========================================
   1. Hero Section
   ======================================== */

.portfolio-hero {
    background: #f5f0e8;
    padding: 50px 0 40px;
    text-align: center;
    border-bottom: 1px solid #e5d9cc;
}

.portfolio-title {
    font-size: 42px;
    font-weight: 700;
    color: #5e341c;
    margin: 0 0 15px;
    font-family: 'Playfair Display', serif;
}

.portfolio-subtitle {
    font-size: 16px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   2. Layout Container - SZERSZY
   ======================================== */

.portfolio-container {
    max-width: 1600px; /* ZMIENIONE z 1400px na 1600px */
    margin: 0 auto;
    padding: 60px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.portfolio-layout {
    display: grid;
    grid-template-columns: 1fr 280px; /* ZMIENIONE z 300px na 280px */
    gap: 40px; /* ZMIENIONE z 60px na 40px */
    align-items: start;
}

/* ========================================
   3. Portfolio Content - 3 KOLUMNY
   ======================================== */

.portfolio-content {
    min-width: 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 KOLUMNY */
    gap: 20px; /* ZMIENIONE z 24px na 20px */
    grid-auto-flow: dense;
}

@media (min-width: 1400px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* Wymuszaj 3 kolumny */
    }
}

/* ========================================
   4. Portfolio Item
   ======================================== */

.portfolio-item {
    position: relative;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: hidden;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.portfolio-item-inner {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
}

.portfolio-item.tall {
    grid-row: span 2;
}

.portfolio-item.tall .portfolio-item-inner {
    padding-bottom: 200%;
}

.portfolio-item.wide {
    grid-column: span 2;
}

.portfolio-item.wide .portfolio-item-inner {
    padding-bottom: 50%;
}

/* ========================================
   5. Portfolio Image
   ======================================== */

.portfolio-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-radius: 16px;
}

/* ========================================
   6. Hover Overlay
   ======================================== */

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(94, 52, 28, 0) 0%,
        rgba(94, 52, 28, 0.85) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    z-index: 2;
    border-radius: 16px;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-info {
    color: #fff;
    margin-bottom: 10px;
}

.portfolio-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

.portfolio-desc {
    font-size: 14px;
    margin: 0 0 10px;
    line-height: 1.5;
    opacity: 0.95;
}

.portfolio-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.portfolio-date svg {
    flex-shrink: 0;
}

/* ========================================
   7. Lightbox Button
   ======================================== */

.portfolio-lightbox-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #ef6341;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(239, 99, 65, 0.4);
    padding: 0;
}

.portfolio-item:hover .portfolio-lightbox-btn {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.portfolio-lightbox-btn:hover {
    background: #ef6341;
    border-color: #ef6341;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 99, 65, 0.6);
}

.portfolio-lightbox-btn svg {
    width: 24px;
    height: 24px;
    stroke: #ef6341;
    fill: none;
    transition: stroke 0.3s ease;
    display: block;
}

.portfolio-lightbox-btn:hover svg {
    stroke: #fff;
}

/* ========================================
   8. Sidebar (PRAWY - 20%)
   ======================================== */

.portfolio-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.portfolio-filters {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.filters-title {
    font-size: 20px;
    font-weight: 700;
    color: #5e341c;
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f0e8;
    position: relative;
}

.filters-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #ef6341;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.filter-list li {
    margin: 0;
}

.filter-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f5f0e8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #5e341c;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-align: left;
}

.filter-btn:hover {
    background: #ef6341;
    color: white;
    transform: translateX(5px);
}

.filter-btn.active {
    background: #ef6341;
    color: white;
}

.filter-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.filter-name {
    flex: 1;
    text-align: left;
}

.filter-count {
    background: white;
    color: #5e341c;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.filter-btn.active .filter-count,
.filter-btn:hover .filter-count {
    background: rgba(255,255,255,0.9);
    color: #ef6341;
}

.filter-info {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f5f0e8;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #999;
    line-height: 1.5;
}

.filter-info svg {
    flex-shrink: 0;
    margin-top: 2px;
    stroke: #ef6341;
}

/* ========================================
   9. Lightbox Modal - NAPRAWIONE BUTTONY
   ======================================== */

.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 100000;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    text-align: center;
    color: #fff;
    max-width: 600px;
}

#lightbox-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
}

#lightbox-desc {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    color: #fff;
}

/* Lightbox Buttons - TEKST ZAMIAST SVG */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed; /* ZMIENIONE z absolute na fixed */
    background: rgba(239, 99, 65, 0.95);
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100002;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: #d55431;
    transform: scale(1.15);
}

/* Close button - X */
.lightbox-close {
    top: 30px;
    right: 30px;
}

.lightbox-close::before {
    content: "×";
    font-size: 42px;
    line-height: 1;
}

/* Previous button - < */
.lightbox-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.15);
}

.lightbox-prev::before {
    content: "‹";
    font-size: 48px;
    line-height: 1;
}

/* Next button - > */
.lightbox-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.15);
}

.lightbox-next::before {
    content: "›";
    font-size: 48px;
    line-height: 1;
}

/* Ukryj SVG (jeśli są) */
.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
    display: none;
}

/* ========================================
   10. Empty State
   ======================================== */

.portfolio-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.portfolio-empty svg {
    margin-bottom: 20px;
}

.portfolio-empty h2 {
    font-size: 28px;
    color: #5e341c;
    margin: 0 0 10px;
    font-family: 'Playfair Display', serif;
}

.portfolio-empty p {
    font-size: 16px;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   11. Load More
   ======================================== */

.portfolio-load-more {
    margin-top: 50px;
    text-align: center;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: #ef6341;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 99, 65, 0.3);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.load-more-btn:hover {
    background: #d55431;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 99, 65, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-info {
    margin-top: 14px;
    font-size: 14px;
    color: #999;
}

.load-more-info span {
    font-weight: 700;
    color: #ef6341;
}

/* ========================================
   12. Responsive - Tablet
   ======================================== */

@media (max-width: 1200px) { /* ZMIENIONE z 1024px na 1200px */
    .portfolio-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .portfolio-sidebar {
        position: static;
        order: -1;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolumny na tablecie */
        gap: 20px;
    }

    .portfolio-item.wide {
        grid-column: span 1;
    }
}

/* ========================================
   13. Responsive - Mobile
   ======================================== */

@media (max-width: 768px) {
    .portfolio-hero {
        padding: 40px 20px 35px;
    }

    .portfolio-title {
        font-size: 32px;
    }

    .portfolio-subtitle {
        font-size: 14px;
    }

    .portfolio-container {
        padding: 40px 20px;
    }

    .portfolio-filters {
        padding: 25px 20px;
    }

    .filter-btn {
        padding: 11px 14px;
        font-size: 13px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .portfolio-item.tall {
        grid-row: span 1;
    }

    .portfolio-overlay {
        padding: 16px;
    }

    .portfolio-name {
        font-size: 16px;
    }

    .portfolio-desc {
        font-size: 13px;
    }

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

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    #lightbox-image {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .portfolio-title {
        font-size: 28px;
    }
}

/* ========================================
   14. Accessibility
   ======================================== */

.portfolio-item:focus-visible,
.filter-btn:focus-visible,
.portfolio-lightbox-btn:focus-visible {
    outline: 2px solid #ef6341;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Filter: Hidden items */
.portfolio-item.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Smooth transition when filtering */
.portfolio-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-item:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}