/* =====================================================================
   Berita publik: daftar (/news/list) dan detail (/news/view/:id/:slug).
   Dimuat per view lewat $this->Html->css(..., ['block' => true]) — DI LUAR bundel
   frontend-bundle.min.css (tidak perlu menjalankan build_frontend_css_bundle.php).

   montserrat-override.css (di bundel) memaksa font-weight 400 !important pada
   span/div/a/p/li (h2 600, h3 500), jadi setiap bobot huruf di sini wajib !important.

   Daftar berita = linimasa: tanggal terbit di rel bertitik (motif rel beranda,
   modern-landing.css), kartu berita di kanannya.
   ===================================================================== */

.rs-news {
    --rs-red: #dc2626;
    --rs-red-deep: #b91c1c;
    --rs-red-soft: #fdf1f1;
    --rs-ink: #1d2433;
    --rs-muted: #5f6675;
    --rs-line: #ebe7e8;
    --rs-mist: #f5f6f8;
    --rs-rail: #d6cfd0;
    background: var(--rs-mist);
    padding: 40px 0 56px;
    color: var(--rs-ink);
    font-size: 16px;
    line-height: 1.65;
}

.rs-news a:focus-visible,
.rs-news button:focus-visible,
.rs-news input:focus-visible {
    outline: 3px solid rgba(220, 38, 38, 0.4);
    outline-offset: 2px;
}

/* ---------- Tata letak daftar ---------- */
.rs-news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 40px;
    align-items: start;
}

.rs-news .rs-news-intro {
    margin: 0 0 28px;
    max-width: 68ch;
    color: var(--rs-muted);
    font-size: 15.5px;
    line-height: 1.7;
}

.rs-news .rs-news-intro a,
.rs-news-filter a {
    color: var(--rs-red-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rs-news-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin: 0 0 24px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--rs-line);
    font-size: 15px;
}

.rs-news .rs-news-filter p {
    margin: 0;
    color: var(--rs-ink);
}

.rs-news .rs-news-filter strong {
    font-weight: 700 !important;
}

/* ---------- Linimasa ---------- */
.rs-news-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rs-news-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 0 22px;
    margin: 0;
}

.rs-news-when {
    position: relative;
    padding: 20px 26px 0 0;
    text-align: right;
}

/* Rel: garis bertitik menyambung antarberita, titik merah sejajar judul kartu. */
.rs-news-when::before {
    content: "";
    position: absolute;
    top: 0;
    right: 4px;
    bottom: 0;
    border-left: 2px dotted var(--rs-rail);
}

.rs-news-when::after {
    content: "";
    position: absolute;
    top: 27px;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rs-red);
    box-shadow: 0 0 0 4px var(--rs-mist);
}

.rs-news-item:first-child .rs-news-when::before {
    top: 30px;
}

.rs-news-item:last-child .rs-news-when::before {
    bottom: auto;
    height: 30px;
}

.rs-news-item:only-child .rs-news-when::before {
    display: none;
}

.rs-news .rs-news-day {
    display: block;
    color: var(--rs-ink);
    font-size: 26px;
    line-height: 1;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
}

.rs-news .rs-news-monthyear {
    display: block;
    margin-top: 5px;
    color: var(--rs-muted);
    font-size: 12.5px;
    line-height: 1.3;
    white-space: nowrap;
}

/* ---------- Kartu berita ---------- */
.rs-news-card {
    position: relative;
    display: flex;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(29, 36, 51, 0.06), 0 0 0 1px var(--rs-line);
    transition: box-shadow 0.15s ease;
}

.rs-news-card:hover {
    box-shadow: 0 8px 22px rgba(29, 36, 51, 0.1), 0 0 0 1px var(--rs-line);
}

.rs-news-card:focus-within {
    box-shadow: 0 0 0 2px var(--rs-red);
}

.rs-news-media {
    flex: 0 0 34%;
    max-width: 260px;
    background: var(--rs-mist);
}

.rs-news-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 176px;
    object-fit: cover;
}

.rs-news-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 20px 22px;
}

.rs-news .rs-news-heading {
    margin: 0;
    color: var(--rs-ink);
    font-size: 19px;
    line-height: 1.35;
    font-weight: 700 !important;
    letter-spacing: -0.005em;
}

.rs-news .rs-news-heading a {
    color: inherit;
    font-weight: inherit !important;
    text-decoration: none;
}

/* Seluruh kartu bisa diklik lewat tautan judul; tag tetap tautan terpisah di atasnya. */
.rs-news .rs-news-heading a::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.rs-news .rs-news-heading a:focus-visible {
    outline: none;
}

.rs-news-card:hover .rs-news-heading a {
    color: var(--rs-red-deep);
}

