/* Portfolio Gallery Styles */
.portfolio-container {
    padding-top: 4rem;
    position: relative;
}

/* Logo Styling */
.portfolio-logo-wrapper {
    position: fixed;
    /* Fixed to stay at top right */
    top: 90px;
    /* Below the theme toggle */
    right: 20px;
    z-index: 50;
    /* Above regular content */
    pointer-events: auto;
    /* Allow link click */
}

.portfolio-logo {
    width: 150px;
    height: auto;
    transform: rotate(15deg);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.portfolio-logo:hover {
    transform: rotate(0deg) scale(1.1);
}

/* Portfolio Header */
.portfolio-box .header {
    display: flex;
    /* Keep flex but center it */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 2rem;
}

.portfolio-box .header-content {
    width: 100%;
}

.portfolio-box .header h1 {
    font-family: 'Cinzel', serif;
    /* Aesthethic serif font */
    font-size: 3rem;
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
}

.portfolio-box .subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-top: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    letter-spacing: 1px;
    display: block;
    width: 100%;
    text-align: center;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Error/Empty Logic */
.gallery-error,
.gallery-empty {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
    background: var(--surface-soft);
    border-radius: 12px;
}

.gallery-error i {
    color: #e74c3c;
    margin-right: 0.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 16 / 9;
    background-color: var(--surface-soft);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow-strong);
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Footer & Socials */
.portfolio-footer {
    margin-top: 4rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.portfolio-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .portfolio-logo-wrapper {
        position: relative;
        /* On mobile, move it back to content flow */
        top: 0;
        right: 0;
        text-align: center;
        margin-bottom: 1rem;
        display: block;
    }

    .portfolio-logo {
        width: 120px;
    }

    .portfolio-container {
        padding-top: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.8rem;
    }

    .lightbox-content {
        width: 95%;
    }
}