/* ============================================================
   Custom Image Gallery Slider — front-end styles
   Sizes / colours come from CSS variables set per instance.
   ============================================================ */

.cigs-gallery {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    background: var(--cigs-bg, #fff);
    padding: var(--cigs-pad, 60px 0 70px);
    text-align: center;
}
.cigs-gallery *, .cigs-gallery *::before, .cigs-gallery *::after { box-sizing: border-box; }

/* Pick the right per-device value (set inline as --cigs-*-d / -t / -m).
   Breakpoints: tablet <= 1024px, mobile <= 767px. */
.cigs-gallery {
    max-width: 100%;
    --cigs-h: var(--cigs-h-d, 480px);
    --cigs-cols: var(--cigs-cols-d, 3);
    --cigs-cwp: var(--cigs-cwp-d, 40%);
    --cigs-heading-size: var(--cigs-heading-size-d, 2.8rem);
}
@media (max-width: 1024px) {
    .cigs-gallery {
        --cigs-h: var(--cigs-h-t, 380px);
        --cigs-cols: var(--cigs-cols-t, 2);
        --cigs-cwp: var(--cigs-cwp-t, 60%);
    }
}
@media (max-width: 767px) {
    .cigs-gallery {
        --cigs-h: var(--cigs-h-m, 260px);
        --cigs-cols: var(--cigs-cols-m, 1);
        --cigs-cwp: var(--cigs-cwp-m, 80%);
        --cigs-heading-size: var(--cigs-heading-size-m, 2rem);
    }
}

/* Visually hidden, still read by screen readers. */
.cigs-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    max-width: calc(100vw - 32px);
    text-align: center;
    border: 0;
}

