/* Primary hubs and lessons (tách từ header.php) */
/* Cung Hoc Toan primary hubs and lessons, 2026-10-23.
   Load after the theme styles. Content rules stay inside .cht-primary.
   Modern :has() only widens the existing page shell when this content is present. */
@supports selector(body:has(.cht-primary)) {
  body:has(.cht-primary) #content > .tgv-container {
    display: block;
    min-width: 0;
  }
  body:has(.cht-primary) #site-content.page-content {
    display: block;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 960px;
    margin: 0 auto 48px;
    padding: 0;
  }
  body:has(.cht-primary) #site-content .page-wrapper,
  body:has(.cht-primary) #site-content .page-body {
    width: 100%;
    min-width: 0;
    max-width: 960px;
    margin-inline: auto;
  }
  body:has(.cht-primary) #site-content .page-header {
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    background: none;
  }
  body:has(.cht-primary) #site-content .page-title {
    margin: 0;
    color: #17324d;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    overflow-wrap: anywhere;
  }
  body:has(.cht-primary) #site-content .page-title::after {
    content: none;
  }
}

.cht-primary,
.cht-primary * {
  box-sizing: border-box;
}
.cht-primary,
body #content .page-body .cht-primary {
  width: 100%;
  min-width: 0;
  max-width: 960px;
  margin: 0 auto 40px;
  padding: 0;
  background: #fff;
  color: #17324d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 1.65;
  text-align: left;
  overflow-wrap: anywhere;
}
.cht-primary p,
body #content .page-body .cht-primary p {
  margin: 0 0 18px;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.65;
  text-align: left;
}
.cht-primary h2,
.cht-primary h3,
body #content .page-body .cht-primary h2,
body #content .page-body .cht-primary h3 {
  margin: 32px 0 14px;
  padding: 0;
  border: 0;
  color: #17324d;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
  overflow-wrap: anywhere;
}
.cht-primary h2,
body #content .page-body .cht-primary h2 {
  font-size: clamp(26px, 2vw + 20px, 34px);
}
.cht-primary h3,
body #content .page-body .cht-primary h3 {
  margin-top: 24px;
  font-size: clamp(22px, 1.4vw + 18px, 27px);
}
.cht-primary h2::after,
.cht-primary h3::after,
body #content .page-body .cht-primary h2::after,
body #content .page-body .cht-primary h3::after {
  content: none;
}
.cht-primary a[href],
body #content .page-body .cht-primary a[href] {
  color: #087568;
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.cht-primary a[href]:hover,
body #content .page-body .cht-primary a[href]:hover {
  color: #17324d;
  text-decoration-thickness: 2px;
}
.cht-primary a[href]:focus-visible,
.cht-primary summary:focus-visible,
body #content .page-body .cht-primary a[href]:focus-visible,
body #content .page-body .cht-primary summary:focus-visible {
  outline: 3px solid #087568;
  outline-offset: 4px;
  border-radius: 4px;
}
.cht-primary ul,
.cht-primary ol,
body #content .page-body .cht-primary ul,
body #content .page-body .cht-primary ol {
  margin: 12px 0 22px;
  padding-left: 28px;
}
.cht-primary li,
body #content .page-body .cht-primary li {
  margin: 8px 0;
  padding: 0;
  font-size: inherit;
  line-height: 1.65;
}
.cht-primary img,
.cht-primary svg {
  max-width: 100%;
  height: auto;
}
.cht-primary .cht-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
  margin: 24px 0;
  padding: 0;
}
.cht-primary .cht-primary-card,
.cht-primary .cht-primary-parent {
  min-width: 0;
  margin: 20px 0;
  padding: 24px;
  border: 1px solid #cedde5;
  border-radius: 14px;
  background: #fff;
}
.cht-primary .cht-primary-grid > .cht-primary-card {
  margin: 0;
}
.cht-primary .cht-primary-card > :first-child,
.cht-primary .cht-primary-parent > :first-child,
body #content .page-body .cht-primary .cht-primary-card > :first-child,
body #content .page-body .cht-primary .cht-primary-parent > :first-child {
  margin-top: 0;
}
.cht-primary .cht-primary-card > :last-child,
.cht-primary .cht-primary-parent > :last-child,
body #content .page-body .cht-primary .cht-primary-card > :last-child,
body #content .page-body .cht-primary .cht-primary-parent > :last-child {
  margin-bottom: 0;
}
.cht-primary .cht-primary-note,
body #content .page-body .cht-primary .cht-primary-note {
  margin: 20px 0;
  padding: 18px 22px;
  border-left: 4px solid #087568;
  border-radius: 0 10px 10px 0;
  background: #f3f8fa;
  color: #17324d;
  line-height: 1.65;
}
.cht-primary .cht-primary-actions,
body #content .page-body .cht-primary .cht-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  margin: 22px 0;
  padding: 0;
}
.cht-primary a.cht-primary-button[href],
body #content .page-body .cht-primary a.cht-primary-button[href] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 18px;
  border: 2px solid #17324d;
  border-radius: 9px;
  background: #17324d;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cht-primary a.cht-primary-button[href]:hover,
