/* ========================================
   MASONRY GALLERY STYLES
   ======================================== */

/* Masonry container */
.gallery-masonry {
    column-count: 3;
    column-gap: 20px;
    margin: 2rem 0;
    padding: 0;
}

/* Masonry items */
.gallery-masonry .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    break-inside: avoid; /* Prevent items from breaking across columns */
    margin-bottom: 20px; /* Space between items vertically */
    display: inline-block;
    width: 100%;
}

.gallery-masonry .gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Image container */
.gallery-masonry .gallery-item figure {
    margin: 0;
    position: relative;
    overflow: hidden;
}

.gallery-masonry .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.3s ease;
}

.gallery-masonry .gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.05);
}

/* Lightbox integration */
.gallery-masonry .lightbox-image {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 0;
    overflow: hidden;
}

.gallery-masonry .lightbox-image:hover {
    text-decoration: none;
}

/* Responsive breakpoints for masonry */
@media screen and (max-width: 768px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 15px;
        margin: 1.5rem 0;
    }
    
    .gallery-masonry .gallery-item {
        margin-bottom: 15px;
    }
    
    .gallery-masonry .gallery-item:hover {
        transform: translateY(-4px);
    }
}

@media screen and (max-width: 480px) {
    .gallery-masonry {
        column-count: 1;
        column-gap: 12px;
        margin: 1rem 0;
    }
    
    .gallery-masonry .gallery-item {
        margin-bottom: 12px;
    }
}

@media screen and (min-width: 1200px) {
    .gallery-masonry {
        column-count: 4;
        column-gap: 24px;
    }
    
    .gallery-masonry .gallery-item {
        margin-bottom: 24px;
    }
}

/* ========================================
   SWIPER GALLERY STYLES
   ======================================== */

/* Core Swiper Structure */
.featured-notes-swiper {
    width: 100%;
    height: auto;
    position: relative;
    margin: 0;
    padding: 0;
    overflow: hidden;
    
    /* Keep visible but ensure proper stacking context */
    visibility: visible;
    opacity: 1;
    isolation: isolate; /* Create new stacking context */
    z-index: 1; /* Ensure proper layering */
}

/* Focus management for keyboard navigation */
.swiper[tabindex]:focus {
    outline: 2px solid rgba(254, 209, 0, 0.6);
    outline-offset: 4px;
    border-radius: 12px;
}

.swiper[tabindex]:focus-visible {
    outline: 2px solid rgba(254, 209, 0, 0.8);
    outline-offset: 4px;
    border-radius: 12px;
}

.featured-notes-swiper .swiper-wrapper {
    align-items: stretch;
}

/* Hide scrollbar for Webkit browsers */
.featured-notes-swiper .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

.featured-notes-swiper .swiper-slide {
    flex-shrink: 0; /* Required for Swiper */
    height: auto; /* Allow content to dictate height */
    width: auto; /* Let Swiper handle width */
    position: relative;
    overflow: hidden; /* Hide anything that spills out */
    border-radius: 12px;
}

/* Ensure featured notes images are fully visible */
.featured-notes-swiper .swiper-slide img,
.featured-notes-swiper .swiper-slide figure,
.featured-notes-swiper .swiper-slide .image {
    opacity: 1 !important;
    transform: none !important;
}

.featured-notes-swiper .swiper-slide .image {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.featured-notes-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.3s ease;
}

.featured-notes-swiper .swiper-slide:hover img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.05);
}

.featured-notes-swiper .swiper-slide:active img {
    transform: scale(1.02);
    transition: transform 0.15s ease;
}

/* ========================================
   UNIFIED GLASSMORPHIC NAVIGATION
   ======================================== */

/* Navigation buttons - UNIFIED GLASSMORPHIC STYLING */
.featured-notes-swiper .swiper-button-next,
.featured-notes-swiper .swiper-button-prev,
.swiper:not(.swiper-lightbox) .swiper-button-next,
.swiper:not(.swiper-lightbox) .swiper-button-prev,
.glightbox-container .gclose,
.glightbox-container .gnext,
.glightbox-container .gprev,
.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
    position: absolute !important;
    top: 50% !important;
    width: 50px !important;
    height: 50px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(15px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(15px) saturate(1.5) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    color: white !important;
    opacity: 0.6 !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    will-change: transform, opacity, background-color !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10002 !important;
    transform: translateY(-50%) !important;
}

