/* RBP Pustaka, bahasasunda.net. Warna mengikuti tema-sunda (hijau #2e7d32, aksen kuning). */
.rbp-pustaka {
  --pk-green: var(--primary-color, #2e7d32);
  --pk-green-dark: var(--primary-dark, #1b5e20);
  --pk-accent: var(--accent-color, #ffc107);
  --pk-surface: #fff;
  --pk-surface-2: #f3f7f2;
  --pk-line: #dfe7dd;
  --pk-text: #1f2a1f;
  --pk-muted: #5f6f5f;
  --pk-shadow: 0 6px 20px rgba(27, 94, 32, .10);
  color: var(--pk-text);
}
body.dark-mode .rbp-pustaka {
  --pk-green: #81c784;
  --pk-green-dark: #a5d6a7;
  --pk-surface: #1e1e1e;
  --pk-surface-2: #242a24;
  --pk-line: #34403a;
  --pk-text: #e9efe9;
  --pk-muted: #a9b6a9;
  --pk-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.rbp-pustaka a { color: var(--pk-green); }
.rbp-pustaka a:hover { color: var(--pk-green-dark); }

/* Tombol */
.rbp-pk-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.1rem; border: 1px solid var(--pk-green); border-radius: 8px;
  background: var(--pk-green); color: #fff !important; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; line-height: 1.2;
}
.rbp-pk-btn:hover { background: var(--pk-green-dark); border-color: var(--pk-green-dark); color: #fff; }
body.dark-mode .rbp-pk-btn { color: #102010 !important; }
.rbp-pk-btn-outline { background: transparent; color: var(--pk-green) !important; }
.rbp-pk-btn-outline:hover { background: var(--pk-surface-2); color: var(--pk-green-dark) !important; }
body.dark-mode .rbp-pk-btn-outline { color: var(--pk-green) !important; }
.rbp-pk-btn-wa { background: #1f9d55; border-color: #1f9d55; }
.rbp-pk-btn-wa:hover { background: #17824a; border-color: #17824a; }
.rbp-pk-btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.rbp-pk-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 0; }

/* Arsip */
.rbp-pk-hero {
  background: linear-gradient(135deg, var(--primary-color, #2e7d32), var(--primary-dark, #1b5e20));
  color: #fff; padding: 2.5rem 0 2rem; margin-bottom: 1.75rem; border-radius: 0 0 20px 20px;
}
body.dark-mode .rbp-pk-hero { background: linear-gradient(135deg, #1f3a21, #142414); }
.rbp-pk-hero h1 { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .4rem; color: #fff; }
.rbp-pk-hero p { margin: 0; opacity: .92; max-width: 60ch; }
.rbp-pk-hero .rbp-pk-eyebrow { font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; opacity: .85; margin-bottom: .4rem; }
.rbp-pk-hero .rbp-pk-eyebrow a { color: #fff; }
.rbp-pk-search { display: flex; max-width: 520px; margin-top: 1.25rem; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.rbp-pk-search input { flex: 1; min-width: 0; border: 0; padding: .7rem 1rem; font-size: 1rem; color: #1f2a1f; background: #fff; }
.rbp-pk-search input:focus { outline: none; }
.rbp-pk-search button { border: 0; background: var(--pk-accent); color: #1f2a1f; padding: 0 1.1rem; font-size: 1.1rem; }

.rbp-pk-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.rbp-pk-chips a { padding: .35rem .9rem; border: 1px solid var(--pk-line); border-radius: 999px; background: var(--pk-surface); color: var(--pk-text); text-decoration: none; font-size: .9rem; }
.rbp-pk-chips a:hover { border-color: var(--pk-green); color: var(--pk-green); }
.rbp-pk-chips a.is-active { background: var(--pk-green); border-color: var(--pk-green); color: #fff; }
body.dark-mode .rbp-pk-chips a.is-active { color: #102010; }

.rbp-pk-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.4rem 1.1rem; }
@media (max-width: 420px) { .rbp-pk-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .8rem; } }
.rbp-pk-card { display: flex; flex-direction: column; min-width: 0; }
.rbp-pk-card-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--pk-surface-2); box-shadow: var(--pk-shadow); transition: transform .2s ease, box-shadow .2s ease; }
.rbp-pk-card-cover:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(27, 94, 32, .18); }
.rbp-pk-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rbp-pk-cover-kosong { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 200px; color: var(--pk-green); font-size: 2.5rem; background: var(--pk-surface-2); }
.rbp-pk-badge { position: absolute; top: 8px; left: 8px; padding: .2rem .55rem; border-radius: 6px; font-size: .72rem; font-weight: 700; line-height: 1.3; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.rbp-pk-badge-gratis { background: #2e7d32; color: #fff; }
.rbp-pk-badge-kode { background: var(--pk-accent); color: #3a2c00; }
.rbp-pk-badge-penuh { background: #1b5e20; color: #fff; }
.rbp-pk-card-body { padding: .65rem .1rem 0; }
.rbp-pk-jenis { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pk-green); }
.rbp-pk-card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; margin: .15rem 0 .2rem; }
.rbp-pk-card-title a { color: var(--pk-text); text-decoration: none; }
.rbp-pk-card-title a:hover { color: var(--pk-green); }
.rbp-pk-card-penulis { font-size: .85rem; color: var(--pk-muted); margin: 0; }
.rbp-pk-card-penulis a { color: var(--pk-muted); text-decoration: none; }
.rbp-pk-card-harga { font-size: .9rem; font-weight: 700; color: var(--pk-green); margin: .25rem 0 0; }
.rbp-pk-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.rbp-pk-section-head h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }

.rbp-pk-empty { text-align: center; padding: 3rem 1.5rem; background: var(--pk-surface); border: 1px solid var(--pk-line); border-radius: 12px; }
.rbp-pk-empty i { font-size: 2.4rem; color: var(--pk-green); }
.rbp-pk-empty h2 { font-size: 1.3rem; margin: .6rem 0 .3rem; }
.rbp-pk-empty p { color: var(--pk-muted); margin: 0; }
.rbp-pk-pagination { margin-top: 2rem; }
.rbp-pk-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.rbp-pk-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .6rem; border: 1px solid var(--pk-line); border-radius: 8px; background: var(--pk-surface); color: var(--pk-text); text-decoration: none; }
.rbp-pk-pagination .page-numbers.current { background: var(--pk-green); border-color: var(--pk-green); color: #fff; }

/* Halaman terbitan */
.rbp-pk-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .9rem; margin-bottom: 1.25rem; color: var(--pk-muted); }
.rbp-pk-crumb a { text-decoration: none; }
.rbp-pk-crumb .bi-chevron-right { font-size: .7rem; }
.rbp-pk-detail { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 2.25rem; align-items: start; }
@media (max-width: 767px) { .rbp-pk-detail { grid-template-columns: 1fr; gap: 1.5rem; } .rbp-pk-detail-cover { max-width: 230px; margin: 0 auto; } }
.rbp-pk-detail-cover { border-radius: 10px; overflow: hidden; box-shadow: 0 14px 34px rgba(27, 94, 32, .2); background: var(--pk-surface-2); }
.rbp-pk-cover-img { display: block; width: 100%; height: auto; }
.rbp-pk-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; line-height: 1.2; margin: .25rem 0 .35rem; }
.rbp-pk-subtitle { font-size: 1.1rem; color: var(--pk-muted); margin: 0 0 .5rem; }
.rbp-pk-byline { font-weight: 600; margin: 0 0 1rem; }
.rbp-pk-byline a { text-decoration: none; }

.rbp-pk-akses { padding: 1.1rem 1.25rem; background: var(--pk-surface); border: 1px solid var(--pk-line); border-radius: 12px; box-shadow: var(--pk-shadow); margin-bottom: 1.25rem; }
.rbp-pk-akses-status { margin: 0; font-weight: 600; }
.rbp-pk-akses-penuh { color: var(--pk-green); }
.rbp-pk-akses-note { margin: 0; color: var(--pk-muted); font-size: .92rem; }
.rbp-pk-harga { margin: 0 0 .3rem; font-size: 1.5rem; font-weight: 700; color: var(--pk-green); }
.rbp-pk-harga span { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--pk-muted); }
.rbp-pk-tukar { margin-top: 1rem; border-top: 1px dashed var(--pk-line); padding-top: .8rem; }
.rbp-pk-tukar summary { cursor: pointer; font-weight: 600; color: var(--pk-green); }
.rbp-pk-tukar-form { display: flex; gap: .5rem; margin-top: .7rem; }
.rbp-pk-tukar-form input { flex: 1; min-width: 0; max-width: 220px; padding: .55rem .8rem; border: 1px solid var(--pk-line); border-radius: 8px; font: 600 1.05rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; background: var(--pk-surface); color: var(--pk-text); }
.rbp-pk-alert { padding: .65rem .85rem; border-radius: 8px; margin-bottom: .9rem; font-size: .92rem; }
.rbp-pk-alert-sukses { background: #e6f4e7; color: #1b5e20; border: 1px solid #b9dfbc; }
.rbp-pk-alert-galat { background: #fdecea; color: #8a1c13; border: 1px solid #f3c2bd; }
body.dark-mode .rbp-pk-alert-sukses { background: #1d3320; color: #b8e3bb; border-color: #2f5533; }
body.dark-mode .rbp-pk-alert-galat { background: #3a1e1b; color: #f4c1bb; border-color: #5c2e29; }

.rbp-pk-meta { margin: 0; display: grid; gap: 0; }
.rbp-pk-meta > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--pk-line); font-size: .92rem; }
.rbp-pk-meta dt { font-weight: 600; color: var(--pk-muted); }
.rbp-pk-meta dd { margin: 0; }

.rbp-pk-desc, .rbp-pk-minta { margin-top: 2.25rem; padding: 1.5rem; background: var(--pk-surface); border: 1px solid var(--pk-line); border-radius: 12px; }
.rbp-pk-desc h2, .rbp-pk-minta h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 .8rem; }
.rbp-pk-minta { scroll-margin-top: 90px; }
.rbp-pk-akses { scroll-margin-top: 90px; }
.rbp-pk-petunjuk { padding: .75rem 1rem; border-left: 4px solid var(--pk-accent); background: var(--pk-surface-2); border-radius: 0 8px 8px 0; margin-bottom: 1rem; }
.rbp-pk-petunjuk p:last-child { margin-bottom: 0; }
.rbp-pk-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
@media (max-width: 767px) { .rbp-pk-form-grid { grid-template-columns: 1fr; } }
.rbp-pk-form-grid label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.rbp-pk-form-grid .rbp-pk-wide { grid-column: 1 / -1; }
.rbp-pk-form-grid input, .rbp-pk-form-grid textarea { padding: .55rem .75rem; border: 1px solid var(--pk-line); border-radius: 8px; font: inherit; font-weight: 400; background: var(--pk-surface); color: var(--pk-text); }
.rbp-pk-form-grid input:focus, .rbp-pk-form-grid textarea:focus, .rbp-pk-tukar-form input:focus { outline: 2px solid var(--pk-green); outline-offset: 1px; }
.rbp-pk-form-note { font-size: .85rem; color: var(--pk-muted); margin: .6rem 0 0; }
.rbp-pk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Pembaca */
.rbp-pk-open { overflow: hidden; }
.rbp-pk-reader[hidden] { display: none; }
.rbp-pk-reader { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: #2b302b; --pk-zoom: 1; }
.rbp-pk-reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; background: #1b5e20; color: #fff; }
body.dark-mode .rbp-pk-reader-bar { background: #142414; }
.rbp-pk-reader-title { min-width: 0; }
.rbp-pk-reader-title h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbp-pk-reader-title > span { font-size: .8rem; opacity: .85; }
.rbp-pk-reader-tools { display: flex; gap: .35rem; flex: none; }
.rbp-pk-reader-tools button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.rbp-pk-reader-tools button:hover { background: rgba(255,255,255,.26); }
.rbp-pk-pages { flex: 1; overflow: auto; padding: 1.25rem .75rem 2rem; overscroll-behavior: contain; }
.rbp-pk-page { width: min(100%, calc(760px * var(--pk-zoom))); margin: 0 auto 1.1rem; }
.rbp-pk-page img { display: block; width: 100%; height: auto; aspect-ratio: var(--pk-ratio); background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.35); user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.rbp-pk-page figcaption { text-align: center; font-size: .75rem; color: #c9d3c9; margin-top: .3rem; }
.rbp-pk-locked { width: min(100%, calc(760px * var(--pk-zoom))); margin: 0 auto 1.1rem; padding: 1.75rem 1.25rem; text-align: center; border: 2px dashed #6f7d6f; border-radius: 10px; color: #e3eae3; background: rgba(255,255,255,.04); }
.rbp-pk-locked i { font-size: 1.6rem; color: var(--pk-accent); }
.rbp-pk-locked p { margin: .4rem 0 .9rem; }
.rbp-pk-locked .rbp-pk-btn { background: var(--pk-accent); border-color: var(--pk-accent); color: #3a2c00 !important; }
.rbp-pk-locked .rbp-pk-link { display: inline-block; margin-left: .75rem; color: #e3eae3; font-size: .9rem; }
/* Akhir pratinjau: tawaran akses penuh */
.rbp-pk-reader-end { width: min(100%, calc(760px * var(--pk-zoom))); margin: .5rem auto 1rem; padding: 2rem 1.5rem; text-align: center; border-radius: 12px; background: linear-gradient(135deg, #1b5e20, #2e7d32); color: #eef6ee; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.rbp-pk-reader-end > i { font-size: 2.2rem; color: var(--pk-accent); }
.rbp-pk-reader-end h3 { margin: .5rem 0 .4rem; font-size: 1.3rem; font-weight: 700; color: #fff; }
.rbp-pk-reader-end p { max-width: 34rem; margin: 0 auto 1.1rem; }
.rbp-pk-reader-end .rbp-pk-actions { justify-content: center; }
.rbp-pk-reader-end .rbp-pk-btn { background: var(--pk-accent); border-color: var(--pk-accent); color: #3a2c00 !important; }
.rbp-pk-reader-end .rbp-pk-btn-outline { background: transparent; border-color: rgba(255,255,255,.7); color: #fff !important; }
.rbp-pk-tawar[hidden] { display: none; }
.rbp-pk-tawar { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); width: min(560px, calc(100% - 1.5rem)); display: flex; align-items: center; gap: .75rem; padding: .75rem .75rem .75rem 1rem; border-radius: 12px; background: #fffdf3; color: #2a2a1a; box-shadow: 0 10px 30px rgba(0,0,0,.4); border-left: 5px solid var(--pk-accent); }
.rbp-pk-tawar p { margin: 0; flex: 1; font-size: .88rem; line-height: 1.35; }
.rbp-pk-tawar .rbp-pk-btn { flex: none; }
.rbp-pk-tawar-tutup { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #5f6f5f; }
.rbp-pk-tawar-tutup:hover { background: #f1eedb; }
body.dark-mode .rbp-pk-tawar { background: #2a2a1e; color: #f1eedb; }
body.dark-mode .rbp-pk-tawar-tutup { color: #c9c4a6; }
.rbp-pk-sibuk[hidden] { display: none; }
.rbp-pk-sibuk { position: absolute; inset: 56px 0 0; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(20,26,20,.92); }
.rbp-pk-sibuk-kotak { max-width: 30rem; padding: 2rem 1.5rem; border-radius: 12px; background: var(--pk-surface); color: var(--pk-text); text-align: center; box-shadow: var(--pk-shadow); }
.rbp-pk-sibuk-kotak > i { font-size: 2rem; color: var(--pk-green); }
.rbp-pk-sibuk-kotak h3 { margin: .5rem 0; font-size: 1.15rem; font-weight: 700; }
.rbp-pk-sibuk-kotak p { color: var(--pk-muted); }
.rbp-pk-sibuk-kotak .rbp-pk-actions { justify-content: center; }
@media (max-width: 600px) { .rbp-pk-tawar { flex-wrap: wrap; } .rbp-pk-tawar p { flex-basis: calc(100% - 40px); } }
@media (max-width: 600px) { .rbp-pk-pages { padding: .75rem .4rem 1.5rem; } .rbp-pk-reader-bar { padding: .5rem .6rem; } }
.rbp-pk-detail-cover .rbp-pk-cover-kosong { aspect-ratio: 2 / 3; min-height: 0; }

/* Daftar balik: pos yang dimuat ulang dari terbitan ini */
.rbp-pk-turunan { margin: 2rem 0; padding: 1.25rem 1.5rem; border: 1px solid var(--pk-line); border-radius: 12px; background: var(--pk-surface); box-shadow: var(--pk-shadow); }
.rbp-pk-turunan h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .75rem; }
.rbp-pk-turunan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rbp-pk-turunan a { display: block; padding: .75rem 1rem; border-radius: 8px; background: var(--pk-surface-2); text-decoration: none; }
.rbp-pk-turunan a strong { display: block; color: var(--pk-text); }
.rbp-pk-turunan a span { display: block; font-size: .88rem; color: var(--pk-muted); margin-top: .2rem; }
.rbp-pk-turunan a:hover strong { color: var(--pk-green); }

/* Kartu ajakan di pos blog yang diambil dari terbitan */
.rbp-pk-cta { display: flex; gap: 1.25rem; align-items: center; margin: 2rem 0 1rem; padding: 1.25rem; border: 1px solid var(--pk-line); border-left: 5px solid var(--pk-green); border-radius: 12px; background: var(--pk-surface-2); box-shadow: var(--pk-shadow); }
.rbp-pk-cta-cover { flex: none; width: 110px; }
.rbp-pk-cta-cover img, .rbp-pk-cta-cover .rbp-pk-cover-kosong { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.rbp-pk-cta-body { min-width: 0; }
.rbp-pk-cta .rbp-pk-cta-title { margin: .25rem 0 .1rem; font-size: 1.2rem; font-weight: 700; color: var(--pk-text); line-height: 1.25; }
.rbp-pk-cta .rbp-pk-cta-meta { margin: 0 0 .5rem; font-size: .85rem; color: var(--pk-muted); }
.rbp-pk-cta .rbp-pk-cta-text { margin: 0 0 .85rem; font-size: .95rem; color: var(--pk-text); }
.entry-content .rbp-pk-cta a.rbp-pk-btn { text-decoration: none; }
@media (max-width: 520px) { .rbp-pk-cta { flex-direction: column; align-items: flex-start; } .rbp-pk-cta-cover { width: 96px; } }

/* Modal "Minta kode akses" */
.rbp-pk-modal[hidden] { display: none; }
.rbp-pk-modal { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.rbp-pk-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 25, 15, .72); }
.rbp-pustaka .rbp-pk-modal-kotak { position: relative; width: min(640px, 100%); max-height: calc(100vh - 2rem); overflow: auto; margin: 0; padding: 1.5rem 1.5rem 1.25rem; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.rbp-pk-modal-kotak h2 { padding-right: 2.5rem; }
.rbp-pk-modal-tutup { position: absolute; top: .75rem; right: .75rem; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--pk-surface-2); color: var(--pk-text); display: inline-flex; align-items: center; justify-content: center; }
.rbp-pk-modal-tutup:hover { background: var(--pk-line); }
@media (max-width: 600px) { .rbp-pk-modal { padding: 0; align-items: flex-end; } .rbp-pustaka .rbp-pk-modal-kotak { max-height: 92vh; border-radius: 14px 14px 0 0; padding: 1.25rem 1rem 1rem; } }
