@charset "UTF-8";
/* WPK Notary 2.0 — the article page, and the WYSIWYG body inside it.
 *
 * Two jobs in one file. Sections 1 to 3 are the page furniture. Section 4 is the
 * only place on this site that styles tags rather than classes, because the article
 * body is CKEditor output and carries no classes to hook onto. Everything there is
 * scoped under .v2-articlebody so it can never reach the rest of the page.
 *
 * NO max-width IN ch. See the note in home.css: `ch` is the width of the "0" glyph
 * and stops Thai text short of its box.
 *
 * What the 113 real articles actually contain, counted: 3,276 <p>, 2,304 <strong>,
 * 1,534 <li>, 634 <br>, 466 <h2>, 370 <ul>, 354 <td>, 222 <h3>, 159 <tr>, 131 <i>,
 * 69 <figure class="table">, 69 <table>, 48 <h4>, 42 <ol>, 36 <a>, 26 <th>,
 * 9 <thead>, 6 <blockquote>. Zero inline styles. Every one of those has a rule
 * below; nothing else does, because nothing else is in the content.
 */

/* ------------------------------------------------------------------ *
 * 1. Header
 * ------------------------------------------------------------------ */
.v2-articlehead {
  background: var(--surface-dark);
  color: var(--text-on-dark);
  padding: clamp(36px, 5vw, 56px) var(--gutter) clamp(40px, 5vw, 56px);
}

.v2-crumbs,
.v2-articlehead__title,
.v2-articlemeta {
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.v2-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 400 15px/1.6 var(--font-body);
  letter-spacing: var(--thai-tracking);
  color: var(--text-on-dark-soft);
}

.v2-crumbs a {
  color: var(--text-on-dark-soft);
  text-decoration: none;
}

.v2-crumbs a:hover {
  color: var(--text-on-dark);
  text-decoration: underline;
}

.v2-articlehead__title {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--type-display-article);
  line-height: var(--lh-subhead);
  letter-spacing: var(--thai-tracking);
  color: var(--text-on-dark);
  margin: 16px auto 0;
  text-wrap: pretty;
}

.v2-articlemeta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: var(--border-on-dark);
  font: 400 15px/1.6 var(--font-body);
  letter-spacing: var(--thai-tracking);
  color: var(--text-on-dark-soft);
}

/* ------------------------------------------------------------------ *
 * 2. The reading column
 *
 * 820px, and it is the most consequential number in this file. Thai has no
 * hyphenation and no inter-word spaces to absorb a long line, so a wide measure
 * costs more here than it does in English.
 * ------------------------------------------------------------------ */
.v2-articlewrap {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px) var(--gutter) clamp(40px, 6vw, 72px);
}

.v2-articlefig {
  margin: 0 0 clamp(28px, 4vw, 40px);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: var(--border-hairline);
  background: var(--surface-strong);
}

/* aspect-ratio on the frame, so the column does not jump as the picture arrives.
 * 16/9 matches the 1200x675 the admin uploads at. */
.v2-articlefig img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.v2-articlefoot {
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 24px;
  border-top: var(--border-hairline);
}

.v2-articlefoot__note {
  font: 400 15px/1.7 var(--font-body);
  letter-spacing: var(--thai-tracking);
  color: var(--text-muted);
  margin: 0;
  text-wrap: pretty;
}

.v2-articlefoot__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.v2-articlefoot__channels {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-articlefoot__channels img {
  display: block;
  width: 24px;
  height: 24px;
}

/* ------------------------------------------------------------------ *
 * 3. Related, and the closing CTA
 * ------------------------------------------------------------------ */
.v2-relatedhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.v2-relatedhead__title {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--type-subhead);
  line-height: var(--lh-subhead);
  letter-spacing: var(--thai-tracking);
  color: var(--text-ink);
  margin: 0;
}

.v2-relatedgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-grid);
}

.v2-articlecta {
  background: var(--surface-dark);
  color: var(--text-on-dark);
  padding: clamp(48px, 6vw, 72px) var(--gutter);
}

.v2-articlecta__inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.v2-articlecta__title {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--type-subhead);
  line-height: 1.3;
  letter-spacing: var(--thai-tracking);
  color: var(--text-on-dark);
  margin: 0;
  text-wrap: balance;
}

.v2-articlecta__body {
  font: 400 17px/1.75 var(--font-body);
  letter-spacing: var(--thai-tracking);
  color: var(--text-on-dark-soft);
  margin: 14px 0 0;
  text-wrap: pretty;
}

.v2-articlecta__actions {
  margin-top: 28px;
}

