/* /blog: the article list and the articles. Loaded after landing.css and built
   from its tokens and its .doc page. The pages are generated by
   scripts/build-blog.mjs from content/blog/. */

/* Long Thai text reads better with more leading than the 1.5rem of .doc. */
.post p,
.post li,
.post td,
.post th {
  line-height: 1.75rem;
}
.post .post-lede {
  margin-top: var(--space-300);
  color: var(--ink-soft);
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-75);
  margin-bottom: var(--space-300);
  padding: 0;
  list-style: none;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.doc .breadcrumb {
  padding-left: 0;
}
.breadcrumb li + li {
  margin-top: 0;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-75);
  color: var(--line-strong);
}
.breadcrumb a {
  color: var(--ink-secondary);
  font-weight: 400;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--coral);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-50) var(--space-200);
  color: var(--ink-secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.doc .post-meta {
  margin-top: var(--space-100);
}

/* The short answer at the top of an article. */
.post-summary {
  margin-top: var(--space-400);
  padding: var(--space-300);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: var(--surface-subtle);
}
.doc .post-summary h2 {
  margin-top: 0;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}
.post-summary ul {
  margin-top: var(--space-75);
}

.doc h3 {
  margin-top: var(--space-400);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
}
.doc ol {
  margin-top: var(--space-100);
  padding-left: var(--space-300);
}
.doc kbd {
  padding: 0 var(--space-50);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font: inherit;
  font-size: 0.875em;
  white-space: nowrap;
}

/* What was said, and the text that came out. */
.post-example {
  margin: var(--space-300) 0 0;
  padding: var(--space-200) var(--space-300);
  border-left: 2px solid var(--coral);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--coral-wash);
}
.doc .post-example p {
  margin-top: 0;
}
.doc .post-example p + p {
  margin-top: var(--space-75);
}
.post-example .example-label {
  display: block;
  color: var(--coral-deep);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
}

/* Tables scroll sideways inside their own box on a phone. */
.table-scroll {
  margin-top: var(--space-300);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.table-scroll table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table-scroll th,
.table-scroll td {
  padding: var(--space-100) var(--space-200);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table-scroll thead th {
  background: var(--surface-subtle);
  font-weight: 600;
}
.table-scroll tbody th {
  font-weight: 500;
}
.table-scroll tbody tr:last-child th,
.table-scroll tbody tr:last-child td {
  border-bottom: 0;
}
.table-note {
  color: var(--ink-secondary);
  font-size: 0.875rem;
}

.doc .faq-list {
  margin-top: var(--space-300);
}
.doc .faq-list p {
  margin-top: 0;
}

.post-sources {
  color: var(--ink-secondary);
  font-size: 0.875rem;
}
.doc .post-sources li {
  font-size: 0.875rem;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}
.doc .post-sources a {
  font-weight: 400;
}

/* Closing panel: what ThaiFlow is and the download button. */
.post-cta {
  margin-top: var(--space-700);
  padding: var(--space-400);
  border-radius: var(--radius-3xl);
  background: var(--plum);
  color: #fff;
}
.doc .post-cta h2 {
  margin-top: 0;
}
.doc .post-cta p {
  max-width: 52ch;
  color: var(--lilac);
}
.doc .post-cta .button-light {
  color: #202020;
}
.post-cta .button {
  margin-top: var(--space-300);
}

.post-more {
  margin-top: var(--space-700);
  padding-top: var(--space-400);
  border-top: 1px solid var(--line);
}
.doc .post-more h2 {
  margin-top: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.doc .post-more ul {
  padding-left: 0;
  list-style: none;
}

/* The list at /blog/. */
.post-list {
  display: grid;
  gap: var(--space-200);
  margin-top: var(--space-500);
  padding: 0;
  list-style: none;
}
.doc .post-list {
  padding-left: 0;
}
.doc .post-list li + li {
  margin-top: 0;
}
.post-card {
  display: block;
  padding: var(--space-300);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 300ms var(--ease),
    color 300ms var(--ease);
}
.doc a.post-card {
  font-weight: 400;
}
.post-card:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.doc .post-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
  transition: color 300ms var(--ease);
}
.post-card:hover h2 {
  color: var(--coral);
}
.doc .post-card p {
  margin-top: var(--space-75);
  color: var(--ink-secondary);
}
.doc .post-card .post-meta {
  margin-top: var(--space-200);
}

@media (max-width: 479px) {
  .post-cta {
    padding: var(--space-300);
    border-radius: var(--radius-2xl);
  }
}

/* ---------- Figures: an opening illustration and charts or diagrams in the text ----------
   A figure carries information the text refers to, or opens the article. Charts and
   diagrams are inline SVG drawn with the page's own tokens so they follow the type. */
.post figure {
  margin: var(--space-400) 0 0;
}
.post figure img,
.post figure svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
.post figcaption {
  margin-top: var(--space-100);
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.375rem;
  text-align: center;
}
.post-hero img {
  width: min(100%, 17.5rem);
}
/* On a phone a 640-unit drawing would shrink its type to 7px, so the chart keeps a
   readable width and scrolls sideways, as the tables do. */
.post-chart {
  overflow-x: auto;
  padding: var(--space-300);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.post-chart svg {
  min-width: 34rem;
}
.post-chart figcaption {
  position: sticky;
  left: 0;
}
.post-chart svg text {
  font-family: inherit;
  fill: var(--ink);
}
.post-chart svg .muted {
  fill: var(--ink-muted);
}
.post-chart svg .bar {
  fill: var(--coral);
}
.post-chart svg .bar-other {
  fill: var(--line-strong);
}
.post-chart svg .rule {
  stroke: var(--line-strong);
  stroke-width: 1;
  fill: none;
}
.post-chart svg .box {
  fill: var(--surface-subtle);
  stroke: var(--line-strong);
  stroke-width: 1;
}
.post-chart svg .box-accent {
  fill: var(--coral-wash);
  stroke: var(--coral);
  stroke-width: 1;
}
/* A chart that carries an article's main claim can have a second drawing for a phone
   column (viewBox 300 wide, so one unit is about one CSS px): it fits with no sideways
   scroll. Charts without one keep the readable minimum width above and scroll. */
.post-chart .chart-narrow {
  display: none;
}
@media (max-width: 640px) {
  .post-chart {
    padding: var(--space-200);
  }
  .post-chart .chart-wide {
    display: none;
  }
  .post-chart .chart-narrow {
    display: block;
    min-width: 0;
    width: 100%;
    /* Drawn for a phone: wider than this the type would grow past the body text. */
    max-width: 22rem;
  }
}


@media (max-width: 759px) {
  .breadcrumb { align-items: center; }
  .breadcrumb li + li { margin-top: 0; }
  .breadcrumb a, .post-more a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
