/* ==========================================================================
   Header Pemerintah Kabupaten Brebes
   Letakkan di: assets/new23/css/header-elegant.css
   Dimuat PALING AKHIR di head.php, semua selector diawali .bb-header
   sehingga tidak bentrok dengan style.css / responsive.css bawaan tema.
   ========================================================================== */

/*MERAH*/
.bb-scope {
  --bb-navy: #d32f2f;       /* Merah utama PDIP yang menyala dan tegas */
  --bb-navy-deep: #9a0007;  /* Merah tua/gelap untuk kedalaman (hover/dark mode) */
  --bb-gold: #ffcc00;       /* Kuning khas yang kontras dengan merah */
  --bb-gold-soft: #fff3cc;  /* Kuning soft untuk background/highlight halus */
  --bb-ink: #1f1f1f;        /* Hitam arang / netral gelap untuk teks utama */
  --bb-muted: #666666;      /* Abu-abu untuk teks sekunder/muted */
  --bb-line: #e0e0e0;       /* Warna garis pembatas yang bersih */
  --bb-mist: #fafafa;       /* Putih abu-abu sangat muda untuk background */
  --bb-radius: 10px;

  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--bb-ink);
  -webkit-font-smoothing: antialiased;
}

/*BIRU
.bb-scope {
  --bb-navy: #0f2b4c;
  --bb-navy-deep: #0a1f38;
  --bb-gold: #c8982f;
  --bb-gold-soft: #f7efd9;
  --bb-ink: #1b2a3b;
  --bb-muted: #5d6d7e;
  --bb-line: #e2e8ef;
  --bb-mist: #f4f7fa;
  --bb-radius: 10px;

  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--bb-ink);
  -webkit-font-smoothing: antialiased;
}*/
/* ---- Header menempel saat scroll ----
   --bb-stick-top diisi otomatis oleh JS (negatif = tinggi top bar + baris logo),
   sehingga bagian itu ikut menggulung dan hanya menu utama yang tetap terlihat.
   Tanpa JS nilainya 0 (seluruh header menempel). */
.bb-header {
  position: sticky;
  top: var(--bb-stick-top, 0px);
  z-index: 995;
  background: #fff;
  transition: box-shadow .2s ease;
}
.bb-header.is-stuck { box-shadow: 0 8px 24px rgba(10, 31, 56, .22); }

/* Tema bawaan memotong konten dengan overflow:hidden, ini membuat sticky gagal.
   "clip" tetap mencegah geser horizontal tanpa mematikan sticky. */
html, body, .boxed_wrapper {
  overflow: visible !important;
  overflow-x: clip !important;
}
/* Anchor (#id) tidak tertutup menu yang menempel */
html { scroll-padding-top: var(--bb-sticky-h, 64px); }

/* ---- Reset terbatas (menetralkan style tema untuk elemen di dalam header) ---- */
.bb-scope *,
.bb-scope *::before,
.bb-scope *::after { box-sizing: border-box; }
.bb-scope ul { margin: 0; padding: 0; list-style: none; }
.bb-scope li { margin: 0; padding: 0; }
.bb-scope a { text-decoration: none; transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, border-color .18s ease; }
.bb-scope img { max-width: 100%; height: auto; border: 0; }
.bb-scope button { font: inherit; color: inherit; margin: 0; cursor: pointer; }
.bb-scope svg { display: block; flex: none; }

.bb-scope :focus-visible {
  outline: 2px solid var(--bb-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.bb-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ==========================================================================
   1. TOP BAR
   ========================================================================== */
.bb-header .bb-topbar {
  background: var(--bb-navy-deep);
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
}
.bb-header .bb-topbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
}
.bb-header .bb-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.bb-header .bb-contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .8);
}
.bb-header .bb-contact a:hover { color: #fff; }
.bb-header .bb-contact svg { color: var(--bb-gold); }

.bb-header .bb-social {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bb-header .bb-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  line-height: 1;
}
.bb-header .bb-social a:hover {
  background: var(--bb-gold);
  border-color: var(--bb-gold);
  color: var(--bb-navy-deep);
}

/* ==========================================================================
   2. BRAND ROW  (logo, slogan, cuaca, tombol menu mobile)
   ========================================================================== */
.bb-header .bb-brandrow { background: #fff; }
.bb-header .bb-brandrow__in {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.bb-header .bb-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--bb-navy);
  min-width: 0;
}
.bb-header .bb-brand__logo {
  height: 60px;
  width: auto;
  flex: none;
}
.bb-header .bb-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bb-header .bb-brand__org {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--bb-muted);
}
.bb-header .bb-brand__name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.012em;
  line-height: 1.1;
  color: var(--bb-navy);
}
.bb-header .bb-brand:hover .bb-brand__name { color: var(--bb-navy-deep); }

