/* MBS FAI - halaman Pengumuman (/pengumuman): katalog DataTables + arsip kartu + detail berlampiran.
   Token warna dari variables.css; dua warna khusus (PDF, WhatsApp) diangkat jadi token di bawah. */
.pgm, .pgm-arsip{
  --pgm-pdf: #B42318;           /* ikon/aksen PDF, 5.9:1 di atas putih */
  --pgm-pdf-soft: #FDECEA;
  --pgm-wa: #128C4E;             /* hijau WhatsApp digelapkan supaya teks putih 4.6:1 */
  --pgm-line: rgba(13, 43, 54, .1);
  --pgm-new: linear-gradient(135deg, var(--mbs-green) 0%, var(--mbs-teal) 100%);
}

/* ---------- Label New ---------- */
.pgm-new{
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  padding: 3px 9px; border-radius: var(--r-pill); background: var(--pgm-new, linear-gradient(135deg, #0B8A4E, #0A7A66));
  color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.2; letter-spacing: .03em; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(11, 138, 78, .25);
}

/* ---------- Pembuka + saringan ---------- */
.pgm-intro{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.pgm-fresh{
  margin: 0; display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px;
  border-radius: var(--r-pill); background: #fff; box-shadow: var(--shadow-sm); font-size: .85rem; color: var(--mbs-ink);
}
.pgm-fresh strong{ color: var(--mbs-green-dark); }
.pgm-chips{ margin-bottom: 18px; }

/* ---------- Katalog (DataTables) ---------- */
.pgm-table-card{ background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 14px 22px 18px; }
.pgm-table{ margin: 0 !important; border-collapse: separate !important; border-spacing: 0; }
.pgm-table > thead > tr > th{
  font-size: .78rem; font-weight: 800; color: var(--mbs-muted); background: transparent;
  border-bottom: 1px solid var(--pgm-line) !important; padding: 12px 10px; white-space: nowrap;
}
.pgm-table > tbody > tr > td{ padding: 16px 10px; vertical-align: middle; border-bottom: 1px solid var(--pgm-line); background: transparent; box-shadow: none; }
.pgm-table > tbody > tr:last-child > td{ border-bottom: 0; }
@media (hover: hover){ .pgm-table > tbody > tr:hover > td{ background: rgba(234, 244, 239, .55); } }

.pgm-item{ display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.pgm-date{
  flex-shrink: 0; width: 52px; height: 56px; border-radius: 14px; background: var(--mbs-grad-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.pgm-date strong{ font-size: 1.2rem; font-weight: 800; color: var(--mbs-teal); }
.pgm-date small{ margin-top: 4px; font-size: .66rem; font-weight: 700; color: var(--mbs-muted); }
.pgm-item-main{ min-width: 0; }
.pgm-item-title{ color: var(--mbs-ink); font-weight: 800; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.pgm-item-title:hover{ color: var(--mbs-teal); }
.pgm-item-sum{
  margin: 4px 0 0; color: var(--mbs-muted); font-size: .85rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pgm-muted{ color: var(--mbs-muted); }
.pgm-files{ display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pgm-file{ display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; color: var(--mbs-muted); white-space: nowrap; }
.pgm-file .bi{ font-size: 1rem; line-height: 1; color: var(--mbs-teal); }
.pgm-file--pdf .bi{ color: var(--pgm-pdf); }

.pgm-open{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-pill); border: 1px solid rgba(10, 122, 102, .35); color: var(--mbs-teal);
  font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pgm-open .bi{ line-height: 1; }
.pgm-open:hover{ background: var(--mbs-grad-main); border-color: transparent; color: #fff; }

/* Kontrol DataTables disesuaikan tema */
.pgm .dt-container .dt-length, .pgm .dt-container .dt-info{ color: var(--mbs-muted); font-size: .85rem; }
.pgm .dt-container .dt-length select{ border-radius: var(--r-sm); margin-inline-end: 6px; }
.pgm .dt-container .dt-layout-row{ margin: 0 !important; padding: 6px 0; }
.pgm .dt-container .pagination{ gap: 4px; margin: 0; flex-wrap: wrap; }
.pgm .dt-container .page-link{
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill) !important; border: 0; color: var(--mbs-teal); font-weight: 700; background: var(--mbs-bg);
}
.pgm .dt-container .page-item.active .page-link{ background: var(--mbs-grad-main); color: #fff; }
.pgm .dt-container .page-item.disabled .page-link{ opacity: .45; background: var(--mbs-bg); }
.pgm div.dt-processing{ border-radius: var(--r-md); box-shadow: var(--shadow-md); border: 0; }
.pgm div.dt-processing > div:last-child > div{ background: var(--mbs-teal); }
/* Baris rincian (kolom yang disembunyikan Responsive di layar sempit) */
.pgm table.dataTable > tbody > tr.child ul.dtr-details{ width: 100%; }
.pgm table.dataTable > tbody > tr.child ul.dtr-details > li{ display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--pgm-line); }
.pgm table.dataTable > tbody > tr.child span.dtr-title{ min-width: 90px; font-size: .78rem; font-weight: 800; color: var(--mbs-muted); }
/* Penanda buka/tutup rincian: segitiga teal di tepi kiri baris, bukan baris sendiri di atas tanggal */
.pgm table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control{ position: relative; padding-inline-start: 30px; }
.pgm table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before{
  position: absolute; inset-inline-start: 8px; top: 50%; margin: -6px 0 0;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid var(--mbs-teal);
}
[dir="rtl"] .pgm table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before{ border-left: 0; border-right: 10px solid var(--mbs-teal); }

/* ---------- Arsip: 3 kartu besar | garis tipis | 4 kartu ringkas ---------- */
.pgm-arsip{ padding: 0 0 88px; }
.pgm-arsip-title{ margin: 0 0 22px; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); font-weight: 800; color: var(--mbs-ink); }
.pgm-sep{ border: 0; height: 1px; margin: 40px 0 32px; background: var(--pgm-line, rgba(13, 43, 54, .1)); opacity: 1; }
.pgm-grid4{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.pgm-mini{
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pgm-mini-media{ aspect-ratio: 16 / 10; min-height: 0; border-radius: 0; font-size: 1.8rem; }
.pgm-mini-body{ display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.pgm-mini-meta{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .74rem; color: var(--mbs-muted); }
.pgm-mini-meta .bi{ line-height: 1; }
.pgm-dot{ width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.pgm-mini-title{
  margin: 0; font-size: .95rem; font-weight: 800; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.pgm-mini-title a{ color: var(--mbs-ink); text-decoration: none; }
.pgm-mini-title a::after{ content: ""; position: absolute; inset: 0; z-index: 1; } /* seluruh kartu bisa diklik */
.pgm-mini-title a:focus-visible{ outline: none; }
.pgm-mini:focus-within{ outline: 2px solid var(--mbs-teal); outline-offset: 3px; }
@media (hover: hover){
  .pgm-mini:hover{ transform: translateY(-4px); box-shadow: var(--shadow-blue-hover); }
  .pgm-mini:hover .pgm-mini-title a{ color: var(--mbs-teal); }
}

/* ---------- Detail: galeri, berkas, bagikan ---------- */
.pgm-gallery{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 28px; }
.pgm-gallery.is-single{ grid-template-columns: minmax(0, 1fr); }
.pgm-shot{ margin: 0; min-width: 0; display: flex; flex-direction: column; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
/* Poster pengumuman sering berisi teks: tampil utuh (contain), tidak dipotong */
.pgm-shot-img{ display: block; aspect-ratio: 4 / 3; background: var(--mbs-grad-soft); }
.pgm-shot-img img{ width: 100%; height: 100%; object-fit: contain; display: block; }
.pgm-gallery.is-single .pgm-shot-img{ aspect-ratio: auto; }
.pgm-gallery.is-single .pgm-shot-img img{ height: auto; max-height: 80vh; }
.pgm-shot figcaption{ display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-top: 1px solid var(--pgm-line); }
.pgm-shot-name{ flex: 1 1 auto; min-width: 0; font-size: .8rem; color: var(--mbs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pgm-icon-btn{
  flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center;
  background: var(--mbs-bg); color: var(--mbs-teal); font-size: 1.05rem; line-height: 1; text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pgm-icon-btn:hover{ background: var(--mbs-grad-main); color: #fff; }

.pgm-count{
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; margin-inline-start: 6px;
  border-radius: var(--r-pill); background: var(--mbs-grad-soft); color: var(--mbs-teal); font-size: .78rem; font-weight: 800; vertical-align: middle;
}
.pgm-doclist{ list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.pgm-doclist li{
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-width: 0;
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.pgm-doc-icon{
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--pgm-pdf-soft); color: var(--pgm-pdf); font-size: 1.35rem; line-height: 1;
}
.pgm-doc-info{ flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pgm-doc-info strong{ font-size: .92rem; color: var(--mbs-ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pgm-doc-info small{ font-size: .76rem; color: var(--mbs-muted); }
.pgm-doc-actions{ display: flex; gap: 8px; flex-shrink: 0; }

/* Tautan penting: seluruh baris satu target klik, buka tab baru */
.pgm-linklist{ list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.pgm-link{
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 14px; min-width: 0;
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-sm); color: var(--mbs-ink); text-decoration: none;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.pgm-link-icon{
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--mbs-grad-soft); color: var(--mbs-teal); font-size: 1.3rem; line-height: 1;
}
.pgm-link-info{ flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pgm-link-info strong{ font-size: .92rem; overflow-wrap: anywhere; }
.pgm-link-info small{ font-size: .76rem; color: var(--mbs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pgm-link-go{
  flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center;
  background: var(--mbs-grad-main); color: #fff; font-size: 1rem; line-height: 1;
}
.pgm-link:hover{ color: var(--mbs-ink); box-shadow: var(--shadow-blue-hover); }
.pgm-link:hover .pgm-link-info strong{ color: var(--mbs-teal); }
.pgm-link:active{ transform: scale(.99); }
.pgm .pgm-link:focus-visible{ outline: 2px solid var(--mbs-teal); outline-offset: 2px; }
[dir="rtl"] .pgm-link-go .bi{ transform: scaleX(-1); }

/* URL di isi pengumuman yang otomatis jadi tautan */
.pgm .pg-prose a{ color: var(--mbs-teal); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.pgm .pg-prose a:hover{ color: var(--mbs-green-dark); }

.pgm-btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: var(--r-pill); background: var(--mbs-grad-main); color: #fff;
  font-size: .86rem; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.pgm-btn .bi{ font-size: 1rem; line-height: 1; }
.pgm-btn:hover{ color: #fff; box-shadow: 0 8px 18px rgba(10, 91, 168, .22); }
.pgm-btn:active{ transform: scale(.97); }
.pgm-btn--ghost{ background: #fff; color: var(--mbs-teal); box-shadow: inset 0 0 0 1px rgba(10, 122, 102, .35); }
.pgm-btn--ghost:hover{ color: var(--mbs-teal); background: var(--mbs-bg); box-shadow: inset 0 0 0 1px var(--mbs-teal); }
.pgm-btn--wa{ background: var(--pgm-wa); }
.pgm-btn--wa:hover{ box-shadow: 0 8px 18px rgba(18, 140, 78, .3); }
.pgm-share{ display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.pgm-share .pg-share-done{ font-size: .78rem; color: var(--mbs-green-dark); }

.pgm .pgm-btn:focus-visible, .pgm .pgm-open:focus-visible, .pgm .pgm-icon-btn:focus-visible{ outline: 2px solid var(--mbs-teal); outline-offset: 2px; }

/* ---------- Responsif ---------- */
@media (max-width: 991.98px){
  .pgm-grid4{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px){
  .pgm-table-card{ padding: 8px 14px 12px; border-radius: var(--r-md); }
  .pgm-table > tbody > tr > td{ padding: 14px 6px; }
  .pgm-grid4{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .pgm-arsip{ padding-bottom: 56px; }
  .pgm-sep{ margin: 28px 0 24px; }
  .pgm .dt-container .dt-layout-row{ flex-direction: column; align-items: center; gap: 8px; }
}
@media (max-width: 575.98px){
  .pgm-intro{ margin-bottom: 14px; }
  .pgm-date{ width: 44px; height: 48px; border-radius: 12px; }
  .pgm-date strong{ font-size: 1.02rem; }
  .pgm-item{ gap: 10px; }
  .pgm-item-title{ font-size: .92rem; }
  .pgm-item-sum{ font-size: .8rem; }
  /* HP: tombol Buka jadi ikon bulat 44px, label tetap untuk pembaca layar */
  .pgm-open{ width: 44px; min-height: 44px; padding: 0; }
  .pgm-open span{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pgm-grid4{ gap: 12px; }
  .pgm-mini-body{ padding: 10px 12px 12px; gap: 4px; }
  .pgm-mini-title{ font-size: .85rem; }
  .pgm-mini-meta{ font-size: .68rem; }
  .pgm-gallery{ gap: 10px; }
  .pgm-doclist li{ flex-wrap: wrap; }
  .pgm-doc-actions{ flex: 1 1 100%; }
  .pgm-doc-actions .pgm-btn{ flex: 1 1 0; }
  .pgm-share .pgm-btn{ flex: 1 1 100%; }
}
@media (pointer: coarse){
  .pgm-open{ min-height: 44px; }
  .pgm .dt-container .page-link{ min-width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce){
  .pgm-mini, .pgm-btn, .pgm-open, .pgm-icon-btn, .pgm-link{ transition: none; }
}
