/* ============================================================
   CLOUDPANG V4 — category & article pages (WHITE CANVAS)
   tight spacing, magazine-style article with sidebar TOC
   ============================================================ */

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 14px var(--gutter-desktop) 0;
  max-width: var(--max-content);
  margin: 0 auto;
  background: var(--bg-canvas);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); transition: color 0.2s ease; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li:last-child { color: var(--text-primary); }

.breadcrumb .th {
  font-family: var(--font-thai-body);
  color: var(--text-muted);
  margin-left: 4px;
}

/* ===== CATEGORY HERO — white ===== */
.cat-hero {
  position: relative;
  padding: 24px 0 56px;
  overflow: hidden;
  background: var(--bg-canvas);
}

.cat-hero-grid {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--gutter-desktop);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: end;
  min-height: 400px;
}

.cat-hero-text { padding-bottom: 12px; }

.cat-hero .eyebrow { margin-bottom: 24px; }

.cat-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.cat-hero h1 em { font-style: italic; }

.cat-hero .h1-th {
  font-family: var(--font-thai-display);
  font-weight: 500;
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1.2;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.cat-hero .cat-tagline-en {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 10px;
  max-width: 480px;
}

.cat-hero .cat-tagline-th {
  font-family: var(--font-thai-body);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.6;
  max-width: 480px;
}

.cat-hero-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
  background: var(--hover-mist);
}

.cat-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-hero-image .corner-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-canvas);
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.cat-hero-image .corner-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* ===== ARTICLE LIST ===== */
.article-list {
  padding: 48px 0 60px;
  background: var(--bg-canvas);
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
  gap: 24px;
  flex-wrap: wrap;
}

.list-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.list-head h2 em { font-style: italic; color: var(--accent); }

.list-head h2 .th {
  font-family: var(--font-thai-display);
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

.list-head .count {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.list-head .count .th {
  font-family: var(--font-thai-body);
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 32px;
  margin-bottom: 48px;
}

.article-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.article-card .img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--hover-mist);
}

.article-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .img-wrap img { transform: scale(1.04); }

.article-card .meta {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.article-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.article-card:hover h3 { color: var(--accent); }

.article-card .deck {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.article-card.feature {
  grid-column: span 2;
  flex-direction: row;
  gap: 32px;
  align-items: center;
}

.article-card.feature .img-wrap {
  flex: 1;
  margin-bottom: 0;
  aspect-ratio: 4/3;
}

.article-card.feature .text-wrap { flex: 1; }
.article-card.feature h3 { font-size: 26px; }
.article-card.feature .deck { font-size: 15px; }

/* ============================================================
   ARTICLE PAGE — magazine 2-column with TOC sidebar
   ============================================================ */

.article-hero-band {
  background: var(--bg-canvas);
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--hairline);
}

.article-hero-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--gutter-desktop);
}

.article-hero-band .article-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.article-hero-band .cat-tag {
  color: var(--accent);
  font-weight: 500;
}

.article-hero-band h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 16px;
  max-width: 1000px;
}

.article-hero-band h1 em { font-style: italic; }

.article-hero-band .h1-th {
  font-family: var(--font-thai-display);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 20px;
  max-width: 900px;
}

.article-hero-band .standfirst {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 800px;
  font-style: italic;
}

.article-hero-band .byline-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 16px 0 0;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.article-hero-band .byline-row strong {
  color: var(--text-primary);
  font-weight: 500;
}

.article-hero-band .byline-row .sep {
  width: 1px;
  height: 12px;
  background: var(--text-muted);
}

.article-feature-image {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 32px var(--gutter-desktop) 0;
}

.article-feature-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.article-feature-image figcaption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
  font-style: italic;
}

/* ===== 2-COLUMN ARTICLE LAYOUT ===== */
.article-layout {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 48px var(--gutter-desktop) 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

/* Sidebar — sticky table of contents */
.article-sidebar {
  position: sticky;
  top: 88px;
}

.toc-block {
  border-top: 1px solid var(--text-primary);
  padding-top: 16px;
  margin-bottom: 32px;
}

.toc-block h4 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 14px;
}

.toc-block h4 .th {
  font-family: var(--font-thai-body);
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-top: 2px;
  font-weight: 400;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
  margin-bottom: 12px;
  padding-left: 28px;
  position: relative;
}

.toc-list li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.toc-list a {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-body);
  display: block;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease;
}

.toc-list a:hover { color: var(--accent); }

.toc-list a.active {
  color: var(--accent);
  font-weight: 500;
}

