/* ================================================================
   HERO SLIDER BERANDA — STAI MUTIARA BANGSA
   File tambahan; tidak mengganti style.css utama.
================================================================ */

.home-hero-slider {
    --home-slide-duration: 7000ms;
    position: relative;
    min-height: 720px;
    padding: 0;
    overflow: hidden;
}

.home-hero-viewport {
    position: relative;
    min-height: 720px;
    transition: height 0.45s ease;
}

.home-hero-slide {
    position: absolute;
    z-index: 1;
    inset: 0 0 auto;
    width: 100%;
    min-height: 720px;
    padding: 72px 0 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(38px);
    transition:
        opacity 0.58s ease,
        transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 0.58s;
}

.home-hero-slide.is-active {
    z-index: 2;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
}

.home-hero-slide.is-leaving {
    z-index: 1;
    visibility: visible;
    opacity: 0;
    transform: translateX(-30px);
}

/* Slide berita dan artikel */
.home-feature-slide {
    display: flex;
    align-items: center;
    padding-bottom: 70px;
}

.home-feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
    gap: clamp(42px, 6vw, 92px);
    align-items: center;
    min-height: 570px;
}

.home-feature-copy {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.home-feature-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    color: #27549a;
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-feature-eyebrow > span {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #e3262e;
}

.home-feature-category {
    display: table;
    margin-bottom: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: #1498c4;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

.home-feature-category-yellow {
    color: #102648;
    background: #f4d600;
}

.home-feature-title {
    max-width: 700px;
    margin: 0;
    color: #102648;
    font-size: clamp(2.35rem, 4.3vw, 4.35rem);
    font-weight: 850;
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.home-feature-summary {
    display: -webkit-box;
    max-width: 620px;
    margin: 24px 0 0;
    overflow: hidden;
    color: #5d6f88;
    font-size: clamp(1rem, 1.3vw, 1.14rem);
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.home-feature-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 22px;
    color: #62748d;
    font-size: 0.82rem;
    font-weight: 700;
}

.home-feature-meta span {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.home-feature-meta span::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1498c4;
    box-shadow: 0 0 0 4px rgba(20, 152, 196, 0.1);
}

.home-feature-meta span:nth-child(2)::before {
    background: #e3262e;
    box-shadow: 0 0 0 4px rgba(227, 38, 46, 0.08);
}

.home-feature-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 24px;
    margin-top: 31px;
}

.home-feature-actions .button {
    min-height: 54px;
    margin: 0;
    padding: 0 25px;
    border-radius: 12px;
}

.home-feature-text-link {
    position: relative;
    color: #214e94;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.home-feature-text-link::after {
    content: "→";
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.22s ease;
}

.home-feature-text-link:hover::after {
    transform: translateX(4px);
}

.home-feature-media {
    position: relative;
    display: block;
    min-height: 510px;
    overflow: hidden;
    border: 1px solid rgba(39, 84, 154, 0.12);
    border-radius: 32px 8px 32px 8px;
    background: #dcecf3;
    box-shadow: 0 34px 75px rgba(16, 38, 72, 0.17);
    isolation: isolate;
}

.home-feature-media::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            transparent 48%,
            rgba(16, 38, 72, 0.54) 100%
        );
    pointer-events: none;
}

.home-feature-media::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    right: 38px;
    width: 90px;
    height: 7px;
    border-radius: 0 0 7px 7px;
    background: linear-gradient(90deg, #e3262e 0 50%, #f4d600 50% 100%);
}

