/* ============================================================
   AE Gallery Swiper Widget — CSS
   Exact match to original theme.css values
   ============================================================ */

.ae-gallery-section {
    background-color: #ffffff;
    overflow: hidden;
    padding: 80px 0 64px;
}

/* ── Section header ──────────────────────────────── */
.ae-gallery-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 0 1.5rem;
    max-width: 1260px;
    margin-left: auto;
    margin-right: auto;
}

.ae-gallery-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: #1a1a1a;
    font-family: Lato, sans-serif;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.ae-gallery-desc {
    font-size: 16px;
    color: #888888;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.65;
    font-family: Montserrat, sans-serif;
}

/* ── Swiper outer wrap ───────────────────────────── */
.ae-gallery-swiper-wrap {
    width: 100%;
    position: relative;
    padding-bottom: 2.5rem;    /* space for pagination dots */
}

/* ── Swiper: overflow visible so side slides peek ── */
.ae-gallery-swiper {
    width: 100%;
    overflow: visible !important;
    /* peek gap — default 15%, overridden by Elementor style control */
    padding-inline: 15%;
}

/* ── Each slide ──────────────────────────────────── */
.ae-gallery-swiper .swiper-slide {
    border-radius: 16px;
    overflow: hidden;
    opacity: 0.55;              /* side slides dimmed */
    transform: scale(0.92);
    transition: opacity 0.45s ease, transform 0.45s ease;
    cursor: pointer;
}

/* Active (centred) slide */
.ae-gallery-swiper .swiper-slide-active {
    opacity: 1;
    transform: scale(1);
}

/* Adjacent slides slightly brighter */
.ae-gallery-swiper .swiper-slide-prev,
.ae-gallery-swiper .swiper-slide-next {
    opacity: 0.7;
    transform: scale(0.94);
}

/* ── Slide inner: 16:9 crop ─────────────────────── */
.ae-gallery-slide-inner {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
    border-radius: 16px;
    background: #1a1a1a;
}

.ae-gallery-slide-inner a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.ae-gallery-slide-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.ae-gallery-swiper .swiper-slide-active .ae-gallery-slide-inner img {
    transform: scale(1.02);    /* subtle zoom on active slide */
}

/* ── Placeholder ─────────────────────────────────── */
.ae-gallery-slide-placeholder {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
}

.ae-gallery-slide-placeholder p {
    color: rgba(255, 255, 255, 0.4);
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    margin: 0;
}

/* ── Dot pagination ─────────────────────────────── */
.ae-gallery-pagination {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex !important;
    justify-content: center;
    gap: 8px;
    padding-top: 1.25rem;
}

.ae-gallery-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: #cccccc;
    border-radius: 50%;
    opacity: 1;
    transition: background-color 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    margin: 0 !important;
}

.ae-gallery-pagination .swiper-pagination-bullet-active {
    background-color: #1a1a1a;
    transform: scale(1.2);
}

/* ── Editor preview in Elementor iframe ──────────── */
.ae-gallery-editor-preview .swiper-wrapper {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ae-gallery-editor-preview .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

.ae-gallery-editor-preview .swiper-slide {
    min-width: 70%;
    flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 767px) {
    .ae-gallery-section {
        padding: 48px 0 48px;
    }
    .ae-gallery-title {
        font-size: 26px;
    }
    .ae-gallery-desc {
        font-size: 14px;
    }
    .ae-gallery-header {
        margin-bottom: 28px;
        padding: 0 1rem;
    }
    .ae-gallery-swiper {
        padding-inline: 8%;
    }
}

/* ══════════════════════════════════════════════════════════
   ARROW NAVIGATION
   ══════════════════════════════════════════════════════════ */

.ae-gallery-prev,
.ae-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a1a1a;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    /* Position outside the slide area */
}

.ae-gallery-prev {
    left: 4%;
}

.ae-gallery-next {
    right: 4%;
}

.ae-gallery-prev:hover,
.ae-gallery-next:hover {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    transform: translateY(-50%) scale(1.06);
}

.ae-gallery-prev:active,
.ae-gallery-next:active {
    transform: translateY(-50%) scale(0.97);
}

.ae-gallery-prev svg,
.ae-gallery-next svg {
    display: block;
    flex-shrink: 0;
}

/* Disabled state */
.ae-gallery-prev.swiper-button-disabled,
.ae-gallery-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hide arrows on mobile when configured */
@media (max-width: 767px) {
    .ae-gallery-arrow--hide-mobile {
        display: none !important;
    }
}

