/* ==========================================================================
   Halaman Beranda Pemerintah Kabupaten Brebes
   Letakkan di: assets/new23/css/home-elegant.css
   Semua selector diawali .hm-page sehingga tidak bentrok dengan CSS tema.
   Palet dan font sama dengan header-elegant.css.
   ========================================================================== */

/*MERAH*/
.hm-page {
  --hm-navy: #990000;         /* Warna utama diganti Merah PDIP */
  --hm-navy-deep: #660000;    /* Warna merah tua / deep */
  --hm-gold: #ffcc00;         /* Warna emas / kuning khas */
  --hm-gold-dark: #b38600;    /* Warna emas gelap */
  --hm-gold-soft: #fff5cc;    /* Warna emas soft latar belakang */
  --hm-ink: #1b2a3b;          /* Warna teks utama tetap kontras dan nyaman dibaca */
  --hm-muted: #5d6d7e;        /* Warna teks sekunder */
  --hm-line: #e2e8ef;         /* Warna garis pembatas */
  --hm-mist: #fcf4f4;         /* Warna latar belakang selang-seling (sedikit nuansa merah muda sangat tipis) */
  --hm-radius: 12px;

  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--hm-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/*BIRU
.hm-page {
  --hm-navy: #0f2b4c;
  --hm-navy-deep: #0a1f38;
  --hm-gold: #c8982f;
  --hm-gold-dark: #8a6416;
  --hm-gold-soft: #f7efd9;
  --hm-ink: #1b2a3b;
  --hm-muted: #5d6d7e;
  --hm-line: #e2e8ef;
  --hm-mist: #f4f7fa;
  --hm-radius: 12px;

  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--hm-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}*/

/* ---- Reset terbatas ---- */
.hm-page *, .hm-page *::before, .hm-page *::after { box-sizing: border-box; }
.hm-page h1, .hm-page h2, .hm-page h3, .hm-page h4, .hm-page p { margin: 0; padding: 0; }
.hm-page ul { margin: 0; padding: 0; list-style: none; }
.hm-page li { margin: 0; padding: 0; }
.hm-page a { text-decoration: none; color: inherit; transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.hm-page img { max-width: 100%; height: auto; border: 0; }
.hm-page button { font: inherit; color: inherit; margin: 0; cursor: pointer; }
.hm-page svg { display: block; flex: none; }
.hm-page :focus-visible { outline: 2px solid var(--hm-gold); outline-offset: 2px; border-radius: 4px; }

.hm-page .hm-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.hm-page .hm-section { padding: 68px 0; background: #fff; }
.hm-page .hm-section--mist { background: var(--hm-mist); }

/* ---- Judul bagian ---- */
.hm-page .hm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.hm-page .hm-title {
  position: relative;
  padding-bottom: 14px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--hm-navy);
}
.hm-page .hm-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--hm-gold);
}
.hm-page .hm-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--hm-navy);
}
.hm-page .hm-link:hover { color: var(--hm-gold-dark); }

/* Tombol panah (carousel) */
.hm-page .hm-nav { display: flex; gap: 8px; flex: none; }
.hm-page .hm-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--hm-line);
  border-radius: 50%;
  color: var(--hm-navy);
}
.hm-page .hm-nav__btn:hover:not(:disabled) { background: var(--hm-navy); border-color: var(--hm-navy); color: #fff; }
.hm-page .hm-nav__btn:disabled { opacity: .4; cursor: default; }
.hm-page .is-static .hm-nav { display: none; }

/* Gambar kosong */
.hm-page .hm-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8eef5, #dde6f0);
  color: #9aabbd;
}

/* ==========================================================================
   1. HERO
   ========================================================================== */
