/* ============================================================
   Connor Image Carousel — Module Styles
   ============================================================ */

.connor-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ── Track ─────────────────────────────────────────────────── */
.connor-carousel-track {
    display: flex;
    transition: transform var(--carousel-speed, 500ms) ease-in-out;
    will-change: transform;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Slides ─────────────────────────────────────────────────── */
.connor-carousel-slide {
    min-width: calc(100% / var(--carousel-per-view, 4)); /* JS sets --carousel-per-view on the wrapper */
    position: relative;
    flex-shrink: 0;
    padding: 0 var(--carousel-gap-half, 0px);
    box-sizing: border-box;
    list-style: none;  /* kill browser bullet */
    margin: 0;
}

/* Prevent Divi/theme list resets from sneaking bullets back in */
.connor-carousel-track li.connor-carousel-slide {
    list-style: none !important;
    list-style-type: none !important;
    background-image: none !important; /* some themes use bg-image bullets */
    padding: 0 var(--carousel-gap-half, 0px); /* symmetric — matches parent rule */
}

.connor-carousel-slide-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--carousel-radius, 6px);
    /* Use padding-top as the height source so aspect-ratio is bulletproof
       across older WebKit and Divi's stylesheet resets.
       The actual ratio is set inline by PHP as --carousel-ratio-pad (e.g. 56.25 for 16:9). */
    padding-top: var(--carousel-ratio-pad, 56.25%);
    height: 0; /* collapse natural height; padding-top drives it */
}

.connor-carousel-slide img {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    pointer-events: none;
    user-select: none;
}

/* ── Caption ─────────────────────────────────────────────────── */
.connor-carousel-slide-inner .connor-carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Arrow buttons ────────────────────────────────────────────── */
.connor-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.35);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.connor-carousel-btn:hover,
.connor-carousel-btn:focus-visible {
    background: rgba(0,0,0,0.65);
    border-color: #fff;
    outline: none;
}

.connor-carousel-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.6);
}

.connor-carousel-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.connor-carousel-prev { left: 14px; }
.connor-carousel-next { right: 14px; }

/* Hide arrows when only one slide */
.connor-carousel-wrapper[data-count="1"] .connor-carousel-btn {
    display: none;
}

/* ── Dots ─────────────────────────────────────────────────────── */
.connor-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 4px;
    list-style: none;
    margin: 0;
    list-style-type: none !important;
}

.connor-carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.connor-carousel-dot.is-active,
.connor-carousel-dot:hover {
    background: #000;
    transform: scale(1.25);
}

.connor-carousel-dot:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* ── Hide dots when only one slide ──────────────────────────── */
.connor-carousel-wrapper[data-count="1"] ~ .connor-carousel-dots {
    display: none;
}

/* ── Reduced-motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .connor-carousel-track {
        transition: none;
    }
}

/* ── Mobile overrides ────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Zero out gap padding at both specificity levels so nothing shifts the image */
    .connor-carousel-slide,
    .connor-carousel-track li.connor-carousel-slide {
        padding: 0 !important;
    }

    /* Ensure the module stretches full width in Divi column contexts */
    .connor-carousel-module {
        width: 100%;
    }
}