/**
 * NDC_PUBLIC_READING_THREE_COLUMN_PILOT_V1 + VISUAL_POLISH_V1 + TYPOGRAPHY_FINAL_V1
 * Scoped to body.ndc-reading-3col-pilot (page 835 only).
 * MASTER outer container tokens (--ndc-public-max / --ndc-public-gutter) are READ-ONLY here.
 */

/* Kill inherited Kadence entry-content type scale on the pilot surface only. */
body.ndc-reading-3col-pilot.ndc-reading-surface .entry-content.single-content,
body.ndc-reading-3col-pilot .entry-content {
  font-size: inherit;
  line-height: inherit;
  text-align: start;
}

/*
 * FOOTER_10P_WIDTH_FIX_V1
 * ndc-broker-journey/assets/ndc-shared-pages-g2.css sets a page-ID-specific
 * max-width: var(--ndc-g2-read) (800px) on .entry-content. That selector wins
 * over global.css's reading reset and squeezes the three columns into 800px.
 * The extra .single-content class beats that legacy width rule regardless of
 * stylesheet order. This is limited to the approved three-column surfaces;
 * the homepage master, A4 two-column pages, and other G2 pages stay intact.
 */
body.ndc-reading-3col-pilot .entry-content.single-content {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  box-sizing: border-box;
}

body.ndc-reading-3col-pilot .entry-content > .ndc-reading-layout--3col:first-child {
  margin-top: 0;
  padding-top: 0;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col {
  --ndc-r3-left: 360px;
  --ndc-r3-center: 870px;
  --ndc-r3-right: 360px;
  --ndc-r3-gap: 30px;
  /* 360+30+870+30+360 = 1650 — fills master public outer, does not redefine it */
  display: grid;
  grid-template-columns: var(--ndc-r3-left) minmax(0, var(--ndc-r3-center)) var(--ndc-r3-right);
  gap: var(--ndc-r3-gap);
  align-items: start;
  justify-content: center;
  width: min(var(--ndc-public-max, 1650px), calc(100% - (var(--ndc-public-gutter, clamp(16px, 2.2vw, 32px)) * 2)));
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 0 0 16px;
  box-sizing: border-box;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__left,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__right {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 20px;
  align-self: start;
}

/* Compact card chrome — FIX_01 */
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-sidebar-card {
  padding: 12px 14px 12px;
  border-radius: 10px;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-sidebar-card h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.3;
  font-weight: 700;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-sidebar-card ul {
  margin: 0;
  padding: 0;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-sidebar-card li {
  margin: 0 0 4px;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__left .ndc-reading-sidebar-card a {
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 600;
}

/* Center reading card — TYPOGRAPHY_FINAL_V1 (sidebar-matched scale) */
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main {
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 16px 22px 18px;
  background: var(--ndc-brand-card, #fff);
  border: 1px solid var(--ndc-color-line, #DFE7E2);
  border-radius: 12px;
  color: var(--ndc-brand-text, #1E3030);
  font-family: "Be Vietnam Pro", var(--ndcpd-font-family, system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.7;
  text-align: justify;
  text-align-last: auto;
  overflow-x: auto;
  overflow-wrap: break-word;
  word-break: normal;
  box-sizing: border-box;
}

/* Beat Kadence / block inheritance — paragraphs + lists = 16px justify. */
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main p,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main .wp-block-paragraph,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main li,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main td,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main th {
  font-family: "Be Vietnam Pro", var(--ndcpd-font-family, system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.7;
  text-align: justify;
  text-align-last: auto;
  font-weight: 400;
}

/* Date line: first paragraph immediately after H1 ("Cập nhật lần cuối…"). */
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h1 + p,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h1 + .wp-block-paragraph {
  font-size: 18px;
  line-height: 1.7;
  font-weight: 700;
  text-align: left;
  text-align-last: auto;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h1,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h2,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h3,
body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h4 {
  font-family: "Be Vietnam Pro", var(--ndcpd-font-family, system-ui, sans-serif);
  text-align: left;
  text-align-last: auto;
  line-height: 1.35;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h2 {
  margin: 1.1em 0 0.35em;
  font-size: 18px;
  font-weight: 700;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h3 {
  margin: 0.95em 0 0.3em;
  font-size: 16px;
  font-weight: 700;
}

body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main > *:first-child {
  margin-top: 0;
}

/* Province directory — FIX_03 + FIX_04 */
body.ndc-reading-3col-pilot .ndc-reading-province-dir__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(17, auto);
  grid-auto-flow: column;
  column-gap: 10px;
  row-gap: 2px;
  max-height: none;
  overflow: visible;
}

body.ndc-reading-3col-pilot .ndc-reading-province-dir__list li {
  margin: 0;
  min-width: 0;
  text-align: left;
}

body.ndc-reading-3col-pilot .ndc-reading-province-dir__list a {
  display: block;
  color: var(--ndc-brand-cta, #146B52);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
}

body.ndc-reading-3col-pilot .ndc-reading-province-dir__list a:hover,
body.ndc-reading-3col-pilot .ndc-reading-province-dir__list a:focus-visible {
  color: var(--ndc-brand-dark, #103B34);
  text-decoration: underline;
}

/* Status kept on data attrs — never show "(sắp mở)" in UI. */
body.ndc-reading-3col-pilot .ndc-reading-province-dir__meta {
  display: none !important;
}

/* Mid desktop: keep 3 tracks fluid inside master width */
@media (max-width: 1699px) and (min-width: 1200px) {
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col {
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr) minmax(240px, 1fr);
    gap: 24px;
  }
}

/* Tablet: stack to one column */
@media (max-width: 1199px) {
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__left,
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__right {
    position: static;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main {
    order: 1;
    padding: 14px 16px;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__left {
    order: 2;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__right {
    order: 3;
  }
}

/* 390: preserve outer master gutter; keep 16px justified body text */
@media (max-width: 390px) {
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col {
    width: min(var(--ndc-public-max, 1650px), calc(100% - (var(--ndc-public-gutter, 14px) * 2)));
    grid-template-columns: minmax(0, 1fr);
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main {
    padding-inline: 12px;
    padding-block: 12px;
    border-radius: 10px;
    overflow-x: hidden;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main,
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main p,
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main .wp-block-paragraph,
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main li {
    font-size: 16px;
    line-height: 1.7;
    text-align: justify;
    text-align-last: auto;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h2 {
    font-size: 18px;
    font-weight: 700;
  }
  body.ndc-reading-3col-pilot .ndc-reading-layout--3col .ndc-reading-layout__main h3 {
    font-size: 16px;
    font-weight: 700;
  }
  body.ndc-reading-3col-pilot .ndc-reading-province-dir__list {
    column-gap: 8px;
  }
}