.featured-notes-swiper .swiper-button-next:hover,
.featured-notes-swiper .swiper-button-prev:hover,
.swiper:not(.swiper-lightbox) .swiper-button-next:hover,
.swiper:not(.swiper-lightbox) .swiper-button-prev:hover,
.glightbox-container .gclose:hover,
.glightbox-container .gnext:hover,
.glightbox-container .gprev:hover,
.glightbox-clean .gclose:hover,
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
    opacity: 0.8 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    transform: translateY(-50%) scale(1.05) !important;
}

.featured-notes-swiper .swiper-button-next:active,
.featured-notes-swiper .swiper-button-prev:active,
.swiper:not(.swiper-lightbox) .swiper-button-next:active,
.swiper:not(.swiper-lightbox) .swiper-button-prev:active,
.glightbox-container .gclose:active,
.glightbox-container .gnext:active,
.glightbox-container .gprev:active,
.glightbox-clean .gclose:active,
.glightbox-clean .gnext:active,
.glightbox-clean .gprev:active {
    transform: translateY(-50%) scale(0.95) !important;
    transition: transform 0.1s ease !important;
}

/* Remove default Swiper arrows */
.featured-notes-swiper .swiper-button-next::after,
.featured-notes-swiper .swiper-button-prev::after,
.swiper:not(.swiper-lightbox) .swiper-button-next::after,
.swiper:not(.swiper-lightbox) .swiper-button-prev::after {
    content: none;
}

/* Position homepage arrows */
.featured-notes-swiper .swiper-button-prev,
.swiper:not(.swiper-lightbox) .swiper-button-prev {
    left: 10px;
}

.featured-notes-swiper .swiper-button-next,
.swiper:not(.swiper-lightbox) .swiper-button-next {
    right: 10px;
}

/* Position lightbox arrows */
.glightbox-container .gprev,
.glightbox-clean .gprev {
    left: 20px !important;
}

.glightbox-container .gnext,
.glightbox-clean .gnext {
    right: 20px !important;
}

.glightbox-container .gclose,
.glightbox-clean .gclose {
    top: 20px !important;
    right: 20px !important;
    transform: none !important;
}

/* SVG Icon Styling - UNIFIED */
.featured-notes-swiper .swiper-button-next svg,
.featured-notes-swiper .swiper-button-prev svg,
.swiper:not(.swiper-lightbox) .swiper-button-next svg,
.swiper:not(.swiper-lightbox) .swiper-button-prev svg,
.glightbox-container .gclose svg,
.glightbox-container .gnext svg,
.glightbox-container .gprev svg,
.glightbox-clean .gclose svg,
.glightbox-clean .gnext svg,
.glightbox-clean .gprev svg {
    width: 24px !important;
    height: 24px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* Override GLightbox's fill on path elements */
.glightbox-clean .gclose path,
.glightbox-clean .gnext path,
.glightbox-clean .gprev path,
.glightbox-container .gclose path,
.glightbox-container .gnext path,
.glightbox-container .gprev path {
    fill: none !important;
}

/* Lucide icon styling - UNIFIED */
.featured-notes-swiper .swiper-button-next [data-lucide],
.featured-notes-swiper .swiper-button-prev [data-lucide],
.swiper:not(.swiper-lightbox) .swiper-button-next [data-lucide],
.swiper:not(.swiper-lightbox) .swiper-button-prev [data-lucide],
.glightbox-clean .gclose [data-lucide],
.glightbox-clean .gnext [data-lucide],
.glightbox-clean .gprev [data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    color: white;
}

/* ========================================
   LIGHTBOX INTEGRATION
   ======================================== */

/* Instagram-style pagination */
.instagram-pagination {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 999999;
    pointer-events: none;
    align-items: center;
}

.pagination-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    display: block;
    flex-shrink: 0;
}

.pagination-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Hide default GLightbox elements */
.glightbox-clean .gslide-title,
.glightbox-clean .gslide-desc,
.glightbox-clean .gslide-description {
    display: none;
}

/* Project overlay for swiper slides */
.featured-notes-swiper .swiper-slide:hover .project-overlay {
    opacity: 1;
}

/* ========================================
   CUSTOM LIGHTBOX STYLES
   ======================================== */

.custom-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgb(0, 0, 0);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    isolation: isolate;
}

.custom-lightbox-overlay .lightbox-swiper {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
}

.custom-lightbox-overlay .swiper-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.custom-lightbox-overlay .swiper-wrapper {
    align-items: center;
    justify-content: center;
}

