/*
 * Crawler pengumuman di bawah menu utama.
 * Warna diselaraskan dengan header: merah menu (#cf2e2e), emas hover butang
 * (#FFD700) dan kelabu bar atas (#E6E9EF).
 *
 * Tanpa JavaScript, senarai dipaparkan statik dan boleh ditatal mendatar.
 * crawler-pengumuman.js menambah .is-bergerak selepas menyalin senarai
 * supaya gelungan animasi bersambung tanpa jurang.
 */
.ikpkt-crawler {
    --ikpkt-merah: #cf2e2e;
    --ikpkt-merah-gelap: #a51e1e;
    --ikpkt-emas: #ffd700;
    --ikpkt-teks: #1f2937;
    --ikpkt-garis: #e6e9ef;
    --ikpkt-tempoh: 40s;

    position: relative;
    z-index: 1;
    margin: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--ikpkt-garis);
    box-shadow: 0 4px 12px -6px rgba(17, 24, 39, 0.12);
    font-family: var(--wp--preset--font-family--inter, inherit);
    color: var(--ikpkt-teks);
}

.ikpkt-crawler__dalam {
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    /* 54px -> 36px: lebih rendah daripada bar tarikh/jam (~44px) supaya
       crawler jelas berperanan sebagai baris sokongan. */
    min-height: 36px;
    margin: 0;
    padding: 0 16px;
}

/* Lencana "Terkini" */
.ikpkt-crawler__lencana {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 9px;
    border-radius: 5px;
    background: var(--ikpkt-merah);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(207, 46, 46, 0.28);
}

.ikpkt-crawler__denyut {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ikpkt-emas);
}

.ikpkt-crawler__denyut::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ikpkt-emas);
    animation: ikpkt-crawler-denyut 1.8s ease-out infinite;
}

@keyframes ikpkt-crawler-denyut {
    0%   { transform: scale(1);   opacity: 0.75; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* Tingkap dan trek */
.ikpkt-crawler__tingkap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.ikpkt-crawler__tingkap::-webkit-scrollbar {
    display: none;
}

.ikpkt-crawler__trek {
    display: flex;
    width: max-content;
}

.ikpkt-crawler.is-bergerak .ikpkt-crawler__tingkap {
    overflow-x: hidden;
}

.ikpkt-crawler.is-bergerak .ikpkt-crawler__trek {
    animation: ikpkt-crawler-gerak var(--ikpkt-tempoh) linear infinite;
}

/* Berhenti bila dihover. */
.ikpkt-crawler.is-bergerak .ikpkt-crawler__tingkap:hover .ikpkt-crawler__trek {
    animation-play-state: paused;
}

/*
 * Fokus papan kekunci: animasi dibuang dan tingkap kembali boleh ditatal,
 * supaya pelayar boleh menatal pautan yang difokus ke dalam pandangan.
 */
.ikpkt-crawler.is-fokus .ikpkt-crawler__tingkap {
    overflow-x: auto;
}

.ikpkt-crawler.is-fokus .ikpkt-crawler__trek {
    animation: none;
}

@keyframes ikpkt-crawler-gerak {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

/* Item */
.ikpkt-crawler__senarai {
    display: flex;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/*
 * Jarak antara item menggunakan padding, bukan gap, supaya setiap salinan
 * senarai mempunyai lebar yang sama dan translate -50% bersambung tepat.
 */
.ikpkt-crawler__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 44px 0 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.ikpkt-crawler__item::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 19px;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: var(--ikpkt-merah);
    opacity: 0.35;
    transform: translateY(-50%) rotate(45deg);
}

.ikpkt-crawler__ikon {
    flex-shrink: 0;
    /* Atribut SVG 18px -> 15px, sepadan dengan teks 13px. */
    width: 15px;
    height: 15px;
    color: var(--ikpkt-merah);
}

.ikpkt-crawler__teks {
    color: var(--ikpkt-teks);
}

.ikpkt-crawler__pautan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 4px;
    color: var(--ikpkt-merah);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ikpkt-crawler__pautan svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.ikpkt-crawler__pautan:hover,
.ikpkt-crawler__pautan:focus-visible {
    color: var(--ikpkt-merah-gelap);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ikpkt-crawler__pautan:hover svg {
    transform: translateX(3px);
}

.ikpkt-crawler__pautan:focus-visible {
    outline: 2px solid var(--ikpkt-merah);
    outline-offset: 3px;
}

.ikpkt-crawler__sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Telefon dan tablet kecil */
@media (max-width: 781px) {
    .ikpkt-crawler__dalam {
        gap: 10px;
        min-height: 34px;
        padding: 0 12px;
    }

    .ikpkt-crawler__lencana {
        padding: 4px 8px;
        font-size: 10px;
    }

    .ikpkt-crawler__item {
        font-size: 12.5px;
        padding-right: 36px;
    }

    .ikpkt-crawler__item::after {
        right: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ikpkt-crawler__denyut::after {
        animation: none;
    }
}

/* Paparan dalam editor apabila tiada pengumuman aktif. */
.ikpkt-crawler--kosong {
    padding: 14px 20px;
    border: 1px dashed var(--ikpkt-merah);
    background: #fff7f7;
    font-size: 14px;
    text-align: center;
}
