/* =========================================================
   HERO + DATA TIM JURNALISTIK (dbjurnalis)
   Kiri  : KATEGORI  — segitiga siku (siku kiri-bawah),
           sisi miring melengkung ke dalam
   Kanan : 10 BERITA TERBARU — segitiga siku (siku kanan-atas),
           sisi miring melengkung ke dalam
   Di desktop, lebar & lengkungan dihitung ulang oleh
   assets/js/berita-jurnalis.js dari posisi huruf di navbar.
   Nilai di bawah hanya cadangan bila JavaScript mati:
     S(y)  = 0.4*y + 0.6*(3y^2 - 2y^3)   (kurva S yang longgar)
     kiri  : lebar     = 0.38 + 0.62 * S(y)
     kanan : tepi kiri = 0.45 * S(y)
   ========================================================= */

.jn-tri {
    --jn-blue: #0056b3;
    --jn-navy: #002060;
    --jn-yellow: #ffcc00;
    position: absolute;
    z-index: 2;
    padding: 0;             /* menimpa aturan global "section { padding }" */
    display: flex;
    flex-direction: column;
    text-align: left;
}
.hero .hero-content { position: relative; z-index: 3; }

/* label kecil di atas tiap blok */
.jn-tri-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--jn-yellow);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.jn-tri-label a {
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: none;
    font-size: 0.8rem;
    opacity: 0.85;
}
.jn-tri-label a:hover { opacity: 1; text-decoration: underline; }

.jn-stripes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;               /* celah antar garis: video tetap terlihat */
}

.jn-stripe {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease, color 0.2s ease;
    animation-duration: 0.55s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
    animation-fill-mode: both;
    animation-delay: calc(0.25s + var(--i, 0) * 55ms);
}
.jn-txt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- KIRI: KATEGORI ---------------- */
.jn-tri-left {
    --bw: 40vw;
    left: 0;
    bottom: 5vh;
    width: var(--bw);
    height: 56vh;
}
.jn-tri-left .jn-tri-label { padding-left: 24px; }
.jn-tri-left .jn-stripes {
    clip-path: polygon(0 0, 38.00% 0.00%, 39.22% 4.17%, 40.80% 8.33%, 42.70% 12.50%, 44.89% 16.67%, 47.34% 20.83%, 50.01% 25.00%, 52.88% 29.17%, 55.91% 33.33%, 59.07% 37.50%, 62.33% 41.67%, 65.65% 45.83%, 69.00% 50.00%, 72.35% 54.17%, 75.67% 58.33%, 78.93% 62.50%, 82.09% 66.67%, 85.12% 70.83%, 87.99% 75.00%, 90.66% 79.17%, 93.11% 83.33%, 95.30% 87.50%, 97.20% 91.67%, 98.78% 95.83%, 100.00% 100.00%, 0 100%);
}
.jn-tri-left .jn-stripe {
    padding-left: 24px;
    background: linear-gradient(90deg, rgba(0, 86, 179, 0.92) 0%, rgba(0, 32, 96, 0.92) 100%);
    border-left: 5px solid var(--jn-yellow);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation-name: jnFromLeft;
}
.jn-tri-left .jn-txt { max-width: calc(var(--w, 0.38) * var(--bw) - 56px); }
.jn-tri-left .jn-stripe:hover,
.jn-tri-left .jn-stripe:focus-visible {
    background: var(--jn-yellow);
    color: #1a1a1a;
    outline: none;
}