/* ================================================================== *
 * 4. The article body — CKEditor output
 *
 * The only tag-selector block on this site. It is scoped under .v2-articlebody,
 * so nothing here can reach the header, the related cards or the footer.
 *
 * Set in Sarabun, which index.php requests for this page and the FAQ only. If that
 * request ever fails the stack falls through to the body face and the article still
 * reads.
 * ================================================================== */
.v2-articlebody {
  font-family: 'Sarabun', var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: var(--thai-tracking);
  color: var(--text-body);
}

.v2-articlebody p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

/* Headings stay in the interface face, not Sarabun. The design sets the article
 * body in the reading face and everything structural in the design-system face,
 * which is also what keeps an article page recognisably the same site. */
.v2-articlebody h2,
.v2-articlebody h3,
.v2-articlebody h4 {
  font-family: var(--font-body);
  color: var(--text-ink);
  letter-spacing: var(--thai-tracking);
  text-wrap: pretty;
}

/* Space above a heading is larger than the gap between paragraphs, so the eye can
 * tell which paragraphs belong to which heading without a rule or a colour. */
.v2-articlebody h2 {
  font-size: var(--type-prose-h2);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  margin: 2em 0 0.5em;
}

.v2-articlebody h3 {
  font-size: var(--type-title);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  margin: 1.7em 0 0.4em;
}

.v2-articlebody h4 {
  font-size: var(--type-subtitle);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-title);
  margin: 1.5em 0 0.35em;
}

.v2-articlebody h2:first-child,
.v2-articlebody h3:first-child,
.v2-articlebody h4:first-child {
  margin-top: 0;
}

.v2-articlebody ul,
.v2-articlebody ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

/* 0.5em between items, because a Thai list item wraps often - there is no
 * hyphenation and no word spacing - and without the gap a two-line item reads as
 * two items. */
.v2-articlebody li {
  margin-bottom: 0.5em;
}

.v2-articlebody li:last-child {
  margin-bottom: 0;
}

.v2-articlebody strong {
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
}

/* overflow-wrap IS A BUG FIX, not typography.
 *
 * Article 9 ends with a contact list carrying a bare Facebook URL, and
 * "https://www.facebook.com/wpknotary" is one unbreakable 315px word inside a 236px
 * list item. Measured at 320px the document scrolled 101px sideways, and 31px at 390px.
 * The live article page, the v2 one and the v3 one all showed it identically, because
 * all three share these body rules - so it is fixed once, here.
 *
 * break-word, NOT anywhere. break-word is last-resort only: it breaks a word that would
 * otherwise overflow and changes nothing else. `anywhere` also alters min-content sizing
 * and would let Thai break at arbitrary points; Thai already wraps by dictionary lookup,
 * so it never reaches the last resort and this cannot touch it. */
.v2-articlebody a {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  overflow-wrap: break-word;
}

.v2-articlebody a:hover {
  color: var(--color-primary-active);
}

.v2-articlebody blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--color-gold);
  color: var(--text-muted);
}

.v2-articlebody blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- tables ----
 * CKEditor wraps every table in <figure class="table">. 69 of them across the
 * corpus. The figure is what scrolls, so a wide table slides sideways inside its
 * own box instead of pushing the whole page past the viewport. */
.v2-articlebody figure {
  margin: 1.6em 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.v2-articlebody table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: var(--type-base);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
}

.v2-articlebody th,
.v2-articlebody td {
  padding: 12px 16px;
  border-bottom: var(--border-hairline);
  text-align: left;
  vertical-align: top;
}

.v2-articlebody th {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  background: var(--surface-soft);
}

/* The last row closes on the box's own border rather than drawing a second one. */
.v2-articlebody tr:last-child td,
.v2-articlebody tr:last-child th {
  border-bottom: 0;
}

/* ---- pictures inside the body ----
 * The design floats an uploaded picture right at 380px with the text wrapping. No
 * article currently carries an inline <img>, so this is here for when one does. */
.v2-articlebody img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.v2-articlebody figure img {
  display: block;
}

.v2-articlebody > img {
  float: right;
  width: 380px;
  max-width: 45%;
  margin: 6px 0 20px 28px;
}

/* ================================================================== *
 * 5. Mobile
 * ================================================================== */
@media (max-width: 1023px) {
  .v2-relatedgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .v2-relatedgrid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A 380px float in a 320px column leaves nothing to wrap around it, so the
   * picture goes full width and the text runs under it. */
  .v2-articlebody > img {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px;
  }

  /* min-width on the table is what makes the figure scroll; below 460px that is
   * the whole point, so it stays. */
  .v2-articlebody table {
    font-size: var(--type-meta);
  }
}
