/* ==========================================================================
   Hari Peringatan — dipakai oleh panel admin dan halaman publik.

   Semua selector diberi awalan .hp- agar tidak bertabrakan dengan tema fe2
   maupun tema admin (Stisla/Bootstrap 4).

   PENTING: popup ini dirender di DUA lingkungan CSS yang berbeda —
   - beranda (layouts/app) memuat Tailwind v4 lewat @vite, sehingga preflight-nya
     me-reset margin/judul/gambar;
   - halaman dalam (layouts/app-single) tidak memuat Tailwind sama sekali.
   Karena itu semua properti yang bisa berbeda (font-size, line-height, margin,
   border-radius, box-sizing) ditulis eksplisit di dalam .hp-scope, tidak
   diwariskan dari tema. Tanpa ini popup akan tampak berbeda di dua tempat.
   ========================================================================== */

.hp-scope {
  --hp-accent: #1a7f4b;
  --hp-accent-dark: #14663c;
  --hp-accent-soft: #eef8f2;
  --hp-accent-line: #c9e8d6;
  --hp-ink: #2c3345;
  --hp-muted: #738097;
  --hp-line: #ebebeb;
  --hp-bg: #f7f8fa;

  font-size: 15px;
  line-height: 1.6;
  color: #2c3345;
  box-sizing: border-box;
}

.hp-scope *,
.hp-scope *::before,
.hp-scope *::after {
  box-sizing: border-box;
}

/* Reset sadar-preflight: hanya elemen yang benar-benar kita render */
.hp-scope h1, .hp-scope h2, .hp-scope h3, .hp-scope h4 {
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.3;
  color: #2c3345;
}

.hp-scope p {
  margin: 0 0 12px;
}

.hp-scope img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

/* --------------------------------------------------------------------------
   1. Thumbnail di tabel admin
   -------------------------------------------------------------------------- */

.hp-admin-thumb {
  width: 76px;
  height: 56px;
  object-fit: cover;
  display: block;
  border: 1px solid #ebebeb;
  border-radius: 8px;
  background: #f3f5f8;
}

.hp-admin-thumb--kosong {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b6bcc8;
  font-size: 18px;
}

/* --------------------------------------------------------------------------
   2. Badge status
   -------------------------------------------------------------------------- */

