/* ─────────────────────────────────────────────────────────────────────────
   NG Tech — blog article typography

   Loaded by the PHP-rendered blog pages. The site sheet only carries
   the Tailwind utilities Tailwind generated for the static build, so the
   article needs its own rules for the reading measure, the heading
   rhythm and the table.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --ng-article-measure: 44rem;   /* 704px — the comfortable reading width */
  --ng-article-gap: 1.25rem;    /* 20px — space between paragraphs      */
  --ng-article-h2-gap: 3rem;     /* 48px — space above a section heading */
  --ng-article-h3-gap: 2rem;     /* 32px — space above a subheading     */
}

/* ── The reading column ─────────────────────────────────────────────────── */

/* Every element that belongs to the article's text column — the title
   block, the summary box, the cover, the call to action — carries this
   class. The site's `max-w-3xl` cannot be used for it: `.container-page`
   sets `max-width: var(--spacing-container-max)` (1280px), which wins
   over the utility and leaves a 1172px measure. */
.ng-measure {
  max-width: var(--ng-article-measure);
  margin-left: auto;
  margin-right: auto;
}

/* `.container-page` adds 1rem of padding on each side, so the reading
   column is 2rem narrower than the token. The measure is a property of
   the TEXT, so it has to be applied to the content box: widening the
   container by the padding and removing the padding from the column
   keeps the text at exactly the intended width and still lets the
   column sit centred in the viewport. */