.rs-news .rs-news-date {
    display: none;
    margin: 0;
    color: var(--rs-muted);
    font-size: 13.5px;
}

.rs-news .rs-news-excerpt {
    margin: 0;
    color: var(--rs-muted);
    font-size: 15px;
    line-height: 1.6;
}

.rs-news-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: auto 0 0;
    padding: 6px 0 0;
    list-style: none;
}

.rs-news-tags li {
    margin: 0;
}

.rs-news .rs-news-tags a,
.rs-news .rs-news-taglist a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--rs-mist);
    color: var(--rs-muted);
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rs-news .rs-news-tags a:hover,
.rs-news .rs-news-taglist a:hover {
    background: var(--rs-red-soft);
    color: var(--rs-red-deep);
}

.rs-news .rs-news-taglist a.is-active {
    background: var(--rs-red);
    color: #fff;
}

/* ---------- Halaman ---------- */
.rs-news-pagination {
    margin: 12px 0 0 110px;
}

.rs-news-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rs-news-pagination li {
    margin: 0;
}

.rs-news .rs-news-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 6px 12px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--rs-line);
    color: var(--rs-ink);
    font-size: 14.5px;
    text-decoration: none;
}

.rs-news .rs-news-pagination a:hover {
    box-shadow: 0 0 0 1px var(--rs-red);
    color: var(--rs-red-deep);
}

.rs-news .rs-news-pagination .active a {
    background: var(--rs-red);
    box-shadow: none;
    color: #fff;
    font-weight: 600 !important;
}

.rs-news .rs-news-pagination .disabled a {
    box-shadow: none;
    background: transparent;
    color: #a3a8b3;
    pointer-events: none;
}

/* ---------- Kosong ---------- */
.rs-news-empty {
    padding: 44px 24px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--rs-line);
    text-align: center;
}

.rs-news .rs-news-empty h2 {
    margin: 0 0 8px;
    color: var(--rs-ink);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700 !important;
}

.rs-news .rs-news-empty p {
    max-width: 46ch;
    margin: 0 auto 18px;
    color: var(--rs-muted);
    font-size: 15px;
}

.rs-news .rs-news-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--rs-red);
    color: #fff;
    font-size: 15px;
    font-weight: 600 !important;
    text-decoration: none;
}

.rs-news .rs-news-btn:hover {
    background: var(--rs-red-deep);
    color: #fff;
}

.rs-news .rs-news-btn--ghost {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--rs-line);
    color: var(--rs-ink);
}

.rs-news .rs-news-btn--ghost:hover {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--rs-red);
    color: var(--rs-red-deep);
}

/* ---------- Cari & tag ---------- */
.rs-news-aside {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 22px;
    padding: 20px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--rs-line);
}

.rs-news-search {
    margin: 0;
}

.rs-news .rs-news-label {
    display: block;
    margin: 0 0 8px;
    color: var(--rs-ink);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600 !important;
}

.rs-news-search-row {
    display: flex;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px #d5d8de;
    background: #fff;
}

.rs-news-search-row:focus-within {
    box-shadow: inset 0 0 0 2px var(--rs-red);
}

.rs-news-search-row input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px 0 0 10px;
    background: transparent;
    color: var(--rs-ink);
    font: inherit;
    font-size: 15px;
}

.rs-news .rs-news-search-row input:focus-visible {
    outline: none;
}

.rs-news-search-row button {
    flex: 0 0 46px;
    height: 44px;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: var(--rs-red);
    font-size: 15px;
    cursor: pointer;
}

.rs-news-search-row button:hover {
    color: var(--rs-red-deep);
}

.rs-news-taglist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rs-news-taglist li {
    margin: 0;
}

/* =====================================================================
   Detail berita
   ===================================================================== */
.rs-news--article {
    padding-top: 28px;
}

.rs-news-crumbs,
.rs-news-article,
.rs-news-more,
.rs-news .rs-news-back {
    max-width: 780px;
    margin-right: auto;
    margin-left: auto;
}

.rs-news-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--rs-muted);
    font-size: 14px;
}

.rs-news .rs-news-crumbs a {
    color: var(--rs-muted);
    text-decoration: none;
}

.rs-news .rs-news-crumbs a:hover {
    color: var(--rs-red-deep);
    text-decoration: underline;
}

.rs-news-article {
    margin-bottom: 28px;
    padding: 40px 44px 32px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(29, 36, 51, 0.06), 0 0 0 1px var(--rs-line);
}

.rs-news .rs-news-title {
    margin: 0 0 14px;
    color: var(--rs-ink);
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700 !important;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.rs-news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rs-line);
    color: var(--rs-muted);
    font-size: 14.5px;
}

.rs-news-meta .rs-news-tags {
    margin: 0;
    padding: 0;
}