/* ----- heading block: heading + sub heading + content (each optional) ----- */
.cigs-head { margin: 0 0 40px; padding: 0 20px; }
.cigs-gallery .cigs-heading {
    margin: 0;
    font-size: var(--cigs-heading-size, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--cigs-heading-color, #111);
    text-align: var(--cigs-heading-align, center);
}
.cigs-gallery .cigs-subheading {
    margin: .7rem 0 0;
    font-size: var(--cigs-sub-size, 1rem);
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--cigs-sub-color, #e31837);
    text-align: var(--cigs-sub-align, center);
}
.cigs-gallery .cigs-content {
    max-width: var(--cigs-content-max, 800px);
    margin: .9rem var(--cigs-content-mr, auto) 0 var(--cigs-content-ml, auto);
    text-align: var(--cigs-content-align, center);
    font-size: var(--cigs-content-size, 1.05rem);
    line-height: 1.65;
    color: var(--cigs-content-color, #555);
}
.cigs-gallery .cigs-content p { margin: 0 0 .6em; color: inherit; }
.cigs-gallery .cigs-content p:last-child { margin-bottom: 0; }

/* Fonts: nothing is forced. The project's own fonts apply unless a font was
   picked in the gallery settings (then the has-*-font class is present). */
.cigs-gallery.cigs-has-heading-font .cigs-heading,
.cigs-gallery.cigs-has-heading-font .cigs-cap-title { font-family: var(--cigs-heading-font); }
.cigs-gallery.cigs-has-text-font .cigs-subheading,
.cigs-gallery.cigs-has-text-font .cigs-content,
.cigs-gallery.cigs-has-text-font .cigs-cap-subtitle,
.cigs-gallery.cigs-has-text-font .cigs-cap-content,
.cigs-gallery.cigs-has-text-font .cigs-btn { font-family: var(--cigs-text-font); }

/* ----- stage: slider + overlapping button ----- */
.cigs-stage {
    position: relative;
    padding-bottom: 24px;   /* room for the part of the button hanging below the image */
}
.cigs-swiper {
    position: relative;
    width: 100%;
    height: var(--cigs-h, 480px);
    overflow: hidden;
    outline: none;
}
.cigs-swiper .swiper-wrapper { align-items: stretch; }

.cigs-gallery .cigs-slide {
    position: relative;
    width: var(--cigs-sw, 16%);
    height: 100%;
    flex-shrink: 0;
    cursor: pointer;
}
.cigs-gallery .cigs-slide.swiper-slide-active { z-index: 2; cursor: default; }

/* The visible picture box. Side slides are small + tilted; the active one grows. */
.cigs-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: var(--cigs-sh, 47%);
    overflow: hidden;
    background: #e9e9e9;
    transform: translate(-50%, -50%);
    transition:
        width  var(--cigs-speed, 800ms) ease,
        height var(--cigs-speed, 800ms) ease,
        transform var(--cigs-speed, 800ms) ease;
    will-change: width, height, transform;
}
/* Images ALWAYS fill their box and are cropped, never stretched or letterboxed.
   !important so theme / page-builder rules like `img{height:auto}` can't break it. */
.cigs-gallery .cigs-inner .cigs-img {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    user-select: none;
    -webkit-user-drag: none;
}

/* ----- image overlay (optional) ----- */
.cigs-inner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;                       /* under the caption (z-index 3) */
    background: var(--cigs-ov-color, #000);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--cigs-speed, 800ms) ease;
}
.cigs-ov-all .cigs-inner::after { opacity: var(--cigs-ov-opacity, .4); }
.cigs-ov-side .cigs-slide:not(.swiper-slide-active) .cigs-inner::after { opacity: var(--cigs-ov-opacity, .4); }
.cigs-ov-hover .cigs-slide:hover .cigs-inner::after { opacity: 0; transition-duration: .3s; }

/* ===== Mode: centered focus (default) ===== */
.cigs-mode-coverflow .cigs-slide.swiper-slide-active .cigs-inner {
    width: var(--cigs-cw, 40%);
    height: 100%;
}
.cigs-mode-coverflow .cigs-slide.cigs-before .cigs-inner {
    transform: translate(-50%, -50%) translateX(calc(var(--cigs-shift, 0px) * -1))
               perspective(1000px) rotateY(var(--cigs-rotate, 12deg));
}
.cigs-mode-coverflow .cigs-slide.cigs-after .cigs-inner {
    transform: translate(-50%, -50%) translateX(var(--cigs-shift, 0px))
               perspective(1000px) rotateY(calc(var(--cigs-rotate, 12deg) * -1));
}

/* ===== Mode: fade (one image at a time) ===== */
.cigs-mode-fade .cigs-inner { width: 100%; height: 100%; }
.cigs-mode-fade .cigs-slide { width: 100%; cursor: default; }

/* ===== Mode: cards (stacked cards) ===== */
.cigs-mode-cards .cigs-swiper {
    width: var(--cigs-cwp, 40%);
    margin: 0 auto;
    overflow: visible;            /* let the stacked cards peek out */
}
.cigs-mode-cards .cigs-slide {
    width: 100%;
    cursor: default;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}
.cigs-mode-cards .cigs-inner { width: 100%; height: 100%; border-radius: 14px; }

/* ===== Modes: simple grid + slides per view =====
   Items are in normal flow (no centered/active image), sized by an aspect ratio. */
.cigs-mode-grid .cigs-stage,
.cigs-mode-slides .cigs-stage {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.cigs-mode-grid .cigs-swiper,
.cigs-mode-slides .cigs-swiper { height: auto; }
.cigs-mode-grid .cigs-swiper { overflow: visible; }

.cigs-gallery.cigs-mode-grid .cigs-swiper .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--cigs-cols, 3), minmax(0, 1fr));
    gap: var(--cigs-gap, 20px);
    height: auto;
    transform: none;
}
.cigs-gallery.cigs-mode-grid .cigs-slide,
.cigs-gallery.cigs-mode-slides .cigs-slide { height: auto; cursor: default; }
.cigs-gallery.cigs-mode-grid .cigs-slide { width: auto; }

.cigs-gallery.cigs-mode-grid .cigs-inner,
.cigs-gallery.cigs-mode-slides .cigs-inner {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    aspect-ratio: var(--cigs-ratio, 4 / 3);
    transform: none;
    transition: none;
}
/* No "active" image here, so every caption is visible. */
.cigs-gallery.cigs-mode-grid .cigs-caption,
.cigs-gallery.cigs-mode-slides .cigs-caption { opacity: 1; transition-delay: 0s; }
/* The button sits below, not over an image. */
.cigs-gallery.cigs-mode-grid .cigs-stage .cigs-btn,
.cigs-gallery.cigs-mode-slides .cigs-stage .cigs-btn {
    position: static;
    transform: none;
    margin-top: 38px;
}
.cigs-mode-slides .cigs-prev { left: 34px; }
.cigs-mode-slides .cigs-next { right: 34px; }

/* ----- per-image caption (title / sub title / content) -----
   Only rendered when an image has at least one of the three fields.
   Visible on the active slide only. */
