/* =====================================================================
   DANH SÁCH TIN TỨC CHẠY (TICKER WIDGET) - ngovinhphu_20261026
   Màu, bo góc, kích thước ảnh lấy từ biến CSS do admin cấu hình.
   ===================================================================== */
.sft {
    --sft-head-bg: #702800;
    --sft-head-color: #fff;
    --sft-title-color: #702800;
    --sft-border: #e7e1dc;
    --sft-radius: 12px;
    --sft-img: 72px;
    --sft-lines: 2;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--sft-border);
    border-radius: var(--sft-radius);
    overflow: hidden;
    min-width: 0;
}

.sft--shadow {
    box-shadow: 0 6px 22px rgba(60, 30, 10, .10);
}

/* ---------- Tiêu đề khung ---------- */
.sft__head {
    flex: 0 0 auto;
    background: var(--sft-head-bg);
    color: var(--sft-head-color);
    padding: 14px 16px;
    text-align: center;
}

.sft .sft__title {
    margin: 0;
    color: inherit;
    font-size: 1.25rem !important;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ---------- Vùng chạy ---------- */
.sft__viewport {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
}

/* Mờ dần 2 mép trên/dưới cho cảm giác chạy liên tục */
.sft.is-animated .sft__viewport {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.sft.is-static .sft__viewport {
    overflow-y: auto;
}

.sft__track {
    list-style: none;
    margin: 0;
    padding: 0;
    will-change: transform;
}

.sft__item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--sft-border);
}

.sft__link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    color: inherit;
    text-decoration: none !important;
    transition: background-color .2s ease;
}

.sft__link:hover,
.sft__link:focus-visible {
    background: #fbf6f1;
}

.sft__link:focus-visible {
    outline: 2px solid var(--sft-title-color);
    outline-offset: -2px;
}

/* ---------- Ảnh ---------- */
.sft__media {
    flex: 0 0 var(--sft-img);
    width: var(--sft-img);
    height: var(--sft-img);
    overflow: hidden;
    background: #f2ece6;
}

.sft--img-square .sft__media { border-radius: 0; }
.sft--img-rounded .sft__media { border-radius: 8px; }
.sft--img-circle .sft__media { border-radius: 50%; }

.sft__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.sft__link:hover .sft__media img {
    transform: scale(1.06);
}

.sft__ph {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f2ece6, #e7ddd3);
}

/* ---------- Nội dung ---------- */
.sft__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

.sft__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.2;
}

.sft .sft__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--sft-lines);
    overflow: hidden;
    color: var(--sft-title-color);
    font-family: var(--sf-font-heading, "Roboto Condensed", Arial, sans-serif) !important;
    font-size: 1.0625rem !important;
    font-weight: 700;
    line-height: 1.35;
}

.sft__link:hover .sft__name {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sft .sft__summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #6b6b6b;
    font-size: .875rem !important;
    line-height: 1.45;
}

.sft .sft__cat {
    color: #bf6504;
    font-size: .75rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.sft .sft-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #8a8a8a;
    font-size: .8125rem !important;
    line-height: 1.3;
}

.sft .sft-time::before {
    content: "";
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background:
        linear-gradient(currentColor, currentColor) 50% 30% / 1.5px 4px no-repeat,
        linear-gradient(currentColor, currentColor) 62% 52% / 3.5px 1.5px no-repeat;
    opacity: .8;
}

.sft .sft-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #d70018;
    color: #fff;
    font-size: .6875rem !important;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .04em;
}

.sft .sft-badge--pin {
    background: #bf6504;
}

/* ---------- Chân khung ---------- */
.sft__foot {
    flex: 0 0 auto;
    border-top: 1px solid var(--sft-border);
    text-align: center;
}

.sft__foot a {
    display: block;
    padding: 10px 16px;
    color: var(--sft-title-color);
    font-weight: 600;
    text-decoration: none;
}

.sft__foot a:hover {
    background: #fbf6f1;
}

/* ---------- Hiệu ứng fade-up ---------- */
.sft__item.sft-leaving {
    opacity: 0;
    transform: translateY(-12px);
}

.sft__item.sft-entering {
    animation: sft-fade-up var(--sft-ms, 600ms) var(--sft-ease, ease-out) both;
}

.sft__item.sft-entering-down {
    animation: sft-fade-down var(--sft-ms, 600ms) var(--sft-ease, ease-out) both;
}

@keyframes sft-fade-down {
    from { opacity: 0; transform: translateY(-18px); }
    to { opacity: 1; transform: none; }
}

@keyframes sft-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Thiết bị ---------- */
@media (min-width: 992px) {
    .sft--hide-desktop { display: none !important; }
}

@media (max-width: 991.98px) {
    .sft--mobile-hide { display: none !important; }

    /* Dải chạy ngang 1 dòng */
    .sft.is-marquee {
        flex-direction: row;
        align-items: stretch;
    }

    .sft.is-marquee .sft__head {
        display: flex;
        align-items: center;
        padding: 8px 12px;
    }

    .sft.is-marquee .sft__title {
        font-size: .875rem !important;
        white-space: nowrap;
    }

    .sft.is-marquee .sft__foot { display: none; }

    .sft.is-marquee .sft__viewport {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
        overflow: hidden;
    }

    .sft.is-marquee .sft__track {
        display: flex;
        width: max-content;
        height: 100%;
    }

    .sft.is-marquee .sft__item {
        border-bottom: 0;
        border-right: 1px solid var(--sft-border);
    }

    .sft.is-marquee .sft__link {
        align-items: center;
        padding: 8px 14px;
        white-space: nowrap;
    }

    .sft.is-marquee .sft__media {
        display: none;
    }

    .sft.is-marquee .sft__name {
        display: block;
        font-size: .9375rem !important;
        white-space: nowrap;
    }

    .sft.is-marquee .sft__summary,
    .sft.is-marquee .sft__meta,
    .sft.is-marquee .sft-time { display: none; }
}

/* ---------- Người dùng bật "giảm chuyển động" ---------- */
@media (prefers-reduced-motion: reduce) {
    .sft__media img,
    .sft__item.sft-entering { transition: none; animation: none; }
}

/* ---------- Bố cục trang chủ: banner + widget ---------- */
.sf-hero-split {
    --bs-gutter-y: 1rem;
}

/* "Cao bằng banner": khung widget phủ đúng chiều cao cột, cột cao theo banner */
@media (min-width: 992px) {
    .sf-hero-split > .sf-hero-split__side {
        position: relative;
    }

    .sf-hero-split > .sf-hero-split__side > .sft.sft--fill {
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(var(--bs-gutter-x, 1.5rem) * .5);
        right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    }
}
