/* ==========================================================================
   HALAMAN DAFTAR ARTIKEL (client/posts/index)
   Senada dengan tampilan isi artikel (article-reading.css): minimalis,
   sudut membulat, aksen hijau Al Madinah. Semua kelas berawalan .am-
   ========================================================================== */

.am-list {
    --am-ink: #111827;
    --am-text: #374151;
    --am-muted: #6b7280;
    --am-line: #eceee9;
    --am-soft: #f5f9f1;
    --am-brand: #145614;
    --am-accent: #87E64B;
    --am-radius: 18px;
}

.dark .am-list {
    --am-ink: #FFF5ED;
    --am-text: rgba(255, 245, 237, 0.82);
    --am-muted: #9a9a9a;
    --am-line: #2a2a2a;
    --am-soft: #1f1f1f;
    --am-brand: #87E64B;
}

/* ---------- Kepala halaman ---------- */
.am-list-head {
    margin: 8px 0 22px;
}

.am-list-title {
    margin: 0;
    color: var(--am-ink);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
}

.am-list-sub {
    margin: 8px 0 0;
    color: var(--am-muted);
    font-size: 15px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .am-list-head {
        margin: 16px 0 28px;
    }

    .am-list-title {
        font-size: 38px;
    }

    .am-list-sub {
        font-size: 16.5px;
    }
}

/* Pencarian */
.am-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 640px;
    margin-top: 18px;
    padding: 5px 5px 5px 18px;
    border: 1px solid var(--am-line);
    border-radius: 999px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.am-search:focus-within {
    border-color: rgba(135, 230, 75, 0.9);
    box-shadow: 0 0 0 4px rgba(135, 230, 75, 0.18);
}

.dark .am-search {
    background: #1f1f1f;
}

.am-search > i {
    color: #9ca3af;
    font-size: 15px;
}

.am-search input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 9px 12px;
    color: var(--am-ink);
    font-size: 15px;
}

.am-search input::placeholder {
    color: #9ca3af;
}

.am-search button {
    flex-shrink: 0;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: #145614;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.am-search button:hover {
    background: #0f430f;
}

.dark .am-search button {
    background: #87E64B;
    color: #191919;
}

/* ---------- Kapsul kategori ---------- */
.am-chips-wrap {
    position: relative;
    margin: 0 -16px 24px;
}

@media (min-width: 768px) {
    .am-chips-wrap {
        margin: 0 0 28px;
    }
}

.am-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 16px;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.am-chips::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .am-chips {
        padding: 2px 0;
    }
}

.am-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid var(--am-line);
    background: #fff;
    color: var(--am-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.am-chip:hover {
    border-color: rgba(135, 230, 75, 0.8);
    color: #145614;
}

.am-chip.is-active {
    background: #145614;
    border-color: #145614;
    color: #fff;
    font-weight: 600;
}

.dark .am-chip {
    background: #1f1f1f;
}

.dark .am-chip:hover {
    color: #87E64B;
}

.dark .am-chip.is-active {
    background: #87E64B;
    border-color: #87E64B;
    color: #191919;
}

.am-chip-more {
    color: #145614;
    font-weight: 600;
}

.dark .am-chip-more {
    color: #87E64B;
}

/* Panah geser (desktop) */
.am-chips-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--am-line);
    background: #fff;
    color: var(--am-ink);
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.am-chips-arrow.prev { left: -14px; }
.am-chips-arrow.next { right: -14px; }

/* Peralihan memudar di belakang panah supaya kapsul tidak terpotong kasar */
.am-chips-arrow::before {
    content: "";
    position: absolute;
    top: -8px;
    bottom: -8px;
    width: 56px;
    pointer-events: none;
    z-index: -1;
}

.am-chips-arrow.next::before {
    right: 50%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff 70%);
}

.am-chips-arrow.prev::before {
    left: 50%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0), #fff 70%);
}

.dark .am-chips-arrow {
    background: #1f1f1f;
}

