body.portfolio-page {
    background: #fff;
    color: #111;
}

.portfolio-page #navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px);
    border-color: #eee !important;
    padding-top: 28px !important;
    padding-bottom: 28px !important;
}

@media (min-width: 768px) {
    .portfolio-page #navbar {
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }
}

.portfolio-page #navbar,
.portfolio-page #mobile-menu a {
    color: #111;
}

.portfolio-page .nav-dot { color: #ccc; }
.portfolio-page .nav-menu a::after { background: #5B7FFF; }

.portfolio-main {
    padding-top: 160px;
    padding-bottom: 100px;
}

@media (min-width: 768px) {
    .portfolio-main {
        padding-top: 180px;
        padding-bottom: 120px;
    }
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 24px;
}

@media (max-width: 1024px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .portfolio-grid { grid-template-columns: 1fr; gap: 32px 0; }
}

.portfolio-item {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    width: 100%;
}

.portfolio-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f0f0f0;
}

.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-thumb img {
    transform: scale(1.03);
    opacity: 0.92;
}

.portfolio-title {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #222;
    font-weight: 400;
    word-break: keep-all;
}

/* Lightbox */
.portfolio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.portfolio-lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-inner {
    width: 100%;
    max-width: 1100px;
    padding: 60px 24px 24px;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 2;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-title {
    color: #fff;
    text-align: center;
    font-size: 14px;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    user-select: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-prev { left: -8px; }
.lightbox-next { right: -8px; }

@media (max-width: 768px) {
    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }
}

.lightbox-counter {
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-top: 16px;
}

.lightbox-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 0 12px;
}

.lightbox-thumb {
    width: 64px;
    height: 48px;
    border: 2px solid transparent;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
    padding: 0;
    background: none;
}

.lightbox-thumb.active {
    border-color: #5B7FFF;
    opacity: 1;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