.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.hp-badge--berlangsung { background: var(--hp-accent-soft); color: var(--hp-accent-dark); }
.hp-badge--akan-datang { background: #e4eefb; color: #1a4f8a; }
.hp-badge--selesai     { background: #eef0f3; color: #5b6472; }

/* --------------------------------------------------------------------------
   3. Popup
   -------------------------------------------------------------------------- */

.hp-popup {
  position: relative;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.hp-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 33, 45, 0.62);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hp-popup-close:hover {
  background: rgba(28, 33, 45, 0.85);
}

.hp-popup-media {
  background: #f1f3f6;
}

.hp-popup-media img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.hp-popup-body {
  padding: 26px 28px 24px;
}

.hp-popup-title {
  font-size: 24px;
  margin: 12px 0 8px;
}

.hp-popup-date {
  font-size: 13px;
  color: #738097;
  margin: 0 0 14px;
}

.hp-popup-date i {
  margin-right: 6px;
}

.hp-popup-desc {
  font-size: 14.5px;
  color: #4a5568;
  margin-bottom: 18px;
}

/* Blok ajakan twibbon */
.hp-popup-twibbon {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--hp-accent-line);
  border-radius: 12px;
  background: var(--hp-accent-soft);
}

.hp-popup-twibbon-img {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #ebebeb;
  background: #fff;
}

.hp-popup-twibbon-text {
  flex: 1 1 auto;
  min-width: 0;
}

.hp-popup-twibbon-text strong {
  display: block;
  font-size: 14px;
  color: #2c3345;
  margin-bottom: 2px;
}

.hp-popup-twibbon-text span {
  font-size: 12.5px;
  color: #738097;
}

.hp-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   4. Tombol
   -------------------------------------------------------------------------- */

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hp-btn--primary {
  background: var(--hp-accent);
  color: #fff;
}

.hp-btn--primary:hover {
  background: var(--hp-accent-dark);
  color: #fff;
  text-decoration: none;
}

.hp-btn--outline {
  background: #fff;
  border-color: #d9dee7;
  color: #2c3345;
}

.hp-btn--outline:hover {
  border-color: var(--hp-accent);
  color: var(--hp-accent);
  text-decoration: none;
}

.hp-btn--ghost {
  background: transparent;
  color: #738097;
}

.hp-btn--ghost:hover {
  color: #2c3345;
  text-decoration: none;
}

@media (max-width: 575px) {
  .hp-popup-body { padding: 20px 18px 20px; }
  .hp-popup-title { font-size: 20px; }
  .hp-popup-twibbon { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hp-popup-twibbon-img { width: 100%; height: 120px; object-fit: contain; }
  .hp-popup-actions .hp-btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   5. Kartu untuk halaman list & section beranda
   -------------------------------------------------------------------------- */

.hp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.hp-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hp-card:hover {
  transform: translateY(-3px);
  border-color: var(--hp-accent-line);
  box-shadow: 0 12px 26px rgba(44, 51, 69, 0.10);
}

.hp-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: #f1f3f6;
  overflow: hidden;
}

.hp-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-card-media--kosong {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c3cad6;
  font-size: 30px;
}

.hp-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 18px 20px 20px;
}

.hp-card-title {
  font-size: 17px;
  margin: 10px 0 8px;
}

.hp-card-desc {
  font-size: 13.5px;
  color: #738097;
  margin-bottom: 14px;
}

.hp-card-foot {
  margin-top: auto;
  padding-top: 14px;
}

.hp-empty {
  padding: 64px 24px;
  text-align: center;
  background: #fff;
  border: 1px dashed #d9dee7;
  border-radius: 14px;
  color: #738097;
}

.hp-empty i {
  display: block;
  font-size: 32px;
  color: #c3cad6;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   6. Running text di bawah breadcrumb halaman dalam

   Menggantikan popup di halaman selain beranda: tetap mengabari pengunjung
   tanpa menghadang mereka dengan modal.

   Isinya sengaja DIDUPLIKASI dua kali di markup, lalu digeser -50%. Dengan
   begitu animasinya mulus tanpa lompatan saat kembali ke awal — cara yang sama
   dipakai marquee tanpa perlu JavaScript.
   -------------------------------------------------------------------------- */

.hp-rt {
  background: var(--hp-accent-soft);
  border-top: 1px solid var(--hp-accent-line);
  border-bottom: 1px solid var(--hp-accent-line);
}

.hp-rt-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
}

.hp-rt-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--hp-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.hp-rt-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.hp-rt-move {
  display: inline-flex;
  white-space: nowrap;
  animation: hp-rt-scroll 30s linear infinite;
}

.hp-rt-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-right: 60px;
  font-size: 13.5px;
  color: var(--hp-ink);
}

.hp-rt-item strong {
  font-weight: 700;
}

.hp-rt-item .hp-rt-sep {
  color: var(--hp-accent);
}

.hp-rt-item a {
  color: var(--hp-accent-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hp-rt-item a:hover {
  color: var(--hp-accent);
}

/* Berhenti saat kursor di atasnya supaya teksnya sempat dibaca */
.hp-rt-track:hover .hp-rt-move,
.hp-rt-track:focus-within .hp-rt-move {
  animation-play-state: paused;
}

@keyframes hp-rt-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Pengunjung yang memilih mengurangi gerakan: teks tidak berjalan,
   tapi tetap bisa digeser manual. */
@media (prefers-reduced-motion: reduce) {
  .hp-rt-move {
    animation: none;
  }

  .hp-rt-track {
    overflow-x: auto;
  }

  .hp-rt-move .hp-rt-item + .hp-rt-item {
    display: none; /* duplikatnya tidak perlu kalau tidak berjalan */
  }
}
