/* Masonry Layout */
.alienity-gallery-wrapper {
    display: flex;
    gap: 20px;
    position: relative;
    align-items: flex-start; /* Important for sticky */
}

.alienity-gallery {
    flex: 1;
    min-width: 0; /* Fix flex overflow */
}

.alienity-masonry {
    column-count: 4;
    column-gap: 14px;
}

@media (max-width: 1024px) {
    .alienity-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .alienity-gallery-wrapper {
        flex-direction: column;
    }
    .alienity-timeline {
        display: none; /* Hide timeline on mobile for simplicity */
    }
    .alienity-masonry {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .alienity-masonry {
        column-count: 1;
    }
}

.alienity-masonry-item {
    width: 100%;
    display: inline-block; /* Prevents breaking inside columns */
    margin-bottom: 14px;
    position: relative;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.alienity-masonry-item:hover {
    opacity: 0.9;
}

.alienity-masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.alienity-masonry-item figcaption {
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
    text-align: center;
}

/* Video Indicator */
.alienity-masonry-item.is-video .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Timeline */
.alienity-timeline {
    width: 60px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: auto;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding-top: 10px;
}

.alienity-timeline-item {
    font-size: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
    text-align: center;
    position: relative;
}

.alienity-timeline-item::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    margin: 5px auto 0;
}

.alienity-timeline-item.active {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.alienity-timeline-item.active::after {
    background: #333;
    transform: scale(1.2);
}

/* Lightbox */
.alienity-lightbox {
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    overflow: hidden;
}

.alienity-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.alienity-lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.alienity-lightbox-content img,
.alienity-lightbox-content video,
.alienity-lightbox-content iframe {
    max-width: 100%;
    max-height: 90vh;
    display: block;
}

.alienity-lightbox-content iframe {
    width: 80vw;
    height: 45vw; /* 16:9 aspect ratio approx */
}

.alienity-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
    z-index: 10;
}

.alienity-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.8);
}