.hm-page .hm-hero { position: relative; background: var(--hm-navy-deep); color: #fff; overflow: hidden; }
.hm-page .hm-hero__viewport { position: relative; height: clamp(360px, 44vw, 540px); }
.hm-page .hm-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s ease, visibility 0s linear .7s;
}
.hm-page .hm-hero__slide.is-active { opacity: 1; visibility: visible; z-index: 1; transition-delay: 0s; }
.hm-page .hm-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-page .hm-hero__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,31,56,.92) 0%, rgba(10,31,56,.68) 42%, rgba(10,31,56,.12) 100%),
    linear-gradient(0deg, rgba(10,31,56,.55) 0%, rgba(10,31,56,0) 40%);
}
.hm-page .hm-hero__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
}
.hm-page .hm-hero__box { max-width: 700px; padding-bottom: 36px; }
.hm-page .hm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  margin-bottom: 18px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}
.hm-page .hm-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hm-gold); }
.hm-page .hm-hero__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: clamp(26px, 3.5vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
}
.hm-page .hm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 12px 22px;
  background: var(--hm-gold);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--hm-navy-deep);
}
.hm-page .hm-btn:hover { background: #d9ab45; color: var(--hm-navy-deep); }

.hm-page .hm-hero__ctrl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 3;
}
.hm-page .hm-hero__ctrl .hm-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hm-page .hm-dots { display: flex; gap: 8px; }
.hm-page .hm-dots button {
  width: 26px;
  height: 4px;
  padding: 0;
  background: rgba(255,255,255,.4);
  border: 0;
  border-radius: 2px;
  transition: background-color .2s ease, width .2s ease;
}
.hm-page .hm-dots button.is-active { width: 46px; background: var(--hm-gold); }
.hm-page .hm-hero .hm-nav__btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: #fff; }
.hm-page .hm-hero .hm-nav__btn:hover:not(:disabled) { background: var(--hm-gold); border-color: var(--hm-gold); color: var(--hm-navy-deep); }

/* ==========================================================================
   2. BERITA
   ========================================================================== */
.hm-page .hm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.hm-page .hm-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-radius);
  overflow: hidden;
}
.hm-page .hm-card:hover { border-color: #cdd7e2; box-shadow: 0 14px 30px rgba(10,31,56,.09); }
.hm-page .hm-card__media { display: block; aspect-ratio: 16 / 10; background: var(--hm-mist); overflow: hidden; }
.hm-page .hm-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-page .hm-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 18px; }
.hm-page .hm-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--hm-muted);
}
.hm-page .hm-meta svg { color: var(--hm-gold); }
.hm-page .hm-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--hm-ink);
}
.hm-page .hm-card__title a:hover { color: var(--hm-navy); text-decoration: underline; text-decoration-color: var(--hm-gold); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.hm-page .hm-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  font-size: 13px;
  color: var(--hm-muted);
}
.hm-page .hm-card__foot-wrap { margin-top: 18px; border-top: 1px solid var(--hm-line); }

/* ==========================================================================
   3. SAMBUTAN
   ========================================================================== */
.hm-page .hm-greet { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 64px; align-items: center; }
.hm-page .hm-greet__photo { margin: 0; }
.hm-page .hm-greet__frame { aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--hm-line); box-shadow: 0 18px 40px rgba(10,31,56,.14); }
.hm-page .hm-greet__frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hm-page .hm-greet__cap { margin-top: 18px; }
.hm-page .hm-greet__cap strong { display: block; font-size: 15px; font-weight: 700; color: var(--hm-navy); }
.hm-page .hm-greet__cap span { display: block; margin-top: 2px; font-size: 14px; color: var(--hm-muted); }

.hm-page .hm-greet__text .hm-title { margin-bottom: 26px; font-size: 28px; }
.hm-page .hm-quote {
  padding-left: 24px;
  border-left: 3px solid var(--hm-gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.85;
  color: #33475b;
  max-width: 62ch;
}
.hm-page .hm-sign { margin-top: 26px; padding-left: 27px; }
.hm-page .hm-sign strong { display: block; font-size: 16px; font-weight: 700; color: var(--hm-navy); }
.hm-page .hm-sign span { font-size: 14px; color: var(--hm-muted); }

/* ==========================================================================
   4. CAROUSEL GESER (galeri, hari jadi, pengumuman, video)
   ========================================================================== */
.hm-page .hm-scroller__track {
  display: flex;
  gap: 20px;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hm-page .hm-scroller__track::-webkit-scrollbar { display: none; }
.hm-page .hm-scroller__item { flex: 0 0 calc((100% - 60px) / 4); min-width: 0; scroll-snap-align: start; }
.hm-page .hm-scroller--one .hm-scroller__item { flex: 0 0 100%; }

.hm-page .hm-tile { display: block; }
.hm-page .hm-tile__media { aspect-ratio: 4 / 3; border-radius: var(--hm-radius); overflow: hidden; background: var(--hm-line); }
.hm-page .hm-tile__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.hm-page .hm-tile:hover .hm-tile__media img { transform: scale(1.04); }
.hm-page .hm-tile__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--hm-ink);
}
.hm-page .hm-tile:hover .hm-tile__title { color: var(--hm-navy); }

