/* ============================================
   Peta Hukum — Berita (daftar /berita + detail /berita/{id})
   Lanjutan dari ph-home.css: memakai token yang sama (--ink, --line, --lavender,
   dst.) supaya halaman berita satu bahasa desain dengan /peraturan dan /sektor.
   Hanya dimuat di dua halaman itu — bukan di seluruh portal.
   ============================================ */

/* Label yang hanya untuk pembaca layar (portal tidak memuat Bootstrap,
   jadi .visually-hidden tidak tersedia). */
.ph-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   DAFTAR BERITA — saringan
   ============================================ */

/* Jumlah berita per sektor, menempel di dalam chip saringan. */
.ph-filter-chip__count {
  margin-left: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--graphite-light);
  font-variant-numeric: tabular-nums;
}
.ph-filter-chip[aria-current="true"] .ph-filter-chip__count { color: rgba(255, 255, 255, 0.7); }

/* Combobox peraturan: ketik → daftar hasil → satu peraturan terpilih. */
.ph-combo { position: relative; flex: 1 1 280px; min-width: 0; max-width: 420px; }
.ph-combo .ph-input { width: 100%; }

.ph-combo__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 40px -24px rgba(15, 15, 20, 0.55);
}
.ph-combo__item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.ph-combo__item:hover { background: var(--lavender); color: var(--ink); }
.ph-combo__empty { padding: 9px 12px; font-size: 13.5px; color: var(--graphite); }

/* Peraturan yang sedang dipakai sebagai saringan. */
.ph-token {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 8px 7px 15px;
  border: 1px solid var(--lavender-deep);
  border-radius: 999px;
  background: var(--lavender);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink);
}
.ph-token__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: var(--lavender-ink);
  cursor: pointer;
}
.ph-token__clear:hover { background: #fff; color: var(--ink); }

/* Sementara Livewire menunggu balasan server, hasil diredupkan — bukan
   dikosongkan — supaya tinggi halaman tidak melompat. */
.ph-is-loading { opacity: 0.45; transition: opacity 0.15s var(--ease); pointer-events: none; }

/* ============================================
   DETAIL BERITA — kerangka halaman
   ============================================ */
.ph-pagehead__title { max-width: 24ch; }
.ph-pagehead .ph-byline { margin-top: 18px; }

.ph-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13.5px;
  color: var(--graphite);
}
.ph-byline__item { display: inline-flex; align-items: center; gap: 7px; }
.ph-byline__item svg { color: var(--graphite-light); flex: none; }

.ph-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(36px, 4vw, 56px);
}
@media (min-width: 980px) {
  .ph-article {
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: clamp(40px, 4.5vw, 68px);
  }
}
.ph-article__main { min-width: 0; }
.ph-article__figure { margin: 0 0 clamp(24px, 3vw, 34px); }
.ph-article__figure .ph-media { aspect-ratio: 3 / 2; border-radius: var(--r-lg); }

/* ---------- Isi berita (HTML dari CMS) ---------- */
.ph-prose {
  font-size: clamp(15.5px, 1.15vw, 17px);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 70ch;
  /* Sebagian isi lama ditulis tanpa <p>: baris baru dari editor tetap dihormati.
     Elemen blok di dalamnya dikembalikan ke `normal` agar tidak dobel jarak. */
  white-space: pre-line;
}
.ph-prose + .ph-prose { margin-top: 1.1em; }
.ph-prose :where(p, ul, ol, blockquote, table, figure) { margin: 0 0 1.05em; white-space: normal; }
.ph-prose > :last-child { margin-bottom: 0; }
.ph-prose :where(h2, h3, h4, h5, h6) {
  margin: 1.9em 0 0.6em;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: normal;
}
.ph-prose h2 { font-size: clamp(21px, 2vw, 26px); }
.ph-prose h3 { font-size: clamp(18px, 1.6vw, 21px); }
.ph-prose h4, .ph-prose h5, .ph-prose h6 { font-size: 17px; }
.ph-prose a { color: var(--lavender-ink); text-decoration: underline; text-underline-offset: 3px; }
.ph-prose a:hover { color: var(--ink); }
.ph-prose strong, .ph-prose b { font-weight: 650; color: var(--ink); }
.ph-prose ul { list-style: disc outside; padding-left: 1.35em; }
.ph-prose ol { list-style: decimal outside; padding-left: 1.35em; }
.ph-prose li { margin-bottom: 0.4em; white-space: normal; }
.ph-prose img { border-radius: var(--r-md); margin-block: 0.4em; }
.ph-prose blockquote {
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--lavender-deep);
  font-family: var(--font-serif);
  font-size: 1.05em;
  line-height: 1.6;
  color: var(--graphite);
  white-space: normal;
}
.ph-prose figcaption { font-size: 13px; color: var(--graphite-light); margin-top: 6px; }
/* Tabel bisa lebih lebar dari kolom teks; biarkan tabelnya sendiri yang
   di-scroll, bukan seluruh halaman. */
