/* ============================================================
   portfolio.css – Portfolio Gallery Page Styles
   ============================================================ */

/* ---- Page Base ------------------------------------------- */
html,
body.portfolio-page {
    background: #0d0d0d;
    color: #fff;
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    /* allow normal scroll on this page */
}

/* ---- Header ---------------------------------------------- */
.portfolio-header {
    position: relative;
    height: 55vh;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 5rem;
    overflow: hidden;
}

.portfolio-header-bg {
    position: absolute;
    inset: 0;
    background: url('Assets/bg.jpg') center / cover no-repeat;
    filter: brightness(0.35);
    transform: scale(1.05);
    transition: transform 6s ease;
}

.portfolio-header:hover .portfolio-header-bg {
    transform: scale(1.0);
}

.portfolio-header-content {
    position: relative;
    z-index: 2;
    padding: 0 6vw;
    animation: fadeInUp 0.9s ease-out both;
}

.portfolio-eyebrow {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #d84748;
    margin-bottom: 0.75rem;
}

.portfolio-header-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 1rem;
}

.portfolio-header-content p {
    font-size: 1.15rem;
    opacity: 0.6;
    margin: 0;
    font-weight: 300;
}

/* ---- Filter Bar ------------------------------------------ */
.filter-bar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 2rem 6vw 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1.4rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.filter-btn.active {
    background: #d84748;
    border-color: #d84748;
    color: #fff;
}

/* ---- Gallery / Grid ----------------------------------- */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 2rem 6vw 4rem;
}

@media (max-width: 1100px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    background: #1a1a1a;

    /* entrance animation via JS */
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease,
        box-shadow 0.3s ease;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    object-fit: cover;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

/* Overlay on hover */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem 1.25rem 1.1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.item-category {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #d84748;
    margin-bottom: 0.3rem;
}

.gallery-item-overlay h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

/* Hidden items (filtered out) */
.gallery-item.hidden {
    display: none;
}

/* ---- Lightbox -------------------------------------------- */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.lightbox-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 901;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    max-width: 92vw;
    max-height: 90vh;
    transform: scale(0.93);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.open .lightbox-content {
    transform: scale(1);
}

.lightbox-img-wrap {
    position: relative;
    flex-shrink: 0;
    max-width: 65vw;
    max-height: 85vh;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
}

#lightboxImg {
    display: block;
    max-width: 65vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

#lightboxImg.loading {
    opacity: 0;
}

/* Spinner */
.lightbox-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lightbox-loader::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #d84748;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
}

.lightbox-loader.active::after {
    opacity: 1;
}

.lightbox-loader.error::after {
    opacity: 0;
}

.lightbox-loader.error {
    pointer-events: all;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Info Panel */
.lightbox-info {
    max-width: 260px;
    flex-shrink: 0;
}

.lightbox-category {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: #d84748;
    margin-bottom: 0.8rem;
}

.lightbox-info h2 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.lightbox-info p {
    font-size: 0.95rem;
    line-height: 1.65;
    opacity: 0.55;
    margin: 0;
}

/* Close Button */
.lightbox-close {
    position: fixed;
    top: 1.4rem;
    right: 1.6rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.2s;
    z-index: 902;
}

.lightbox-close:hover {
    background: #d84748;
    transform: rotate(90deg) scale(1.1);
}

/* Nav Arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.2s;
    z-index: 902;
}

.lightbox-nav.prev {
    left: 1.2rem;
}

.lightbox-nav.next {
    right: 1.2rem;
}

.lightbox-nav:hover {
    background: #d84748;
    transform: translateY(-50%) scale(1.1);
}

/* ---- Footer ---------------------------------------------- */
.portfolio-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 2.5rem 6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.portfolio-footer p {
    font-size: 0.9rem;
    opacity: 0.4;
    margin: 0;
}

/* ---- Responsive Lightbox --------------------------------- */
@media (max-width: 768px) {
    .lightbox-content {
        flex-direction: column;
        justify-content: center;
        gap: 1.2rem;
    }

    .lightbox-img-wrap,
    #lightboxImg {
        max-width: 90vw;
        max-height: 55vh;
    }

    .lightbox-info {
        max-width: 90vw;
        text-align: center;
    }

    .lightbox-nav.prev {
        left: 0.4rem;
    }

    .lightbox-nav.next {
        right: 0.4rem;
    }
}