.dark .am-chips-arrow.next::before {
    background: linear-gradient(to right, rgba(25, 25, 25, 0), #191919 70%);
}

.dark .am-chips-arrow.prev::before {
    background: linear-gradient(to left, rgba(25, 25, 25, 0), #191919 70%);
}

@media (min-width: 768px) {
    .am-chips-arrow.is-visible {
        display: inline-flex;
    }
}

/* ---------- Bilah alat: keterangan hasil + urutan ---------- */
.am-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 14px;
    margin-bottom: 20px;
}

.am-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: var(--am-muted);
    font-size: 13.5px;
}

.am-sort select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 34px 8px 14px;
    border: 1px solid var(--am-line);
    border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center;
    color: var(--am-ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.am-sort select:focus {
    outline: none;
    border-color: rgba(135, 230, 75, 0.9);
    box-shadow: 0 0 0 3px rgba(135, 230, 75, 0.2);
}

.dark .am-sort select {
    background-color: #1f1f1f;
}

/* ---------- Keterangan hasil filter ---------- */
.am-result {
    flex: 1 1 320px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--am-soft);
    color: var(--am-text);
    font-size: 14px;
}

.am-result strong {
    color: var(--am-ink);
}

.am-result-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #145614;
    font-weight: 600;
}

.dark .am-result-clear {
    color: #87E64B;
}

/* ---------- Artikel sorotan ---------- */
.am-feature {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.am-feature-img {
    display: block;
    aspect-ratio: 3 / 2;
    border-radius: var(--am-radius);
    overflow: hidden;
    background: var(--am-soft);
}

.am-feature-img img,
.am-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.am-feature:hover .am-feature-img img,
.am-card-link:hover .am-card-img img {
    transform: scale(1.03);
}

.am-feature-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.am-feature-title {
    margin: 0;
    color: var(--am-ink);
    font-size: 23px;
    line-height: 1.25;
    font-weight: 800;
    text-wrap: balance;
    transition: color 0.2s ease;
}

.am-feature:hover .am-feature-title {
    color: #145614;
}

.dark .am-feature:hover .am-feature-title {
    color: #87E64B;
}

.am-feature-excerpt {
    margin: 0;
    color: var(--am-muted);
    font-size: 15.5px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.am-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: #145614;
    font-size: 14.5px;
    font-weight: 700;
}

.am-readmore i {
    transition: transform 0.2s ease;
}

.am-feature:hover .am-readmore i {
    transform: translateX(4px);
}

.dark .am-readmore {
    color: #87E64B;
}

@media (min-width: 768px) {
    .am-feature {
        grid-template-columns: 1.15fr 1fr;
        gap: 28px;
        margin-bottom: 30px;
        padding-bottom: 30px;
        border-bottom: 1px solid var(--am-line);
    }

    .am-feature-title {
        font-size: 27px;
    }
}

/* ---------- Label kategori di kartu ---------- */
.am-card-cat {
    align-self: flex-start;
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(135, 230, 75, 0.18);
    color: #145614;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.dark .am-card-cat {
    background: rgba(135, 230, 75, 0.12);
    color: #87E64B;
}

/* ---------- Info tanggal · penulis ---------- */
.am-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    overflow: hidden;
    color: var(--am-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.am-card-meta-inner {
    display: flex;
    flex-wrap: wrap;
    margin-left: -14px;
}

.am-card-meta-inner > span::before {
    content: "·";
    display: inline-block;
    width: 14px;
    text-align: center;
    color: #b8bdb3;
}

/* ---------- Daftar kartu ---------- */
.am-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.am-card {
    min-width: 0;
}

.am-card-link {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 14px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--am-line);
}

.am-grid .am-card:last-child .am-card-link {
    border-bottom: 0;
}

.am-card-img {
    display: block;
    aspect-ratio: 3 / 2;
    border-radius: 12px;
    overflow: hidden;
    background: var(--am-soft);
}

.am-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.am-card-title {
    margin: 0;
    color: var(--am-ink);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.am-card-link:hover .am-card-title {
    color: #145614;
}

.dark .am-card-link:hover .am-card-title {
    color: #87E64B;
}

.am-card-excerpt {
    display: none;
    margin: 0;
    color: var(--am-muted);
    font-size: 14px;
    line-height: 1.6;
}

.am-card .am-card-author {
    display: none;
}

/* HP: kategori ringkas berupa teks kecil */
@media (max-width: 767px) {
    .am-card .am-card-cat {
        padding: 0;
        background: none !important;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }
}

/* Desktop & tablet: kartu 2 kolom dengan gambar utuh 3:2 */
@media (min-width: 768px) {
    .am-grid {
        grid-template-columns: 1fr 1fr;
        gap: 22px;
    }

    .am-card-link {
        height: 100%;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        border: 1px solid var(--am-line) !important;
        border-radius: var(--am-radius);
        overflow: hidden;
        background: #fff;
        transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    }

    .dark .am-card-link {
        background: #191919;
    }

    .am-card-link:hover {
        border-color: rgba(135, 230, 75, 0.7) !important;
        box-shadow: 0 14px 30px -18px rgba(20, 86, 20, 0.35);
        transform: translateY(-2px);
    }

    .am-card-img {
        border-radius: 0;
    }

    .am-card-body {
        gap: 9px;
        padding: 16px 18px 18px;
    }

    .am-card-title {
        font-size: 17.5px;
        -webkit-line-clamp: 2;
    }

    .am-card-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .am-card .am-card-author {
        display: inline;
    }

    /* Kartu terakhir yang sendirian di barisnya: lebar penuh, gambar di kiri */
    .am-grid .am-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .am-grid .am-card:last-child:nth-child(odd) .am-card-link {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
    }

    .am-grid .am-card:last-child:nth-child(odd) .am-card-img {
        height: 100%;
    }

    .am-grid .am-card:last-child:nth-child(odd) .am-card-body {
        padding: 20px 24px;
    }
}

/* ---------- Paginasi ---------- */
.am-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 32px;
}

.am-pager-btn,
.am-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--am-line);
    background: #fff;
    color: var(--am-ink);
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.dark .am-pager-btn,
.dark .am-pager-num {
    background: #1f1f1f;
}