.bb-header .bb-slogan {
  display: flex;
  align-items: center;
  align-self: stretch;
  padding-left: 20px;
  border-left: 1px solid var(--bb-line);
}
.bb-header .bb-slogan img {
  height: 54px;
  width: auto;
}

.bb-header .bb-weather {
  margin-left: auto;
  flex: none;
  max-width: 250px;
  line-height: 0;
  overflow: hidden;
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  background: #fff;
}
.bb-header .bb-weather a { display: block; }
.bb-header .bb-weather img { display: block; width: 100%; max-height: 64px; object-fit: cover; }

/* Tombol menu: hanya tampil di layar kecil */
.bb-header .bb-burger {
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: #fff;
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  color: var(--bb-navy);
}
.bb-header .bb-burger:hover { background: var(--bb-mist); }

/* ==========================================================================
   3. NAVIGASI UTAMA (desktop)
   ========================================================================== */
.bb-header .bb-nav {
  background: var(--bb-navy);
  position: relative;
}
.bb-header .bb-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.bb-header .bb-menu > li { position: relative; }

.bb-header .bb-menu > li > a {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 52px;
  padding: 0 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .9);
  white-space: nowrap;
}
.bb-header .bb-menu > li > a .bb-chev {
  opacity: .65;
  transition: transform .18s ease, opacity .18s ease;
}
.bb-header .bb-menu > li:hover > a,
.bb-header .bb-menu > li:focus-within > a,
.bb-header .bb-menu > li.is-active > a {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 -3px 0 var(--bb-gold);
}
.bb-header .bb-menu > li:hover > a .bb-chev,
.bb-header .bb-menu > li:focus-within > a .bb-chev {
  opacity: 1;
  transform: rotate(180deg);
}

/* Dropdown */
.bb-header .bb-sub {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 250px;
  max-width: 340px;
  padding: 8px 0;
  background: #fff;
  border-top: 3px solid var(--bb-gold);
  border-radius: 0 0 var(--bb-radius) var(--bb-radius);
  box-shadow: 0 16px 36px rgba(10, 31, 56, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.bb-header .bb-menu > li:hover > .bb-sub,
.bb-header .bb-menu > li:focus-within > .bb-sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.bb-header .bb-menu > li:nth-last-child(-n+2) > .bb-sub { left: auto; right: 0; }

.bb-header .bb-sub a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--bb-ink);
}
.bb-header .bb-sub a:hover,
.bb-header .bb-sub a:focus-visible {
  background: var(--bb-mist);
  color: var(--bb-navy);
  box-shadow: inset 3px 0 0 var(--bb-gold);
}

/* ==========================================================================
   4. PENGUMUMAN (berjalan, berhenti saat disorot)
   ========================================================================== */
.bb-scope .bb-ticker {
  background: var(--bb-mist);
  border-bottom: 1px solid var(--bb-line);
}
.bb-scope .bb-ticker__in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
}
.bb-scope .bb-ticker__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 5px 14px 5px 11px;
  border-radius: 999px;
  background: var(--bb-gold);
  color: var(--bb-navy-deep);
  font-size: 13px;
  font-weight: 700;
}
.bb-scope .bb-ticker__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}
.bb-scope .bb-ticker__track {
  display: flex;
  width: max-content;
  animation: bb-marquee var(--bb-dur, 40s) linear infinite;
}
.bb-scope .bb-ticker__viewport:hover .bb-ticker__track,
.bb-scope .bb-ticker__viewport:focus-within .bb-ticker__track { animation-play-state: paused; }

.bb-scope .bb-ticker__group {
  display: flex;
  flex: none;
  align-items: center;
}
.bb-scope .bb-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-right: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bb-ink);
  white-space: nowrap;
}
.bb-scope .bb-ticker__item::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--bb-gold);
  transform: rotate(45deg);
  flex: none;
}
.bb-scope a.bb-ticker__item:hover { color: var(--bb-navy); text-decoration: underline; text-underline-offset: 3px; }

@keyframes bb-marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .bb-scope .bb-ticker__track { animation: none; width: auto; }
  .bb-scope .bb-ticker__viewport { overflow-x: auto; scrollbar-width: thin; }
  .bb-scope .bb-ticker__group[aria-hidden="true"] { display: none; }
  .bb-header .bb-sub { transition: none; }
}

/* ==========================================================================
   5. DRAWER MENU (mobile)
   ========================================================================== */
.bb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1990;
  background: rgba(10, 31, 56, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.bb-overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.bb-drawer {
  --bb-navy: #0f2b4c;
  --bb-navy-deep: #0a1f38;
  --bb-gold: #c8982f;
  --bb-ink: #1b2a3b;
  --bb-muted: #5d6d7e;
  --bb-line: #e2e8ef;
  --bb-mist: #f4f7fa;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  width: min(88vw, 360px);
  background: #fff;
  font-family: "DM Sans", "Merriweather Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--bb-ink);
  box-shadow: -18px 0 40px rgba(10, 31, 56, .25);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .28s ease, visibility 0s linear .28s;
}
.bb-drawer.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }

