/* =============================================================================
   news-carousel.css — Слайдер "Останні новини"  [v2 — виправлено]
   ============================================================================= */

/* ── Секція ──────────────────────────────────────────────────────────────────── */

.stg-carousel-section {
    padding: 28px 0 24px;
    /* overflow: hidden ПРИБРАНО — тінь не обрізається */
    position: relative;
}

/* ── Шапка: заголовок + кнопки ──────────────────────────────────────────────── */

.stg-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 18px;
    position: relative;
    z-index: 10;   /* завжди над карточками */
}

.stg-carousel-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--stg-text, #1c2833);
    margin: 0;
    line-height: 1.2;
}

.stg-carousel-heading__accent {
    color: var(--stg-primary, #1a5276);
}

.stg-carousel-controls {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.stg-carousel-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--stg-border, #dce1e8);
    background: var(--stg-white, #fff);
    color: var(--stg-primary, #1a5276);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.stg-carousel-btn:hover {
    background: var(--stg-primary, #1a5276);
    border-color: var(--stg-primary, #1a5276);
    color: #fff;
    transform: scale(1.08);
}

.stg-carousel-btn:active  { transform: scale(0.96); }
.stg-carousel-btn:disabled {
    opacity: .35;
    cursor: default;
    transform: none;
}

/* ── Трек ────────────────────────────────────────────────────────────────────── */

.stg-carousel {
    position: relative;
}

.stg-carousel__track {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;

    /* Висота керується JS через CSS-змінну --carousel-height */
    height: var(--carousel-height, 440px);

    /* Вертикальний padding щоб тінь не обрізалась */
    padding: 16px 0 20px;

    user-select: none;
    cursor: grab;
}

.stg-carousel__track.is-dragging { cursor: grabbing; }

/* ── Слайди ──────────────────────────────────────────────────────────────────── */

.stg-carousel__slide {
    position: absolute;

    /* ~40% контейнера = 3 карточки видно одночасно */
    width: 40%;
    max-width: 380px;
    min-width: 240px;

    border-radius: 16px;
    overflow: hidden;   /* overflow лише на картці */

    /* Плавніше: .7s замість .5s */
    transition:
        transform  .7s cubic-bezier(.33,1,.68,1),
        opacity    .7s cubic-bezier(.33,1,.68,1),
        box-shadow .7s cubic-bezier(.33,1,.68,1);

    will-change: transform, opacity;

    opacity: 0;
    pointer-events: none;
    transform: translateX(0) scale(0.72);
    z-index: 0;
    box-shadow: none;
}

/* Активний — центр */
.stg-carousel__slide--active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
    z-index: 4;
    box-shadow: 0 12px 40px rgba(26, 82, 118, .20);
}

/* Попередній — зліва */
.stg-carousel__slide--prev {
    opacity: .7;
    pointer-events: auto;
    transform: translateX(-72%) scale(0.84);
    z-index: 3;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    cursor: pointer;
}

/* Наступний — справа */
.stg-carousel__slide--next {
    opacity: .7;
    pointer-events: auto;
    transform: translateX(72%) scale(0.84);
    z-index: 3;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    cursor: pointer;
}

/* Далеко ліворуч — натяк */
.stg-carousel__slide--far-prev {
    opacity: .15;
    pointer-events: none;
    transform: translateX(-118%) scale(0.68);
    z-index: 2;
    box-shadow: none;
}

/* Далеко праворуч */
.stg-carousel__slide--far-next {
    opacity: .15;
    pointer-events: none;
    transform: translateX(118%) scale(0.68);
    z-index: 2;
    box-shadow: none;
}

/* ── Посилання ───────────────────────────────────────────────────────────────── */

.stg-carousel__inner {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    background: var(--stg-white, #fff);
}

/* ── Зображення ──────────────────────────────────────────────────────────────── */

.stg-carousel__img-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--stg-bg-alt, #eef2f7);
    flex-shrink: 0;
}

.stg-carousel__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.4,0,.2,1);
    display: block;
}

.stg-carousel__slide--active .stg-carousel__inner:hover .stg-carousel__img {
    transform: scale(1.04);
}

.stg-carousel__img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(14,58,85,.45) 100%);
    pointer-events: none;
}

.stg-carousel__img-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        var(--stg-primary-dark, #0e3a55) 0%,
        var(--stg-primary, #1a5276) 100%
    );
}

/* ── Тіло картки ─────────────────────────────────────────────────────────────── */

.stg-carousel__body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stg-carousel__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stg-carousel__cat {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--stg-primary, #1a5276);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.stg-carousel__date {
    font-size: .73rem;
    color: var(--stg-text-muted, #5d6d7e);
}

.stg-carousel__title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--stg-text, #1c2833);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stg-carousel__excerpt {
    font-size: .8rem;
    color: var(--stg-text-muted, #5d6d7e);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stg-carousel__read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--stg-primary, #1a5276);
    margin-top: auto;
    padding-top: 6px;
    transition: gap .2s;
}

.stg-carousel__slide--active .stg-carousel__inner:hover .stg-carousel__read-more {
    gap: 9px;
}

/* ── Точки ───────────────────────────────────────────────────────────────────── */

.stg-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 8px 0 4px;
    position: relative;
    z-index: 5;
}

.stg-carousel__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: var(--stg-border, #dce1e8);
    cursor: pointer;
    padding: 0;
    transition: background .25s, width .3s, border-radius .3s;
}

.stg-carousel__dot--active {
    width: 22px;
    border-radius: 4px;
    background: var(--stg-primary, #1a5276);
}

/* ── Адаптив ─────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .stg-carousel__slide {
        width: 55%;
    }
    .stg-carousel__slide--prev  { transform: translateX(-80%) scale(0.82); }
    .stg-carousel__slide--next  { transform: translateX(80%)  scale(0.82); }
    .stg-carousel__slide--far-prev,
    .stg-carousel__slide--far-next { opacity: 0; pointer-events: none; }
}

@media (max-width: 480px) {
    .stg-carousel__slide        { width: 78%; min-width: 0; }
    .stg-carousel__slide--prev  { transform: translateX(-88%) scale(0.78); opacity: .5; }
    .stg-carousel__slide--next  { transform: translateX(88%)  scale(0.78); opacity: .5; }
}
