/* assets/css/portal-v2.css (u210) — penyegaran tampilan Portal.
   Dimuat SETELAH gaya bawaan (header.php), hanya menimpa: huruf judul, ukuran & jarak di layar komputer.
   Tampilan HP sengaja hampir tidak berubah (sudah rapi), kecuali huruf judul. */

:root { --as-judul: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --as-lebar: 1180px; }

/* ---------- 1. Judul besar: Plus Jakarta Sans, sama dengan aplikasi Ruang Belajar (u213: Fredoka dibatalkan) ---------- */
.hero h1, .section-title h2, .cta-band h2, .pp-dhero h1, .prose h2, .gl-head h2, .hx-judul {
  font-family: var(--as-judul); font-weight: 800;
}
.hero h1 { line-height: 1.15; }
.section-title h2 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; }
.section-title .eyebrow { letter-spacing: .14em; font-size: 11.5px; font-weight: 800; }
.prose h3 { font-family: var(--as-judul); font-weight: 800; }

/* ---------- 2. Kerangka: lebar isi & jarak antarbagian seragam ---------- */
@media (min-width: 1024px) {
  .container { max-width: var(--as-lebar); padding: 0 32px; }
  .section { padding: 72px 0; }
  .section-title { margin-bottom: 44px; }
  .section-title h2 { margin-top: 2px; }
}

/* ---------- 3. Bagian atas beranda: dua kolom (teks kiri, foto kanan) ---------- */
@media (min-width: 1024px) {
  .hero:has(.hero-slider) { padding: 72px 0 96px; text-align: left; }
  .hero:has(.hero-slider) > .container {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 52px; align-items: center;
    grid-template-areas: "eb foto" "jd foto" "ld foto" "ak foto";
  }
  .hero:has(.hero-slider) .hero-eyebrow { grid-area: eb; justify-self: start; margin-bottom: 18px; }
  .hero:has(.hero-slider) h1 { grid-area: jd; font-size: clamp(32px, 2.8vw, 40px); line-height: 1.18; margin: 0 0 16px; text-wrap: balance; }
  .hero:has(.hero-slider) p.lead { grid-area: ld; margin: 0 0 28px; max-width: 520px; font-size: 16px; }
  .hero:has(.hero-slider) .hero-actions { grid-area: ak; justify-content: flex-start; align-self: start; }
  .hero:has(.hero-slider) .hero-slider { grid-area: foto; margin: 0; max-width: none; width: 100%; aspect-ratio: 2 / 1; align-self: center; border-radius: 20px; } /* rasio asli banner: tidak terpotong */
  .trust-badges { margin-top: -44px; }
  .trust-badges-grid { max-width: var(--as-lebar); }
}

/* ---------- 4. Angka (statistik) — lebih ringkas di komputer ---------- */
@media (min-width: 1024px) {
  html body .hx-stats { margin: 22px 0 0; }
  html body .hx-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 0; align-items: center; padding: 18px 20px; }
  html body .hx-stat .hx-ik { grid-row: 1 / 3; margin: 0; width: 46px; height: 46px; border-radius: 14px; }
  html body .hx-stat b { font-size: 28px; align-self: end; justify-self: start; }
  html body .hx-stat small { align-self: start; }
}