.cigs-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 4.5rem 2rem var(--cigs-cap-pb, 3.9rem);
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .38) 55%, rgba(0, 0, 0, 0) 100%);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}
.cigs-gallery .cigs-slide.swiper-slide-active .cigs-caption { opacity: 1; transition-delay: calc(var(--cigs-speed, 800ms) * .6); }
.cigs-cap-left   .cigs-caption { text-align: left; }
.cigs-cap-right  .cigs-caption { text-align: right; }
.cigs-caption { overflow-wrap: anywhere; }
.cigs-cap-title    { margin: 0 0 .35rem; color: var(--cigs-captitle-color, #fff); font-size: var(--cigs-captitle-size, 1.7rem); font-weight: 700; line-height: 1.2; }
.cigs-cap-subtitle { margin: 0 0 .5rem; color: var(--cigs-capsub-color, #fff); font-size: var(--cigs-capsub-size, .85rem); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.cigs-cap-content  { color: var(--cigs-capcontent-color, #fff); font-size: var(--cigs-capcontent-size, .98rem); line-height: 1.55; opacity: .95; }
.cigs-cap-content p { margin: 0 0 .5em; color: inherit; }
.cigs-cap-content p:last-child { margin-bottom: 0; }
.cigs-cap-title:last-child, .cigs-cap-subtitle:last-child { margin-bottom: 0; }

/* ----- call-to-action button, overlapping the bottom of the centered image ----- */
.cigs-gallery .cigs-btn {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 5;
    transform: translateX(-50%);
    display: inline-block;
    padding: 1.25rem 3.1rem;
    background: var(--cigs-btn-bg, #e31837);
    color: var(--cigs-btn-color, #fff);
    font-size: var(--cigs-btn-size, .95rem);
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    transition: filter .25s ease;
}
.cigs-gallery a.cigs-btn:hover,
.cigs-gallery a.cigs-btn:focus-visible { filter: brightness(.88); color: var(--cigs-btn-color, #fff); }
.cigs-gallery span.cigs-btn { cursor: default; }

/* ----- arrows ----- */
.cigs-arrow {
    position: absolute;
    top: 50%;
    z-index: 6;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    padding: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    transition: background .25s ease;
}
.cigs-arrow:hover { background: var(--cigs-btn-bg, #e31837); }
.cigs-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}
.cigs-prev { left: 16px; }
.cigs-next { right: 16px; }
.cigs-prev::after { transform: translate(-30%, -50%) rotate(-135deg); }
.cigs-next::after { transform: translate(-70%, -50%) rotate(45deg); }
.cigs-arrow.swiper-button-disabled { opacity: .35; cursor: default; }

/* ----- dots ----- */
.cigs-gallery .cigs-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 30px;
    line-height: 1;
}
.cigs-gallery .cigs-dots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }
.cigs-gallery .cigs-dots .cigs-dot {
    position: relative;
    width: 10px;
    height: 10px;
    margin: 0 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #8a8a8a;           /* >= 3:1 against white (WCAG 1.4.11) */
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}
.cigs-gallery .cigs-dots .cigs-dot::before {   /* enlarge the click/touch area to 24x24 */
    content: '';
    position: absolute;
    top: -7px; right: -7px; bottom: -7px; left: -7px;
}
.cigs-gallery .cigs-dots .cigs-dot.is-active { background: var(--cigs-btn-bg, #e31837); transform: scale(1.3); }

/* Pause / play (WCAG 2.2.2: moving content must be pausable) */
.cigs-pause {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #8a8a8a;
    border-radius: 50%;
    background: #fff;
    color: #333;
    cursor: pointer;
}
.cigs-pause:hover { border-color: var(--cigs-btn-bg, #e31837); color: var(--cigs-btn-bg, #e31837); }
.cigs-pause-icon {            /* pause bars */
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 12px;
    transform: translate(-50%, -50%);
    border-left: 3px solid currentColor;
    border-right: 3px solid currentColor;
}
.cigs-pause[aria-pressed="true"] .cigs-pause-icon {   /* play triangle */
    width: 0; height: 0;
    border: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid currentColor;
    transform: translate(-30%, -50%);
}

/* ----- visible keyboard focus (WCAG 2.4.7) ----- */
.cigs-gallery .cigs-swiper:focus-visible,
.cigs-gallery .cigs-btn:focus-visible,
.cigs-gallery .cigs-arrow:focus-visible,
.cigs-gallery .cigs-pause:focus-visible,
.cigs-gallery .cigs-dot:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 3px;
}
@supports not selector(:focus-visible) {
    .cigs-gallery .cigs-swiper:focus,
    .cigs-gallery .cigs-btn:focus,
    .cigs-gallery .cigs-arrow:focus,
    .cigs-gallery .cigs-pause:focus,
    .cigs-gallery .cigs-dot:focus { outline: 3px solid #1a73e8; outline-offset: 3px; }
}

/* ----- responsive ----- */
@media (max-width: 767px) {
    .cigs-gallery .cigs-btn { white-space: normal; }
    .cigs-head { margin-bottom: 28px; }
    .cigs-gallery .cigs-btn { padding: 1rem 2.2rem; font-size: calc(var(--cigs-btn-size, .95rem) * .9); }
    .cigs-caption { padding: 2.5rem 1rem var(--cigs-cap-pb, 3.4rem); }
    .cigs-arrow { width: 38px; height: 38px; margin-top: -19px; }
    .cigs-prev { left: 8px; }
    .cigs-next { right: 8px; }
}

@media (max-width: 480px) {
    .cigs-mode-grid .cigs-stage,
    .cigs-mode-slides .cigs-stage { padding: 0 14px; }
    .cigs-cap-content {                            /* keep tiny images readable: clamp to 2 lines */
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
}
@media (prefers-reduced-motion: reduce) {
    .cigs-inner, .cigs-caption, .cigs-dot { transition: none !important; }
}

/* ===== Browser fallbacks ===== */
/* No aspect-ratio support (Safari < 15, old Edge): padding-top ratio box. */
@supports not (aspect-ratio: 1 / 1) {
    .cigs-gallery.cigs-mode-grid .cigs-inner,
    .cigs-gallery.cigs-mode-slides .cigs-inner { height: 0; padding-top: var(--cigs-ratio-pad, 75%); }
}
/* Safari: keep rounded corners + overflow clipping on transformed cards. */
.cigs-mode-cards .cigs-slide { isolation: isolate; -webkit-backface-visibility: hidden; backface-visibility: hidden; }


/* ======================================================================
   v1.2 — typography chains, positions, animation, lazy/skeleton,
   lightbox, single slide + thumbnails
   ====================================================================== */

/* Per-device text sizes (desktop value, mobile <= 767px value). */
.cigs-gallery {
    --cigs-sub-size: var(--cigs-sub-size-d, 1rem);
    --cigs-content-size: var(--cigs-content-size-d, 1.05rem);
    --cigs-captitle-size: var(--cigs-captitle-size-d, 1.7rem);
    --cigs-capsub-size: var(--cigs-capsub-size-d, .85rem);
    --cigs-capcontent-size: var(--cigs-capcontent-size-d, .98rem);
}
@media (max-width: 767px) {
    .cigs-gallery {
        --cigs-sub-size: var(--cigs-sub-size-m, .9rem);
        --cigs-content-size: var(--cigs-content-size-m, .95rem);
        --cigs-captitle-size: var(--cigs-captitle-size-m, 1.2rem);
        --cigs-capsub-size: var(--cigs-capsub-size-m, .72rem);
        --cigs-capcontent-size: var(--cigs-capcontent-size-m, .85rem);
    }
}

/* ----- button position (left / center / right) ----- */
.cigs-btn-left  .cigs-stage { text-align: left; }
.cigs-btn-right .cigs-stage { text-align: right; }
.cigs-btn-left.cigs-mode-coverflow  .cigs-btn { left: calc(50% - var(--cigs-cw, 40%) / 2 + 24px); transform: none; }
.cigs-btn-right.cigs-mode-coverflow .cigs-btn { left: auto; right: calc(50% - var(--cigs-cw, 40%) / 2 + 24px); transform: none; }
.cigs-btn-left.cigs-mode-cards  .cigs-btn { left: calc(50% - var(--cigs-cwp, 40%) / 2 + 24px); transform: none; }
.cigs-btn-right.cigs-mode-cards .cigs-btn { left: auto; right: calc(50% - var(--cigs-cwp, 40%) / 2 + 24px); transform: none; }
.cigs-btn-left.cigs-mode-fade  .cigs-btn { left: 24px; transform: none; }
.cigs-btn-right.cigs-mode-fade .cigs-btn { left: auto; right: 24px; transform: none; }

/* ----- entrance animation (plays when the gallery scrolls into view) -----
   Hidden state = first keyframe, held by a paused animation. A second 'failsafe'
   animation reveals everything after 5s even if JavaScript never runs. */
@keyframes cigs-a-fade       { from { opacity: 0; } to { opacity: 1; } }
@keyframes cigs-a-fade-up    { from { opacity: 0; transform: translateY(40px); }  to { opacity: 1; transform: none; } }
@keyframes cigs-a-fade-down  { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
@keyframes cigs-a-fade-left  { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes cigs-a-fade-right { from { opacity: 0; transform: translateX(60px); }  to { opacity: 1; transform: none; } }
@keyframes cigs-a-zoom-in    { from { opacity: 0; transform: scale(.85); }        to { opacity: 1; transform: none; } }
@keyframes cigs-a-zoom-out   { from { opacity: 0; transform: scale(1.15); }       to { opacity: 1; transform: none; } }
@keyframes cigs-a-flip-up    { from { opacity: 0; transform: perspective(800px) rotateX(-65deg); } to { opacity: 1; transform: none; } }
@keyframes cigs-a-failsafe   { to { opacity: 1; transform: none; } }

.cigs-anim .cigs-anim-el {
    animation-duration: var(--cigs-anim-d, 700ms), .01s;
    animation-delay: var(--cigs-anim-delay, 0ms), 5s;
    animation-timing-function: cubic-bezier(.22, .61, .36, 1), linear;
    animation-fill-mode: both, forwards;
    animation-play-state: paused, running;
}
.cigs-anim.cigs-in-view .cigs-anim-el { animation-play-state: running, running; }
.cigs-anim .cigs-slide.cigs-anim-el {   /* grid: stagger image by image */
    animation-delay: calc(var(--cigs-anim-delay, 0ms) + var(--cigs-i, 0) * var(--cigs-anim-stagger, 90ms)), 5s;
}
.cigs-anim-fade       .cigs-anim-el { animation-name: cigs-a-fade,       cigs-a-failsafe; }
.cigs-anim-fade-up    .cigs-anim-el { animation-name: cigs-a-fade-up,    cigs-a-failsafe; }
.cigs-anim-fade-down  .cigs-anim-el { animation-name: cigs-a-fade-down,  cigs-a-failsafe; }
.cigs-anim-fade-left  .cigs-anim-el { animation-name: cigs-a-fade-left,  cigs-a-failsafe; }
.cigs-anim-fade-right .cigs-anim-el { animation-name: cigs-a-fade-right, cigs-a-failsafe; }
.cigs-anim-zoom-in    .cigs-anim-el { animation-name: cigs-a-zoom-in,    cigs-a-failsafe; }
.cigs-anim-zoom-out   .cigs-anim-el { animation-name: cigs-a-zoom-out,   cigs-a-failsafe; }
.cigs-anim-flip-up    .cigs-anim-el { animation-name: cigs-a-flip-up,    cigs-a-failsafe; }

/* ----- lazy-load effect: how an image appears once it has loaded -----
   (the first image is never hidden: it is the LCP candidate) */
.cigs-gallery .cigs-img.cigs-fx {
    transition: opacity var(--cigs-lazy-d, 600ms) ease, transform var(--cigs-lazy-d, 600ms) ease, filter var(--cigs-lazy-d, 600ms) ease;
}
.cigs-lz-fade     .cigs-img.cigs-fx { opacity: 0; }
.cigs-lz-blur     .cigs-img.cigs-fx { filter: blur(18px); transform: scale(1.06); }
.cigs-lz-zoom     .cigs-img.cigs-fx { opacity: 0; transform: scale(1.18); }
.cigs-lz-slide-up .cigs-img.cigs-fx { opacity: 0; transform: translateY(24px); }
.cigs-gallery .cigs-img.cigs-fx.is-loaded { opacity: 1; filter: none; transform: none; }
@keyframes cigs-img-failsafe { to { opacity: 1; filter: none; transform: none; } }
.cigs-gallery .cigs-img.cigs-fx:not(.is-loaded) { animation: cigs-img-failsafe .01s 6s forwards; }

/* ----- skeleton loader: shimmering placeholder until the image has loaded ----- */
@keyframes cigs-shimmer { 0% { background-position: 200% 0, 0 0; } 100% { background-position: -200% 0, 0 0; } }
.cigs-inner.cigs-skel:not(.is-loaded)::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 0;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, 0) 70%) 0 0 / 200% 100% no-repeat, var(--cigs-skel, #e6e6e6);
    animation: cigs-shimmer 1.4s ease-in-out infinite;
}

/* ----- expand button on the image + click cursor (lightbox) ----- */
.cigs-zoom {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 4;
    width: 40px; height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s ease, background .25s ease;
}
.cigs-zoom-icon {
    position: absolute;
    top: 50%; left: 50%;
    width: 22px; height: 22px;
    margin: -11px 0 0 -11px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cigs-slide:hover .cigs-zoom, .cigs-zoom:focus-visible { opacity: 1; }
.cigs-zoom:hover { background: var(--cigs-btn-bg, #e31837); }
@media (hover: none) { .cigs-zoom { opacity: 1; } }
/* only the main image (or any image in grid / multi-view) can be opened */
.cigs-gallery:not(.cigs-mode-grid):not(.cigs-mode-slides) .cigs-slide:not(.swiper-slide-active) .cigs-zoom { display: none; }
.cigs-has-lb.cigs-mode-grid .cigs-inner,
.cigs-has-lb.cigs-mode-slides .cigs-inner,
.cigs-has-lb .cigs-slide.swiper-slide-active .cigs-inner { cursor: zoom-in; }

/* ----- single slide (+ thumbnails) ----- */
.cigs-mode-single .cigs-stage { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cigs-mode-single .cigs-slide { width: 100%; cursor: default; }
.cigs-mode-single .cigs-inner { width: 100%; height: 100%; }
.cigs-gallery.cigs-mode-single .cigs-stage .cigs-btn { position: static; transform: none; margin-top: 32px; }
.cigs-single-layout { display: flex; gap: var(--cigs-thumb-gap, 10px); }
.cigs-thumbs-below .cigs-single-layout { flex-direction: column; }
.cigs-thumbs-left  .cigs-single-layout { flex-direction: row-reverse; }   /* thumbs come after the main image in the HTML */
.cigs-thumbs-right .cigs-single-layout { flex-direction: row; }
.cigs-single-layout .cigs-swiper { flex: 1 1 auto; min-width: 0; }
.cigs-thumbs { position: relative; overflow: hidden; min-width: 0; }
.cigs-thumbs-below .cigs-thumbs { width: 100%; }
.cigs-thumbs-left .cigs-thumbs, .cigs-thumbs-right .cigs-thumbs { flex: 0 0 var(--cigs-thumb-size, 110px); width: var(--cigs-thumb-size, 110px); height: var(--cigs-h, 480px); }
.cigs-thumb {
    position: relative;
    display: block;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 3px;
    background: var(--cigs-skel, #e6e6e6);
    overflow: hidden;
    cursor: pointer;
    opacity: .65;
    transition: opacity .25s ease, border-color .25s ease;
}
.cigs-thumb:hover { opacity: .9; }
.cigs-thumb.swiper-slide-thumb-active { opacity: 1; border-color: var(--cigs-btn-bg, #e31837); }
.cigs-thumbs-below .cigs-thumb { aspect-ratio: 4 / 3; }
.cigs-gallery .cigs-thumb .cigs-thumb-img {
    display: block !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
}
.cigs-thumb:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
@media (max-width: 767px) {     /* side thumbnails move below the image on phones */
    .cigs-thumbs-left .cigs-single-layout, .cigs-thumbs-right .cigs-single-layout { flex-direction: column; }
    .cigs-thumbs-left .cigs-thumbs, .cigs-thumbs-right .cigs-thumbs { flex: none; width: 100%; height: auto; }
    .cigs-thumbs-left .cigs-thumb, .cigs-thumbs-right .cigs-thumb { aspect-ratio: 4 / 3; }
    .cigs-mode-single .cigs-stage { padding: 0 14px; }
}
@supports not (aspect-ratio: 1 / 1) {
    .cigs-thumbs-below .cigs-thumb { height: 0; padding-top: 75%; }
}
/* overlay on thumbnails (same options as the images) */
.cigs-ov-side .cigs-thumb:not(.swiper-slide-thumb-active)::after,
.cigs-ov-all .cigs-thumb::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--cigs-ov-color, #000);
    opacity: var(--cigs-ov-opacity, .4);
    pointer-events: none;
    transition: opacity .25s ease;
}
.cigs-ov-hover .cigs-thumb:hover::after { opacity: 0; }

/* ----- lightbox ----- */
html.cigs-lb-open, html.cigs-lb-open body { overflow: hidden; }
.cigs-lb[hidden] { display: none; }
.cigs-lb {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    background: var(--cigs-lb-bg, rgba(0, 0, 0, .92));
    color: #fff;
    opacity: 0;
    transition: opacity .25s ease;
}
.cigs-lb.is-open { opacity: 1; }
.cigs-lb *, .cigs-lb *::before, .cigs-lb *::after { box-sizing: border-box; }
.cigs-lb-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.cigs-lb-count { margin-right: auto; font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.cigs-lb-btn {
    position: relative;
    flex: 0 0 auto;
    width: 44px; height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease;
}
.cigs-lb-btn:hover { background: rgba(255, 255, 255, .3); }
.cigs-lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cigs-lb-btn[disabled] { opacity: .3; cursor: default; }
.cigs-lb-icon { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; background-position: center; background-repeat: no-repeat; background-size: contain; }
.cigs-lb-close .cigs-lb-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E"); }
.cigs-lb-fs .cigs-lb-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E"); }
.cigs-lb-fs.is-on .cigs-lb-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5'/%3E%3C/svg%3E"); }
.cigs-lb-prev .cigs-lb-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4l-8 8 8 8'/%3E%3C/svg%3E"); }
.cigs-lb-next .cigs-lb-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4l8 8-8 8'/%3E%3C/svg%3E"); }
.cigs-lb-arrow { position: absolute; top: 50%; z-index: 3; margin-top: -22px; width: 50px; height: 50px; }
.cigs-lb-prev { left: 14px; }
.cigs-lb-next { right: 14px; }
.cigs-lb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 64px 76px 72px; touch-action: pan-y; }
.cigs-lb-fig { display: grid; place-items: center; width: 100%; height: 100%; margin: 0; }
.cigs-lb .cigs-lb-img {
    grid-area: 1 / 1;
    display: block;
    width: auto; height: auto;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}
.cigs-lb:fullscreen .cigs-lb-img, .cigs-lb:-webkit-full-screen .cigs-lb-img { max-height: calc(100vh - 140px); }
@keyframes cigs-lb-in-next  { from { opacity: 0; transform: translateX(70px); }  to { opacity: 1; transform: none; } }
@keyframes cigs-lb-in-prev  { from { opacity: 0; transform: translateX(-70px); } to { opacity: 1; transform: none; } }
@keyframes cigs-lb-out-next { to { opacity: 0; transform: translateX(-70px); } }
@keyframes cigs-lb-out-prev { to { opacity: 0; transform: translateX(70px); } }
.cigs-lb-in-next  { animation: cigs-lb-in-next  .32s ease both; }
.cigs-lb-in-prev  { animation: cigs-lb-in-prev  .32s ease both; }
.cigs-lb-out-next { animation: cigs-lb-out-next .32s ease both; }
.cigs-lb-out-prev { animation: cigs-lb-out-prev .32s ease both; }
@keyframes cigs-spin { to { transform: rotate(360deg); } }
.cigs-lb-stage.is-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 42px; height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cigs-spin .8s linear infinite;
}
.cigs-lb-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 80px 18px; text-align: center; background: linear-gradient(to top, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); pointer-events: none; }
.cigs-lb-cap[hidden] { display: none; }
.cigs-lb-cap > * { display: block; }
.cigs-lb-cap-title { font-size: 1.15rem; line-height: 1.3; }
.cigs-lb-cap-sub { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.cigs-lb-cap-text { margin-top: .3rem; font-size: .95rem; line-height: 1.5; opacity: .92; }
@media (max-width: 767px) {
    .cigs-lb-stage { padding: 60px 8px 84px; }
    .cigs-lb-arrow { width: 40px; height: 40px; margin-top: -20px; background: rgba(0, 0, 0, .5); }
    .cigs-lb-prev { left: 6px; } .cigs-lb-next { right: 6px; }
    .cigs-lb-cap { padding: 22px 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .cigs-anim .cigs-anim-el { animation: none !important; }
    .cigs-gallery .cigs-img.cigs-fx { transition: none; }
    .cigs-inner.cigs-skel:not(.is-loaded)::before { animation: none; }
    .cigs-lb, .cigs-lb-in-next, .cigs-lb-in-prev, .cigs-lb-out-next, .cigs-lb-out-prev { animation: none; transition: none; }
}
