/* =========================================================
   CONTAINER LAYOUTS & BULLETPROOF FALLBACKS
   ========================================================= */
.prime-gallery-grid { 
    display: grid; 
    width: 100%; 
    /* SAFETY NET: If Elementor fails to load dynamic columns, use these so it never overflows! */
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
}

/* Tablet Fallback */
@media (max-width: 1024px) {
    .prime-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile Fallback */
@media (max-width: 768px) {
    .prime-gallery-grid { grid-template-columns: 1fr; }
}

.prime-gallery-carousel { overflow: hidden; width: 100%; position: relative; padding-bottom: 40px; }
.prime-gallery-carousel .swiper-wrapper { display: flex; box-sizing: content-box; }
.prime-gallery-carousel .swiper-slide { flex-shrink: 0; box-sizing: border-box; }

/* =========================================================
   ITEM SIZING & ASPECT RATIO LOCK
   ========================================================= */
.prime-gallery-item { 
    display: block; 
    width: 100%; 
    height: 100%; /* Forces item to respect grid boundaries */
    min-width: 0; 
    min-height: 0; 
    position: relative; 
}

.prime-gallery-item-inner {
    position: relative; 
    overflow: hidden; 
    border-radius: 8px;
    background: #1a2a40; 
    display: block; 
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3; /* The clean, modern way to keep boxes uniform */
    min-width: 0;
}

.prime-gallery-item-inner a { position: absolute; inset: 0; display: block; width: 100%; height: 100%; text-decoration: none; z-index: 5; }

/* SEO Image Sizing */
.prime-gallery-img {
    position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important;
    object-fit: cover !important; object-position: center !important; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    margin: 0 !important; padding: 0 !important;
}

/* The Dark Overlay */
.prime-gallery-item-inner a::before {
    content: ""; position: absolute; inset: 0; background-color: rgba(26, 42, 64, 0.4);
    opacity: 0; transition: opacity 0.4s ease; z-index: 10;
}
.prime-gallery-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; z-index: 20; }

/* Hover Elements */
.prime-gallery-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5); opacity: 0; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); color: #fff; font-size: 32px; }
.prime-gallery-icon svg { width: 32px; fill: #fff; }
.prime-gallery-text { transform: translateY(20px); opacity: 0; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.prime-gallery-title { color: #fff; margin: 0; font-size: 20px; font-weight: 600; }

/* Hover Animations */
.prime-gallery-item-inner:hover .prime-gallery-img { transform: scale(1.08); }
.prime-gallery-item-inner:hover a::before { opacity: 1; }
.prime-gallery-item-inner:hover .prime-gallery-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.prime-gallery-item-inner:hover .prime-gallery-text { opacity: 1; transform: translateY(0); }

/* =========================================================
   CAROUSEL NAVIGATION (ARROWS & DOTS)
   ========================================================= */
.prime-gallery-carousel .swiper-button-prev,
.prime-gallery-carousel .swiper-button-next {
    display: none !important; /* Hides Swiper's ugly default double-arrows */
}

.prime-slider-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 45px; height: 45px;
    background-color: rgba(26, 42, 64, 0.9); display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; z-index: 10; transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.prime-slider-nav svg { width: 14px; fill: #ffffff; transition: fill 0.3s ease; }
.prime-slider-nav:hover { background-color: #ff5a00; transform: translateY(-50%) scale(1.1); }
.prime-gallery-prev { left: 15px; }
.prime-gallery-next { right: 15px; }
.prime-slider-nav.swiper-button-disabled { opacity: 0; pointer-events: none; }

.prime-gallery-pagination { text-align: center; margin-top: 20px; position: absolute; bottom: 0; left: 0; width: 100%; z-index: 10; }
.prime-gallery-pagination .swiper-pagination-bullet {
    width: 10px; height: 10px; background-color: rgba(26, 42, 64, 0.3); display: inline-block;
    opacity: 1; margin: 0 5px; border-radius: 50%; transition: all 0.3s ease; cursor: pointer;
}
.prime-gallery-pagination .swiper-pagination-bullet-active { background-color: #ff5a00; width: 25px; border-radius: 5px; }

/* =========================================================
   POPUP LIGHTBOX ARROWS (NATIVE SVG OVERRIDE)
   ========================================================= */
.elementor-lightbox .elementor-swiper-button-prev, .elementor-lightbox .elementor-swiper-button-next,
.elementor-lightbox .swiper-button-prev, .elementor-lightbox .swiper-button-next {
    display: flex !important; opacity: 1 !important; visibility: visible !important; z-index: 99999 !important;
    background-color: rgba(26, 42, 64, 0.8) !important; border-radius: 4px !important; width: 50px !important; height: 50px !important;
    background-size: 20px !important; background-position: center !important; background-repeat: no-repeat !important; transition: background-color 0.3s ease !important; pointer-events: auto !important;
}
.elementor-lightbox .elementor-swiper-button-prev, .elementor-lightbox .swiper-button-prev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='%23ffffff' d='M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z'/%3E%3C/svg%3E") !important; }
.elementor-lightbox .elementor-swiper-button-next, .elementor-lightbox .swiper-button-next { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='%23ffffff' d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E") !important; }
.elementor-lightbox .elementor-swiper-button-prev:hover, .elementor-lightbox .elementor-swiper-button-next:hover { background-color: #ff5a00 !important; }
.elementor-lightbox .elementor-swiper-button-prev svg, .elementor-lightbox .elementor-swiper-button-next svg, .elementor-lightbox .elementor-swiper-button-prev i, .elementor-lightbox .elementor-swiper-button-next i { display: none !important; }