/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightbox-image {
    display: none;
    width: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transition: none;
    will-change: transform;
    transform: translateZ(0);
}

.lightbox.active .lightbox-image {
    display: block;
}

/* Gallery container styles */
.gallery-container {
    display: none;
}

.gallery img {
    display: none;
}

/* Make frame containers clickable */
[data-gallery] {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 1000;
}

.lightbox-nav button {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

.lightbox-nav button.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-nav button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.lightbox-nav button:active {
    transform: scale(0.95);
}

.lightbox-nav button i {
    font-size: 1.2em;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1rem;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.lightbox.active .lightbox-caption {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
        background: rgba(0, 0, 0, 0.85);
        padding: 20px;
        gap: 15px;
    }

    .lightbox-nav {
        left: 0;
        width: 100%;
        padding: 0 40px;
        box-sizing: border-box;
    }

    .lightbox-nav button {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        background: rgba(0, 0, 0, 0.7);
    }

    .lightbox-nav button i {
        font-size: 1.4em;
    }

    .lightbox-image {
        max-height: 60vh; /* This will be overridden by JS for landscape */
        object-fit: contain;
        margin: 0 auto;
        display: block;
        transition: none;
        will-change: transform;
        transform: translateZ(0);
        border-radius: var(--border-radius);
    }

    .lightbox-caption {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: none;
        overflow-y: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-top: 10px;
        font-size: 0.9rem;
        color: white;
        border-radius: 0;
    }
}

/* Landscape specific adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .lightbox-content {
        padding: 15px;
        gap: 10px;
    }

    .lightbox-caption {
        margin-top: 5px;
        font-size: 0.85rem;
    }
} 