/* ---------- 5. Program Kami — jarak lega, area ikon lebih pendek, tautan sejajar di bawah ---------- */
@media (min-width: 1024px) {
  html body .pp-grid { gap: 28px; }
  html body .pp-grid .pp-thumb { aspect-ratio: 16 / 7; }
  html body .pp-grid .pp-thumb img.pp-ik { width: 84px; height: 84px; border-radius: 22px; }
  html body .pp-grid .pp-body { padding: 20px 22px 22px; gap: 8px; }
  html body .pp-grid .pp-body h3 { font-size: 17px; }
  html body .pp-grid .pp-body p { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- 6. Kegiatan Terbaru — 1 foto besar + 4 kecil, dua baris rapi tanpa sisa ---------- */
@media (min-width: 900px) {
  html body .hx-galeri-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  html body .hx-foto { aspect-ratio: 4 / 3; border-radius: 16px; }
  html body .hx-foto.besar { aspect-ratio: auto; }
  html body .hx-foto:nth-child(n+6) { display: none; } /* foto ke-6 dst. cukup di halaman Galeri */
}
@media (max-width: 899px) { html body .hx-foto:nth-child(n+7) { display: none; } }

/* ---------- 7. Sekilas — dua kolom di komputer ---------- */
@media (min-width: 1024px) {
  .section.bg-soft .prose { max-width: 820px; }
  .section.bg-soft .prose p { font-size: 15.5px; }
  .section.bg-soft .prose blockquote { font-size: 16px; padding: 20px 26px; }
}

/* ---------- 8. Ajakan daftar ---------- */
@media (min-width: 1024px) {
  .cta-band { max-width: calc(var(--as-lebar) - 64px); margin: 0 auto; padding: 56px 40px; border-radius: 28px;
    background: radial-gradient(circle at 90% 0, rgba(255,255,255,.08), transparent 45%), var(--as-primary-dark); }
  .cta-band h2 { font-size: 30px; }
  .cta-band p { font-size: 15px; }
}

/* ---------- 9. Artikel & Informasi — kartu lega, gambar 16:9 ---------- */
.post-card .post-thumb { height: auto; aspect-ratio: 16 / 9; }
@media (min-width: 1024px) {
  html body .card-grid.cols-3:has(.post-card) { gap: 28px; }
  .post-card { display: flex; flex-direction: column; }
  .post-card .post-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
  .post-card h4, .post-card .post-judul { font-size: 17px; line-height: 1.38; }
  .post-card p { font-size: 13.5px; }
  .post-card .post-readmore { margin-top: auto; padding-top: 14px; }
}

/* ---------- 9b. Artikel di komputer: 1 sorotan besar di kiri + 2 baris ringkas di kanan (u211; hanya bila ada 3 artikel) ---------- */
@media (min-width: 1024px) {
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 28px; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:first-child { grid-row: span 2; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:first-child .post-thumb { aspect-ratio: 2 / 1; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:first-child :is(h4, .post-judul) { font-size: 20px; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:first-child p { -webkit-line-clamp: 3; font-size: 14px; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) { flex-direction: row; align-items: stretch; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) .post-thumb { width: 38%; max-width: 200px; flex: none; aspect-ratio: auto; height: auto; min-height: 120px; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) .post-category { display: none; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) .post-body { padding: 16px 20px; justify-content: center; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) :is(h4, .post-judul) { font-size: 16px; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) p { -webkit-line-clamp: 2; font-size: 13px; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(3)) > .post-card:not(:first-child) .post-readmore { padding-top: 10px; }
  html body .card-grid.cols-3:has(> .post-card:nth-child(4)) > .post-card:first-child { grid-row: span 3; }
  /* hanya 2 artikel: dua kartu biasa berdampingan */
  html body .card-grid.cols-3:has(> .post-card):not(:has(> .post-card:nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 860px; margin: 0 auto; }
}

/* ---------- 9c. Halaman biasa (Profil dll.): teks tetap selebar nyaman dibaca (u212) ---------- */
@media (min-width: 1024px) {
  .container.prose { max-width: 820px; }
  .container.prose p { font-size: 15.5px; line-height: 1.85; }
}

/* ---------- 9d. Kontak: kartu kontak berderet di komputer (u212) ---------- */
@media (min-width: 760px) { html body .contact-grid { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { html body .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } html body .contact-card { flex-direction: column; align-items: flex-start; text-align: left; padding: 22px; height: 100%; } html body .contact-card .value { font-size: 14.5px; line-height: 1.45; } }

/* ---------- 9e. Program: 4 kolom di layar lebar (u212) ---------- */
@media (min-width: 1200px) {
  html body .pp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  html body .pp-grid .pp-body { padding: 18px 18px 20px; }
  html body .pp-grid .pp-body h3 { font-size: 16px; }
  html body .pp-grid .pp-thumb img.pp-ik { width: 72px; height: 72px; border-radius: 20px; }
  html body #program-kami .pp-grid > .pp-card:nth-child(n+5) { display: none; } /* beranda: 4 program; sisanya di halaman Program */
}

/* ---------- 10. Tombol: sedikit lebih besar di komputer ---------- */
@media (min-width: 1024px) {
  .hero-actions .btn-primary, .hero-actions .btn-outline-white { padding: 14px 28px; font-size: 15px; }
}

/* ---------- 11. Halaman artikel (u212) ---------- */
.ar-kepala { max-width: 720px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 14px; }
.ar-jejak { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--as-text-muted); }
.ar-jejak a { color: var(--as-primary); font-weight: 700; text-decoration: none; }
.ar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; color: var(--as-text-muted); font-weight: 600; }
.ar-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ar-meta svg { color: var(--as-gold); flex: none; }
.ar-bagi { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--as-border); color: var(--as-primary); font-weight: 800; text-decoration: none; font-size: 12.5px; }
.ar-bagi:hover { background: #fbeced; }
.ar-sampul { margin: 4px 0 0; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 340px; background: #f6eef0; } /* u211: sampul tidak terlalu tinggi */
.ar-sampul img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-kepala + .section { padding-top: 28px; }
.ar-kepala ~ .section .prose { max-width: 720px; }
@media (min-width: 1024px) {
  .ar-kepala ~ .section .prose p, .ar-kepala ~ .section .prose li { font-size: 16.5px; line-height: 1.85; }
  .ar-kepala ~ .section .prose h2 { font-size: 26px; } .ar-kepala ~ .section .prose h3 { font-size: 21px; margin-top: 38px; }
  .ar-kepala ~ .section .prose blockquote { font-size: 17px; }
}
.ar-lain { background: var(--as-bg); margin-top: 48px; }
@media (max-width: 520px) { .ar-bagi { margin-left: 0; } }

@media (prefers-reduced-motion: reduce) { .hx-foto img { transition: none; } }

/* ---------- 10. u215: keterbacaan & aksesibilitas (kontras >= 4,5 untuk teks kecil) ---------- */
html body .section-title .eyebrow, html body .program-intro-body .eyebrow, html body .team-card .role, html body .pp-kat, html body .post-card .post-date, html body .post-date { color: #a16207; }
html body .pp-badge { background: #15803d; }
html body .pp-badge.offline { background: #c2410c; }
html body .pp-badge.hybrid { background: #a16207; }
html body .gal-item-cat { font-size: 12px; }
html body .site-footer-bottom { font-size: 12px; }
html body .gal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
