/* ===========================================================================
   Blog: /blog/ list and /<slug>/ articles (Lay, 2026-11-15, from Accountants Thailand).
   Clean and readable: a comfortable text column, a quiet side column with
   the contents and the free-request box. Built on the tokens in site.css.
   Loaded by blog.php and article.php through $extra_css = 'guides'.
   =========================================================================== */

.g-page { padding-block: 0 clamp(48px, 7vw, 88px); }

/* ---- head ---------------------------------------------------------------- */
.g-head { padding-block: .5rem clamp(24px, 3.5vw, 40px); max-width: 860px; }
.g-head h1 {
  font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.7rem);
  letter-spacing: -.025em; line-height: 1.15;
  margin: 0 0 .6rem;
}
.g-lead { color: var(--ink-2); font-size: clamp(1.02rem, .98rem + .3vw, 1.15rem); line-height: 1.6; margin: 0 0 .9rem; max-width: 65ch; }
.g-meta { display: flex; flex-wrap: wrap; gap: .35rem .6rem; color: var(--ink-3); font-size: .9rem; margin: 0; }
.g-meta span + span::before { content: "\00b7"; margin-inline-end: .6rem; }

/* ---- two columns: text + side ------------------------------------------- */
.g-layout { display: grid; gap: clamp(32px, 4vw, 64px); border-top: 1px solid var(--line); padding-top: clamp(24px, 3.5vw, 40px); }
@media (min-width: 1000px) {
  .g-layout { grid-template-columns: minmax(0, 720px) 300px; justify-content: space-between; align-items: start; }
  .g-side { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* ---- featured image (Admin > Blog > the article > Featured image), 16:9 ---- */
.g-featured { margin: 0 0 clamp(24px, 3vw, 36px); border-radius: 14px; overflow: hidden; background: var(--bg-soft);
  aspect-ratio: 16 / 9; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.08); }
.g-featured img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- the article text ---------------------------------------------------- */
.g-body { font-size: 1.0625rem; line-height: 1.75; color: var(--ink); }
.g-body > :first-child { margin-top: 0; }
.g-body p { margin: 0 0 1.15em; }
.g-body h2 {
  font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); line-height: 1.25;
  margin: 2.2em 0 .7em; scroll-margin-top: calc(var(--header-h) + 20px);
}
.g-body h3 { font-size: 1.15rem; line-height: 1.35; margin: 1.8em 0 .5em; }
.g-body ul, .g-body ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.g-body li { margin: .35em 0; padding-left: .2em; }
.g-body li::marker { color: var(--ink-3); }
.g-body strong { font-weight: 650; }
.g-body a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.g-body a:hover { text-decoration-thickness: 2px; }
.g-body blockquote {
  margin: 1.5em 0; padding: 1rem 1.25rem;
  background: var(--bg-soft); border-radius: var(--r);
  color: var(--ink-2);
}
.g-body blockquote > :last-child { margin-bottom: 0; }
.g-body table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1.5em 0; display: block; overflow-x: auto; }
.g-body th, .g-body td { padding: .65rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.g-body th { font-weight: 650; color: var(--ink); border-bottom-color: var(--line-strong); }

/* FAQ: plain questions and answers, always visible. */
.g-faq { margin-top: 2.6em; padding-top: 2em; border-top: 1px solid var(--line); }
.g-faq h2 { margin-top: 0; }
.g-faq h3 { font-size: 1.05rem; margin: 1.5em 0 .35em; }
.g-faq h3 + p { color: var(--ink-2); }

.g-note { margin-top: 2.2em; padding-top: 1.2em; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .88rem; line-height: 1.6; }

/* ---- side column --------------------------------------------------------- */
.g-side { display: grid; gap: 20px; }
.g-toc { font-size: .92rem; }
.g-toc__title { font-size: .78rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .7rem; }
.g-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.g-toc a { color: var(--ink-2); line-height: 1.4; display: block; }
.g-toc a:hover { color: var(--link); text-decoration: none; }
@media (max-width: 999px) { .g-toc { display: none; } }

.g-box {
  background: var(--bg-soft); border-radius: var(--r-lg);
  padding: 1.4rem 1.4rem 1.5rem;
}
.g-box h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .5rem; }
.g-box p { color: var(--ink-2); font-size: .95rem; line-height: 1.6; margin: 0 0 1.1rem; }
.g-box .btn { width: 100%; justify-content: center; }

/* The same box, wide, after the article on phones and tablets. */
.g-end { margin-top: clamp(32px, 5vw, 48px); }
@media (min-width: 1000px) { .g-end { display: none; } }
@media (max-width: 999px) { .g-side .g-box { display: none; } }

/* ---- /guides/ list ------------------------------------------------------- */
.g-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.g-card {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.4rem 1.4rem 1.3rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease;
}
.g-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.g-card__title { font-size: 1.12rem; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.g-card__text { color: var(--ink-2); font-size: .95rem; line-height: 1.6; }
.g-card__meta { margin-top: auto; padding-top: .4rem; color: var(--ink-3); font-size: .85rem; }
.g-empty { color: var(--ink-3); }
