﻿/* ============================================================
   Portfolio Gallery - Site Side Styles
   ============================================================ */

/* ---------- Portfolio Grid ---------- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-card {
    display: block;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

    .portfolio-card.reveal-in {
        opacity: 1;
        transform: translateY(0);
    }

    .portfolio-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
        color: inherit;
        text-decoration: none;
    }

.portfolio-thumb {
    position: relative;
    width: 100%;
    height: 260px;
    background-size: cover;
    background-position: center;
    background-color: #f3f4f6;
    overflow: hidden;
}

    .portfolio-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
        display: block;
    }

.portfolio-card:hover .portfolio-thumb img,
.portfolio-card:hover .portfolio-thumb {
    transform: scale(1.08);
}

.portfolio-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.portfolio-cat {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #11998e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(6px);
}

.portfolio-view-count {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    z-index: 2;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.portfolio-body {
    padding: 1.4rem 1.5rem 1.5rem;
}

.portfolio-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1rem;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 12px;
    color: #9ca3af;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

    .portfolio-meta span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .portfolio-meta i {
        color: #11998e;
    }

/* ---------- Empty State ---------- */
.portfolio-empty {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

    .portfolio-empty i {
        font-size: 64px;
        color: #d1d5db;
        margin-bottom: 20px;
    }

    .portfolio-empty h3 {
        color: #374151;
        margin-bottom: 10px;
    }

    .portfolio-empty p {
        color: #9ca3af;
    }

/* ---------- Detail Page: Hero ---------- */
.portfolio-detail-hero {
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 80px 0;
    color: #fff;
    margin-bottom: 0;
}

    .portfolio-detail-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(17, 153, 142, 0.85), rgba(56, 239, 125, 0.75));
        z-index: 1;
    }

    .portfolio-detail-hero > * {
        position: relative;
        z-index: 2;
    }

.portfolio-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 14px;
    margin-top: 1rem;
}

    .portfolio-detail-meta span {
        display: flex;
        align-items: center;
        gap: 6px;
        opacity: 0.95;
    }

    .portfolio-detail-meta i {
        font-size: 13px;
    }

/* ---------- Detail Page: Main Content ---------- */
.portfolio-detail-container {
    max-width: 1320px;
    margin: -60px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.portfolio-detail-card {
    background: #fff;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

/* ---------- Main Image Display ---------- */
.portfolio-main-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #0f0f1a;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    cursor: zoom-in;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.portfolio-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.35s ease;
    display: block;
    opacity: 1;
}

    .portfolio-main-image.fade-out {
        opacity: 0;
    }

.portfolio-main-image-wrap:hover .portfolio-main-image {
    transform: scale(1.02);
}

.portfolio-main-image-wrap .zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(6px);
    opacity: 0.85;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.portfolio-main-image-wrap:hover .zoom-hint {
    opacity: 1;
}

/* ---------- Image Navigation Arrows ---------- */
.portfolio-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #11998e;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
}

.portfolio-main-image-wrap:hover .portfolio-nav-arrow {
    opacity: 1;
}

.portfolio-nav-arrow:hover {
    background: #11998e;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.portfolio-nav-arrow.prev {
    left: 15px;
}

.portfolio-nav-arrow.next {
    right: 15px;
}

.portfolio-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---------- Image Counter ---------- */
.portfolio-image-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    z-index: 5;
}

/* ---------- Thumbnails Strip ---------- */
.portfolio-thumbs-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 4px 15px;
    scrollbar-width: thin;
    scrollbar-color: #11998e #e5e7eb;
}

    .portfolio-thumbs-strip::-webkit-scrollbar {
        height: 6px;
    }

    .portfolio-thumbs-strip::-webkit-scrollbar-track {
        background: #e5e7eb;
        border-radius: 10px;
    }

    .portfolio-thumbs-strip::-webkit-scrollbar-thumb {
        background: #11998e;
        border-radius: 10px;
    }

