/* ============================================================
   IMI JATIM — Komponen (design system v2, port dari amanahofficial.com)
   File : public/assets/css/components.css
   Header, menu navigasi, bottom nav (mobile), footer, tombol WA, tema.
   ============================================================ */

/* ══════════ HEADER ══════════ */
.site-header { position: sticky; top: 0; z-index: 900; background: var(--brand-grad); color: #fff; }
.site-header a { color: inherit; }

/* Baris atas (desktop) */
.sh-top { display: none; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.sh-top-inner { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.sh-top-left, .sh-top-right { display: flex; align-items: center; gap: 18px; }
.sh-top a, .sh-top-follow { display: inline-flex; align-items: center; gap: 6px; opacity: .92; }
.sh-top a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.sh-top .ic { width: 15px; height: 15px; }
.sh-sep { width: 1px; height: 13px; background: rgba(255, 255, 255, .5); }

.sh-account { position: relative; }
.sh-account-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: #fff; font-size: 13px; padding: 4px 0; }
.sh-account .avatar { background: rgba(255, 255, 255, .2); color: #fff; }
.sh-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px 0;
  background: var(--surface); color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow-3);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 950;
}
.sh-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.sh-account:hover .sh-menu, .sh-account.open .sh-menu { opacity: 1; visibility: visible; transform: none; }
.sh-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; color: var(--ink); opacity: 1; }
.sh-menu a:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.sh-menu .ic { width: 18px; height: 18px; color: var(--muted); }
.sh-menu a:hover .ic { color: var(--brand); }
.sh-menu-danger { border-top: 1px solid var(--line); margin-top: 4px; }
.sh-notif b { background: var(--accent); color: var(--accent-ink); font-size: 11px; border-radius: 9px; padding: 0 6px; line-height: 16px; margin-left: 2px; }

/* Bar utama: logo + menu + aksi */
.sh-main-inner { display: flex; align-items: center; gap: 10px; height: 60px; }
.sh-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; }
.sh-logo img { height: 44px; width: auto; }
.sh-logo-text { line-height: 1.1; min-width: 0; }
.sh-logo-text b { display: block; font-size: 16px; letter-spacing: .02em; }
.sh-logo-text span { display: block; font-size: 11px; color: var(--accent); white-space: nowrap; }
.sh-nav { display: none; }
.sh-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sh-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; background: none; color: #fff; border-radius: var(--r-sm); }
.sh-icon-btn:hover { background: rgba(255, 255, 255, .1); }
.sh-icon-btn .ic { width: 24px; height: 24px; }
.sh-icon-btn .dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.sh-cta { display: none; }

@media (min-width: 1024px) {
  .sh-top { display: block; }
  .sh-main-inner { height: 76px; gap: 20px; }
  .sh-logo img { height: 56px; }
  .sh-nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
  .sh-nav > a, .sh-nav-dd > button {
    display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: var(--r-sm);
    font-size: 14px; font-weight: 500; color: #fff; opacity: .92; background: none; border: 0;
  }
  .sh-nav > a:hover, .sh-nav-dd > button:hover, .sh-nav > a.active, .sh-nav-dd.active > button { opacity: 1; background: rgba(255, 255, 255, .1); }
  .sh-nav > a.active, .sh-nav-dd.active > button { box-shadow: inset 0 -2px 0 var(--accent); }
  .sh-nav-dd { position: relative; }
  .sh-nav-dd .ic { width: 14px; height: 14px; }
  .sh-nav-dd .sh-menu { left: 0; right: auto; }
  .sh-nav-dd:hover .sh-menu, .sh-nav-dd.open .sh-menu { opacity: 1; visibility: visible; transform: none; }
  .sh-cta { display: inline-flex; }
  .sh-burger { display: none !important; }
}

