/*
 * Gaya tambahan situs publik (CI4 frontend), dimuat setelah style.css.
 * Berisi: warna switcher bahasa berdasar <html lang>, halaman daftar &
 * detail artikel, dan halaman 404.
 */

/* ---- Switcher bahasa: warna label mengikuti bahasa aktif dari server ---- */
html[lang="en"] .lang-label.id { color: var(--text-inactive); }
html[lang="en"] .lang-label.en { color: var(--text-active); }
.lang-label:hover { color: var(--primary); }

/* ---- Kerangka halaman non-beranda (memberi ruang navbar fixed) ---- */
.page-section {
    padding-top: 7rem;
    padding-bottom: 4rem;
    min-height: 70vh;
}
@media (min-width: 992px) {
    .page-section { padding-top: 8.5rem; }
}

/* ---- Kartu artikel (app/post/loop.php) ---- */
.post-card { display: flex; flex-direction: column; border-radius: var(--radius); }
.post-card__thumb { aspect-ratio: 16 / 9; background: var(--muted); overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__thumb .post-card__placeholder { object-fit: contain; padding: 2.5rem; opacity: .5; }
.post-card__body { display: flex; flex-direction: column; flex: 1; }
.post-card__body .post-card__more { margin-top: auto; color: var(--primary); }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .8125rem; }
.post-card__date { color: var(--muted-foreground); }
.post-card--featured { flex-direction: column; }
@media (min-width: 768px) {
    .post-card--featured { flex-direction: row; }
    .post-card--featured .post-card__thumb { flex: 0 0 50%; aspect-ratio: auto; min-height: 18rem; }
}
.post-search { min-width: min(100%, 22rem); }

/* ---- Detail artikel (app/post/view.php) ---- */
.article-wrap {
    max-width: 52rem;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 3rem);
}
.article-langs { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
.article-langs__label { font-size: .875rem; color: var(--muted-foreground); margin-right: .25rem; }
.article-cat {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--primary);
    background: rgba(0, 86, 179, .08);
    border-radius: 999px;
    padding: .2rem .7rem;
    text-decoration: none;
    margin-bottom: .5rem;
}
.article-date { font-size: .875rem; color: var(--muted-foreground); margin-bottom: .5rem; }
.article-title { font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.article-toptags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.article-toptags .tag {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .8125rem; color: var(--muted-foreground);
    border: 1px solid var(--border); border-radius: 999px;
    padding: .15rem .65rem; text-decoration: none;
}
.article-toptags .tag:hover { color: var(--primary); border-color: var(--primary); }
.article-thumb { width: 100%; height: auto; border-radius: .75rem; margin-bottom: 1.25rem; }
/* Progressive image: placeholder 32.webp = background <img> (inline style), hilang saat termuat. */
img.pimg { background-size: cover; background-position: center; background-repeat: no-repeat; }
img.pimg.is-loaded { background-image: none; }
.article-body img.article-body-img { max-width: 100%; height: auto; }
.article-excerpt {
    font-style: italic;
    border-left: 3px solid var(--border);
    padding-left: 14px;
    margin: 0 0 22px;
    color: var(--muted-foreground);
}
.article-body { line-height: 1.8; }
.article-body img { max-width: 100%; height: auto; border-radius: .5rem; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: .5rem; }
.article-note {
    margin-top: 2rem;
    font-size: .875rem;
    background: var(--muted);
    border-left: 4px solid var(--primary);
    border-radius: .5rem;
    padding: 1rem 1.25rem;
}