/* ══════════════════════════════════════════════════════════
   LOOP JERK FIX
   Ensures smooth infinite loop — no white flash between slides
   ══════════════════════════════════════════════════════════ */

/* Keep overflow hidden on the outer wrap to clip the Swiper */
.ae-gallery-swiper-wrap {
    /* Must clip arrows correctly */
    position: relative;
}

/* The swiper itself: overflow VISIBLE so peek slides show */
.ae-gallery-swiper {
    /* Clip only horizontally to prevent vertical overflow */
    clip-path: none;
}

/* Duplicate slides (loop clones) must be styled same as real slides */
.ae-gallery-swiper .swiper-slide-duplicate .ae-gallery-slide-inner {
    border-radius: 16px;
}

.ae-gallery-swiper .swiper-slide-duplicate.swiper-slide-active {
    opacity: 1;
    transform: scale(1);
}

.ae-gallery-swiper .swiper-slide-duplicate:not(.swiper-slide-active) {
    opacity: 0.55;
    transform: scale(0.92);
}

/* Transition: smooth interpolation prevents jerk */
.ae-gallery-swiper .swiper-slide {
    transition-property: opacity, transform !important;
    will-change: transform, opacity;
}

/* ══════════════════════════════════════════════════════════
   GALLERY SUB-HEADING + POSITION VARIANTS
   ══════════════════════════════════════════════════════════ */
.ae-gallery-subheading {
    display: block;
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #e8192c;
    margin-bottom: 10px;
}

/* Bottom position header */
.ae-gallery-header--bottom {
    margin-bottom: 0;
    margin-top: 40px;
}

/* Middle overlay (over slider) */
.ae-gallery-header--middle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 90%;
    text-align: center;
    margin: 0;
}

.ae-gallery-section {
    position: relative; /* needed for middle overlay */
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .ae-gallery-subheading { font-size: 11px; }
    .ae-gallery-header--bottom { margin-top: 24px; }
}
@media (max-width: 479px) {
    .ae-gallery-header { padding: 0 0.75rem; margin-bottom: 20px; }
    .ae-gallery-title  { font-size: 22px; }
    .ae-gallery-desc   { font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════
   PER-SLIDE TEXT OVERLAY
   Optional heading + sub-heading + content on each slide
   ══════════════════════════════════════════════════════════ */

.ae-slide-text {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 4;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    /* Default: bottom */
    bottom: 0;
    top: auto;
}

/* ── Vertical positions ───────────────────────────────────── */
.ae-slide-text--top {
    top: 0;
    bottom: auto;
}

.ae-slide-text--middle {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    padding: 24px;
}

.ae-slide-text--bottom {
    bottom: 0;
    top: auto;
}

/* ── Text alignment ───────────────────────────────────────── */
.ae-slide-text--left   { text-align: left;   align-items: flex-start; }
.ae-slide-text--center { text-align: center; align-items: center; }
.ae-slide-text--right  { text-align: right;  align-items: flex-end; }

/* ── Sub-heading ─────────────────────────────────────────── */
.ae-slide-sub {
    display: inline-block;
    font-family: Montserrat, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #e8192c;
    background: rgba(255,255,255,0.92);
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1.4;
}

/* ── Heading ─────────────────────────────────────────────── */
.ae-slide-heading {
    font-family: Lato, sans-serif;
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Content ─────────────────────────────────────────────── */
.ae-slide-content {
    font-family: Montserrat, sans-serif;
    font-size: clamp(12px, 1.5vw, 14px);
    color: rgba(255,255,255,0.88);
    line-height: 1.55;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    max-width: 420px;
}

/* Make slide-inner relative so overlay positions correctly */
.ae-gallery-slide-inner {
    position: relative;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .ae-slide-text {
        padding: 14px 16px;
        gap: 4px;
    }
    .ae-slide-heading {
        font-size: clamp(14px, 4vw, 18px);
    }
    .ae-slide-content {
        font-size: 12px;
    }
    .ae-slide-sub {
        font-size: 10px;
        padding: 2px 6px;
    }
}

@media (max-width: 479px) {
    .ae-slide-text {
        padding: 10px 12px;
        gap: 3px;
    }
    .ae-slide-heading {
        font-size: 14px;
    }
    .ae-slide-content {
        font-size: 11px;
        display: none; /* hide body text on very small screens */
    }
}