/* Drawer menu (mobile) */
.drawer { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: flex-end; background: rgba(0, 0, 0, .45); }
.drawer[hidden] { display: none !important; }
.drawer-box { width: min(340px, 88vw); height: 100%; overflow-y: auto; background: var(--surface); color: var(--ink); padding-bottom: 24px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--brand-grad); color: #fff; }
.drawer-head b { font-size: 16px; }
.drawer-head button { border: 0; background: none; color: #fff; }
.drawer h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 16px 6px; }
.drawer a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; font-size: 15px; }
.drawer a .ic { color: var(--brand); }
.drawer a.active { color: var(--brand); font-weight: 600; background: var(--brand-50); }

/* ══════════ BOTTOM NAV (mobile) ══════════ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--bottom-nav-h); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(22, 21, 67, .05);
}
.bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); }
.bn-item .ic { width: 22px; height: 22px; }
.bn-item.active { color: var(--brand); }
.bn-item.active .ic { stroke-width: 2.4; }
.bn-item-main .ic { width: 26px; height: 26px; }
body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav { padding-bottom: 0; }
}

/* ══════════ TOMBOL WA MELAYANG ══════════ */
.wa-float {
  position: fixed; right: 16px; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 890;
  width: 48px; height: 48px; border-radius: 50%; background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-2);
}
.wa-float .ic { width: 26px; height: 26px; }
@media (min-width: 768px) { .wa-float { bottom: 24px; right: 24px; width: 54px; height: 54px; } }

/* ══════════ FOOTER ══════════ */
.site-footer { background: var(--brand-dark); color: rgba(255, 255, 255, .78); border-top: 4px solid var(--accent); margin-top: 40px; padding: 36px 0 20px; font-size: 14px; }
.sf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 16px; }
@media (min-width: 900px) { .sf-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; } }
.sf-brand { grid-column: 1 / -1; }
@media (min-width: 900px) { .sf-brand { grid-column: auto; } }
.sf-brand-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: #fff; }
.sf-brand-head img { height: 56px; width: auto; }
.sf-brand-head b { font-size: 17px; display: block; }
.sf-brand-head span { font-size: 12px; color: var(--accent); }
.site-footer h4 { font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.site-footer a:hover { color: var(--accent); }
.sf-contact li { display: flex; gap: 8px; align-items: flex-start; }
.sf-contact .ic { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; }
.sf-social { display: flex; gap: 10px; margin-top: 14px; }
.sf-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); }
.sf-social a:hover { border-color: var(--accent); }
.sf-bottom { display: flex; flex-direction: column; gap: 8px; text-align: center; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding-top: 18px; font-size: 13px; color: rgba(255, 255, 255, .6); }
@media (min-width: 640px) { .sf-bottom { flex-direction: row; justify-content: space-between; text-align: left; } }
.sf-bottom nav { display: flex; gap: 14px; justify-content: center; }

/* ══════════ PEMILIH TEMA (dari amanah dark.css) ══════════ */
.sh-tema { position: relative; }
.sh-tema-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: #fff; font-size: 13px; padding: 4px 0; cursor: pointer; }
.sh-tema-btn .tm-ic { display: none; }
.sh-tema-btn .ic { width: 15px; height: 15px; }
:root[data-tema="terang"] .tm-terang, :root:not([data-tema]) .tm-terang,
:root[data-tema="gelap"] .tm-gelap, :root[data-tema="sistem"] .tm-sistem { display: inline-flex; }
.sh-tema.open .sh-menu { opacity: 1; visibility: visible; transform: none; }
.sh-tema-menu { min-width: 170px; }
.sh-tema-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: 0; background: none; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.sh-tema-menu button .ic { width: 18px; height: 18px; color: var(--muted); }
.sh-tema-menu button:hover { background: var(--brand-50); color: var(--brand); }
.sh-tema-menu button[aria-pressed="true"], .sh-tema-menu button[aria-pressed="true"] .ic { color: var(--brand); font-weight: 600; }
@media (max-width: 1023px) {
  .sh-tema.hide-lg .sh-tema-btn { width: 42px; height: 42px; justify-content: center; padding: 0; }
  .sh-tema.hide-lg .sh-tema-btn .ic { width: 22px; height: 22px; }
  .sh-tema-label { display: none; }
}
@media (min-width: 1024px) { .hide-lg { display: none !important; } }
@media (max-width: 1023px) { .show-lg { display: none !important; } }
