/* =========================
   HPO - LỖI SA HÌNH (BANNER + MỤC LỤC)
   Trang đã có đánh số sẵn trong HTML
========================= */

#hpo-shl-hero,
#hpo-shl-page,
#hpo-shl-hero *,
#hpo-shl-page * {
  box-sizing: border-box;
}

#hpo-shl-hero,
#hpo-shl-page {
  color: #0f172a;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  line-height: 1.5;
}

/* ===== Banner ===== */
#hpo-shl-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 0;
}

.hpo-shl-hero__inner {
  border-radius: 22px;
  padding: 22px 26px 20px;
  color: #fff;
  background: linear-gradient(135deg, #14b8ff 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 18px 46px rgba(2, 6, 23, .18);
  text-align: left;
}

.hpo-shl-hero__kicker {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .9;
  margin: 0 0 10px;
}

.hpo-shl-hero__title {
  margin: 0;
  font-weight: 950;
  font-size: 24px;
  line-height: 1.15;
  max-width: 980px;
}

.hpo-shl-hero__desc {
  margin-top: 10px;
  max-width: 980px;
  opacity: .95;
}

/* ===== Layout ===== */
#hpo-shl-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ===== Sidebar / Mục lục ===== */
#hpo-shl-sidebar-wrap {
  width: 320px;
  flex: 0 0 320px;
  min-width: 320px;
  position: sticky;
  top: var(--hpo-shl-top, 120px);
  align-self: flex-start;
  z-index: 50;
}

#hpo-shl-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .08);
  position: relative;
  top: auto;
  overflow: hidden;
  max-height: calc(100vh - var(--hpo-shl-top, 120px) - 16px);
  display: flex;
  flex-direction: column;
}

.hpo-shl__tabs {
  padding: 10px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.hpo-shl__tabs::-webkit-scrollbar {
  width: 8px;
}

.hpo-shl__tabs::-webkit-scrollbar-track {
  background: transparent;
}

.hpo-shl__tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.hpo-shl__tabs::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mục lục chưa active: viền xanh */
#hpo-shl-tabs a[data-shl-tab] {
  display: block;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid #2563eb !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .08) !important;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
}

#hpo-shl-tabs a[data-shl-tab]:hover {
  transform: translateY(-1px);
  border-color: #1d4ed8 !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .14) !important;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%) !important;
}

/* Mục lục active: viền đỏ */
#hpo-shl-tabs a[data-shl-tab].is-active {
  border-color: #dc2626 !important;
  box-shadow: 0 12px 26px rgba(220, 38, 38, .18) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
  color: #dc2626 !important;
}

/* ===== Content ===== */
#hpo-shl-content {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .08);
  padding: 14px 16px 16px;
}

/* Hiển thị tất cả nội dung */
#hpo-shl-page [data-shl-pane] {
  display: block !important;
  scroll-margin-top: calc(var(--hpo-shl-scroll-top, 120px) + 18px);
}

#hpo-shl-page [data-shl-pane]+[data-shl-pane] {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

/* Heading nội dung: không thêm số vì HTML đã có sẵn */
#hpo-shl-page .hpo-shl__heading {
  margin: 0 0 10px !important;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.25;
  color: #2925f8;
}

#hpo-shl-page .hpo-shl__sub {
  margin: 12px 0 8px !important;
  font-weight: 900;
}

#hpo-shl-page .hpo-shl__desc {
  margin: 0 0 10px !important;
  opacity: .95;
}

/* Video */
.hpo-shl__video {
  margin: 10px 0 12px !important;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 26px rgba(2, 6, 23, .08);
  background: #fff;
  width: 80%;
  max-width: 820px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.hpo-shl__video video {
  display: block;
  width: 100%;
  height: auto;
  outline: none;
}

/* List */
#hpo-shl-page ul {
  margin: 8px 0 10px 18px !important;
}

#hpo-shl-page li {
  margin: 0 0 6px !important;
}

/* Fix wpautop */
#hpo-shl-page p {
  margin: 0 0 10px !important;
}

#hpo-shl-page p:empty {
  display: none !important;
}

#hpo-shl-page br {
  display: none !important;
}

/* Ẩn nút play overlay trên iOS nếu có */
#hpo-shl-page .hpo-shl__video video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* Mobile */
@media (max-width: 900px) {
  .hpo-shl-hero__inner {
    padding: 18px 18px 16px;
    border-radius: 18px;
  }

  .hpo-shl-hero__title {
    font-size: 20px;
    max-width: 100%;
  }

  #hpo-shl-layout {
    display: block;
  }

  #hpo-shl-sidebar-wrap {
    width: 100%;
    min-width: 0;
    position: relative;
    top: auto;
  }

  #hpo-shl-sidebar {
    position: relative;
    top: auto;
    max-height: none;
  }

  .hpo-shl__tabs {
    overflow: visible;
    max-height: none;
  }

  #hpo-shl-content {
    margin-top: 14px;
  }

  .hpo-shl__video {
    width: 100%;
    max-width: none;
  }
}