/* ============================================================
   Custom public styles for PPVTPP
   ============================================================ */

/* ============================================================
   Accessibility / disability widget
   ============================================================ */
#a11y-widget { position: fixed; left: 20px; bottom: 20px; z-index: 99990; }
.a11y-fab {
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: #1b7a3d; color: #fff; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.a11y-fab:hover, .a11y-fab.open { background: #145e2f; transform: scale(1.06); }

.a11y-panel {
  position: absolute; left: 0; bottom: 66px; width: 320px; max-width: 86vw;
  background: #fff; border: 1px solid #e6e8ec; border-radius: 12px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .22); overflow: hidden;
}
.a11y-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #1b7a3d; color: #fff; padding: 12px 16px; font-weight: 600; font-size: 15px;
}
.a11y-x { background: none; border: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.a11y-panel-body { padding: 14px 16px 16px; max-height: 68vh; overflow-y: auto; }
.a11y-group { margin-bottom: 14px; }
.a11y-label { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #6b7280; margin-bottom: 7px; }
.a11y-row { display: flex; align-items: center; gap: 8px; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-btn {
  border: 1px solid #d7dae0; background: #f7f8fa; color: #231E41;
  border-radius: 8px; padding: 9px 10px; font-size: 13px; cursor: pointer;
  transition: .15s ease; text-align: center; line-height: 1.3;
}
.a11y-btn:hover { border-color: #1b7a3d; background: #eef6f0; }
.a11y-btn.active { background: #1b7a3d; color: #fff; border-color: #1b7a3d; }
.a11y-btn-primary { background: #1b7a3d; color: #fff; border-color: #1b7a3d; flex: 1; }
.a11y-btn-primary:hover { background: #145e2f; color: #fff; }
.a11y-level { min-width: 54px; text-align: center; font-weight: 700; }
.a11y-hint { display: block; color: #9aa0a6; font-size: 11px; margin-top: 6px; }
.a11y-reset { width: 100%; margin-top: 2px; border-color: #f0c2c2; color: #b00020; }
.a11y-reset:hover { background: #fdecec; border-color: #b00020; }

@media (max-width: 576px) {
  #a11y-widget { left: 14px; bottom: 14px; }
}

/* ---- accessibility modes applied to the page ----
   NB: CSS filter breaks position:fixed for descendants, so grayscale/invert are applied
   to the content and the fixed top-bar directly -- NOT to body -- and the floating
   controls (accessibility widget + WhatsApp) live outside .sb-app so they stay put. */
body.a11y-grayscale .sb-app > * { filter: grayscale(100%); }

/* Invert EVERYTHING including photos (user preference): a single inversion on the content,
   with NO media re-invert, so images/video/360 viewer also render as a negative. */
body.a11y-invert .sb-app > * { filter: invert(100%) hue-rotate(180deg); }

body.a11y-contrast .sb-app,
body.a11y-contrast .sb-app *:not(.slide) {   /* .slide = hero banner, handled separately below */
  background-color: #000 !important;
  background-image: none !important;   /* drop decorative background images */
  color: #ffdf00 !important;
  border-color: #ffdf00 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
body.a11y-contrast .sb-app a, body.a11y-contrast .sb-app a * { color: #35d0ff !important; }
/* <img>/<svg>/<video> are bitmap/vector content -- CSS colour cannot repaint them, so make
   them high-contrast monochrome (with a light border) to fit the black/yellow scheme. */
body.a11y-contrast .sb-app img,
body.a11y-contrast .sb-app svg,
body.a11y-contrast .sb-app video {
  filter: grayscale(1) contrast(1.25) brightness(1.05) !important;
  background-color: transparent !important;
  outline: 1px solid #ffdf00;
}
/* Hero banner: the photo is a PER-SLIDE inline background-image, so it cannot be removed
   from CSS without hiding the banner, and a `filter` on the slide would also grey out the
   overlay text. Instead keep the image and desaturate ONLY the background layer via a
   luminosity blend against a black backdrop -> the banner turns grayscale while the coloured
   overlay text (which is not a background) stays fully readable. */
body.a11y-contrast .sb-app .slide.swiper-slide {
  background-color: #000 !important;
  background-blend-mode: luminosity !important;
}
/* keep the overlay legible over the grayscale banner: one translucent panel, no per-word boxes */
body.a11y-contrast .sb-app .slide .image-data { background-color: rgba(0, 0, 0, .58) !important; }
body.a11y-contrast .sb-app .slide .image-data * { background-color: transparent !important; }

body.a11y-links a { text-decoration: underline !important; text-underline-offset: 2px; font-weight: 700 !important; }
body.a11y-readable, body.a11y-readable *:not(i):not(.fa):not([class^="fa"]):not([class*=" fa"]) {
  font-family: Verdana, Tahoma, Arial, "Segoe UI", sans-serif !important;
}
body.a11y-spacing .sb-app p, body.a11y-spacing .sb-app li, body.a11y-spacing .sb-app td,
body.a11y-spacing .sb-app dd, body.a11y-spacing .sb-app blockquote,
body.a11y-spacing .sb-app h1, body.a11y-spacing .sb-app h2, body.a11y-spacing .sb-app h3,
body.a11y-spacing .sb-app h4, body.a11y-spacing .sb-app h5, body.a11y-spacing .sb-app h6,
body.a11y-spacing .sb-app .text-for-reading, body.a11y-spacing .sb-app .sb-text,
body.a11y-spacing .sb-app .sb-member-description {
  line-height: 2 !important; letter-spacing: .4px !important; word-spacing: 2px !important;
}

/* the widget itself must stay readable even in contrast/grayscale mode */
#a11y-widget, #a11y-widget * { filter: none !important; }

/* element currently being read aloud in "Baca saat Disorot" (hover) mode */
.a11y-reading { outline: 3px solid #1b7a3d !important; outline-offset: 2px; border-radius: 2px; }
body.a11y-contrast .a11y-reading { outline-color: #ffdf00 !important; }

/* ------------------------------------------------------------
   Struktur Organisasi image -> click to open/zoom in Fancybox
   ------------------------------------------------------------ */
.sb-struktur-image a {
  position: relative;
  display: block;
}
.sb-struktur-zoom-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  background: rgba(35, 30, 65, .75);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 13px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.sb-struktur-image a:hover .sb-struktur-zoom-hint {
  opacity: 1;
}

/* ------------------------------------------------------------
   Profil Pejabat — organisational hierarchy (tiers driven by the
   admin "Tingkat Jabatan" table). A centered tier label with side
   rules, a connector between tiers, and a subtle lift on the top tier.
   ------------------------------------------------------------ */
.sb-org-tier { margin-top: 10px; }

.sb-org-tier-title {
  position: relative;
  display: inline-block;
  padding: 0 22px;
  font-weight: 600;
  color: #231E41;
}
.sb-org-tier-title::before,
.sb-org-tier-title::after {
  content: '';
  position: absolute;
  top: 55%;
  width: 44px;
  height: 2px;
  background-color: #F5C332;
}
.sb-org-tier-title::before { right: 100%; }
.sb-org-tier-title::after  { left: 100%; }

.sb-org-connector {
  width: 2px;
  height: 34px;
  margin: 4px auto 10px;
  background: linear-gradient(#F5C332, #E6E8EC);
}

/* emphasise the top of the hierarchy (e.g. Kepala Pusat) */
.sb-org-top .sb-team-member .sb-photo-frame img {
  box-shadow: 0 8px 26px rgba(0, 0, 0, .14);
}

/* clickable pejabat photo -> opens the picture in a Fancybox lightbox.
   The link must FILL the frame (not create its own shrink-wrapped box), so the
   theme's absolutely-positioned ".sb-photo-frame img" keeps positioning against the
   frame; otherwise the img collapses and the frame's gold ::before placeholder shows. */
.sb-photo-frame .sb-pejabat-photo {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: block;
  z-index: 2;
  cursor: zoom-in;
}
.sb-photo-frame .sb-pejabat-zoom {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(35, 30, 65, .38);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.sb-photo-frame .sb-pejabat-zoom img {
  width: 46px;
  height: 46px;
  padding: 11px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.sb-photo-frame .sb-pejabat-photo:hover .sb-pejabat-zoom {
  opacity: 1;
}

/* ------------------------------------------------------------
   Level-3 navigation submenu
   (e.g. "Laporan" > Laporan Kinerja / PPID / IKM / ...)

   The theme only styles a single dropdown level via the generic
   ".sb-navigation li:hover ul" rule, so third-level items used to
   render as a long flat list stretching down the page. This turns
   them into a proper submenu: a flyout to the side on desktop and
   an inline accordion on mobile. Built on top of the theme's own
   hover-driven menu -- no JS required.
   ------------------------------------------------------------ */

/* positioning context for the flyout (theme already sets li{relative}) */
nav .sb-navigation li ul li.sb-has-flyout {
  position: relative;
}

/* caret hint on the parent item; replace the theme's dot pseudo-elements */
nav .sb-navigation li ul li.sb-has-flyout > a {
  padding-right: 34px;
}
nav .sb-navigation li ul li.sb-has-flyout > a::before {
  content: none;
}
nav .sb-navigation li ul li.sb-has-flyout > a::after {
  content: '\203A'; /* › */
  left: auto;
  right: 14px;
  top: 50%;
  margin-top: 0;
  transform: translateY(-50%);
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  opacity: .6;
}

/* ---------- DESKTOP: flyout submenu to the right ---------- */
@media (min-width: 993px) {
  nav .sb-navigation li ul li.sb-has-flyout > .sb-submenu {
    top: -15px;
    left: 100%;
    margin-left: 0;
    min-width: 210px;
    padding: 15px 0;
  }

  /* no top hover-bridge for the flyout (that bridge is for the top bar) */
  nav .sb-navigation li ul li.sb-has-flyout > .sb-submenu::before {
    content: none;
  }

  /* keep the flyout hidden while only the first-level dropdown is open
     (overrides the theme's generic ".sb-navigation li:hover ul") */
  nav .sb-navigation li:hover ul li.sb-has-flyout > .sb-submenu {
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
  }

  /* reveal only when hovering its own parent item */
  nav .sb-navigation li ul li.sb-has-flyout:hover > .sb-submenu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
  }

  nav .sb-navigation li ul li.sb-has-flyout:hover > a::after {
    opacity: 1;
  }
}

/* ---------- MOBILE: inline accordion ---------- */
@media (max-width: 992px) {
  /* caret points down on mobile */
  nav .sb-navigation li ul li.sb-has-flyout > a::after {
    transform: translateY(-50%) rotate(90deg);
  }

  /* collapsed by default, even when the section above it is open */
  nav .sb-navigation li:hover ul li.sb-has-flyout > .sb-submenu {
    max-height: 0;
    overflow: hidden;
    padding: 0;
  }

  /* expand only when its own item is tapped */
  nav .sb-navigation li ul li.sb-has-flyout:hover > .sb-submenu {
    max-height: 1000px;
    padding: 0 0 10px;
  }

  nav .sb-navigation li ul li.sb-has-flyout > .sb-submenu li a {
    font-size: 13px;
    opacity: .95;
  }
}


/* ------------------------------------------------------------
   Virtual Tour — Pannellum hotspot icons (preset + custom)
   ------------------------------------------------------------ */
.vt-hotspot {
  width: var(--vt-size, 34px); height: var(--vt-size, 34px); border-radius: 50%;
  background: rgba(27, 122, 61, .92); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: pointer;
  background-size: cover; background-position: center;
}
.vt-hotspot::before {
  font-family: "Font Awesome 5 Free", "FontAwesome"; font-weight: 900; font-size: calc(var(--vt-size, 34px) * 0.44);
}
.vt-hotspot--arrow::before  { content: "\f061"; }
.vt-hotspot--door::before   { content: "\f52b"; }
.vt-hotspot--stairs::before { content: "\f0a0"; }
.vt-hotspot--info::before   { content: "\f129"; }
.vt-hotspot--pin::before    { content: "\f3c5"; }
.vt-hotspot--camera::before { content: "\f030"; }
.vt-hotspot--link::before   { content: "\f0c1"; }
.vt-hotspot--custom::before { content: ""; }   /* uses background-image from createTooltipFunc */
.vt-hotspot .vt-hotspot-tip {
  position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; font-size: 12px; padding: 3px 8px;
  border-radius: 4px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.vt-hotspot:hover .vt-hotspot-tip { opacity: 1; }