.bb-drawer *, .bb-drawer *::before, .bb-drawer *::after { box-sizing: border-box; }
.bb-drawer ul { margin: 0; padding: 0; list-style: none; }
.bb-drawer li { margin: 0; padding: 0; }
.bb-drawer a { text-decoration: none; }
.bb-drawer button { font: inherit; color: inherit; margin: 0; cursor: pointer; }
.bb-drawer svg { display: block; flex: none; }
.bb-drawer :focus-visible { outline: 2px solid var(--bb-gold); outline-offset: 2px; border-radius: 4px; }

.bb-drawer .bb-d-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bb-navy);
  color: #fff;
}
.bb-drawer .bb-d-brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.bb-drawer .bb-d-brand img { height: 40px; width: auto; }
.bb-drawer .bb-d-brand span { font-size: 16px; font-weight: 700; line-height: 1.2; }
.bb-drawer .bb-d-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .1);
  border: 0;
  border-radius: 10px;
  color: #fff;
}
.bb-drawer .bb-d-close:hover { background: rgba(255, 255, 255, .2); }

.bb-drawer .bb-d-nav { flex: 1; overflow-y: auto; padding: 8px 0; -webkit-overflow-scrolling: touch; }
.bb-drawer .bb-d-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--bb-line); }
.bb-drawer .bb-d-row > a {
  flex: 1;
  padding: 14px 20px;
  font-weight: 500;
  color: var(--bb-ink);
}
.bb-drawer .bb-d-item.is-active > .bb-d-row > a {
  color: var(--bb-navy);
  font-weight: 700;
  box-shadow: inset 4px 0 0 var(--bb-gold);
  background: var(--bb-mist);
}
.bb-drawer .bb-d-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--bb-line);
  color: var(--bb-muted);
}
.bb-drawer .bb-d-toggle svg { transition: transform .2s ease; }
.bb-drawer .bb-d-item.is-open > .bb-d-row .bb-d-toggle svg { transform: rotate(180deg); }
.bb-drawer .bb-d-item.is-open > .bb-d-row .bb-d-toggle { color: var(--bb-navy); }

.bb-drawer .bb-d-sub { display: none; background: var(--bb-mist); }
.bb-drawer .bb-d-item.is-open > .bb-d-sub { display: block; }
.bb-drawer .bb-d-sub a {
  display: block;
  padding: 11px 20px 11px 34px;
  font-size: 14px;
  color: var(--bb-ink);
  border-bottom: 1px solid var(--bb-line);
}
.bb-drawer .bb-d-sub a:hover { color: var(--bb-navy); }

.bb-drawer .bb-d-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--bb-line);
  background: #fff;
  font-size: 13.5px;
  color: var(--bb-muted);
}
.bb-drawer .bb-d-foot strong { display: block; margin-bottom: 6px; color: var(--bb-navy); font-size: 14px; }
.bb-drawer .bb-d-foot a { display: block; padding: 2px 0; color: var(--bb-ink); word-break: break-word; }
.bb-drawer .bb-d-social { display: flex; gap: 8px; margin-top: 12px; }
.bb-drawer .bb-d-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--bb-line);
  border-radius: 50%;
  color: var(--bb-navy);
  font-size: 14px;
}
.bb-drawer .bb-d-social a:hover { background: var(--bb-navy); color: #fff; }

html.bb-lock { overflow: hidden; }

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 1199.98px) {
  .bb-header .bb-menu > li > a { padding: 0 12px; font-size: 14px; }
  .bb-header .bb-brand__name { font-size: 23px; }
}

@media (max-width: 991.98px) {
  .bb-header .bb-topbar,
  .bb-header .bb-nav,
  .bb-header .bb-slogan,
  .bb-header .bb-weather { display: none; }

  .bb-header .bb-burger { display: inline-flex; }
  .bb-header .bb-brandrow { border-bottom: 1px solid var(--bb-line); }
  .bb-header .bb-brandrow__in { padding-top: 10px; padding-bottom: 10px; gap: 12px; }
  .bb-header .bb-brand__logo { height: 46px; }
  .bb-header .bb-brand__name { font-size: 20px; }
  .bb-header .bb-brand__org { font-size: 12px; }
}

@media (max-width: 575.98px) {
  .bb-header .bb-brand { gap: 10px; }
  .bb-header .bb-brand__logo { height: 40px; }
  .bb-header .bb-brand__name { font-size: 17px; }
  .bb-scope .bb-ticker__in { gap: 10px; min-height: 40px; }
  .bb-scope .bb-ticker__label { padding: 5px 11px 5px 9px; font-size: 12px; }
  .bb-scope .bb-ticker__item { font-size: 13px; }
}

@media (min-width: 992px) {
  .bb-overlay, .bb-drawer { display: none; }
}