.container-page:has(> .ng-measure),
.container-page:has(> .article-body) {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

.article-body {
  max-width: var(--ng-article-measure);
  margin-left: auto;
  margin-right: auto;
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.75;             /* 29.75px */
  color: #334155;
}

/* Every direct child is a block wrapper; the spacing lives on the
   element inside it, so the rhythm does not depend on the wrapper. */
.article-body > * + * {
  margin-top: var(--ng-article-gap);
}

/* ── Paragraphs ──────────────────────────────────────────────────────────── */

.article-body p {
  margin: 0;
  color: #334155;
  line-height: 1.75;
}

/* The lead paragraph. It is marked with .ng-lead by the renderer, which
   knows which block is the first plain paragraph — the articles open
   with a direct-answer card, so "the first paragraph on the page" is
   not the lead. */
.article-body p.ng-lead {
  font-size: 1.1875rem;          /* 19px */
  line-height: 1.7;
  color: #1e293b;
  font-weight: 500;
}

/* ── Headings ────────────────────────────────────────────────────────────── */

/* H2 — a section. It carries a rule above it and a coloured bar, so it
   reads as a break in the article rather than just a bigger line. */
.article-body h2 {
  margin: var(--ng-article-h2-gap) 0 1rem;
  padding-top: 2rem;
  /* slate-300, not slate-200: a 1px line in #e2e8f0 is invisible on a
     white background at normal viewing distance. */
  border-top: 1px solid #cbd5e1;
  font-size: 1.75rem;             /* 28px */
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* The first heading in the body has nothing to separate it from. */
.article-body > div:first-child h2,
.article-body > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.article-body h2 > span[aria-hidden] {
  width: 0.375rem;                /* 6px  */
  height: 1.75rem;                /* 28px */
  border-radius: 9999px;
  background-image: linear-gradient(to bottom, #2563eb, #06b6d4);
  flex-shrink: 0;
}

/* H3 — a sub-section. No rule: a second divider would compete with the
   H2's. It gets a thin blue bar on the left instead, so the hierarchy
   between H2 and H3 is visible without another horizontal line. */
.article-body h3 {
  margin: var(--ng-article-h3-gap) 0 0.75rem;
  padding-left: 0.875rem;
  border-left: 3px solid #bfdbfe;
  font-size: 1.3125rem;           /* 21px */
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

/* The "Artikel Terkait" chip box and the WhatsApp call to action use an
   H3 of their own. They are blocks, not sub-sections, so they must not
   pick up the heading rhythm. */
.article-body .ng-card h3,
.article-body [data-block="related"] h3,
.article-body [data-block="cta_wa"] strong {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.4;
}

/* ── Lists ───────────────────────────────────────────────────────────────── */

.article-body ul,
.article-body ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-body li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.625rem;
  color: #334155;
  line-height: 1.7;
}

.article-body li:first-child {
  margin-top: 0;
}

.article-body li > span:first-child {
  flex-shrink: 0;
  margin-top: 0.6rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: #2563eb;
}

/* An ordered list numbers its items instead of bulleting them.
   The selector has to out-specify `.article-body li > span:first-child`
   above, which is (0,2,2) — one class, one pseudo-class, two elements.
   This one is (0,2,3): `.article-body` + `.ng-ol-marker` are the classes,
   and `ol`, `li` and `span` are the elements. Without the extra elements
   the badge inherited the 6px bullet size and the blue fill, and the
   digit was unreadable. */
.article-body ol li > span.ng-ol-marker {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
  border-radius: 9999px;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Links ───────────────────────────────────────────────────────────────── */

.article-body a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 150ms ease;
}

.article-body a:hover {
  color: #1d4ed8;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.article-body .ng-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.article-body table {
  width: 100%;
  min-width: 34rem;              /* 544px — scrolls on a phone */
  font-size: 0.9375rem;          /* 15px */
  border-collapse: collapse;
}

.article-body th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #0f172a;
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.article-body td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}

.article-body tbody tr:last-child td {
  border-bottom: 0;
}

/* The first column of a table is the label column, so it reads as a
   header rather than as another value. */
.article-body td.ng-td-first {
  font-weight: 600;
  color: #0f172a;
}

/* ── Callouts ────────────────────────────────────────────────────────────── */

.article-body .ng-callout {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
}

.article-body .ng-callout p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* The badge is a circle holding a stroke icon. It used to be a rounded
   square with a literal "i" inside, which read as a broken glyph rather
   than an information mark. */
.article-body .ng-callout-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background-color: #2563eb;
  color: #ffffff;
}

.article-body .ng-callout-label {
  font-weight: 700;
  color: #1e3a8a;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* ── The direct-answer block ─────────────────────────────────────────────── */

/* It is the first block of the body, so it must not also pick up the
   lead-paragraph treatment — that would make it twice as prominent as
   the paragraph that follows it. */
.article-body .ng-aeo p:first-child {
  font-size: 1rem;
  line-height: 1.75;
  color: #334155;
  font-weight: 400;
}

.article-body .ng-aeo {
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background-color: #ffffff;
  border-left: 4px solid #2563eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.article-body .ng-aeo p {
  margin: 0;
  font-size: 1rem;
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */

.article-body details {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-top: 0.75rem;
  overflow: hidden;
}

.article-body summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: #0f172a;
  transition: color 150ms ease;
}

.article-body summary::-webkit-details-marker {
  display: none;
}

.article-body summary:hover {
  color: #1d4ed8;
}

.article-body details > div {
  padding: 0 1rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #334155;
}

/* ── Images in the body ──────────────────────────────────────────────────── */

.article-body figure {
  margin: 0;
}

.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}

.article-body figure p {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

/* The caption of a body image, shown as a note when the image itself is
   not rendered. */
.article-body .ng-figure-note {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid #bfdbfe;
  background-color: #f8fafc;
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #64748b;
  font-style: italic;
}

/* ── The cover, above the title ──────────────────────────────────────────── */

.ng-article-cover {
  margin: 0 0 2rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.1),
              0 4px 6px -4px rgba(15, 23, 42, 0.1);
}

.ng-article-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ── Phone ───────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .article-body {
    font-size: 1rem;
    line-height: 1.7;
  }

  .article-body h2 {
    font-size: 1.4375rem;         /* 23px */
    margin-top: 2.25rem;
    padding-top: 1.5rem;
  }

  .article-body h3 {
    font-size: 1.1875rem;         /* 19px */
    margin-top: 1.5rem;
  }

  .article-body > div:first-child > p,
  .article-body > p:first-child {
    font-size: 1.0625rem;
  }
}
