/**
 * Booktoan Pro — Sách Toán CSS
 * Mô phỏng giao diện Astro /sachtoan
 * Áp dụng cho: page-sachtoan.php và page-baitoan.php
 */

/* ================================================================
   VARIABLES
   ================================================================ */
:root {
  --st-sidebar-w: 260px;
  --st-nav-h: 56px;
  /* chiều cao fixed nav */
  --st-sidebar-bg: #ffffff;
  --st-sidebar-border: #e5e7eb;
  --st-chapter-color: #065f46;
  /* xanh lá đậm - chương */
  --st-active-color: #1565c0;
  /* xanh blue - bài đang xem */
  --st-lesson-link: #2563eb;
  /* xanh blue - link bài học */
  --st-hero-default-bg: #064e3b;
  /* xanh đậm mặc định */

  /* Callout */
  --st-c-def-bg: #eff6ff;
  --st-c-def-border: #3b82f6;
  --st-c-def-head: rgba(59, 130, 246, .12);
  --st-c-ex-bg: #f5f3ff;
  --st-c-ex-border: #8b5cf6;
  --st-c-ex-head: rgba(139, 92, 246, .12);
  --st-c-sol-bg: #f0fdf4;
  --st-c-sol-border: #10b981;
  --st-c-sol-head: rgba(16, 185, 129, .12);
  --st-c-method-bg: #fff7ed;
  --st-c-method-border: #f97316;
  --st-c-method-head: rgba(249, 115, 22, .12);
  --st-c-note-bg: #fefce8;
  --st-c-note-border: #eab308;
  --st-c-note-head: rgba(234, 179, 8, .12);
  --st-c-warn-bg: #fff1f2;
  --st-c-warn-border: #f43f5e;
  --st-c-warn-head: rgba(244, 63, 94, .12);

  /* Task / Bài tập */
  --st-c-task-bg: #f0f9ff;
  --st-c-task-border: #0ea5e9;
  --st-c-task-head: #0284c7;
}

/* ================================================================
   RESET cho entry khi dùng st-wrap
   ================================================================ */
.page-template-page-templates-page-sachtoan .entry,
.page-template-page-templates-page-baitoan .entry {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  transform: none !important;
}

.page-template-page-templates-page-sachtoan .site-inner,
.page-template-page-templates-page-baitoan .site-inner {
  padding-top: var(--st-nav-h) !important;
  max-width: 100% !important;
}

/* ================================================================
   LAYOUT: 2 CỘT
   ================================================================ */
.st-wrap {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--st-nav-h));
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.st-sidebar {
  width: var(--st-sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--st-nav-h);
  height: calc(100vh - var(--st-nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--st-sidebar-bg);
  border-right: 1px solid var(--st-sidebar-border);
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.st-sidebar::-webkit-scrollbar {
  width: 4px;
}

.st-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.st-sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* Sidebar header */
.st-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--st-sidebar-border);
  position: sticky;
  top: 0;
  background: var(--st-sidebar-bg);
  z-index: 2;
}

.st-sidebar-book-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  color: #111 !important;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.st-sidebar-book-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.st-sidebar-book-name {
  color: #da2008 !important;
}

/* Nav */
.st-sidebar-nav {
  padding: 6px 0 40px;
}

.st-sidebar-section {
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

/* === MÀU NỀN TỪNG CHƯƠNG (desktop sidebar) === */
.st-sidebar-section:nth-child(6n+1) .st-sidebar-chapter-row {
  background: rgba(224, 242, 254, .45);
  border-left: 3px solid #38bdf8;
}

.st-sidebar-section:nth-child(6n+2) .st-sidebar-chapter-row {
  background: rgba(220, 252, 231, .45);
  border-left: 3px solid #34d399;
}

.st-sidebar-section:nth-child(6n+3) .st-sidebar-chapter-row {
  background: rgba(250, 232, 255, .45);
  border-left: 3px solid #c084fc;
}

.st-sidebar-section:nth-child(6n+4) .st-sidebar-chapter-row {
  background: rgba(254, 243, 199, .45);
  border-left: 3px solid #fbbf24;
}

.st-sidebar-section:nth-child(6n+5) .st-sidebar-chapter-row {
  background: rgba(219, 234, 254, .45);
  border-left: 3px solid #60a5fa;
}

.st-sidebar-section:nth-child(6n+6) .st-sidebar-chapter-row {
  background: rgba(255, 228, 230, .45);
  border-left: 3px solid #fb7185;
}

/* Bài học bên trong chương — màu accent nhẹ theo nhóm */
.st-sidebar-section:nth-child(6n+1) .st-sidebar-lesson-item a:hover {
  background: #e0f2fe;
  color: #0369a1 !important;
}

.st-sidebar-section:nth-child(6n+2) .st-sidebar-lesson-item a:hover {
  background: #dcfce7;
  color: #15803d !important;
}

.st-sidebar-section:nth-child(6n+3) .st-sidebar-lesson-item a:hover {
  background: #fae8ff;
  color: #7e22ce !important;
}

.st-sidebar-section:nth-child(6n+4) .st-sidebar-lesson-item a:hover {
  background: #fef3c7;
  color: #92400e !important;
}

.st-sidebar-section:nth-child(6n+5) .st-sidebar-lesson-item a:hover {
  background: #dbeafe;
  color: #1d4ed8 !important;
}

.st-sidebar-section:nth-child(6n+6) .st-sidebar-lesson-item a:hover {
  background: #ffe4e6;
  color: #be123c !important;
}

/* Chapter row */
.st-sidebar-chapter-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 4px;
}