.rs-news-cover {
    margin: 0 0 26px;
}

.rs-news-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Isi dari editor admin: ukuran & lebar gambar/tabel/video dijinakkan supaya tidak melebar di HP.
   Dulu js-view-news memaksa max-height 400px + object-fit cover pada semua gambar isi berita,
   sehingga poster/infografik tegak terpotong. */
.rs-news-content {
    max-width: none;
    font-size: 16.5px;
    line-height: 1.75;
    overflow-wrap: break-word;
}

.rs-news-content p {
    margin: 0 0 16px;
}

.rs-news-content img {
    max-width: 100%;
    height: auto !important;
    border-radius: 8px;
}

.rs-news-content iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
}

.rs-news-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.rs-news-content th,
.rs-news-content td {
    padding: 8px 10px;
    border: 1px solid var(--rs-line);
    vertical-align: top;
}

.rs-news-content blockquote {
    margin: 0 0 16px;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--rs-red);
    color: var(--rs-muted);
    font-size: inherit;
}

.rs-news-content > :last-child {
    margin-bottom: 0;
}

/* ---------- Bagikan ---------- */
.rs-news-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--rs-line);
}

.rs-news .rs-news-share-label {
    margin-right: 4px;
    color: var(--rs-muted);
    font-size: 14.5px;
}

.rs-news .rs-news-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--rs-line);
    color: var(--rs-ink);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.3;
    font-weight: 600 !important;
    text-decoration: none;
    cursor: pointer;
}

.rs-news .rs-news-share-btn span {
    font-weight: inherit !important;
}

.rs-news .rs-news-share-btn:hover {
    box-shadow: inset 0 0 0 1px var(--rs-ink);
    color: var(--rs-ink);
}

.rs-news-share-btn i {
    font-size: 16px;
}

.rs-news-share-btn.is-wa i {
    color: #128c7e;
}

.rs-news-share-btn.is-fb i {
    color: #1877f2;
}

.rs-news-share-btn.is-done i {
    color: #15803d;
}

/* ---------- Berita lainnya ---------- */
.rs-news-more {
    margin-bottom: 24px;
}

.rs-news .rs-news-more h2 {
    margin: 0 0 6px;
    color: var(--rs-ink);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700 !important;
}

.rs-news-more ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rs-news-more li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 20px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--rs-line);
}

.rs-news .rs-news-more a {
    color: var(--rs-ink);
    font-size: 16px;
    line-height: 1.45;
    font-weight: 600 !important;
    text-decoration: none;
}

.rs-news .rs-news-more a:hover {
    color: var(--rs-red-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rs-news-more time {
    flex: 0 0 auto;
    color: var(--rs-muted);
    font-size: 13.5px;
    white-space: nowrap;
}

.rs-news .rs-news-back {
    margin-bottom: 0;
}

/* =====================================================================
   Responsif
   ===================================================================== */
@media (max-width: 991px) {
    .rs-news-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    /* Cari & tag naik ke atas daftar; tag jadi satu baris yang bisa digeser. */
    .rs-news-aside {
        position: static;
        order: -1;
        gap: 14px;
        padding: 16px;
    }

    .rs-news-tagbox {
        min-width: 0;
    }

    .rs-news-taglist {
        flex-wrap: nowrap;
        margin: 0 -16px;
        padding: 2px 16px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .rs-news-taglist::-webkit-scrollbar {
        display: none;
    }

    .rs-news-taglist a {
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .rs-news {
        padding: 24px 0 40px;
    }

    .rs-news .rs-news-intro {
        margin-bottom: 20px;
    }

    /* Rel disembunyikan; tanggal pindah ke dalam kartu. */
    .rs-news-item {
        display: block;
    }

    .rs-news-when {
        display: none;
    }

    .rs-news .rs-news-date {
        display: block;
    }

    .rs-news-card {
        flex-direction: column;
        margin-bottom: 14px;
    }

    .rs-news-media {
        flex: 0 0 auto;
        max-width: none;
    }

    .rs-news-media img {
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .rs-news-body {
        padding: 16px 18px 18px;
    }

    .rs-news .rs-news-heading {
        font-size: 17.5px;
    }

    .rs-news-pagination {
        margin-left: 0;
    }

    .rs-news--article {
        padding-top: 18px;
    }

    .rs-news-article {
        padding: 24px 18px 22px;
    }

    .rs-news .rs-news-title {
        font-size: 24px;
    }

    .rs-news-meta {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .rs-news-content {
        font-size: 16px;
        line-height: 1.7;
    }

    .rs-news-more li {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rs-news-card,
    .rs-news .rs-news-tags a,
    .rs-news .rs-news-taglist a {
        transition: none;
    }
}