body #content .page-body .cht-primary a.cht-primary-button[href]:hover {
  border-color: #087568;
  background: #087568;
  color: #fff;
  text-decoration: none;
}
.cht-primary .cht-primary-parent {
  background: #f3f8fa;
  font-size: 18px;
  line-height: 1.65;
}
.cht-primary details.cht-primary-parent {
  padding: 0;
}
.cht-primary details.cht-primary-parent > summary {
  display: list-item;
  min-height: 48px;
  margin: 0;
  padding: 18px 22px;
  border-radius: 14px;
  color: #17324d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  list-style-position: inside;
  cursor: pointer;
}
.cht-primary details.cht-primary-parent[open] > summary {
  margin-bottom: 18px;
  border-bottom: 1px solid #cedde5;
  border-radius: 14px 14px 0 0;
}
.cht-primary details.cht-primary-parent > :not(summary) {
  margin-right: 22px;
  margin-left: 22px;
}
.cht-primary details.cht-primary-parent > :last-child,
body #content .page-body .cht-primary details.cht-primary-parent > :last-child {
  margin-bottom: 22px;
}

/* A paragraph is one fixed dot row. Do not box, pad or wrap each row.
   The empty-group display keeps the same minimum height as a visible row. */
.cht-primary .cht-primary-dots {
  display: grid;
  gap: 10px;
  justify-content: start;
  align-content: start;
  min-width: 0;
  min-height: 36px;
  max-width: 100%;
  margin: 18px 0;
  padding: 0;
  color: #087568;
}
.cht-primary .cht-primary-dots > p,
body #content .page-body .cht-primary .cht-primary-dots > p {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  white-space: nowrap;
}
.cht-primary .cht-primary-dots > p > span {
  display: inline-block;
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 32px;
  line-height: 36px;
  text-align: center;
}

@media (max-width: 640px) {
  .cht-primary .cht-primary-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .cht-primary .cht-primary-card,
  .cht-primary .cht-primary-parent {
    padding: 18px;
  }
  .cht-primary .cht-primary-note,
  body #content .page-body .cht-primary .cht-primary-note {
    padding: 16px 18px;
  }
  .cht-primary .cht-primary-actions,
  body #content .page-body .cht-primary .cht-primary-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .cht-primary a.cht-primary-button[href],
  body #content .page-body .cht-primary a.cht-primary-button[href] {
    width: 100%;
  }
  .cht-primary details.cht-primary-parent {
    padding: 0;
  }
  .cht-primary details.cht-primary-parent > summary {
    padding: 16px 18px;
  }
  .cht-primary details.cht-primary-parent > :not(summary) {
    margin-right: 18px;
    margin-left: 18px;
  }
}
@media (max-width: 360px) {
  .cht-primary .cht-primary-card {
    padding: 16px;
  }
  .cht-primary .cht-primary-dots > p,
  body #content .page-body .cht-primary .cht-primary-dots > p {
    gap: 14px;
  }
}

/* Native shapes keep the same visual scale without depending on font glyphs. */
.cht-primary .cht-primary-shape {
  display: block;
  width: 56px;
  height: 56px;
  margin: 18px 0;
  padding: 0;
}
.cht-primary .cht-primary-circle {
  border: 3px solid #17324d;
  border-radius: 50%;
}
.cht-primary .cht-primary-square {
  border: 3px solid #17324d;
  border-radius: 0;
}
.cht-primary .cht-primary-triangle {
  position: relative;
  width: 0;
  height: 0;
  border-left: 32px solid transparent;
  border-right: 32px solid transparent;
  border-bottom: 56px solid #17324d;
}
.cht-primary .cht-primary-triangle::after {
  position: absolute;
  top: 6px;
  left: -27px;
  width: 0;
  height: 0;
  border-left: 27px solid transparent;
  border-right: 27px solid transparent;
  border-bottom: 47px solid #fff;
  content: "";
}
