/* ==========================================================================
   WM Slider / Carousel  —  built on Swiper.js
   ========================================================================== */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.wm-slider {
    position: relative;
    width: 100%;
}

.wm-slider__swiper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* ── Slide ───────────────────────────────────────────────────────────────── */
.wm-slider__slide {
    position: relative;
    overflow: hidden;
    height: 500px;   /* overridden by Elementor style control */
    box-sizing: border-box;
}

/* ── Image fill ──────────────────────────────────────────────────────────── */
.wm-slider__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Image fill — covers the slide completely, centre-cropped, no distortion.
 *
 * width/height 100% make the <img> box fill .wm-slider__image exactly.
 * object-fit: cover scales the image so its shorter axis fills the box
 *   while keeping the intrinsic aspect ratio — never squishes or stretches.
 * object-position: center centre — the midpoint of the image stays visible
 *   regardless of how much the edges are cropped.
 *
 * Specificity (0,1,2) — child-combinator selector beats Elementor's global
 * `img { height: auto }` (0,0,1) and `.elementor-widget-container img` (0,1,1)
 * without needing !important.
 */
.wm-slider__image > img,
.wm-slider__image > a > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* ── Per-slide tint overlay ──────────────────────────────────────────────── */
.wm-slider__tint {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ── Content ─────────────────────────────────────────────────────────────── */
.wm-slider__content {
    position: relative;
    z-index: 2;
    padding: 24px 32px;
    box-sizing: border-box;
}

/* Overlay variants — content sits on top of the image */
.wm-slider__content--overlay {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    /* Default: top. Overridden by Elementor's responsive title_position CSS. */
    top: 0;
}

/* Legacy position classes — kept for backward compatibility with
   any existing slider instances that still carry these class names. */
.wm-slider__content--overlay-bottom {
    bottom: 0;
    top: auto;
    transform: none;
}

.wm-slider__content--overlay-top {
    top: 0;
    bottom: auto;
    transform: none;
}

.wm-slider__content--overlay-center {
    top: 50%;
    bottom: auto;
    transform: translateY( -50% );
}

/* Below-image variant — slide must allow content to expand height */
.wm-slider__content--below {
    position: relative;
    background: inherit;
}

/* When content is below, slide becomes a flex column */
.wm-slider__slide:has( .wm-slider__content--below ) {
    height: auto;
    display: flex;
    flex-direction: column;
}

.wm-slider__slide:has( .wm-slider__content--below ) .wm-slider__image {
    position: relative;
    flex: 0 0 auto;
    height: 260px;
}

/* ── Title ───────────────────────────────────────────────────────────────── */
.wm-slider__title {
    margin: 0 0 8px;
    line-height: 1.2;
    font-size: 1.5em;
    color: #fff;
}

.wm-slider__title a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.wm-slider__title a:hover {
    opacity: 0.85;
}

/* ── Date / meta ─────────────────────────────────────────────────────────── */
.wm-slider__meta {
    font-size: 0.8em;
    opacity: 0.75;
    margin-bottom: 6px;
    color: inherit;
}

/* ── Description / excerpt ───────────────────────────────────────────────── */
.wm-slider__desc {
    margin: 0 0 0;
    line-height: 1.5;
    color: rgba( 255, 255, 255, 0.85 );
}

/* ── Button ──────────────────────────────────────────────────────────────── */
.wm-slider__btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

/* ── Swiper navigation arrows ────────────────────────────────────────────── */
.wm-slider__swiper .swiper-button-prev,
.wm-slider__swiper .swiper-button-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba( 0, 0, 0, 0.3 );
    color: #fff;
    transition: background-color 0.2s ease;
}

.wm-slider__swiper .swiper-button-prev::after,
.wm-slider__swiper .swiper-button-next::after {
    font-size: 18px;
    font-weight: 700;
}

.wm-slider__swiper .swiper-button-prev:hover,
.wm-slider__swiper .swiper-button-next:hover {
    background-color: rgba( 0, 0, 0, 0.6 );
}

/* Hide arrows when disabled (end of non-looping slider) */
.wm-slider__swiper .swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Swiper pagination ───────────────────────────────────────────────────── */
.wm-slider__swiper .swiper-pagination {
    bottom: 16px;
}

.wm-slider__swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba( 255, 255, 255, 0.5 );
    opacity: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.wm-slider__swiper .swiper-pagination-bullet-active {
    background: #fff;
    transform: scale( 1.3 );
}

/* ── Posts slider: below-image card body ─────────────────────────────────── */
.wm-slider__content--below .wm-slider__title {
    color: inherit;
}

.wm-slider__content--below .wm-slider__desc {
    color: inherit;
    opacity: 0.8;
}

.wm-slider__content--below .wm-slider__meta {
    color: inherit;
}