.portfolio-thumb-item {
    flex: 0 0 auto;
    width: 100px;
    height: 75px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.65;
    position: relative;
    background: #f3f4f6;
}

    .portfolio-thumb-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

    .portfolio-thumb-item:hover {
        opacity: 1;
        transform: translateY(-3px);
        border-color: rgba(17, 153, 142, 0.4);
    }

        .portfolio-thumb-item:hover img {
            transform: scale(1.1);
        }

    .portfolio-thumb-item.active {
        opacity: 1;
        border-color: #11998e;
        transform: translateY(-3px);
        box-shadow: 0 4px 15px rgba(17, 153, 142, 0.35);
    }

    .portfolio-thumb-item.is-main::after {
        content: '★';
        position: absolute;
        top: 3px;
        right: 3px;
        background: #ffc107;
        color: #212529;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

/* ---------- Portfolio Info Sidebar ---------- */
.portfolio-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 14px;
    border-right: 4px solid #11998e;
}

.portfolio-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .portfolio-info-item .label {
        font-size: 12px;
        color: #6b7280;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .portfolio-info-item .value {
        font-size: 15px;
        color: #1a1a2e;
        font-weight: 600;
    }

        .portfolio-info-item .value a {
            color: #11998e;
            text-decoration: none;
            word-break: break-all;
        }

            .portfolio-info-item .value a:hover {
                text-decoration: underline;
            }

/* ---------- Content Styling ---------- */
.portfolio-content {
    font-size: 1.02rem;
    line-height: 2.1;
    color: #374151;
}

    .portfolio-content h2,
    .portfolio-content h3,
    .portfolio-content h4 {
        color: #1a1a2e;
        margin: 2rem 0 1rem;
        font-weight: 700;
    }

    .portfolio-content p {
        margin-bottom: 1.2rem;
    }

    .portfolio-content img {
        max-width: 100%;
        height: auto;
        border-radius: 12px;
        margin: 1.5rem 0;
    }

/* ---------- CTA Back Button ---------- */
.portfolio-back-cta {
    text-align: center;
    margin: 3rem 0;
}

    .portfolio-back-cta a {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 14px 32px;
        background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
        color: #fff;
        text-decoration: none;
        border-radius: 30px;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(17, 153, 142, 0.35);
    }

        .portfolio-back-cta a:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(17, 153, 142, 0.5);
            color: #fff;
        }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.96);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

    .lightbox-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.lightbox-content {
    position: relative;
    max-width: 92vw;
    max-height: 85vh;
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image {
    max-width: 92vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    user-select: none;
    transition: opacity 0.3s ease;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    opacity: 0.9;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-close {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100001;
    backdrop-filter: blur(6px);
}

    .lightbox-close:hover {
        background: #dc3545;
        border-color: #dc3545;
        transform: rotate(90deg) scale(1.1);
    }

.lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100001;
    backdrop-filter: blur(6px);
}

    .lightbox-arrow:hover {
        background: #11998e;
        border-color: #11998e;
        transform: translateY(-50%) scale(1.15);
    }

    .lightbox-arrow.prev {
        left: 25px;
    }

    .lightbox-arrow.next {
        right: 25px;
    }

.lightbox-counter {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    backdrop-filter: blur(6px);
    z-index: 100001;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-thumb {
        height: 220px;
    }

    .portfolio-detail-container {
        padding: 0 12px;
        margin-top: -40px;
    }

    .portfolio-detail-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .portfolio-main-image-wrap {
        aspect-ratio: 4 / 3;
        border-radius: 12px;
    }

    .portfolio-nav-arrow {
        width: 38px;
        height: 38px;
        font-size: 14px;
        opacity: 1;
    }

    .lightbox-arrow {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

        .lightbox-arrow.prev {
            left: 8px;
        }

        .lightbox-arrow.next {
            right: 8px;
        }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .portfolio-thumb-item {
        width: 80px;
        height: 60px;
    }

    .portfolio-info-grid {
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .portfolio-card,
    .portfolio-thumb img,
    .portfolio-main-image,
    .portfolio-thumb-item,
    .lightbox-content,
    .lightbox-image {
        transition: none !important;
    }
}