.st-sidebar-chapter-link {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--st-chapter-color) !important;
  text-decoration: none !important;
  line-height: 1.4;
  transition: opacity 0.15s;
}

.st-sidebar-chapter-link:hover {
  opacity: 0.75;
}

.st-sidebar-chapter-link.active {
  color: var(--st-active-color) !important;
}

/* Toggle arrow button — reset tất cả global button overrides từ modern-effects.css */
.st-wrap .st-sidebar-toggle,
.st-wrap .st-sidebar-toggle:focus,
.st-wrap .st-sidebar-toggle:hover,
.st-wrap .st-sidebar-toggle:active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  cursor: pointer;
  color: #9ca3af !important;
  transform: none !important;
  flex-shrink: 0;
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  opacity: 1 !important;
  transition: color 0.15s, background 0.15s !important;
  line-height: 1 !important;
}

.st-wrap .st-sidebar-toggle:hover {
  color: #374151 !important;
  background: #f3f4f6 !important;
}

.st-sidebar-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.st-sidebar-section.is-open .st-sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Lessons list */
.st-sidebar-lessons {
  display: none;
  list-style: none !important;
  margin: 0 !important;
  padding: 2px 8px 8px 24px !important;
}

.st-sidebar-lessons.is-visible {
  display: block;
}

.st-sidebar-lesson-item {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.st-sidebar-lesson-item a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #374151 !important;
  text-decoration: none !important;
  border-radius: 6px;
  line-height: 1.4;
  transition: background 0.12s, color 0.12s;
}

.st-sidebar-lesson-item a::before {
  content: '•';
  color: #d1d5db;
  flex-shrink: 0;
  font-size: 10px;
  margin-top: 2px;
}

.st-sidebar-lesson-item a:hover {
  background: #f0fdf4;
  color: #065f46 !important;
}

.st-sidebar-lesson-item a:hover::before {
  color: #10b981;
}

.st-sidebar-lesson-item.active>a {
  background: #eff6ff;
  color: var(--st-active-color) !important;
  font-weight: 600;
}

.st-sidebar-lesson-item.active>a::before {
  color: var(--st-active-color);
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.st-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.st-hero {
  background-color: var(--st-hero-default-bg);
  padding: 48px 40px 56px;
  overflow: hidden;
  position: relative;
}

.st-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 900px;
}

.st-hero-content {
  flex: 1;
}

.st-hero-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
  margin: 0 0 10px;
}

.st-hero-title {
  font-size: clamp(28px, 5vw, 52px) !important;
  font-weight: 800 !important;
  color: #fff !important;
  margin: 0 0 16px !important;
  line-height: 1.1 !important;
  letter-spacing: -0.025em !important;
}

.st-hero-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, .75);
  line-height: 1.7;
  margin: 0 0 24px;
  max-width: 520px;
}

.st-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.st-hero-deco {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  opacity: 0.7;
}

.st-hero-deco svg {
  width: 100%;
  height: 100%;
}

/* ================================================================
   SECTION WRAPPER
   ================================================================ */
.st-section {
  padding: 36px 40px;
}

