/* =====================================================================
   CIBOR — Contact page slider (.contact-page-slider)
   Stackable Carousel: у кожному слайді картинка (3:1) + текст під нею.
   Текст накладаємо на фото (знизу зліва) з жовтим елементом "D"
   (img/element-preventive-gell-title.svg, як у preventieve-блоках)
   і дуже легким градієнтом знизу для контрасту.
   Розмітку в редакторі міняти не треба.
   ===================================================================== */

:root {
    --cps-yellow: #EDCC19;
    --cps-ease:   cubic-bezier(.16, .84, .44, 1);
}

/* ── Слайд ──────────────────────────────────────────────────────────── */
.contact-page-slider .stk-block-carousel__slider > .stk-block-column {
    position: relative;
}
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-column__content {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    padding: 0 !important;
}
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-inner-blocks {
    position: relative;
    row-gap: 0 !important;
}

/* ── Фото + легкий градієнт ─────────────────────────────────────────── */
.contact-page-slider .stk-block-image {
    margin: 0 !important;
}
.contact-page-slider .stk-block-image figure {
    position: relative;
    margin: 0;
}
.contact-page-slider .stk-block-image .stk-img-wrapper {
    display: block;
    aspect-ratio: 3 / 1 !important;
    height: auto !important;
}
.contact-page-slider .stk-block-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* градієнт: тільки нижня третина, дуже легкий */
.contact-page-slider .stk-block-image figure::after {
    content: "" !important;
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(0, 18, 38, .42) 0%,
        rgba(0, 18, 38, .18) 30%,
        rgba(0, 18, 38, 0) 60%
    );
}

/* ── Текст поверх фото ──────────────────────────────────────────────── */
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0 !important;
    display: flex;
    align-items: center;   /* текст по центру відносно "D" при 1 або 2 рядках */
    gap: 40px;
    padding: 0 48px 30px 0;
    pointer-events: none;
}
/* жовтий елемент "D" зліва, ледь заходить за край */
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text::before {
    content: "" !important; /* Stackable ставить content:none */
    position: static;
    flex: 0 0 auto;
    width: 56px;
    height: 96px;
    margin-left: -12px;
    background: url("/wp-content/themes/blankslate/img/element-preventive-gell-title.svg") left center / contain no-repeat;
    pointer-events: none;
}
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text .stk-block-text__text {
    margin: 0;
    flex: 0 1 auto;
    max-width: 640px;
    color: #fff !important;
    font-size: clamp(20px, 1.4vw + 10px, 32px);
    font-weight: 700;
    line-height: 1.15;
    text-wrap: balance;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
}

/* легка анімація появи тексту на активному слайді (Stackable ставить aria-hidden на неактивні) */
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text .stk-block-text__text,
.contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text::before {
    transition: opacity .6s ease, transform .7s var(--cps-ease);
}
.contact-page-slider .stk-block-carousel__slider > .stk-block-column[aria-hidden="true"] .stk-block-text .stk-block-text__text,
.contact-page-slider .stk-block-carousel__slider > .stk-block-column[aria-hidden="true"] .stk-block-text::before {
    opacity: 0;
    transform: translateY(10px);
}

/* ── Адаптив ────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .contact-page-slider .stk-block-image .stk-img-wrapper { aspect-ratio: 2 / 1 !important; }
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text {
        gap: 30px;
        padding: 0 32px 24px 0;
    }
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text::before {
        width: 44px;
        height: 76px;
    }
}
@media (max-width: 767px) {
    .contact-page-slider .stk-block-image .stk-img-wrapper { aspect-ratio: 4 / 3 !important; }
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text {
        gap: 22px;
        padding: 0 20px 20px 0;
    }
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text::before {
        width: 34px;
        height: 60px;
        margin-left: -8px;
    }
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text .stk-block-text__text {
        font-size: 18px;
        line-height: 1.25;
    }
    .contact-page-slider .stk-block-image figure::after {
        background: linear-gradient(to top, rgba(0, 18, 38, .5) 0%, rgba(0, 18, 38, .2) 40%, rgba(0, 18, 38, 0) 70%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text .stk-block-text__text,
    .contact-page-slider .stk-block-carousel__slider > .stk-block-column .stk-block-text::before { transition: none; }
}
