/* Ultra Premium Media Gallery Styles */

/* 1. Base Variables & Animations */
:root {
    --gold-primary: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Grid Container - Masonry Layout */
.media-grid-container {
    column-count: 3;
    column-gap: 30px;
    margin-top: 4rem;
    padding-bottom: 5rem;
}

@media (max-width: 1024px) {
    .media-grid-container {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .media-grid-container {
        column-count: 1;
        column-gap: 20px;
    }
}

/* 3. The Premium Media Card */
.media-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0; 
    animation: floatUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transition: all 0.4s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    
    break-inside: avoid;
    margin-bottom: 30px;
    display: block;
}

.media-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: all 0.4s ease;
}

.media-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 25px var(--gold-glow);
    border-color: rgba(212, 175, 55, 0.3);
}

.media-card:hover::before {
    background: linear-gradient(135deg, var(--gold-primary), transparent);
}

/* 4. Media Elements inside the Card */
.media-card img, 
.media-card video {
    width: 100%;
    /* Remove fixed height so images show their full natural aspect ratio */
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Ensure video cards don't collapse before metadata loads */
.media-card video {
    min-height: 200px;
    object-fit: cover;
    background: #0a0a10;
}

.media-card:hover img,
.media-card:hover video {
    transform: scale(1.08);
}

/* 5. Stunning Overlay for Captions */
.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(5, 5, 10, 0.95), rgba(5, 5, 10, 0.7) 60%, transparent);
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 60%;
}

.media-card:hover .media-overlay {
    transform: translateY(0);
}

.media-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border-left: 3px solid var(--gold-primary);
    padding-left: 10px;
}

/* 6. Play Icon for Videos */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(10, 10, 15, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(8px);
}

.media-card:hover .play-icon {
    color: var(--gold-primary);
    background: rgba(10, 10, 15, 0.7);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px var(--gold-glow);
}

/* 7. The Cinematic Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.98);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(15px);
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255,255,255,0.05);
}

.lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.lightbox-close:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
    transform: rotate(90deg);
    background: rgba(212, 175, 55, 0.1);
}

.lightbox-caption {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 100001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

/* 8. Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--gold-primary);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    .lightbox-prev { left: 15px; }
    .lightbox-next { right: 15px; }
    .lightbox-close { top: 20px; right: 20px; width: 40px; height: 40px; font-size: 1.2rem; }
}

/* =============================================
   MACHINES LAUNCHED — Uniform Equal-Size Grid
   ============================================= */

.machines-uniform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 4rem;
    padding-bottom: 5rem;
}

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

@media (max-width: 640px) {
    .machines-uniform-grid {
        grid-template-columns: 1fr;
    }
}

/* Force every card in the machines grid to the same height */
.machines-uniform-grid .media-card {
    margin-bottom: 0;
    break-inside: unset;
    height: 380px;
    background: #0d0d1a;   /* dark fill for any letterbox space */
    display: flex;
    align-items: center;
    justify-content: center;
}

.machines-uniform-grid .media-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* show full image — no cropping */
    object-position: center;
    padding: 12px;             /* small breathing room around image */
}