.custom-lightbox-overlay .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    filter: blur(1px) brightness(0.7);
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.custom-lightbox-overlay .swiper-slide-active {
    opacity: 1;
    filter: blur(0px) brightness(1);
}

.custom-lightbox-overlay .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.custom-lightbox-overlay .lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px) saturate(1.5);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.custom-lightbox-overlay .lightbox-close:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.custom-lightbox-overlay .lightbox-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================
   SIMPLE LIGHTBOX MODAL
   ======================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent any content from bleeding through */
    overflow: hidden;
    /* Ensure complete coverage */
    isolation: isolate;
}

.lightbox-overlay.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure proper isolation during transitions */
    isolation: isolate;
    will-change: transform, opacity;
    /* Prevent any content bleeding during transitions */
    overflow: hidden;
    border-radius: 8px;
}

.lightbox-header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10006; /* Higher than pagination and navigation */
    padding: 20px;
    pointer-events: none; /* Allow clicks to pass through header to close button */
}

.lightbox-close {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px) saturate(1.5);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10005; /* Higher than pagination */
    pointer-events: auto;
    position: relative;
}

.lightbox-close:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.lightbox-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.lightbox-swiper {
    width: 100%;
    height: 100%;
}

.lightbox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, filter 0.4s ease;
    opacity: 0.3;
    filter: blur(1px) brightness(0.7);
}

.lightbox-swiper .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.3s ease;
}

/* Active slide styling */
.lightbox-swiper .swiper-slide-active {
    opacity: 1;
    filter: blur(0px) brightness(1);
}

/* Mobile adjustments for peek effect */
@media screen and (max-width: 768px) {
    .lightbox-swiper .swiper-slide {
        opacity: 0.2;
        filter: blur(0.5px) brightness(0.8);
    }
    
    .lightbox-swiper .swiper-slide-active {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }
}

.lightbox-swiper .swiper-slide-active img {
    opacity: 1;
}

/* Swiper zoom containers */
.swiper-zoom-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-zoom-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Lightbox navigation buttons */
#lightbox-next,
#lightbox-prev {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px) saturate(1.5);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: white;
    opacity: 0.7;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transform: translateY(-50%);
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

#lightbox-next:hover,
#lightbox-prev:hover {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-50%) scale(1.05);
}

#lightbox-prev {
    left: 20px;
}

#lightbox-next {
    right: 20px;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Mobile - Hide navigation arrows */
@media screen and (max-width: 768px) {
    .featured-notes-swiper .swiper-button-next,
    .featured-notes-swiper .swiper-button-prev,
    .swiper:not(.swiper-lightbox) .swiper-button-next,
    .swiper:not(.swiper-lightbox) .swiper-button-prev {
        display: none;
    }
    
    /* Mobile swiper improvements for centered peek effect */
    .featured-notes-swiper {
        overflow: visible !important;
        padding: 0 48px !important;
    }

    .featured-notes-swiper .swiper-wrapper {
        padding: 0;
    }

    .featured-notes-swiper .swiper-slide {
        opacity: 0.7;
        transform: scale(0.9);
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        filter: blur(1px);
    }

    .featured-notes-swiper .swiper-slide-active {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }

    .featured-notes-swiper .swiper-slide .image {
        height: 300px;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1023px) {
    .featured-notes-swiper .swiper-slide .image {
        height: 320px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .featured-notes-swiper .swiper-slide .image {
        height: 400px;
    }
}

/* Mobile responsive improvements */
@media screen and (max-width: 768px) {
    /* Fix for swapped hero on mobile */
    .hero .columns.is-swapped .image-column-base {
        order: 1 !important;
    }

    .hero .columns.is-swapped .nav-column-base,
    .hero .columns .nav-column-base {
        order: 2 !important;
    }

    /* General mobile hero layout */
    .hero .columns {
        flex-direction: column;
    }
    
    .featured-image-container {
        height: auto;
        margin-bottom: 1.5rem;
    }

    .featured-image-container img {
        max-height: 300px;
        width: 100%;
        object-fit: cover;
    }

    /* Disable drag-related styles on mobile */
    .nav-column-base,
    .nav-column-base.is-scaled-down {
        transform: none !important;
    }
    
    .nav-column-base * {
        pointer-events: auto !important;
        -webkit-user-select: auto !important;
        user-select: auto !important;
    }
} 