.home-feature-media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Poster vertikal/infografik harus terlihat utuh, bukan terpotong seperti foto. */
.home-feature-media-contain {
    background:
        radial-gradient(circle at 75% 30%, rgba(141, 208, 225, 0.42), transparent 44%),
        linear-gradient(145deg, #eef7fb, #d8eaf2);
}

.home-feature-media-contain::before {
    background:
        linear-gradient(
            180deg,
            transparent 70%,
            rgba(16, 38, 72, 0.26) 100%
        );
}

.home-feature-media-contain img {
    object-fit: contain;
    object-position: center;
}

.home-feature-media:hover img {
    transform: scale(1.035);
}

/* Artikel memakai foto eksternal dengan rasio beragam. Tampilkan gambar utuh. */
.home-feature-article .home-feature-media {
    background:
        radial-gradient(circle at 24% 22%, rgba(141, 208, 225, 0.34), transparent 42%),
        linear-gradient(145deg, #f4f9fc, #dcecf3);
}

.home-feature-article .home-feature-media img {
    object-fit: contain;
    object-position: center;
}

.home-feature-article .home-feature-media:hover img,
.home-feature-media-contain:hover img {
    transform: none;
}

.home-feature-media-label {
    position: absolute;
    z-index: 3;
    right: 26px;
    bottom: 24px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(16, 38, 72, 0.56);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

/* Navigasi carousel */
.home-hero-controls {
    position: absolute;
    z-index: 20;
    inset: 0;
    pointer-events: none;
}

.home-hero-arrow,
.home-hero-dot {
    pointer-events: auto;
}

.home-hero-arrow {
    position: absolute;
    top: 50%;
    display: inline-flex;
    width: 48px;
    height: 48px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(39, 84, 154, 0.2);
    border-radius: 50%;
    color: #214e94;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 25px rgba(16, 38, 72, 0.1);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transform: translateY(-50%);
    transition:
        color 0.22s ease,
        background-color 0.22s ease,
        transform 0.22s ease;
}

.home-hero-arrow span {
    display: block;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 850;
    line-height: 1;
}

.home-hero-arrow:hover {
    color: #ffffff;
    background: #27549a;
    transform: translateY(-50%) scale(1.07);
}

.home-hero-prev {
    left: clamp(10px, 2.2vw, 38px);
}

.home-hero-next {
    right: clamp(10px, 2.2vw, 38px);
}

.home-hero-dots {
    display: flex;
    gap: 8px;
    padding: 7px;
    border: 1px solid rgba(39, 84, 154, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 25px rgba(16, 38, 72, 0.08);
    pointer-events: auto;
    backdrop-filter: blur(12px);
}

.home-hero-counter {
    display: inline-flex;
    min-width: 58px;
    height: 42px;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid rgba(39, 84, 154, 0.12);
    border-radius: 999px;
    color: #7a8ba2;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 25px rgba(16, 38, 72, 0.08);
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 42px;
    pointer-events: none;
    backdrop-filter: blur(12px);
}

.home-hero-counter strong {
    color: #214e94;
    font-size: 0.9rem;
    font-weight: 850;
}

.home-hero-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #b9c7d9;
    cursor: pointer;
    transition:
        width 0.28s ease,
        background-color 0.28s ease;
}

.home-hero-dot.is-active {
    width: 31px;
    background: #27549a;
}

.home-hero-progress {
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: min(240px, 48vw);
    height: 3px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(39, 84, 154, 0.12);
    transform: translateX(-50%);
}

.home-hero-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1498c4, #27549a, #f4d600);
    transform: scaleX(0);
    transform-origin: left center;
}

.home-hero-slider.is-playing .home-hero-progress > span {
    animation: homeHeroProgress var(--home-slide-duration) linear forwards;
}

.home-hero-slider.is-paused .home-hero-progress > span {
    animation-play-state: paused;
}

@keyframes homeHeroProgress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@media (max-width: 1050px) {
    .home-feature-grid {
        grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.85fr);
        gap: 34px;
    }

    .home-feature-media {
        min-height: 470px;
    }
}

@media (max-width: 860px) {
    .home-hero-slider,
    .home-hero-viewport {
        min-height: 0;
    }

    .home-hero-slide {
        min-height: 0;
        padding-top: 64px;
    }

    .home-feature-slide {
        padding-bottom: 96px;
    }

    .home-feature-grid {
        grid-template-columns: 1fr;
        gap: 34px;
        min-height: 0;
        text-align: center;
    }

    .home-feature-copy {
        max-width: 690px;
        margin: 0 auto;
    }

    .home-feature-eyebrow {
        justify-content: center;
    }

    .home-feature-category {
        margin-right: auto;
        margin-left: auto;
    }

    .home-feature-summary {
        margin-right: auto;
        margin-left: auto;
    }

    .home-feature-meta,
    .home-feature-actions {
        justify-content: center;
    }

    .home-feature-media {
        width: min(650px, 100%);
        min-height: 390px;
        margin: 0 auto;
    }

    .home-hero-controls {
        inset: 0;
    }
}

@media (max-width: 560px) {
    .home-hero-slide {
        padding-top: 45px;
    }

    .home-feature-slide {
        padding-bottom: 88px;
    }

    .home-feature-grid {
        gap: 26px;
    }

    .home-feature-eyebrow {
        gap: 9px;
        margin-bottom: 17px;
        font-size: 0.68rem;
    }

    .home-feature-eyebrow > span {
        width: 25px;
        height: 3px;
    }

    .home-feature-category {
        margin-bottom: 15px;
        padding: 7px 10px;
        font-size: 0.62rem;
    }

    .home-feature-title {
        font-size: clamp(2rem, 10.4vw, 3rem);
        line-height: 1.05;
    }

    .home-feature-summary {
        margin-top: 18px;
        font-size: 0.94rem;
        line-height: 1.65;
        -webkit-line-clamp: 4;
    }

    .home-feature-meta {
        gap: 10px 16px;
        margin-top: 17px;
        font-size: 0.74rem;
    }

    .home-feature-actions {
        gap: 15px;
        margin-top: 24px;
    }

    .home-feature-actions .button {
        min-height: 50px;
        padding: 0 20px;
        font-size: 0.86rem;
    }

    .home-feature-media {
        min-height: 315px;
        border-radius: 24px 7px 24px 7px;
    }

    .home-feature-media-label {
        right: 17px;
        bottom: 16px;
        padding: 8px 11px;
        font-size: 0.62rem;
    }

    .home-hero-controls {
        inset: 0;
    }

    .home-hero-arrow {
        width: 42px;
        height: 42px;
        background: rgba(255, 255, 255, 0.92);
    }

    .home-hero-prev {
        left: 8px;
    }

    .home-hero-next {
        right: 8px;
    }

    .home-hero-progress {
        bottom: -12px;
        width: 145px;
    }

    .home-hero-counter {
        min-width: 52px;
        height: 38px;
        line-height: 38px;
    }
}

/* Teks pengumuman untuk pembaca layar tidak boleh muncul di kanvas. */
.home-hero-slider .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-viewport,
    .home-hero-slide,
    .home-feature-media img,
    .home-hero-arrow,
    .home-hero-dot {
        transition: none !important;
    }

    .home-hero-progress > span {
        animation: none !important;
    }
}
