/* ===================== */
/* PORTFOLIO PAGES STYLES */
/* ===================== */

/* Portfolio Hero Section */
.portfolio-hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    contain: layout style paint;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('src/backlavori/backlavori.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: grayscale(100%) contrast(120%);
}

.hero-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: var(--color-text-light);
    text-align: center;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(18px) saturate(110%);
    -webkit-backdrop-filter: blur(18px) saturate(110%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 50px 60px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.hero-overlay:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05),
        0 0 40px rgba(255, 255, 255, 0.05);
    transform: translate(-50%, -50%) scale(1.02);
}

.hero-overlay h1 {
    font-size: 72px;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(
        135deg,
        var(--color-cta) 0%,
        var(--color-bg-dark-alt) 50%,
        var(--color-cta) 100%
    );
    backdrop-filter: blur(15px) saturate(120%);
    -webkit-backdrop-filter: blur(15px) saturate(120%);
    color: var(--color-cta-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: none;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02);
    text-decoration: none;
}

.view-btn::before {
    content: '🌙';
    font-size: 18px;
}

.view-btn:hover {
    background: linear-gradient(
        135deg,
        var(--color-bg-dark-alt) 0%,
        var(--color-cta) 50%,
        var(--color-bg-dark-alt) 100%
    );
    border: 1px solid var(--color-accent);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05),
        0 0 25px rgba(255, 255, 255, 0.08);
}

/* Portfolio Gallery - NUOVO LAYOUT A CASCATA */
.portfolio-gallery {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-dark-alt) 50%, #1a2d2b 100%);
    min-height: 100vh;
    contain: layout style paint;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    contain: layout style;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 60px;
    align-items: stretch;
}

.gallery-item {
    position: relative;
    border-radius: 25px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-out;
    cursor: pointer;
    height: 600px;
    display: flex;
    flex-direction: column;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout style;
}

.gallery-item:nth-child(odd) {
    transform: translateY(30px);
}

.gallery-item:nth-child(even) {
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.item-image {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: filter 0.3s ease-out;
    position: relative;
    filter: grayscale(30%) contrast(110%);
    flex-shrink: 0;
    will-change: filter;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.gallery-item:hover .item-image {
    filter: grayscale(0%) contrast(120%);
}

.item-content {
    padding: 25px;
    color: var(--color-text-light);
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.4);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-content h3 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.item-content p {
    font-size: 15px;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 20px;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Liquid Glass Effects */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.15) 100%
    );
    z-index: 1;
    border-radius: 25px;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-overlay {
        padding: 30px 40px;
    }
    
    .hero-overlay h1 {
        font-size: 48px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .gallery-item {
        transform: none !important;
        height: 500px;
    }
    
    .gallery-item:hover {
        transform: translateY(-5px) scale(1.01) !important;
        transition: transform 0.2s ease-out !important;
    }
    
    .item-image {
        height: 250px;
    }
    
    .item-content {
        padding: 20px;
    }
    
    .item-content h3 {
        font-size: 20px;
    }
}

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

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

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

.lightbox-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease-out;
}

.lightbox-image.fade {
  opacity: 0;
  transition: opacity 0.5s;
}
.lightbox-image {
  opacity: 1;
  transition: opacity 0.5s;
}

.lightbox-thumbnails {
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 60px;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lightbox-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.thumbnail:hover {
    transform: scale(1.1);
    border-color: var(--color-accent);
}

.thumbnail.active {
    border-color: var(--color-text-light);
    transform: scale(1.1);
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-text-light);
    font-size: 20px;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-nav.thumb-prev {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.lightbox-nav.thumb-next {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-text-light);
    font-size: 24px;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--color-text-light);
    font-size: 14px;
    z-index: 10;
} 