/* ==========================================================================
   Publikasi Publik: /berita, /berita/{slug}, /galeri
   Gambar unggahan selalu tampil utuh (object-fit: contain) di atas latar
   blur dari gambar yang sama, sehingga poster/foto tidak terpotong.
   Memakai token sin-* dari sin-app.css.
   ========================================================================== */

/* Hero --------------------------------------------------------------------- */
.pb-hero { position: relative; isolation: isolate; overflow: hidden; padding: 2.4rem 0 5.5rem; color: #fff; background: linear-gradient(125deg, var(--sin-navy) 0%, #0a3f8f 50%, var(--sin-primary) 100%); }
.pb-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background:
    radial-gradient(circle at 88% 18%, rgba(244, 207, 69, .24), transparent 30%),
    radial-gradient(circle at 8% 120%, rgba(1, 106, 236, .6), transparent 45%),
    radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.2px) 0 0 / 22px 22px; }
.pb-hero-compact { padding-bottom: 4.5rem; }
.pb-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1.1rem; color: rgba(255, 255, 255, .7); font-size: .78rem; }
.pb-breadcrumb a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.pb-breadcrumb a:hover { color: #fff; }
.pb-breadcrumb span { color: var(--sin-accent); font-weight: 600; }
.pb-eyebrow { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; backdrop-filter: blur(6px); }
.pb-hero h1 { max-width: 46rem; margin: .9rem 0 .7rem; color: #fff; font-family: inherit; font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 800; line-height: 1.12; letter-spacing: -.03em; }
.pb-hero h1 span { color: var(--sin-accent); }
.pb-hero p { max-width: 38rem; margin: 0; color: rgba(255, 255, 255, .82); font-size: .98rem; line-height: 1.65; }
.pb-hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.pb-hero-meta li { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .85rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .88); font-size: .8rem; }
.pb-hero-meta strong { color: #fff; font-size: .92rem; }

/* Main --------------------------------------------------------------------- */
.pb-main { padding: 0 0 4rem; background: var(--sin-bg); }
.pb-main > .container { position: relative; margin-top: -3.5rem; }

/* Toolbar: kategori + pencarian */
.pb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem; margin-bottom: 1.6rem; padding: .85rem; border: 1px solid var(--sin-border); border-radius: 18px; background: var(--sin-surface); box-shadow: 0 18px 40px -24px rgba(6, 44, 101, .35); }
.pb-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.pb-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .9rem; border: 1px solid var(--sin-border); border-radius: 999px; background: var(--sin-surface); color: var(--sin-text-2); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.pb-chip small { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--sin-primary-50); color: var(--sin-primary); font-size: .7rem; font-weight: 700; }
.pb-chip:hover { border-color: var(--sin-primary); color: var(--sin-primary); }
.pb-chip.is-active { border-color: var(--sin-primary); background: var(--sin-primary); color: #fff; }
.pb-chip.is-active small { background: rgba(255, 255, 255, .2); color: #fff; }
.pb-search { position: relative; flex: 0 1 280px; }
.pb-search .icon { position: absolute; top: 50%; left: .85rem; width: 18px; height: 18px; color: var(--sin-muted); transform: translateY(-50%); pointer-events: none; }
.pb-search input { width: 100%; padding: .62rem .9rem .62rem 2.5rem; border: 1px solid var(--sin-border); border-radius: 999px; background: var(--sin-bg); color: var(--sin-text); font: inherit; font-size: .88rem; }
.pb-search input:focus { outline: none; border-color: var(--sin-primary); background: #fff; box-shadow: 0 0 0 3px var(--sin-primary-100); }

/* Media: gambar utuh + latar blur ----------------------------------------- */
.pb-media { position: relative; display: block; overflow: hidden; isolation: isolate; aspect-ratio: var(--pb-ratio, 4 / 3); background: var(--sin-navy); }
.pb-media-bg { position: absolute; inset: -10%; z-index: -1; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(26px) saturate(1.25) brightness(.85); opacity: .9; }
.pb-media-img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .45s ease; }
.pb-media-empty { display: grid; place-items: center; width: 100%; height: 100%; color: rgba(255, 255, 255, .55); background: linear-gradient(135deg, var(--sin-navy), var(--sin-primary)); }
.pb-media-empty .icon { width: 48px; height: 48px; }
.pb-zoom { position: absolute; right: .75rem; bottom: .75rem; display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: rgba(6, 22, 52, .55); color: #fff; opacity: 0; transform: translateY(6px); backdrop-filter: blur(6px); cursor: zoom-in; transition: opacity .2s ease, transform .2s ease; }
.pb-media:hover .pb-zoom, .pb-zoom:focus-visible { opacity: 1; transform: none; }

/* Pill & meta */
.pb-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 999px; background: #fdf6d8; color: #8a6a00; font-size: .74rem; font-weight: 700; letter-spacing: .01em; }
.pb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; color: var(--sin-muted); font-size: .8rem; }
.pb-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.pb-meta .icon { width: 15px; height: 15px; }
.pb-more { display: inline-flex; align-items: center; gap: .35rem; color: var(--sin-primary); font-size: .86rem; font-weight: 700; text-decoration: none; }
.pb-more .icon { width: 16px; height: 16px; transition: transform .2s ease; }

/* Berita: sorotan --------------------------------------------------------- */
.pb-feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; margin-bottom: 2rem; border: 1px solid var(--sin-border); border-radius: 24px; background: var(--sin-surface); box-shadow: 0 24px 50px -30px rgba(6, 44, 101, .45); }
.pb-feature .pb-media { --pb-ratio: auto; min-height: 380px; height: 100%; }
.pb-feature-body { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; padding: 2.2rem; }
.pb-feature-tag { display: inline-flex; align-items: center; gap: .35rem; color: var(--sin-primary); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pb-feature h2 { margin: 0; color: var(--sin-text); font-size: clamp(1.4rem, 2.4vw, 1.95rem); line-height: 1.25; letter-spacing: -.02em; }
.pb-feature h2 a { color: inherit; text-decoration: none; }
.pb-feature h2 a:hover { color: var(--sin-primary); }
.pb-feature p { margin: 0; color: var(--sin-text-2); line-height: 1.7; }
.pb-feature .pb-btn { margin-top: auto; }
.pb-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .72rem 1.25rem; border-radius: 999px; background: var(--sin-primary); color: #fff; font-size: .9rem; font-weight: 700; text-decoration: none; box-shadow: 0 12px 24px -12px rgba(7, 85, 181, .8); transition: transform .2s ease, background .2s ease; }
.pb-btn:hover { background: var(--sin-navy); color: #fff; transform: translateY(-2px); }
.pb-btn .icon { width: 17px; height: 17px; }

/* Berita: kartu ------------------------------------------------------------ */
.pb-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; color: var(--sin-text); font-size: 1.15rem; font-weight: 800; }
.pb-section-title::after { content: ''; flex: 1; height: 1px; background: var(--sin-border); }
.pb-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.pb-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sin-border); border-radius: 20px; background: var(--sin-surface); box-shadow: 0 10px 30px -22px rgba(6, 44, 101, .4); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.pb-card:hover { border-color: var(--sin-primary-100); box-shadow: 0 26px 46px -26px rgba(6, 44, 101, .5); transform: translateY(-5px); }
.pb-card:hover .pb-media-img { transform: scale(1.03); }
.pb-card:hover .pb-more .icon { transform: translateX(3px); }
.pb-card .pb-media { --pb-ratio: 1 / 1; }
.pb-card .pb-pill { position: absolute; top: .85rem; left: .85rem; z-index: 2; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .4); }
.pb-card-body { display: flex; flex: 1; flex-direction: column; gap: .6rem; padding: 1.2rem 1.25rem 1.3rem; }
.pb-card h3 { margin: 0; color: var(--sin-text); font-size: 1.05rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pb-card h3 a { color: inherit; text-decoration: none; }
.pb-card h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pb-card:hover h3 { color: var(--sin-primary); }
.pb-card p { margin: 0; color: var(--sin-muted); font-size: .9rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pb-card .pb-more { margin-top: auto; padding-top: .4rem; }

/* Empty state */
.pb-empty { display: grid; justify-items: center; gap: .5rem; padding: 3.5rem 1.5rem; border: 1px dashed var(--sin-border-strong, #cfd8e3); border-radius: 20px; background: var(--sin-surface); color: var(--sin-muted); text-align: center; }
.pb-empty .icon { width: 44px; height: 44px; color: var(--sin-primary); }
.pb-empty strong { color: var(--sin-text); font-size: 1.05rem; }
.pb-empty p { margin: 0; }

/* Detail berita ------------------------------------------------------------ */
.pb-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 1.6rem; }
.pb-article { overflow: hidden; border: 1px solid var(--sin-border); border-radius: 24px; background: var(--sin-surface); box-shadow: 0 24px 50px -32px rgba(6, 44, 101, .45); }
.pb-article .pb-media { --pb-ratio: auto; display: grid; place-items: center; max-height: 78vh; padding: 1.5rem; }
.pb-article .pb-media-img { width: auto; max-width: 100%; height: auto; max-height: calc(78vh - 3rem); border-radius: 12px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55); cursor: zoom-in; }
.pb-article .pb-zoom { opacity: 1; transform: none; }
.pb-article-body { padding: 2rem 2.3rem 2.4rem; }
.pb-article-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding-bottom: 1.2rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--sin-border); }
.pb-prose { color: var(--sin-text-2); font-size: 1.02rem; line-height: 1.85; overflow-wrap: anywhere; }
.pb-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 2rem; padding-top: 1.3rem; border-top: 1px solid var(--sin-border); }
.pb-share > span { margin-right: .3rem; color: var(--sin-muted); font-size: .85rem; font-weight: 600; }
.pb-share a, .pb-share button { display: inline-flex; align-items: center; gap: .4rem; padding: .48rem .85rem; border: 1px solid var(--sin-border); border-radius: 999px; background: var(--sin-surface); color: var(--sin-text-2); font: inherit; font-size: .82rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.pb-share a:hover, .pb-share button:hover { border-color: var(--sin-primary); color: var(--sin-primary); }
.pb-share .icon { width: 16px; height: 16px; }

.pb-aside { position: sticky; top: 110px; display: grid; gap: 1rem; }
.pb-aside-card { padding: 1.2rem; border: 1px solid var(--sin-border); border-radius: 20px; background: var(--sin-surface); box-shadow: var(--sin-shadow-sm); }
.pb-aside-card h2 { margin: 0 0 .9rem; color: var(--sin-text); font-size: 1rem; font-weight: 800; }
.pb-related { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.pb-related a { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: .8rem; padding: .35rem; border-radius: 14px; color: inherit; text-decoration: none; transition: background .15s ease; }
.pb-related a:hover { background: var(--sin-primary-50); }
.pb-related .pb-media { --pb-ratio: 1 / 1; border-radius: 10px; }
.pb-related strong { display: -webkit-box; color: var(--sin-text); font-size: .88rem; line-height: 1.4; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pb-related a:hover strong { color: var(--sin-primary); }
.pb-related small { display: block; margin-top: .2rem; color: var(--sin-muted); font-size: .75rem; }
.pb-back { display: inline-flex; align-items: center; gap: .4rem; color: var(--sin-primary); font-size: .88rem; font-weight: 700; text-decoration: none; }

/* Galeri: masonry tanpa potong ------------------------------------------- */
.pb-masonry { columns: 4 260px; column-gap: 1.1rem; }
.pb-photo { position: relative; display: block; width: 100%; margin: 0 0 1.1rem; padding: 0; overflow: hidden; break-inside: avoid; border: 0; border-radius: 18px; background: var(--sin-surface); box-shadow: 0 12px 30px -20px rgba(6, 44, 101, .5); cursor: zoom-in; text-align: left; font: inherit; }
.pb-photo img { display: block; width: 100%; height: auto; transition: transform .5s ease; }
.pb-photo:hover img { transform: scale(1.04); }
.pb-photo-caption { position: absolute; inset: auto 0 0 0; display: grid; gap: .3rem; padding: 2.6rem 1rem 1rem; color: #fff; background: linear-gradient(to top, rgba(4, 18, 44, .92), rgba(4, 18, 44, .55) 55%, transparent); opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease; }
.pb-photo:hover .pb-photo-caption, .pb-photo:focus-visible .pb-photo-caption { opacity: 1; transform: none; }
.pb-photo-caption strong { font-size: .95rem; line-height: 1.35; }
.pb-photo-caption small { display: inline-flex; align-items: center; gap: .3rem; color: var(--sin-accent); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pb-photo-badge { position: absolute; top: .7rem; right: .7rem; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(6, 22, 52, .5); color: #fff; backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease; }
.pb-photo:hover .pb-photo-badge { opacity: 1; }
.pb-photo-badge .icon { width: 16px; height: 16px; }
.pb-photo:focus-visible { outline: 3px solid var(--sin-accent); outline-offset: 3px; }
.pb-main [hidden] { display: none !important; }

/* Lightbox ----------------------------------------------------------------- */
.pb-lightbox { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(3, 12, 30, .94); color: #fff; }
.pb-lightbox:not([open]) { display: none; }
.pb-lightbox::backdrop { background: rgba(3, 12, 30, .94); }
.pb-lb-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; }
.pb-lb-count { color: rgba(255, 255, 255, .7); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pb-lb-actions { display: flex; gap: .5rem; }
.pb-lb-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s ease; }
.pb-lb-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.pb-lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 4.5rem; }
.pb-lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); }
.pb-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.pb-lb-prev { left: 1rem; }
.pb-lb-next { right: 1rem; }
.pb-lb-caption { display: grid; justify-items: center; gap: .25rem; padding: 1rem 1.2rem 1.4rem; text-align: center; }
.pb-lb-caption strong { font-size: 1rem; }
.pb-lb-caption span { max-width: 48rem; color: rgba(255, 255, 255, .72); font-size: .88rem; }
.pb-lb-caption small { color: var(--sin-accent); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
body.pb-lock { overflow: hidden; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 1024px) {
    .pb-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pb-article-layout { grid-template-columns: 1fr; }
    .pb-aside { position: static; }
}
@media (max-width: 760px) {
    .pb-hero { padding: 1.8rem 0 4.8rem; }
    .pb-feature { grid-template-columns: 1fr; }
    .pb-feature .pb-media { --pb-ratio: 4 / 5; min-height: 0; height: auto; }
    .pb-feature-body { padding: 1.4rem; }
    .pb-search { flex-basis: 100%; }
    .pb-toolbar { padding: .75rem; }
    .pb-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -.2rem; padding: 0 .2rem .2rem; scrollbar-width: none; }
    .pb-chip { flex-shrink: 0; }
    .pb-article-body { padding: 1.4rem 1.2rem 1.6rem; }
    .pb-article .pb-media { padding: .8rem; }
    .pb-masonry { columns: 2 150px; column-gap: .7rem; }
    .pb-photo { margin-bottom: .7rem; border-radius: 14px; }
    .pb-photo-caption { opacity: 1; transform: none; padding: 2rem .7rem .7rem; }
    .pb-photo-caption strong { font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .pb-lb-stage { padding: 0 .6rem; }
    .pb-lb-nav { width: 38px; height: 38px; background: rgba(3, 12, 30, .55); }
    .pb-lb-prev { left: .4rem; }
    .pb-lb-next { right: .4rem; }
}
@media (max-width: 560px) {
    .pb-news-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .pb-card, .pb-media-img, .pb-photo img, .pb-photo-caption { transition: none; }
}