a.am-pager-btn:hover,
a.am-pager-num:hover {
    border-color: rgba(135, 230, 75, 0.8);
    color: #145614;
}

.dark a.am-pager-btn:hover,
.dark a.am-pager-num:hover {
    color: #87E64B;
}

.am-pager-btn.is-disabled {
    opacity: 0.4;
    cursor: default;
}

.am-pager-num {
    padding: 0;
}

.am-pager-num.is-active {
    background: #145614;
    border-color: #145614;
    color: #fff;
}

.dark .am-pager-num.is-active {
    background: #87E64B;
    border-color: #87E64B;
    color: #191919;
}

.am-pager-pages {
    display: none;
    align-items: center;
    gap: 6px;
}

.am-pager-dots {
    padding: 0 4px;
    color: var(--am-muted);
}

.am-pager-status {
    color: var(--am-muted);
    font-size: 13.5px;
    text-align: center;
    white-space: nowrap;
}

/* HP: tombol "Sebelumnya" cukup ikon agar keterangan halaman muat satu baris */
@media (max-width: 767px) {
    .am-pager-btn[rel="prev"] .am-pager-label,
    .am-pager-btn.is-disabled:first-child .am-pager-label {
        display: none;
    }
}

@media (min-width: 768px) {
    .am-pager {
        justify-content: center;
    }

    .am-pager-pages {
        display: inline-flex;
    }

    .am-pager-status {
        display: none;
    }
}

@media (max-width: 340px) {
    .am-pager-label {
        display: none;
    }
}

/* ---------- Kosong ---------- */
.am-empty {
    padding: 48px 24px;
    border-radius: var(--am-radius);
    background: var(--am-soft);
    text-align: center;
}

.am-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #145614;
    font-size: 20px;
}

.dark .am-empty-icon {
    background: #191919;
    color: #87E64B;
}

.am-empty h3 {
    margin: 0 0 6px;
    color: var(--am-ink);
    font-size: 19px;
    font-weight: 700;
}

.am-empty p {
    margin: 0 0 18px;
    color: var(--am-muted);
    font-size: 14.5px;
}

