/* =========================
   HPO - AN TOÀN (BANNER + MỤC LỤC + ĐÁNH SỐ)
========================= */

/* Reset an toàn trong module */
#hpo-at-hero,
#hpo-at-page,
#hpo-at-hero *,
#hpo-at-page * {
  box-sizing: border-box;
}

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

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

.hpo-at-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-at-hero__kicker {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .9;
  margin: 0 0 10px;
}

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

/* ===== Layout ===== */
#hpo-at-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-at-sidebar-wrap {
  width: 320px;
  flex: 0 0 320px;
  min-width: 320px;
  position: sticky;
  top: var(--hpo-at-top, 120px);
  align-self: flex-start;
  z-index: 50;
}

#hpo-at-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;
}

/* Tabs */
.hpo-at__tabs {
  padding: 10px;
  display: grid;
  gap: 10px;
}

/* Chưa active: viền xanh */
#hpo-at-tabs a[data-at-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-at-tabs a[data-at-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;
}

/* Active: viền đỏ */
#hpo-at-tabs a[data-at-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-at-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 An toàn */
#hpo-at-page [data-at-pane] {
  display: block !important;
  scroll-margin-top: calc(var(--hpo-at-scroll-top, 120px) + 18px);
}

/* Khoảng cách giữa các phần nội dung */
#hpo-at-page [data-at-pane]+[data-at-pane] {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}


/* Heading */
#hpo-at-page .hpo-at__heading {
  margin: 0 0 10px !important;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.25;
  color: #2925f8;
}

/* =========================
   IMAGE: giảm ~50% + căn giữa
========================= */
.hpo-at__img {
  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: 50%;
  max-width: 520px;
  min-width: 280px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.hpo-at__img img {
  display: block;
  width: 100%;
  height: auto;
}

/* Fix khoảng trống theme/wpautop */
#hpo-at-page p {
  margin: 0 0 10px !important;
}

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

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

#hpo-at-page ul {
  margin: 8px 0 10px 18px !important;
}

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

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

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

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

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

  #hpo-at-sidebar {
    position: relative;
    top: auto;
  }

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

  .hpo-at__img {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}