.st-section-heading {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0ac946 !important;
  margin: 0 0 24px !important;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

/* ================================================================
   CHAPTER GRID & CARDS
   ================================================================ */
.st-chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.st-chapter-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Nền "random" mượt bằng soft gradients cho các card thứ tự khác nhau */
.st-chapter-card:nth-child(6n+1) {
  background: linear-gradient(145deg, #ffffff, #f0f9ff);
  border-color: #e0f2fe;
}

.st-chapter-card:nth-child(6n+2) {
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
  border-color: #dcfce7;
}

.st-chapter-card:nth-child(6n+3) {
  background: linear-gradient(145deg, #ffffff, #fdf4ff);
  border-color: #fae8ff;
}

.st-chapter-card:nth-child(6n+4) {
  background: linear-gradient(145deg, #ffffff, #fffbeb);
  border-color: #fef3c7;
}

.st-chapter-card:nth-child(6n+5) {
  background: linear-gradient(145deg, #ffffff, #eff6ff);
  border-color: #dbeafe;
}

.st-chapter-card:nth-child(6n+6) {
  background: linear-gradient(145deg, #ffffff, #fff1f2);
  border-color: #ffe4e6;
}

.st-chapter-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

.st-chapter-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.st-chapter-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary, #1565c0);
  background: rgba(21, 101, 192, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.st-chapter-card__emoji {
  font-size: 22px;
}

.st-chapter-card__title {
  font-size: 19px !important;
  font-weight: 800 !important;
  color: #f01818 !important;
  margin: 0 0 10px !important;
  line-height: 1.35 !important;
}

.st-chapter-card__title a {
  color: #db0505 !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.st-chapter-card__title a:hover {
  color: var(--st-active-color, #1565c0) !important;
}

.st-chapter-card__desc {
  font-size: 14.5px;
  color: #4b5563;
  margin: 0 0 16px;
  line-height: 1.6;
}

.st-chapter-card__lessons {
  list-style: none !important;
  margin: auto 0 0 0 !important;
  /* Đẩy xuống dưới nếu card dài */
  padding: 16px 0 0 0 !important;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.st-chapter-card__lessons li {
  border: none !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  display: flex;
  align-items: flex-start;
}

.st-chapter-card__lessons li::before {
  content: '•';
  color: #9ca3af;
  margin-right: 8px;
  font-weight: bold;
}

.st-chapter-card__lessons li a {
  font-size: 15px;
  font-weight: 500;
  color: var(--st-lesson-link) !important;
  text-decoration: none !important;
  display: block;
  line-height: 1.5;
  transition: color 0.15s ease;
}

.st-chapter-card__lessons li a:hover {
  text-decoration: none !important;
  color: #0d47a1 !important;
}


/* ================================================================
   LESSON PAGE
   ================================================================ */
.st-lesson {
  max-width: 820px;
  padding: 32px 40px 80px;
}

/* Breadcrumb */
.st-breadcrumb {
  margin-bottom: 20px;
}

.st-bc-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0;
  font-size: 13px;
  color: #9ca3af;
}

.st-bc-list li {
  display: flex;
  align-items: center;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.st-bc-list li+li::before {
  content: ' › ';
  margin: 0 5px;
  color: #d1d5db;
}

.st-bc-list a {
  color: #6b7280 !important;
  text-decoration: none !important;
}

.st-bc-list a:hover {
  color: var(--st-chapter-color) !important;
}

.st-bc-list li:last-child {
  color: #374151;
  font-weight: 500;
}

/* Lesson header */
.st-lesson-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
}

.st-lesson-title {
  font-size: clamp(22px, 4vw, 34px) !important;
  font-weight: 800 !important;
  color: #111 !important;
  line-height: 1.2 !important;
  margin: 0 0 10px !important;
}

.st-lesson-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.st-lesson-meta__chapter a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-chapter-color) !important;
  text-decoration: none !important;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  padding: 3px 12px;
}

.st-lesson-meta__chapter a:hover {
  background: #dcfce7;
}

/* Lesson content (MathJax render từ Genesis) */
.st-lesson-content {
  font-family: 'STIX Two Text', 'Times New Roman', Georgia, serif !important;
  font-size: 17px;
  line-height: 1.9;
  color: #111;
}

.st-lesson-content h2 {
  font-family: 'Be Vietnam Pro', sans-serif !important;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: #111 !important;
  margin: 44px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--st-active-color);
}

.st-lesson-content h3 {
  font-family: 'Be Vietnam Pro', sans-serif !important;
  font-size: clamp(15px, 2.5vw, 18px);
  font-weight: 600;
  color: #1e3a5f !important;
  background: #f0f9ff;
  padding: 10px 16px;
  border-radius: 8px;
  border-left: 3px solid #38bdf8;
  margin: 32px 0 14px;
}

.st-lesson-content p {
  margin-bottom: 20px;
}

/* MathJax override — không co chữ */
.st-lesson-content mjx-container {
  font-size: 1.05em !important;
}

/* ================================================================
   CALLOUT BOXES — kiểu pill label + bordered card
   ================================================================ */

/* Container chung: tạo vùng đẩy xuống để pill label nhô ra ngoài */
.st-callout {
  position: relative;
  margin: 32px 0 24px;
  padding-top: 14px;
  /* chỗ trống cho pill nhô lên */
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: transparent;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.st-callout:hover {
  transform: translateY(-2px);
}

/* Phần pill label nhô lên trên đường viền */
.st-callout__head {
  /* absolute ra ngoài box, đặt góc trên-trái */
  position: absolute;
  top: -14px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
  /* shadow nhẹ cho pill */
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  z-index: 1;
}

/* Pill label cho details (lời giải) cần list-style none */
.st-callout>summary.st-callout__head {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.st-callout>summary.st-callout__head::-webkit-details-marker {
  display: none;
}

.st-callout__icon {
  font-size: 14px;
  flex-shrink: 0;
}

.st-callout__title {
  flex: 1;
}

/* Mũi tên thu/mở cho details */
.st-callout__arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
  margin-left: 4px;
}

details.st-callout[open] .st-callout__arrow {
  transform: rotate(90deg);
}

/* Nội dung box — có nền màu nhạt, border-radius hợp với container */
.st-callout__body {
  padding: 20px 20px 18px;
  font-size: 16px;
  line-height: 1.85;
  border-radius: 12px;
}

.st-callout__body>*:last-child {
  margin-bottom: 0 !important;
}

/* ── Định nghĩa (blue) ──────────────────────────────── */
.st-callout--def {
  border-color: var(--st-c-def-border);
  /* #3b82f6 */
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
}

.st-callout--def:hover {
  box-shadow: 0 6px 24px rgba(59, 130, 246, .18);
}

.st-callout--def .st-callout__head {
  background: #1e40af;
  /* dark blue pill */
  color: #fff;
}

.st-callout--def .st-callout__body {
  background: var(--st-c-def-bg);
  /* #eff6ff */
  color: #1e3a5f;
}

/* ── Ví dụ (purple) ─────────────────────────────────── */
.st-callout--ex {
  border-color: var(--st-c-ex-border);
  /* #8b5cf6 */
  box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
}

.st-callout--ex:hover {
  box-shadow: 0 6px 24px rgba(139, 92, 246, .18);
}

.st-callout--ex .st-callout__head {
  background: #5b21b6;
  /* dark purple pill */
  color: #fff;
}

.st-callout--ex .st-callout__body {
  background: var(--st-c-ex-bg);
  /* #f5f3ff */
  color: #3b2066;
}

/* ── Lời giải (green) ───────────────────────────────── */
.st-callout--sol {
  border-color: var(--st-c-sol-border);
  /* #10b981 */
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
}

.st-callout--sol:hover {
  box-shadow: 0 6px 24px rgba(16, 185, 129, .18);
}

.st-callout--sol>summary.st-callout__head {
  background: #065f46;
  /* dark green pill */
  color: #fff;
}

.st-callout--sol .st-callout__body {
  background: var(--st-c-sol-bg);
  /* #f0fdf4 */
  color: #14532d;
}

/* ── Phương pháp (orange) ───────────────────────────── */
.st-callout--method {
  border-color: var(--st-c-method-border);
  /* #f97316 */
  box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
}

.st-callout--method:hover {
  box-shadow: 0 6px 24px rgba(249, 115, 22, .18);
}

.st-callout--method .st-callout__head {
  background: #c2410c;
  /* dark orange pill */
  color: #fff;
}

.st-callout--method .st-callout__body {
  background: var(--st-c-method-bg);
  /* #fff7ed */
  color: #7c2d12;
}

/* ── Nhận xét (yellow) ──────────────────────────────── */
.st-callout--note {
  border-color: var(--st-c-note-border);
  /* #eab308 */
  box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
}

.st-callout--note:hover {
  box-shadow: 0 6px 24px rgba(234, 179, 8, .2);
}

.st-callout--note .st-callout__head {
  background: #a16207;
  /* dark yellow pill */
  color: #fff;
}

.st-callout--note .st-callout__body {
  background: var(--st-c-note-bg);
  /* #fefce8 */
  color: #713f12;
}

/* ── Chú ý (rose/red) ───────────────────────────────── */
.st-callout--warn {
  border-color: var(--st-c-warn-border);
  /* #f43f5e */
  box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
}

.st-callout--warn:hover {
  box-shadow: 0 6px 24px rgba(244, 63, 94, .18);
}

.st-callout--warn .st-callout__head {
  background: #9f1239;
  /* dark rose pill */
  color: #fff;
}

.st-callout--warn .st-callout__body {
  background: var(--st-c-warn-bg);
  /* #fff1f2 */
  color: #881337;
}

/* ============================================================
   CALLOUT NÂNG CAO: Định lý, Tính chất, Dạng bài
   ============================================================ */

/* ── Định lý (indigo) ───────────────────────────────── */
.st-callout--theorem {
  border-color: #4f46e5;
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
}

.st-callout--theorem:hover {
  box-shadow: 0 6px 24px rgba(79, 70, 229, .18);
}

.st-callout--theorem .st-callout__head {
  background: #312e81;
  /* dark indigo pill */
  color: #fff;
}

.st-callout--theorem .st-callout__body {
  background: #eef2ff;
  color: #312e81;
}

/* ── Tính chất (teal) ───────────────────────────────── */
.st-callout--prop {
  border-color: #0d9488;
  box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
}

.st-callout--prop:hover {
  box-shadow: 0 6px 24px rgba(13, 148, 136, .18);
}

.st-callout--prop .st-callout__head {
  background: #134e4a;
  /* dark teal pill */
  color: #fff;
}

.st-callout--prop .st-callout__body {
  background: #f0fdfa;
  color: #134e4a;
}

/* ── Dạng bài (amber) ───────────────────────────────── */
.st-callout--dang {
  border-color: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
}

.st-callout--dang:hover {
  box-shadow: 0 6px 24px rgba(245, 158, 11, .22);
}

.st-callout--dang .st-callout__head {
  background: #92400e;
  /* dark amber pill */
  color: #fff;
  font-size: 13.5px;
}

.st-callout--dang .st-callout__title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
}

.st-callout--dang .st-callout__body {
  background: #fffbeb;
  color: #78350f;
  font-family: 'STIX Two Text', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.85;
  padding: 20px 22px 20px;
}

/* Lồng [phuongphap] bên trong [dang] */
.st-callout--dang .st-callout--method {
  margin: 20px 0 0;
}

/* "Phương pháp giải:" heading bên trong body */
.st-callout--dang .st-callout__body strong:first-child {
  display: block;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 10px;
}

/* ── Bài tập (slate/grey-blue professional) ───────── */
.st-callout--task {
  border-color: var(--st-c-task-border);
  /* #475569 */
  box-shadow: 0 0 0 0 rgba(19, 38, 66, 0);
}

.st-callout--task:hover {
  box-shadow: 0 6px 24px rgba(36, 73, 38, 0.15);
}

.st-callout--task .st-callout__head {
  background: var(--st-c-task-head);
  /* #1e293b */
  color: #fff;
}

.st-callout--task .st-callout__body {
  background: var(--st-c-task-bg);
  color: #1e324d;
  border: 1px solid var(--st-c-task-border);
}

/* ─────────────────────────────────────────────────── */
/* DANH SÁCH BÀI VIẾT (Shortcode [list-posts])        */
/* ─────────────────────────────────────────────────── */
.st-list-posts {
  list-style: none !important;
  margin: 1.5rem 0 !important;
  padding: 0 !important;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.st-list-posts li {
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid #f3f4f6;
}

.st-list-posts li:last-child {
  border-bottom: none;
}

.st-list-posts a {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.st-list-posts a::before {
  content: "→";
  margin-right: 12px;
  color: #10b981;
  font-weight: bold;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.st-list-posts a:hover {
  background: #f9fafb;
  color: #1565c0 !important;
  padding-left: 24px;
}

.st-list-posts a:hover::before {
  transform: translateX(4px);
  opacity: 1;
}

/* ================================================================
   BÀI TRƯỚC / SAU NAVIGATION
   ================================================================ */
.st-lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.st-lesson-nav__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none !important;
  color: #111 !important;
  background: #fff;
  flex: 1;
  max-width: 45%;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.st-lesson-nav__btn:hover {
  border-color: var(--st-active-color);
  box-shadow: 0 4px 16px rgba(21, 101, 192, .12);
  transform: translateY(-1px);
  color: var(--st-active-color) !important;
}

.st-lesson-nav__btn--next {
  justify-content: flex-end;
  text-align: right;
}

.st-lesson-nav__arrow {
  font-size: 18px;
  color: var(--st-active-color);
  flex-shrink: 0;
}

.st-lesson-nav__text {
  display: flex;
  flex-direction: column;
}

.st-lesson-nav__text small {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

/* ================================================================
   FAB + OVERLAY (MOBILE)
   Nút pill "Mục lục" — trên mobile: cùng hàng với nút Menu
   Reset HOÀN TOÀN khỏi global button styles của modern-effects.css
   ================================================================ */
#st-fab,
#st-fab:link,
#st-fab:visited,
#st-fab:hover,
#st-fab:focus,
#st-fab:active {
  /* Ẩn mặc định - chỉ hiện trên mobile qua media query */
  display: none;
  /* Layout: Ngay dưới menu main, bên trái */
  position: fixed !important;
  top: calc(var(--st-nav-h) + 8px) !important;
  left: 12px !important;
  bottom: auto !important;
  right: auto !important;
  z-index: 1000 !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  /* Hình elip pill */
  width: auto !important;
  height: 38px !important;
  padding: 0 16px !important;
  background: linear-gradient(135deg, #1e3a5f 0%, #065f46 100%) !important;
  background-image: linear-gradient(135deg, #1e3a5f 0%, #065f46 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  /* Typography */
  font-family: 'Be Vietnam Pro', sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  white-space: nowrap !important;
  /* Shadow */
  box-shadow: 0 3px 12px rgba(6, 79, 70, .35), 0 1px 4px rgba(0, 0, 0, .12) !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
  transform: none !important;
  opacity: 1 !important;
  text-decoration: none !important;
}

#st-fab:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(6, 79, 70, .45), 0 2px 8px rgba(0, 0, 0, .18) !important;
}

/* Trạng thái đang mở — đổi màu + icon xoay */
#st-fab[aria-expanded="true"],
#st-fab[aria-expanded="true"]:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  background-image: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

.st-fab__icon {
  font-size: 15px;
  pointer-events: none;
  margin-right: 5px;
  transition: transform 0.25s ease;
}

#st-fab[aria-expanded="true"] .st-fab__icon {
  transform: rotate(90deg);
}

.st-fab__text {
  pointer-events: none;
}

.st-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.st-overlay.is-visible {
  display: block;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  :root {
    --st-sidebar-w: 220px;
  }

  .st-hero {
    padding: 36px 28px 44px;
  }

  .st-section {
    padding: 28px 28px;
  }

  .st-lesson {
    padding: 24px 28px 60px;
  }
}

@media (max-width: 840px) {

  /* Sidebar drawer: trượt từ trái, NỔI TRÊN overlay */
  .st-sidebar {
    position: fixed;
    top: var(--st-nav-h);
    left: 0;
    width: 85%;
    max-width: 320px;
    height: calc(100vh - var(--st-nav-h));
    z-index: 1002;
    /* PHẢI > overlay (999) */
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
    border-right: 1px solid var(--st-sidebar-border);
    border-bottom: none;
    overflow-y: auto;
    background: #fff;
  }

  .st-sidebar.is-open {
    transform: translateX(0);
  }

  /* Đảm bảo list bài học HIỂN THỊ RÕ trong sidebar mobile */
  .st-sidebar-lessons {
    background: transparent !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .st-sidebar-lesson-item a {
    color: #374151 !important;
    opacity: 1 !important;
  }

  /* Remove màu nền chương trên mobile để gọn hơn */
  .st-sidebar-section:nth-child(n) .st-sidebar-chapter-row {
    background: rgba(0, 0, 0, .03) !important;
    border-left: 3px solid #9ca3af !important;
  }

  .st-main {
    width: 100%;
  }

  /* Hiển thị FAB trên mobile */
  #st-fab {
    display: flex !important;
  }

  .st-hero {
    padding: 32px 20px 40px;
  }

  .st-section {
    padding: 24px 20px;
  }

  .st-lesson {
    padding: 20px 20px 80px;
  }

  /* thêm padding bottom để không bị fab che */

  .st-chapter-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .st-hero-deco {
    display: none;
  }

  .st-hero-inner {
    flex-direction: column;
    gap: 0;
  }

  .st-lesson-nav {
    flex-direction: column;
  }

  .st-lesson-nav__btn {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .st-hero-title {
    font-size: 26px !important;
  }

  .st-lesson-title {
    font-size: 22px !important;
  }
}