.share-block {
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
}

.share-block h4 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.share-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.share-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Article body — main column */
.article-main {
  min-width: 0;
}

.article-body {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-body);
  max-width: 720px;
}

.article-body > * + * { margin-top: 1.4em; }

.article-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 64px;
  line-height: 0.9;
  float: left;
  margin: 8px 12px 0 0;
  color: var(--text-primary);
}

.article-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  scroll-margin-top: 96px;
}

.article-body h2 em { font-style: italic; }

.article-body h2 .th {
  font-family: var(--font-thai-display);
  display: block;
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

.article-body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-primary);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  scroll-margin-top: 96px;
}

.article-body blockquote {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 24px;
  margin: 1.6em 0;
  font-style: italic;
}

.article-body blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 14px;
  letter-spacing: 0.04em;
}

.article-body figure {
  margin: 2em 0;
}

.article-body figure img {
  width: 100%;
}

.article-body figcaption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  font-style: italic;
}

.article-body a:not(.article-end-author a) {
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.article-body a:hover { color: var(--accent); }

.article-body ul, .article-body ol {
  padding-left: 1.5em;
}

.article-body li { margin-bottom: 0.5em; }

.article-end {
  max-width: 720px;
  margin: 48px 0 0;
  text-align: center;
}

.article-end-mark {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.5em;
}

.article-end-author {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  max-width: 540px;
  margin: 0 auto;
}

.article-end-author strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* article tags row */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  max-width: 720px;
}

.article-tags .label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  align-self: center;
  margin-right: 8px;
  font-weight: 500;
}

.article-tags a {
  font-size: 12px;
  color: var(--text-primary);
  border: 1px solid var(--hairline);
  padding: 5px 10px;
  transition: all 0.2s ease;
}

.article-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== RELATED ===== */
.related-section {
  background: var(--hover-mist);
  padding: 64px 0;
  margin-top: 64px;
}

.related-section .list-head h2 { font-size: 20px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .breadcrumb { padding: 12px var(--gutter-tablet) 0; }
  .cat-hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 var(--gutter-tablet);
  }
  .cat-hero-text { padding-bottom: 0; order: 2; }
  .cat-hero-image { order: 1; }
  .article-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 28px; }
  .article-card.feature {
    grid-column: span 2;
    flex-direction: column;
    gap: 14px;
  }
  .article-card.feature .img-wrap { width: 100%; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .article-hero-inner { padding: 0 var(--gutter-tablet); }
  .article-feature-image { padding: 24px var(--gutter-tablet) 0; }

  /* Article: 2-col → 1-col on tablet, TOC moves to top as collapsible */
  .article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px var(--gutter-tablet) 0;
  }
  .article-sidebar {
    position: static;
    border: 1px solid var(--hairline);
    padding: 16px 18px;
  }
  .toc-block { border-top: none; padding-top: 0; margin-bottom: 0; }
}

@media (max-width: 700px) {
  .breadcrumb { padding: 10px var(--gutter-mobile) 0; font-size: 11px; }
  .cat-hero { padding: 14px 0 40px; }
  .cat-hero-grid { padding: 0 var(--gutter-mobile); gap: 18px; }
  .cat-hero h1 { font-size: 36px; }
  .cat-hero .h1-th { font-size: 17px; margin-bottom: 14px; }
  .cat-hero .cat-tagline-en { font-size: 15px; }
  .cat-hero .cat-tagline-th { font-size: 13px; }

  .article-list { padding: 36px 0; }
  .list-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 28px; }
  .article-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-card.feature { grid-column: span 1; }
  .article-card.feature h3 { font-size: 21px; }

  .article-hero-band { padding: 14px 0 24px; }
  .article-hero-inner { padding: 0 var(--gutter-mobile); }
  .article-hero-band h1 { font-size: 28px; }
  .article-hero-band .h1-th { font-size: 16px; }
  .article-hero-band .standfirst { font-size: 16px; }
  .article-feature-image { padding: 20px var(--gutter-mobile) 0; margin-bottom: 0; }
  .article-layout { padding: 28px var(--gutter-mobile) 0; gap: 24px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 24px; }
  .article-body h3 { font-size: 19px; }
  .article-body blockquote { font-size: 19px; padding-left: 18px; }
  .article-body p:first-of-type::first-letter { font-size: 52px; }
  .related-grid { grid-template-columns: 1fr; }
  .related-section { padding: 40px 0; margin-top: 48px; }
}
