/* Import Google font 'Lato' for use throughout the gallery block */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

/* Import TT Ramillas font for headings and year display */
@font-face{
    font-family: "TT Ramillas W03 Regular";
    src: url("../../fonts/311f6b683b69b2e481bec0dc7c27d412.eot");
    src: url("../../fonts/311f6b683b69b2e481bec0dc7c27d412.eot?#iefix")format("embedded-opentype"),
        url("../../fonts/311f6b683b69b2e481bec0dc7c27d412.woff")format("woff"),
        url("../../fonts/311f6b683b69b2e481bec0dc7c27d412.woff2")format("woff2"),
        url("../../fonts/311f6b683b69b2e481bec0dc7c27d412.ttf")format("truetype"),
        url("../../fonts/311f6b683b69b2e481bec0dc7c27d412.svg#TT Ramillas W03 Regular")format("svg");
    font-weight:normal;
    font-style:normal;
    font-display:swap;
}

/* Scroll-triggered Animations */
.segib20_gallery__left-column,
.segib20_gallery__right-column,
.segib20_gallery__slider-container {
    opacity: 0;
    transform: translateY(20px);
    transition-property: opacity, transform;
    transition-timing-function: ease-out;
    will-change: opacity, transform; /* Hint for browser optimization */
}

.segib20_gallery__left-column {
    transition-duration: 0.5s;
}

.segib20_gallery__right-column {
    transition-duration: 0.5s;
    transition-delay: 0.2s;
}

.segib20_gallery__slider-container {
    transition-duration: 0.7s;
    transition-delay: 0.4s;
}

.segib20_gallery__left-column.is-visible,
.segib20_gallery__right-column.is-visible,
.segib20_gallery__slider-container.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reset for block */
.wp-block-acf-segib20_gallery {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'Lato', sans-serif;
}

/* Container styles */
.segib20_gallery__container {
    box-sizing: border-box;
    margin: 0 auto;
    padding: 30px 0;
    width: 100%;
    max-width: 1440px;
    overflow: hidden;
}

/* Header section with title and description wrapper */
.segib20_gallery__header-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    box-sizing: border-box;
}

/* For large screens, create a two-column layout */
@media (min-width: 992px) {
    .segib20_gallery__header-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: center;
    }
    
    .segib20_gallery__left-column {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .segib20_gallery__right-column {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 0;
    }
}

