/* News split cards — horizontal carousel (pub9-style) */

.ns-section {
    background: transparent;
    padding: 1rem 0 0;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    box-sizing: border-box;
    overflow-x: clip;
    min-width: 0;
}

.ns-section .container {
    max-width: 1200px;
}

.ns-section-title {
    color: #1e293b;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    margin-bottom: 1.75rem;
}

.ns-section-sub {
    color: #64748b;
    text-align: center;
    font-size: 0.95rem;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.ns-carousel-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-inline: 4.25rem;
    box-sizing: border-box;
}

.ns-arrows {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none;
}

.ns-arrow {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(26, 31, 110, 0.16);
    color: var(--portal-primary, #2c2e85);
    font-size: 1.7rem;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 16px 38px rgba(26, 31, 110, 0.16);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.ns-arrow:hover {
    background: var(--portal-primary, #2c2e85);
    border-color: var(--portal-primary, #2c2e85);
    color: #fff;
    transform: scale(1.06);
}

.ns-arrow:focus-visible {
    outline: 2px solid var(--portal-primary, #2c2e85);
    outline-offset: 2px;
}

.ns-scroller {
    display: flex;
    gap: 1.25rem;
    padding: 1rem 0 1.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-sizing: border-box;
    justify-content: center;
    scroll-padding-inline: 14rem;
}

.ns-scroller::-webkit-scrollbar {
    display: none;
}

.ns-scroller::before,
.ns-scroller::after {
    content: "";
    flex: 0 0 clamp(2rem, 16vw, 14rem);
}

.ns-card {
    display: flex;
    width: 250px;
    flex-shrink: 0;
    height: 380px;
    background: #fff;
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    scroll-snap-align: center;
    text-decoration: none;
    color: inherit;
}

[dir="rtl"] .ns-card {
    direction: ltr;
}

[dir="rtl"] .ns-card .ns-content,
[dir="rtl"] .ns-card .ns-overlay-title,
[dir="rtl"] .ns-card .ns-tag {
    direction: rtl;
    text-align: right;
}

.ns-card:hover {
    width: min(700px, 92vw);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.ns-image {
    flex: 1;
    position: relative;
    height: 100%;
    min-width: 250px;
    background: linear-gradient(135deg, #2c3e50, #1a1a2e);
}

.ns-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ns-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    transition: opacity 0.4s ease;
    z-index: 1;
}

.ns-tag {
    position: absolute;
    top: 1.25rem;
    inset-inline-start: 1.25rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

.ns-overlay-title {
    position: absolute;
    bottom: 1.5rem;
    inset-inline-start: 1.25rem;
    inset-inline-end: 1.25rem;
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 2;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.ns-card:hover .ns-overlay-title {
    opacity: 0;
    transform: translateY(15px);
}

.ns-card:hover .ns-image::after {
    opacity: 0;
}

.ns-content {
    width: 0;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ns-card:hover .ns-content {
    width: min(450px, 45vw);
}

.ns-inner {
    min-width: 280px;
    padding: 0 2rem;
    opacity: 0;
    transform: translateX(calc(-20px * var(--ns-slide, 1)));
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: 0s;
}

[dir="rtl"] .ns-inner {
    --ns-slide: -1;
}

.ns-card:hover .ns-inner {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
}

.ns-title {
    font-size: 1.35rem;
    color: #1a1a2e;
    margin: 0 0 0.75rem;
    line-height: 1.25;
    font-weight: 700;
}

.ns-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.ns-btn {
    align-self: flex-start;
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, var(--portal-primary, #2c2e85), var(--portal-primary-dark, #22246a));
    color: #fff !important;
    font-weight: 700;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.ns-btn:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 46, 133, 0.35);
}

.ns-placeholder-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.35);
    z-index: 0;
}

@media (max-width: 850px) {
    .ns-section {
        padding: 1.5rem 0 2rem;
    }

    .ns-section .container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .ns-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.35rem;
    }

    .ns-carousel-wrap {
        padding-inline: 3rem;
    }

    .ns-scroller {
        padding: 0.5rem 0 1.25rem;
        gap: 0.85rem;
        /* Center card(s) when the strip is wider than the card (typical on phones) */
        justify-content: center;
        scroll-padding-inline: 0;
    }

    .ns-scroller::before,
    .ns-scroller::after {
        display: none;
    }

    .ns-card {
        flex-direction: column;
        width: min(100%, 22rem) !important;
        max-width: 100%;
        height: auto;
        flex-shrink: 0;
    }

    .ns-card:hover {
        width: min(100%, 22rem) !important;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    }

    .ns-image {
        min-width: 100%;
        height: min(200px, 42vw);
        max-height: 220px;
    }

    .ns-content {
        width: 100% !important;
        height: auto;
        padding: 1rem 0 1.15rem;
    }

    .ns-card:hover .ns-content {
        width: 100% !important;
    }

    .ns-inner {
        min-width: unset;
        padding: 0 1rem;
        opacity: 1;
        transform: none;
    }

    .ns-title {
        font-size: 1.1rem;
    }

    .ns-excerpt {
        font-size: 0.88rem;
        margin-bottom: 1rem;
    }

    .ns-btn {
        align-self: stretch;
        text-align: center;
    }

    .ns-overlay-title,
    .ns-image::after {
        display: none;
    }
}

/* Narrow phones: one card = full content width, no horizontal page scroll */
@media (max-width: 400px) {
    .ns-card,
    .ns-card:hover {
        width: 100% !important;
        max-width: 100%;
    }

    .ns-image {
        height: 180px;
    }
}