/* ---------------- KANAN: 10 BERITA TERBARU ---------------- */
.jn-tri-right {
    --bw: 36vw;
    right: 0;
    top: 86px;              /* tepat di bawah tulisan "Mencetak Generasi Vokasi Islami" */
    bottom: 5vh;            /* sejajar dengan bawah blok kategori */
    width: var(--bw);
}
.jn-tri-right .jn-tri-label { justify-content: flex-end; padding-right: 24px; }
.jn-tri-right .jn-stripes {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 45.00% 100.00%, 44.11% 95.83%, 42.97% 91.67%, 41.59% 87.50%, 40.00% 83.33%, 38.22% 79.17%, 36.28% 75.00%, 34.20% 70.83%, 32.00% 66.67%, 29.71% 62.50%, 27.34% 58.33%, 24.93% 54.17%, 22.50% 50.00%, 20.07% 45.83%, 17.66% 41.67%, 15.29% 37.50%, 13.00% 33.33%, 10.80% 29.17%, 8.72% 25.00%, 6.78% 20.83%, 5.00% 16.67%, 3.41% 12.50%, 2.03% 8.33%, 0.89% 4.17%, 0.00% 0.00%);
}
.jn-tri-right .jn-stripe {
    padding-left: calc(var(--x, 0) * var(--bw) + 22px);
    padding-right: 24px;
    background: rgba(255, 255, 255, 0.93);
    border-right: 5px solid var(--jn-yellow);
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
    animation-name: jnFromRight;
}
.jn-no {
    flex-shrink: 0;
    color: var(--jn-blue);
    font-weight: 700;
    font-size: 0.85rem;
}
.jn-tri-right .jn-stripe:hover,
.jn-tri-right .jn-stripe:focus-visible {
    background: var(--jn-yellow);
    color: #1a1a1a;
    outline: none;
}

@keyframes jnFromLeft  { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes jnFromRight { from { transform: translateX(100%); }  to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .jn-stripe { animation: none; }
}

/* judul artikel boleh 2 baris di desktop (bloknya sempit) */
@media (min-width: 901px) {
    /* tinggi tiap baris tetap 1/10 blok, walau artikelnya kurang dari 10
       (9 celah x 5px = 45px) */
    .jn-tri-right .jn-stripe { flex: 0 0 calc((100% - 45px) / 10); }
    .jn-tri-right .jn-txt {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3;
        font-size: 0.86rem;
    }
}

/* teks hero dibuat lebih ramping agar muat di jalur tengah */
@media (min-width: 901px) {
    .hero .hero-content { max-width: min(560px, 38vw); }
    .hero .hero-content h1 { font-size: clamp(1.9rem, 3vw, 3rem); }
    .hero .hero-content p  { font-size: clamp(0.95rem, 1.2vw, 1.2rem); }
}

/* ---------------- LAYAR KECIL: susun ke bawah ---------------- */
@media (max-width: 900px) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 120px 0 36px;
        justify-content: flex-start;
    }
    .hero .hero-content { padding: 0 16px; margin-bottom: 32px; }
    .jn-tri {
        position: relative;
        left: auto; right: auto; top: auto; bottom: auto;
        width: 100%;
        height: auto;
        margin-top: 24px;
    }
    .jn-tri .jn-stripes { clip-path: none; }
    .jn-stripe { flex: none; min-height: 42px; padding-top: 6px; padding-bottom: 6px; }
    /* tetap bertangga membentuk segitiga */
    .jn-tri-left .jn-stripe { width: max(170px, calc(var(--w, 1) * 100%)); }
    .jn-tri-left .jn-txt { max-width: none; }
    .jn-tri-right .jn-stripe {
        margin-left: calc(var(--x, 0) * 45%);
        padding-left: 16px;
    }
}

/* =========================================================
   SLIDE FOTO ALBUM DI HERO (pengganti video)
   ========================================================= */
.hero-slides {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: #002060;
}
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hero-slide.is-active {
    opacity: 1;
    animation: heroZoom 7.5s ease-out both;   /* zoom pelan */
}
@keyframes heroZoom { from { transform: scale(1.07); } to { transform: scale(1); } }

.hero-slide-caption {
    position: absolute;
    left: 50%;
    bottom: 2.2vh;
    z-index: 3;
    transform: translateX(-50%);
    max-width: 40vw;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0, 20, 50, 0.45);
    color: #fff;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, color 0.2s ease;
}
.hero-slide-caption:hover { background: #ffcc00; color: #1a1a1a; }

@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
    .hero-slide.is-active { animation: none; }
}
@media (max-width: 900px) {
    .hero-slide-caption {
        position: relative;
        left: auto; bottom: auto;
        transform: none;
        max-width: 90%;
        margin-top: 20px;
    }
}