.ph-prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; display: block; overflow-x: auto; }
.ph-prose :where(td, th) { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.ph-prose th { background: var(--canvas-warm); font-weight: 650; }
.ph-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ---------- Blok setelah isi berita ---------- */
.ph-article__block { margin-top: clamp(34px, 4vw, 48px); }
.ph-article__block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.ph-article__block-head svg { color: var(--graphite); flex: none; }
.ph-article__block-title {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ph-article__block-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Peraturan terkait dirender dengan kartu yang sama persis seperti di
   /peraturan; di kolom artikel muat satu per baris. */
.ph-article .ph-reg-grid { grid-template-columns: minmax(0, 1fr); }

.ph-article__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  margin-top: clamp(34px, 4vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.ph-share { display: flex; align-items: center; gap: 9px; }
.ph-share__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}
.ph-share__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}
.ph-share__link:hover { background: var(--ink); border-color: var(--ink); color: #fff; transform: translateY(-1px); }

/* ============================================
   SIDEBAR
   ============================================ */
.ph-aside { min-width: 0; }
@media (min-width: 980px) {
  .ph-aside { position: sticky; top: 92px; align-self: start; }
}
.ph-widget + .ph-widget { margin-top: clamp(28px, 3vw, 36px); }
.ph-widget__title {
  margin: 0 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.ph-widget .ph-side-item:first-of-type { border-top: 0; }
.ph-widget .ph-empty { padding: 20px; text-align: left; margin-top: 16px; }
.ph-widget .ph-empty p { margin-inline: 0; }
.ph-widget .ph-chips { flex-wrap: wrap; overflow: visible; margin-top: 16px; }

/* ============================================
   SITASI BERITA — tombol + dialog
   ============================================ */
[x-cloak] { display: none !important; }

.ph-cite {
  margin-top: clamp(30px, 3.4vw, 40px);
  padding: clamp(20px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(70% 130% at 8% 0%, var(--lavender) 0%, transparent 62%),
    #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.ph-cite__copy { max-width: 46ch; }
.ph-cite__title { font-size: 16.5px; font-weight: 650; letter-spacing: -0.015em; }
.ph-cite__desc { margin-top: 5px; font-size: 14px; line-height: 1.55; color: var(--graphite); }

.ph-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(3px);
}
.ph-modal__panel {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 40px 90px -40px rgba(15, 15, 20, 0.7);
  padding: clamp(22px, 3vw, 32px);
}
.ph-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.ph-modal__title { margin: 0; font-size: clamp(19px, 1.8vw, 23px); font-weight: 700; letter-spacing: -0.025em; }
.ph-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.ph-modal__close:hover { background: var(--canvas-warm); }

.ph-field { margin-bottom: 20px; }
.ph-field__label {
  display: block;
  margin-bottom: 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}
.ph-select {
  width: 100%;
  min-height: 46px;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235A5A66' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  appearance: none;
  cursor: pointer;
}
.ph-select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

.ph-cite__preview {
  padding: 20px 22px;
  border-left: 3px solid var(--lavender-deep);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--canvas-warm);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  word-break: break-word;
}

.ph-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1300;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 18px 40px -22px rgba(15, 15, 20, 0.8);
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.ph-toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }
.ph-toast[data-state="error"] { background: #A33A3A; }