.am-btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    background: #145614;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
}

.dark .am-btn-solid {
    background: #87E64B;
    color: #191919 !important;
}

/* ---------- Sidebar ---------- */
.am-side-card {
    padding: 20px;
    border-radius: var(--am-radius);
    border: 1px solid var(--am-line);
    background: #fff;
}

.dark .am-side-card {
    background: #191919;
}

.am-side-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--am-ink);
    font-size: 15px;
    font-weight: 700;
}

.am-side-title i {
    color: #145614;
    font-size: 14px;
}

.dark .am-side-title i {
    color: #87E64B;
}

.am-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.am-tag {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f3f4f1;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.am-tag:hover {
    background: rgba(135, 230, 75, 0.25);
    color: #145614;
}

.dark .am-tag {
    background: #1f1f1f;
    color: #d6d3cf;
}

.dark .am-tag:hover {
    color: #87E64B;
}

.am-newsletter {
    padding: 22px 20px;
    border-radius: var(--am-radius);
    background: #145614;
    color: #fff;
}

.dark .am-newsletter {
    background: #1f2a1c;
    border: 1px solid rgba(135, 230, 75, 0.22);
}

.am-newsletter h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.am-newsletter p {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13.5px;
    line-height: 1.55;
}

.am-newsletter input {
    width: 100%;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 14px;
}

.am-newsletter button {
    width: 100%;
    margin-top: 10px;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: #87E64B;
    color: #145614;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.am-newsletter button:hover {
    background: #B6F500;
}

/* ==========================================================================
   HALAMAN KATEGORI, TAG, PENCARIAN (memakai komponen di atas)
   ========================================================================== */

/* Sorotan kata yang dicari */
.am-mark {
    padding: 0 2px;
    border-radius: 4px;
    background: rgba(135, 230, 75, 0.35);
    color: inherit;
}

.dark .am-mark {
    background: rgba(135, 230, 75, 0.28);
}

/* Label kecil di atas judul halaman (Kategori / Topik / Pencarian) */
.am-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: #145614;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dark .am-eyebrow {
    color: #87E64B;
}

/* Breadcrumb ringkas */
.am-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--am-muted);
    font-size: 13.5px;
}

.am-crumbs a:hover {
    color: #145614;
}

.dark .am-crumbs a:hover {
    color: #87E64B;
}

.am-crumbs i {
    font-size: 10px;
    opacity: 0.7;
}

/* Grid kartu kategori */
.am-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .am-cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

.am-cat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 104px;
    padding: 16px 16px 14px;
    border: 1px solid var(--am-line);
    border-radius: var(--am-radius);
    background: #fff;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .am-cat-card {
    background: #191919;
}

.am-cat-card:hover {
    border-color: rgba(135, 230, 75, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -18px rgba(20, 86, 20, 0.35);
}

.am-cat-name {
    display: block;
    color: var(--am-ink);
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.3;
}

.am-cat-card:hover .am-cat-name {
    color: #145614;
}

.dark .am-cat-card:hover .am-cat-name {
    color: #87E64B;
}

.am-cat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.am-cat-count {
    color: var(--am-muted);
    font-size: 13px;
}

.am-cat-arrow {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(135, 230, 75, 0.18);
    color: #145614;
    font-size: 11px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.am-cat-card:hover .am-cat-arrow {
    transform: translateX(3px);
    background: #145614;
    color: #fff;
}

.dark .am-cat-arrow {
    background: rgba(135, 230, 75, 0.12);
    color: #87E64B;
}

.dark .am-cat-card:hover .am-cat-arrow {
    background: #87E64B;
    color: #191919;
}

.am-cat-card.is-empty {
    opacity: 0.55;
}

.am-section-label {
    margin: 30px 0 12px;
    color: var(--am-muted);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Kapsul kecil di sidebar (topik lain / kategori saran) */
.am-tag.is-active {
    background: #145614;
    color: #fff;
}

.dark .am-tag.is-active {
    background: #87E64B;
    color: #191919;
}

.am-suggest {
    margin-top: 22px;
}

.am-suggest .am-tag-cloud {
    justify-content: center;
}
