/* ============================================================
   PortfolioOS — Project Detail Page Styles
   ============================================================ */

/* ── Hero ── */
.project-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.project-hero-img-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.project-hero-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.project-hero-no-img {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}
.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10,10,15,0.95) 0%,
        rgba(10,10,15,0.6) 40%,
        rgba(10,10,15,0.2) 100%
    );
}
.project-hero-content {
    position: relative;
    z-index: 1;
    padding-bottom: 56px;
}
.project-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.project-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.project-breadcrumb a:hover { color: var(--text-secondary); }
.project-hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 14px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.project-hero-sub {
    font-size: clamp(15px, 2vw, 18px);
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    line-height: 1.6;
}

/* ── Body Layout ── */
.project-body {
    padding: 60px 0 80px;
}
.project-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

/* ── Case Study Sections ── */
.case-section {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--glass-border);
}
.case-section:last-of-type {
    border-bottom: none;
}
.case-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.case-num {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--accent-violet2);
    letter-spacing: 0.5px;
}
.case-content {
    font-size: clamp(15px, 1.8vw, 17px);
    color: var(--text-secondary);
    line-height: 1.85;
}
.case-content p { margin-bottom: 16px; }
.case-content p:last-child { margin-bottom: 0; }

/* ── Gallery ── */
.project-gallery { margin-top: 16px; }
.gallery-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
}
.gallery-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-img { transform: scale(1.06); }
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,15,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    color: #fff;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* ── Prev/Next Nav ── */
.project-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}
.project-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
    color: var(--text-secondary);
}
.project-nav-btn:hover {
    background: var(--glass-bg2);
    border-color: var(--glass-border2);
    color: var(--text-primary);
    transform: translateX(-3px);
}
.project-nav-btn-right:hover { transform: translateX(3px); }
.project-nav-btn-right { justify-content: flex-end; text-align: right; }
.project-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.project-nav-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-nav-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    justify-content: center;
}
.project-nav-all:hover {
    color: var(--text-primary);
    border-color: var(--glass-border2);
}

/* ── Sidebar ── */
.project-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Meta card */
.project-meta-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.meta-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.meta-row:last-child { border-bottom: none; }
.meta-key {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    width: 80px;
    flex-shrink: 0;
    padding-top: 1px;
}
.meta-val {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}
.meta-link {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s;
}
.meta-link:hover { color: var(--accent-cyan2); }

/* Tools */
.tools-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tag {
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 10px;
    background: var(--glass-bg2);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    color: var(--text-secondary);
}

/* CTA card */
.project-cta-card {
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(6,182,212,0.05));
    border: 1px solid rgba(124,58,237,0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.project-cta-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.project-cta-sub {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

/* ── Related Section ── */
.related-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding-top: 60px;
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox.open { display: flex; }

.lb-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lb-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: block;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.lb-caption {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 12px;
    text-align: center;
}
.lb-close {
    position: fixed;
    top: 20px; right: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 501;
}
.lb-close:hover { background: rgba(255,255,255,0.2); }
.lb-prev, .lb-next {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 501;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.18); }
.lb-counter {
    position: fixed;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .project-layout { grid-template-columns: 1fr; gap: 32px; }
    .project-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .project-meta-card, .project-cta-card { flex: 1; min-width: 260px; }
    .project-hero { min-height: 50vh; }
}
@media (max-width: 640px) {
    .project-nav { grid-template-columns: 1fr 1fr; }
    .project-nav-all { display: none; }
    .gallery-grid { grid-template-columns: 1fr 1fr; }
    .project-sidebar { flex-direction: column; }
}
