/* ========================================
   LIGHTBOX GALLERY STYLES
   Simple Image Carousel Modal
   ======================================== */

.lightbox-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 22000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-smooth);
}

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

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lightbox-close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    /* Increased opacity from 0.05 */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* More visible border */
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999 !important;
    /* Higher than content and inline styles */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* Added shadow for depth */
}

.lightbox-close:hover {
    background: rgba(183, 110, 121, 0.3);
    border-color: rgba(183, 110, 121, 0.6);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-title {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--white);
    text-align: center;
    z-index: 10;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(212, 175, 55, 1) 50%,
            rgba(255, 255, 255, 0.8) 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gleamShine 3s linear infinite;
}

#lightbox-carousel-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 1;
}

.lightbox-image-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-nav {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 3rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    flex-shrink: 0;
}

.lightbox-nav:hover {
    background-color: var(--rose-gold);
    border-color: var(--rose-gold);
    transform: scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.lightbox-instructions {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.lightbox-instructions p {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .lightbox-title {
        top: 25px;
        font-size: 1.5rem;
    }

    #lightbox-carousel-container {
        width: 95%;
        height: 70vh;
        gap: 20px;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2.5rem;
    }

    .lightbox-counter {
        bottom: 80px;
        font-size: 0.9rem;
    }

    .lightbox-instructions {
        bottom: 20px;
    }

    .lightbox-instructions p {
        font-size: 0.7rem;
    }
}

/* ========================================
   MAGAZINE MODAL & FLIPBOOK STYLES
   ======================================== */

.magazine-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.magazine-modal.active {
    display: flex;
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.modal-close:hover {
    background: rgba(183, 110, 121, 0.3);
    border-color: rgba(183, 110, 121, 0.6);
    transform: rotate(90deg) scale(1.1);
}

.modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    z-index: 50;
}

.book-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flip-book {
    transition: transform 0.3s ease;
    transform-origin: center;
}

.flip-book.loaded {
    animation: bookFadeIn 0.8s ease forwards;
}

@keyframes bookFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Magazine Toolbar */
.magazine-toolbar {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn:hover {
    background: rgba(183, 110, 121, 0.3);
    border-color: rgba(183, 110, 121, 0.6);
    transform: translateY(-2px);
}

.page-counter {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    padding: 0 10px;
}

/* Magazine Cards */
.magazine-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.magazine-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(183, 110, 121, 0.4);
    box-shadow: 0 20px 60px rgba(183, 110, 121, 0.2);
}

.magazine-cover {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.magazine-card:hover .magazine-cover {
    transform: scale(1.05);
}

.magazine-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.95), transparent);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.magazine-card:hover .magazine-info {
    transform: translateY(0);
}

.magazine-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.read-btn {
    display: inline-block;
    padding: 10px 25px;
    background: rgba(183, 110, 121, 0.3);
    border: 1px solid rgba(183, 110, 121, 0.6);
    border-radius: 25px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.read-btn:hover {
    background: rgba(183, 110, 121, 0.5);
    transform: translateX(5px);
}

/* Responsive Magazine Modal */
@media (max-width: 768px) {
    .modal-close {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .magazine-toolbar {
        bottom: 20px;
        padding: 12px 20px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .toolbar-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .page-counter {
        font-size: 0.8rem;
    }

    .magazine-card {
        max-width: 300px;
    }

    .magazine-title {
        font-size: 1.2rem;
    }
}