/* ==========================================================================
   5. PENGUMUMAN & VIDEO
   ========================================================================== */
.hm-page .hm-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.hm-page .hm-panel {
  background: #fff;
  border: 1px solid var(--hm-line);
  border-radius: 14px;
  padding: 26px;
}
.hm-page .hm-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.hm-page .hm-panel__title { font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--hm-navy); }

.hm-page .hm-ann__media { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--hm-mist); }
.hm-page .hm-ann__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-page .hm-ann__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--hm-ink);
}
.hm-page .hm-btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 18px;
  border: 1.5px solid var(--hm-navy);
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--hm-navy);
}
.hm-page .hm-btn-line:hover { background: var(--hm-navy); color: #fff; }

.hm-page .hm-video { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.hm-page .hm-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.hm-page .hm-video__title { margin-top: 16px; font-size: 17px; line-height: 1.45; font-weight: 600; color: var(--hm-ink); }

/* ==========================================================================
   6. MEDIA SOSIAL & INFORMASI PUBLIK
   ========================================================================== */
.hm-page .hm-widgets { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 24px; align-items: stretch; }
.hm-page .hm-widgets .hm-panel { display: flex; flex-direction: column; min-width: 0; }
.hm-page .hm-widget__body { flex: 1; min-height: 0; max-height: 400px; overflow-y: auto; scrollbar-width: thin; }

.hm-page .hm-social { display: flex; flex-direction: column; }
.hm-page .hm-social a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--hm-line);
  font-size: 15px;
  font-weight: 600;
  color: var(--hm-ink);
  word-break: break-word;
}
.hm-page .hm-social li:last-child a { border-bottom: 0; }
.hm-page .hm-social a:hover { color: var(--hm-navy); background: var(--hm-mist); }
.hm-page .hm-social img { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; border: 1px solid var(--hm-line); }
.hm-page .hm-social .hm-go { margin-left: auto; color: var(--hm-muted); }

/* ==========================================================================
   7. LAYANAN PUBLIK
   ========================================================================== */
