.icna-gallery-section {
    position: relative;
    width: 100%;
    max-width: none;
    overflow: hidden;
    padding: 10px 0 18px;
    background: var(--icna-gallery-bg, #fff);
}

/*
 * Full-bleed mode intentionally escapes a boxed Elementor parent.
 * The gallery remains centered on the viewport while its cards keep their
 * configured dimensions; JS adds additional circular positions as needed.
 */
.icna-gallery-section--full-bleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

@supports (width: 100dvw) {
    .icna-gallery-section--full-bleed {
        width: 100dvw;
        max-width: 100dvw;
        margin-left: calc(50% - 50dvw);
        margin-right: calc(50% - 50dvw);
    }
}

.icna-gallery-widget {
    --icna-gallery-height: 320px;
    --icna-slide-width: 184px;
    --icna-slide-height: 238px;
    --icna-active-width: 242px;
    --icna-active-height: 302px;
    --icna-slide-offset: 193px;
    --icna-mid-scale: 1;
    --icna-mid-opacity: .8;
    --icna-far-scale: 1;
    --icna-far-opacity: .25;
    --icna-fade-width: 15%;
    --icna-transition-duration: 650ms;
    --icna-gallery-bg: #fff;
    --icna-drag-x: 0px;

    position: relative;
    width: 100%;
    height: var(--icna-gallery-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
    -webkit-tap-highlight-color: transparent;
}

.icna-gallery-widget.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.icna-gallery-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.icna-gallery-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--icna-slide-width);
    height: var(--icna-slide-height);
    transform:
        translate(-50%, -50%)
        translateX(var(--icna-x, 0px))
        translateX(var(--icna-drag-x, 0px))
        scale(var(--icna-scale, 1));
    opacity: var(--icna-opacity, 1);
    z-index: var(--icna-z, 0);
    overflow: hidden;
    background: #eee;
    border-radius: 14px;
    will-change: transform, opacity, width, height;
    transition:
        transform var(--icna-transition-duration) cubic-bezier(.4, 0, .2, 1),
        opacity var(--icna-transition-duration) ease,
        width var(--icna-transition-duration) cubic-bezier(.4, 0, .2, 1),
        height var(--icna-transition-duration) cubic-bezier(.4, 0, .2, 1),
        border-radius var(--icna-transition-duration) ease,
        box-shadow var(--icna-transition-duration) ease;
}

.icna-gallery-widget.is-initializing .icna-gallery-slide,
.icna-gallery-widget.is-dragging .icna-gallery-slide {
    transition: none !important;
}

.icna-gallery-slide.is-active {
    width: var(--icna-active-width);
    height: var(--icna-active-height);
    z-index: 10;
    box-sizing: border-box;
    border: var(--icna-active-frame-width, 6px) solid var(--icna-active-frame-color, #ffffff);
    background: var(--icna-active-frame-color, #ffffff);
}

.icna-gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none !important;
    cursor: inherit;
    outline-offset: -3px;
}

.icna-gallery-link:focus-visible {
    outline: 2px solid currentColor;
}

.icna-gallery-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.icna-gallery-widget::before,
.icna-gallery-widget::after {
    content: "";
    position: absolute;
    top: 0;
    width: var(--icna-fade-width);
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

.icna-gallery-widget::before {
    left: 0;
    background: linear-gradient(
        to right,
        var(--icna-gallery-bg) 0%,
        color-mix(in srgb, var(--icna-gallery-bg) 85%, transparent) 30%,
        transparent 100%
    );
}

.icna-gallery-widget::after {
    right: 0;
    background: linear-gradient(
        to left,
        var(--icna-gallery-bg) 0%,
        color-mix(in srgb, var(--icna-gallery-bg) 85%, transparent) 30%,
        transparent 100%
    );
}

@supports not (background: color-mix(in srgb, white 50%, transparent)) {
    .icna-gallery-widget::before {
        background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,.85) 30%, rgba(255,255,255,0) 100%);
    }

    .icna-gallery-widget::after {
        background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,.85) 30%, rgba(255,255,255,0) 100%);
    }
}
/* =========================================
   Gallery Navigation
========================================= */

.icna-gallery-navigation {
    position: absolute;
    inset: 0;
    z-index: 40;
    pointer-events: none;
}

.icna-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;

    background: #ffffff;
    color: #111111;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 10px 30px rgba(0, 0, 0, 0.08);

    cursor: pointer;
    pointer-events: auto;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;

    -webkit-tap-highlight-color: transparent;
}

.icna-gallery-nav-prev {
    left: clamp(12px, 2.5vw, 44px);
}

.icna-gallery-nav-next {
    right: clamp(12px, 2.5vw, 44px);
}

.icna-gallery-nav svg {
    width: 22px;
    height: 22px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

.icna-gallery-nav:hover {
    transform: translateY(-50%) scale(1.08);

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.12),
        0 12px 35px rgba(0, 0, 0, 0.12);
}

.icna-gallery-nav:active {
    transform: translateY(-50%) scale(0.94);
}

.icna-gallery-nav:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

@media (max-width: 767px) {

    .icna-gallery-nav {
        width: 42px;
        height: 42px;
    }

    .icna-gallery-nav-prev {
        left: 8px;
    }

    .icna-gallery-nav-next {
        right: 8px;
    }

    .icna-gallery-nav svg {
        width: 18px;
        height: 18px;
    }
}
/* Lightbox */
body.icna-gallery-lightbox-open {
    overflow: hidden;
}

.icna-gallery-lightbox[hidden] {
    display: none !important;
}

.icna-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 24px;
}

.icna-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .9);
}

.icna-gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(1200px, 94vw);
    height: min(880px, 90vh);
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 16px;
}

.icna-gallery-lightbox-figure {
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.icna-gallery-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 56px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 7px;
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
}

.icna-gallery-lightbox-caption {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 10px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}

.icna-gallery-lightbox-alt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icna-gallery-lightbox-counter {
    flex: 0 0 auto;
    opacity: .8;
}

.icna-gallery-lightbox button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font: inherit;
    cursor: pointer;
    box-shadow: none;
}

.icna-gallery-lightbox button:hover,
.icna-gallery-lightbox button:focus-visible {
    background: rgba(255, 255, 255, .22);
}

.icna-gallery-lightbox-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 30px !important;
    line-height: 1 !important;
    z-index: 2;
}

.icna-gallery-lightbox-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px !important;
    line-height: 1 !important;
}

@media (max-width: 700px) {
    .icna-gallery-lightbox {
        padding: 12px;
    }

    .icna-gallery-lightbox-dialog {
        width: 100%;
        height: 92vh;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 8px;
    }

    .icna-gallery-lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 20px !important;
    }

    .icna-gallery-lightbox-close {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 500px) {
    .icna-gallery-slide[data-position="-3"],
    .icna-gallery-slide[data-position="3"] {
        opacity: 0 !important;
        pointer-events: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .icna-gallery-slide {
        transition-duration: 0.01ms !important;
    }
}