/* Header section with title and description */
.segib20_gallery__header {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

/* Title styles - match with greetings section */
.segib20_gallery__title {
    font-family: "TT Ramillas W03 Regular", serif;
    font-size: 48px;
    line-height: 1;
    color: #000000 !important;
    margin: 0 0 20px 0;
    font-weight: 700;
}

/* Description styles */
.segib20_gallery__description {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #595F5F !important;
    margin-bottom: 20px;
}

/* Filter buttons */
.segib20_gallery__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.segib20_gallery__filter-btn {
    background: none;
    border: 1px solid #1B1C19;
    border-radius: 30px;
    padding: 8px 18px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: #1B1C19 !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.segib20_gallery__filter-btn.active,
.segib20_gallery__filter-btn:hover {
    background-color: #1B1C19;
    color: #FFFFFF !important;
}

/* Filter button styles */
.segib20_gallery__filter-btn:active {
    transform: scale(0.98);
}

/* Slider container */
.segib20_gallery__slider-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    clear: both;
    max-width: 1440px;
    opacity: 0;
    transform: translateY(20px);
    transition-property: opacity, transform;
    transition-timing-function: ease-out;
    will-change: opacity, transform; /* Hint for browser optimization */
}

.segib20_gallery__slider-container {
    transition-duration: 0.7s;
    transition-delay: 0.4s;
}

/* Animation container - helps with overflow management */
.segib20_gallery__animation-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Main slider */
.segib20_gallery__slider {
    display: flex;
    flex-wrap: nowrap;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    cursor: grab;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    touch-action: pan-y;
    gap: 10px;
    height: auto;
}

.segib20_gallery__slider.dragging {
    cursor: grabbing !important;
    transition: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Individual slides */
.segib20_gallery__slide {
    height: 100%;
    flex: 0 0 auto;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-right: none;
    display: flex;
    flex-direction: column;
    margin-right: 0;
}

.segib20_gallery__slide:last-child {
    border-right: none;
}

/* Image container */
.segib20_gallery__image-container {
    position: relative;
    height: auto;
    width: 100%;
    overflow: hidden;
    background-color: #F5F5F5;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Gallery images */
.segib20_gallery__image {
    display: block;
    height: auto;
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    margin: 0;
    box-shadow: none;
}

/* Image hover effect */
.segib20_gallery__image-container:hover .segib20_gallery__image {
    transform: scale(1.05);
}



/* Caption - styled to appear below the image */
.segib20_gallery__caption {
    position: static;
    width: 100%;
    padding: 10px 0;
    padding-left: 20px;
    color: #595F5F !important;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    background-color: transparent;
    opacity: 1;
    transition: none;
    margin-top: 5px;
}

/* Controls section - now just for pagination */
.segib20_gallery__controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    width: 150px;
    height: 40px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation buttons - floating square buttons at block edges */
.segib20_gallery__nav {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    position: absolute;
    top: 40%;
    margin-top: -24px; /* Half of height for perfect centering */
    overflow: visible;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.segib20_gallery__nav-prev {
    left: 20px;
}

.segib20_gallery__nav-next {
    right: 20px;
}

.segib20_gallery__nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.segib20_gallery__nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navigation button styles */
.segib20_gallery__nav:active {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Navigation arrows */
.segib20_gallery__nav-prev .segib20_gallery__nav-arrow,
.segib20_gallery__nav-next .segib20_gallery__nav-arrow {
    display: inline-block;
    width: 8px;
    height: 14px;
    transition: transform 0.2s ease;
}

.segib20_gallery__nav-prev .segib20_gallery__nav-arrow {
    background: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 1L1 7L7 13' stroke='%231B1C19' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center center;
}

.segib20_gallery__nav-next .segib20_gallery__nav-arrow {
    background: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L1 13' stroke='%231B1C19' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center center;
}

.segib20_gallery__nav-prev:not(.disabled):hover .segib20_gallery__nav-arrow {
    transform: translateX(-2px);
}

.segib20_gallery__nav-next:not(.disabled):hover .segib20_gallery__nav-arrow {
    transform: translateX(2px);
}

/* Pagination */
.segib20_gallery__pagination {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    user-select: none;
    -webkit-user-select: none;
}

.segib20_gallery__current-page {
    font-weight: 900;
    color: #1B1C1F !important;
}

.segib20_gallery__total-pages {
    font-weight: 300;
    color: #1B1C1F !important;
}

/* Empty state */
.segib20_gallery__empty {
    padding: 40px;
    text-align: center;
    background-color: #F5F5F5;
    border-radius: 8px;
    color: #707B7B !important;
}

/* Responsive styles */
/* Large screens (1440px and up) */
@media (min-width: 1440px) {
    .segib20_gallery__title {
        font-size: 48px;
    }
    
    .segib20_gallery__slider {
        height: 500px;
    }
}

/* Extra large screens (1201px-1439px) */
@media (min-width: 1201px) and (max-width: 1439px) {
    .segib20_gallery__title {
        font-size: 48px;
    }
    
    .segib20_gallery__slider {
        height: 500px;
    }
}

/* Medium screens (992px-1200px) */
@media (min-width: 992px) and (max-width: 1200px) {
    .segib20_gallery__title {
        font-size: 38px;
    }
    
    .segib20_gallery__slider {
        height: 450px;
    }
}

/* Tablet layout (481px-991px) */
@media (min-width: 481px) and (max-width: 991px) {
    .segib20_gallery__header-wrapper {
        align-items: flex-start;
        gap: 20px;
        grid-template-columns: 1fr;
        margin-bottom: 35px;
    }
    
    .segib20_gallery__title {
        font-size: 30px;
    }
    
    .segib20_gallery__slider {
        height: 400px;
    }
}

/* Hide navigation buttons on iPad and lower */
@media (max-width: 991px) {
    .segib20_gallery__nav,
    .segib20_gallery__nav-prev,
    .segib20_gallery__nav-next,
    .document-lightbox-nav {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* Additional iOS-specific fix */
@media (max-width: 991px) and (-webkit-min-device-pixel-ratio: 1) {
    .segib20_gallery__nav,
    .segib20_gallery__nav-prev,
    .segib20_gallery__nav-next {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* Force hide on all touch devices */
@media (pointer: coarse) {
    .segib20_gallery__nav,
    .segib20_gallery__nav-prev,
    .segib20_gallery__nav-next {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* Ultra-aggressive hiding for all possible mobile scenarios */
@media screen and (max-width: 1024px) {
    .segib20_gallery__nav,
    .segib20_gallery__nav-prev,
    .segib20_gallery__nav-next {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
    }
}

/* Mobile layout (480px and below) */
@media (max-width: 480px) {
    .segib20_gallery__header-wrapper {
        align-items: flex-start;
        gap: 20px;
        grid-template-columns: 1fr;
        margin-bottom: 35px;
    }
    
    .segib20_gallery__title {
        font-size: 28px;
    }
    
    .segib20_gallery__slider {
        height: 350px;
    }
}

/* Lightbox Styles */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.no-scroll {
    overflow: hidden;
    touch-action: none;
}



/* Document lightbox */
.document-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.85);
    max-width: none !important;
    transition: background-color 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
}

/* Document lightbox toolbar */
.document-lightbox-toolbar {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between text and button */
    z-index: 1003;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 15px 8px 20px; /* Increased padding */
    border-radius: 30px; /* More rounded corners */
    cursor: pointer; /* Make entire toolbar clickable */
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.document-lightbox-toolbar:hover {
    transform: translateY(-2px); /* Subtle lift effect on hover */
    opacity: 1;
}

/* Document lightbox close text */
.document-lightbox-close-text {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: #fff !important;
    line-height: 1;
    user-select: none;
}

/* Document lightbox close button */
.document-lightbox-close {
    position: static !important; /* Remove fixed positioning */
    top: auto !important;
    right: auto !important;
    width: 24px !important; /* Smaller size */
    height: 24px !important; /* Smaller size */
    background-color: transparent !important; /* Make background transparent */
    border: none !important;
    border-radius: 50% !important; /* Keep it circular */
    color: #fff !important;
    font-size: 28px !important; /* Adjust symbol size if needed */
    line-height: 0.8 !important; /* Adjust line height */
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important; /* Remove previous padding */
    z-index: auto !important; /* No longer needs high z-index */
    transition: opacity 0.2s ease !important;
    outline: none !important;
    opacity: 0.7;
    font-family: "Arial", sans-serif !important;
}

.document-lightbox-toolbar:hover .document-lightbox-close,
.document-lightbox-close:hover {
    background-color: transparent !important;
    opacity: 1;
}

.document-lightbox-close:active {
    transform: scale(0.95);
}

/* Document lightbox image container */
.document-lightbox-image-container {
    overflow: visible;
    width: 100%;
    height: 100%;
    max-height: none !important;
    max-width: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    cursor: default;
    position: relative;
    padding: 0;
    box-sizing: border-box;
}

.document-lightbox-image-container.is-grabbing {
    cursor: grabbing; /* Change cursor when panning */
}

/* Document lightbox image */
.document-lightbox-image {
    max-width: calc(100% - 20px) !important; /* Reduced from calc(100% - 30px) */
    max-height: calc(100% - 20px) !important; /* Reduced from calc(100% - 30px) */
    min-width: 200px !important;
    object-fit: contain !important;
    margin: auto !important;
    transform-origin: center center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    cursor: default;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
    box-shadow: none;
}

/* Fullscreen mode styling */
.document-lightbox:fullscreen .document-lightbox-image {
    max-width: 95% !important;
    max-height: 95% !important;
}

/* Ensure the lightbox display stays correct across browsers */
.document-lightbox--gallery {
    display: none;
    box-sizing: border-box;
    padding: 80px 80px 80px 80px !important; /* Increased padding on all sides */
}

/* When visible */
.document-lightbox--gallery[style*="display: flex"],
.document-lightbox--gallery[style*="display:flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Mobile specific lightbox styles */
@media (max-width: 767px) {
    .document-lightbox-toolbar {
        top: 15px;
        right: 15px;
        padding: 5px 8px 5px 12px;
    }
    
    .document-lightbox-close-text {
        font-size: 12px;
    }
    
    .document-lightbox-close {
        width: 22px !important;
        height: 22px !important;
        font-size: 24px !important;
    }
    
    /* Optimize lightbox image for mobile screens */
    .document-lightbox-image {
        max-width: calc(100% - 10px) !important; /* Even smaller margins on mobile */
        max-height: calc(100% - 110px) !important; /* Account for smaller padding */
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12); /* Lighter shadow on mobile */
    }
    
    /* Reduce padding on mobile lightbox */
    .document-lightbox--gallery {
        padding: 40px 10px 40px 10px !important; /* Reduced from 80px */
    }
    
    /* Adjust caption position for mobile */
    .document-lightbox-caption-container {
        margin: 0 10px 40px 10px; /* Reduced from 80px to match lightbox padding */
        max-width: calc(100% - 20px); /* Adjust for new margins */
        padding: 12px 15px; /* Slightly more compact padding */
    }
    
    /* Feedback indicator for touch devices */
    .document-lightbox::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 1002;
    }
    
    .document-lightbox.touch-active::after {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        animation: pulse 1.5s infinite;
    }
    
    @keyframes pulse {
        0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
        50% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
        100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
    }
}

/* Make lightbox image links appear clickable */
.segib20_gallery__item-link[data-image-type="lightbox"] {
    cursor: pointer;
}

.segib20_gallery__item-link[data-image-type="lightbox"]:hover .segib20_gallery__image {
    opacity: 0.9;
    transform: scale(1.03);
}

/* Document lightbox caption container */
.document-lightbox-caption-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 20px;
    margin: 0 80px 80px 80px; /* Match the lightbox padding */
    z-index: 1004;
    max-width: calc(100% - 160px); /* Account for left/right margin */
    width: auto;
    box-sizing: border-box;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Document lightbox caption text */
.document-lightbox-caption {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333 !important;
    text-align: center;
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word; /* Break long words */
    font-weight: 500;
}

/* Only hide empty captions */
.document-lightbox-caption:empty {
    display: none;
}

.document-lightbox-caption-container:empty {
    display: none;
}

/* Mobile adjustments for caption */
@media (max-width: 767px) {
    .document-lightbox-caption-container {
        padding: 10px 15px;
    }
    
    .document-lightbox-caption {
        font-size: 13px;
    }
}

/* Lightbox loading spinner */
.lightbox-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    background-color: rgba(255, 255, 255, 0.7);
    transition: opacity 0.3s ease;
}

.lightbox-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--bg-color, #1B1C19);
    border-radius: 50%;
    animation: lightbox-spin 1s infinite linear;
}

.lightbox-error {
    margin-top: 15px;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #f44336 !important;
    text-align: center;
    max-width: 240px;
    line-height: 1.4;
}

@keyframes lightbox-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ensure the overlay covers the entire screen and is clickable */
.document-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    cursor: pointer;
}

/* Navigation buttons */
.document-lightbox-nav {
    position: fixed;
    top: 50%;
    margin-top: -24px; /* Half of height for perfect centering */
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1003;
    transition: opacity 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.document-lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.document-lightbox-nav:active {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.document-lightbox-prev {
    left: 30px;
}

.document-lightbox-next {
    right: 30px;
}

/* Remove all visual focus cues while preserving click functionality */
.segib20_gallery__filter-btn:focus,
.segib20_gallery__nav-prev:focus,
.segib20_gallery__nav-next:focus,
.segib20_gallery__image:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus rings from main gallery elements only */
.wp-block-acf-segib20_gallery .segib20_gallery__filter-btn:focus,
.wp-block-acf-segib20_gallery .segib20_gallery__nav-prev:focus,
.wp-block-acf-segib20_gallery .segib20_gallery__nav-next:focus,
.wp-block-acf-segib20_gallery .segib20_gallery__image:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Allow focus indicators on lightbox elements ONLY when using keyboard navigation */
.using-keyboard .segib-simple-lightbox-prev:focus,
.using-keyboard .segib-simple-lightbox-next:focus,
.using-keyboard .segib-simple-lightbox-close:focus,
.using-keyboard .document-lightbox--gallery .document-lightbox-prev:focus,
.using-keyboard .document-lightbox--gallery .document-lightbox-next:focus,
.using-keyboard .document-lightbox--gallery .document-lightbox-close:focus {
    outline: 2px solid #0073aa !important;
    outline-offset: 2px !important;
}

/* Hide focus indicators when using mouse */
:not(.using-keyboard) .segib-simple-lightbox-prev:focus,
:not(.using-keyboard) .segib-simple-lightbox-next:focus,
:not(.using-keyboard) .segib-simple-lightbox-close:focus,
:not(.using-keyboard) .document-lightbox--gallery .document-lightbox-prev:focus,
:not(.using-keyboard) .document-lightbox--gallery .document-lightbox-next:focus,
:not(.using-keyboard) .document-lightbox--gallery .document-lightbox-close:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove browser default focus styles only from main gallery elements */
.wp-block-acf-segib20_gallery .segib20_gallery__filter-btn,
.wp-block-acf-segib20_gallery .segib20_gallery__nav-prev,
.wp-block-acf-segib20_gallery .segib20_gallery__nav-next,
.wp-block-acf-segib20_gallery .segib20_gallery__image {
    outline: none !important;
    box-shadow: none !important;
}