.hm-page .hm-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.hm-page .hm-service {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--hm-line);
  border-radius: var(--hm-radius);
}
.hm-page .hm-service__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 10px;
  background: var(--hm-gold-soft);
  color: var(--hm-gold-dark);
  transition: background-color .18s ease, color .18s ease;
}
.hm-page .hm-service__name { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--hm-ink); }
.hm-page .hm-service .hm-go { margin-left: auto; color: var(--hm-muted); }
.hm-page .hm-service:hover { border-color: var(--hm-navy); box-shadow: 0 10px 24px rgba(10,31,56,.08); }
.hm-page .hm-service:hover .hm-service__icon { background: var(--hm-navy); color: #fff; }
.hm-page .hm-service:hover .hm-service__name { color: var(--hm-navy); }

/* ==========================================================================
   8. POPUP INFORMASI
   ========================================================================== */
dialog.hm-popup:not([open]) { display: none; }
dialog.hm-popup {
  width: min(92vw, 520px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  color: #1b2a3b;
  background: #fff;
  box-shadow: 0 30px 70px rgba(10,31,56,.35);
  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
dialog.hm-popup::backdrop { background: rgba(10,31,56,.62); }
dialog.hm-popup[open] { display: flex; flex-direction: column; }
dialog.hm-popup * { box-sizing: border-box; }
dialog.hm-popup .hm-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 22px;
  background: #0f2b4c;
  color: #fff;
}
dialog.hm-popup .hm-pop__head h2 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
dialog.hm-popup .hm-pop__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255,255,255,.12);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}
dialog.hm-popup .hm-pop__x:hover { background: rgba(255,255,255,.22); }
dialog.hm-popup .hm-pop__body { flex: 1; overflow-y: auto; padding: 22px; text-align: center; }
dialog.hm-popup .hm-pop__name { margin: 0 0 16px; font-size: 17px; line-height: 1.45; font-weight: 700; color: #0f2b4c; }
dialog.hm-popup .hm-pop__img { display: block; }
dialog.hm-popup .hm-pop__img img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 10px; background: #f4f7fa; }
dialog.hm-popup .hm-pop__video { aspect-ratio: 16 / 9; margin-top: 16px; border-radius: 10px; overflow: hidden; background: #000; }
dialog.hm-popup .hm-pop__video iframe { display: block; width: 100%; height: 100%; border: 0; }
dialog.hm-popup .hm-pop__note { margin-top: 18px; font-size: 14px; line-height: 1.55; color: #5d6d7e; }
dialog.hm-popup .hm-pop__note a { display: block; font-weight: 700; color: #0f2b4c; }
dialog.hm-popup .hm-pop__note a:hover { text-decoration: underline; }
dialog.hm-popup .hm-pop__foot { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid #e2e8ef; background: #f4f7fa; }
dialog.hm-popup .hm-pop__close {
  padding: 9px 22px;
  background: #0f2b4c;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
dialog.hm-popup .hm-pop__close:hover { background: #0a1f38; }
dialog.hm-popup :focus-visible { outline: 2px solid #c8982f; outline-offset: 2px; }

dialog.hm-popup:not([open]) { display: none; }
dialog.hm-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(92vw, 520px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  color: #1b2a3b;
  background: #fff;
  box-shadow: 0 30px 70px rgba(10,31,56,.35);
  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
dialog.hm-popup::backdrop { background: rgba(10,31,56,.62); }
dialog.hm-popup[open] { display: flex; flex-direction: column; }

/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */
@media (max-width: 1199.98px) {
  .hm-page .hm-greet { grid-template-columns: 320px minmax(0, 1fr); gap: 48px; }
  .hm-page .hm-scroller__item { flex-basis: calc((100% - 40px) / 3); }
  .hm-page .hm-services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .hm-page .hm-section { padding: 52px 0; }
  .hm-page .hm-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .hm-page .hm-greet { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hm-page .hm-greet__photo { max-width: 360px; }
  .hm-page .hm-duo { grid-template-columns: minmax(0, 1fr); }
  .hm-page .hm-widgets { grid-template-columns: minmax(0, 1fr); }
  .hm-page .hm-scroller__item { flex-basis: calc((100% - 20px) / 2); }
  .hm-page .hm-title { font-size: 26px; }
}

@media (max-width: 767.98px) {
  .hm-page .hm-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-page .hm-hero__ctrl .hm-nav { display: none; }
  .hm-page .hm-hero__box { padding-bottom: 48px; }
  .hm-page .hm-panel { padding: 20px; }
}

@media (max-width: 575.98px) {
  .hm-page .hm-section { padding: 44px 0; }
  .hm-page .hm-head { gap: 12px; margin-bottom: 22px; }
  .hm-page .hm-title { font-size: 23px; }
  .hm-page .hm-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hm-page .hm-services { grid-template-columns: minmax(0, 1fr); }
  .hm-page .hm-scroller__item { flex-basis: 80%; }
  .hm-page .hm-scroller--one .hm-scroller__item { flex-basis: 100%; }
  .hm-page .hm-quote { font-size: 17px; padding-left: 18px; }
  .hm-page .hm-sign { padding-left: 21px; }
  .hm-page .hm-greet__photo { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-page .hm-hero__slide { transition: none; }
  .hm-page .hm-scroller__track { scroll-behavior: auto; }
  .hm-page .hm-tile__media img { transition: none; }
  .hm-page .hm-tile:hover .hm-tile__media img { transform: none; }
}
