/* ================= VARIABLES ================= */
:root {
    --primary: #2563eb;
    --dark: #0f172a;
    --gray: #64748b;
    --light-gray: #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-xl: 0 30px 80px rgba(0,0,0,0.2);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= RESET ================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
}

/* ================= WRAPPER ================= */
.detail-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* ================= HEADER ================= */
.detail-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 20px 0;
    letter-spacing: -1px;
    line-height: 1.2;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-meta {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.meta-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

/* ================= COVER IMAGE ================= */
.cover-container {
    position: relative;
    margin: 0 auto 80px;
    max-width: 1200px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cover {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.cover-container:hover .cover {
    transform: scale(1.05);
}

.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.cover-container:hover .cover-overlay {
    opacity: 1;
}

/* ================= CONTENT LAYOUT ================= */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

/* ================= TEXT SECTION ================= */
.detail-text {
    animation: fadeInLeft 0.8s ease 0.3s both;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.text-container {
    position: sticky;
    top: 100px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.05);
}

.intro {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--dark);
    margin: 0 0 30px 0;
}

.divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
    margin: 30px 0;
    border-radius: 2px;
}

.description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray);
    margin: 0;
    white-space: pre-line;
}

/* ================= GALLERY SECTION ================= */
.detail-gallery {
    animation: fadeInRight 0.8s ease 0.4s both;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gallery-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 30px 0;
}

.detail-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.image-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.image-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.image-card:hover img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 🔥 INI YANG BIKIN KLIK TEMBUS KE GAMBAR */
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    font-size: 2.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-card:hover .zoom-icon {
    transform: scale(1);
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 1.1rem;
}

/* ================= LIGHTBOX ================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

/* Header with back button and close */
.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.lightbox-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.lightbox-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.lightbox-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Main content area */
.lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 100px 80px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
    user-select: none;
}

.lightbox-content img:active {
    cursor: grabbing;
}

@keyframes zoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Navigation buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Footer with counter */
.lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: 25px;
    background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.lightbox-counter {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* ================= RESPONSIVE LIGHTBOX ================= */
@media (max-width: 900px) {
    .lightbox-content {
        padding: 80px 60px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
}

@media (max-width: 600px) {
    .lightbox-header {
        padding: 20px;
    }
    
    .lightbox-back {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-content {
        padding: 70px 20px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-footer {
        padding: 20px;
    }
    
    .lightbox-counter {
        font-size: 0.85rem;
        padding: 8px 18px;
    }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
    .detail-content {
        gap: 60px;
    }
}

@media (max-width: 900px) {
    .detail-wrapper {
        padding: 40px 30px 80px;
    }

    .detail-content {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .text-container {
        position: static;
        padding: 30px;
    }

    .cover-container {
        margin-bottom: 50px;
    }
}

@media (max-width: 600px) {
    .detail-wrapper {
        padding: 30px 20px 60px;
    }

    .detail-header {
        margin-bottom: 35px;
    }

    .text-container {
        padding: 25px;
    }

    .intro {
        font-size: 1.15rem;
    }

    .description {
        font-size: 1rem;
    }

    .detail-images {
        grid-template-columns: 1fr;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}