/*
 * Sistem Sunyi Editorial Essay Layout v1.0.2
 * Reusable Premium Article Structure + KBDS Term Family Integration
 * Canonical Horizontal Scroll Table + Mobile Card Removal + Action Divider Cleanup
 * Scope utama: .td-post-content .ss-editorial-essay
 */

/* =========================================================
   01. LOCAL CONTAINMENT
   ========================================================= */

.td-post-content .ss-editorial-essay,
.td-post-content .ss-editorial-essay *,
.td-post-content .ss-editorial-essay *::before,
.td-post-content .ss-editorial-essay *::after {
  box-sizing: border-box;
}

.td-post-content .ss-editorial-essay {
  --sse-text: #282b2e;
  --sse-muted: #686f75;
  --sse-heading: #171a1d;
  --sse-accent: #8a6b3f;
  --sse-accent-soft: rgba(138, 107, 63, 0.12);
  --sse-line: rgba(30, 34, 38, 0.13);
  --sse-surface: #f7f6f2;
  --sse-surface-strong: #efede6;
  --sse-table-bg: #ffffff;
  --sse-radius: 18px;

  max-width: 100%;
  color: var(--sse-text);
  font-size: clamp(17px, 1.18vw, 19px);
  line-height: 1.82;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

.td-post-content .ss-editorial-essay .ss-editorial-prose {
  width: min(100%, 780px);
  margin-inline: auto;
}

.td-post-content .ss-editorial-essay p {
  margin: 0 0 1.35em;
  padding: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* =========================================================
   02. EDITORIAL HEADING RHYTHM
   ========================================================= */

.td-post-content .ss-editorial-essay h2,
.td-post-content .ss-editorial-essay h3,
.td-post-content .ss-editorial-essay h4 {
  clear: both;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  border: 0;
  color: var(--sse-heading);
  font-style: normal;
  text-transform: none;
  text-wrap: balance;
}

.td-post-content .ss-editorial-essay h2 {
  position: relative;
  margin-top: clamp(3.5rem, 8vw, 6.5rem);
  margin-bottom: 1.15rem;
  padding-top: 1.2rem;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.17;
  letter-spacing: -0.025em;
}

.td-post-content .ss-editorial-essay h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 2px;
  background: var(--sse-accent);
}

.td-post-content .ss-editorial-essay h3 {
  margin-top: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 0.8rem;
  font-size: clamp(22px, 2.35vw, 29px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.td-post-content .ss-editorial-essay h4 {
  margin-top: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 0.7rem;
  padding-left: 1rem;
  border-left: 3px solid var(--sse-accent);
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* =========================================================
   03. INTRO AND EDITORIAL NOTES
   ========================================================= */

.td-post-content .ss-editorial-essay .ss-editorial-intro {
  margin: 0 0 clamp(3rem, 7vw, 5.5rem);
}

.td-post-content .ss-editorial-essay .ss-editorial-lead {
  margin-bottom: 1.6rem;
  color: var(--sse-heading);
  font-size: clamp(23px, 2.7vw, 34px);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.018em;
}

.td-post-content .ss-editorial-essay .ss-editorial-note {
  margin: 2rem 0 2.3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--sse-line);
  border-radius: var(--sse-radius);
  background: var(--sse-surface);
  box-shadow: none;
}

.td-post-content .ss-editorial-essay .ss-editorial-note p:last-child {
  margin-bottom: 0;
}

.td-post-content .ss-editorial-essay .ss-editorial-note-label,
.td-post-content .ss-editorial-essay .ss-editorial-eyebrow {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--sse-accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.td-post-content .ss-editorial-essay .ss-editorial-note--clarity {
  border-left: 4px solid var(--sse-accent);
}

.td-post-content .ss-editorial-essay .ss-editorial-note--boundary {
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--sse-surface-strong);
}

.td-post-content .ss-editorial-essay .ss-editorial-note--boundary h3 {
  margin-top: 0;
}

/* =========================================================
   04. TERM LINKS
   ========================================================= */

.td-post-content .ss-editorial-essay a.ss-editorial-term-link {
  color: inherit;
  font-weight: 650;
  text-decoration-line: underline;
  text-decoration-color: rgba(138, 107, 63, 0.48);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.td-post-content .ss-editorial-essay a.ss-editorial-term-link:hover,
.td-post-content .ss-editorial-essay a.ss-editorial-term-link:focus-visible {
  color: var(--sse-accent);
  text-decoration-color: currentColor;
}

/* =========================================================
   05. TERM FAMILY SHELL
   ========================================================= */

.td-post-content .ss-editorial-essay .ss-editorial-term-family {
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
  margin: clamp(4rem, 8vw, 7rem) 50%;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  transform: translateX(-50%);
  border: 1px solid var(--sse-line);
  border-radius: 24px;
  background: var(--sse-surface);
}

.td-post-content .ss-editorial-essay .ss-editorial-section-head {
  max-width: 760px;
  margin-bottom: 1.5rem;
}

.td-post-content .ss-editorial-essay .ss-editorial-section-head h2 {
  margin-top: 0;
  padding-top: 0;
}

.td-post-content .ss-editorial-essay .ss-editorial-section-head h2::before {
  display: none;
}

.td-post-content .ss-editorial-essay .ss-editorial-section-head p {
  margin-bottom: 0;
  color: var(--sse-muted);
}

/* =========================================================
   06. CANONICAL HORIZONTAL-SCROLL TABLE
   Tabel tetap tabel pada semua breakpoint. Tidak ada card mode.
   ========================================================= */

.td-post-content .ss-editorial-essay .ss-editorial-table-wrap {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-inline: contain !important;
  border: 1px solid var(--sse-line) !important;
  border-radius: 16px !important;
  background: var(--sse-table-bg) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 107, 63, 0.48) transparent;
}

/* Jangan warisi aksen garis/pseudo-element dari wrapper tabel lain. */
.td-post-content .ss-editorial-essay .ss-editorial-table-wrap::before,
.td-post-content .ss-editorial-essay .ss-editorial-table-wrap::after {
  content: none !important;
  display: none !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.td-post-content .ss-editorial-essay .ss-editorial-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.td-post-content .ss-editorial-essay .ss-editorial-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(138, 107, 63, 0.48);
}

.td-post-content .ss-editorial-essay table.ss-editorial-term-table {
  display: table !important;
  width: 100% !important;
  min-width: 920px !important;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  background: transparent !important;
  color: var(--sse-text) !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table thead {
  display: table-header-group !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table tbody {
  display: table-row-group !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table tr {
  display: table-row !important;
  width: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table th,
.td-post-content .ss-editorial-essay .ss-editorial-term-table td {
  display: table-cell !important;
  float: none !important;
  width: auto;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  border: 0 !important;
  border-right: 1px solid var(--sse-line) !important;
  border-bottom: 1px solid var(--sse-line) !important;
  background: transparent !important;
  color: inherit !important;
  text-align: left !important;
  vertical-align: top !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table th:last-child,
.td-post-content .ss-editorial-essay .ss-editorial-term-table td:last-child {
  border-right: 0 !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table th {
  background: var(--sse-surface-strong) !important;
  color: var(--sse-heading) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table th:nth-child(1),
.td-post-content .ss-editorial-essay .ss-editorial-term-table td:nth-child(1) {
  width: 22% !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table th:nth-child(2),
.td-post-content .ss-editorial-essay .ss-editorial-term-table td:nth-child(2) {
  width: 47% !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table th:nth-child(3),
.td-post-content .ss-editorial-essay .ss-editorial-term-table td:nth-child(3) {
  width: 31% !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-table p {
  margin: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-name {
  font-size: 16px;
  line-height: 1.4;
}

/* =========================================================
   07. SIX KBDS ACTIONS
   Bersihkan divider/pseudo-element Newspaper pada action row.
   ========================================================= */

.td-post-content .ss-editorial-essay .ss-editorial-term-actions,
.td-post-content .ss-editorial-essay .ss-editorial-term-actions.ss-ds-kbd-card-actions {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(6, 34px) !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 7px !important;
  width: max-content !important;
  max-width: none !important;
  min-width: 239px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-actions::before,
.td-post-content .ss-editorial-essay .ss-editorial-term-actions::after,
.td-post-content .ss-editorial-essay .ss-editorial-term-actions.ss-ds-kbd-card-actions::before,
.td-post-content .ss-editorial-essay .ss-editorial-term-actions.ss-ds-kbd-card-actions::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
  background: none !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-actions .ss-ds-kbd-card-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--sse-line) !important;
  border-radius: 9px !important;
  background: var(--sse-table-bg) !important;
  color: var(--sse-heading) !important;
  font: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.td-post-content .ss-editorial-essay .ss-editorial-term-actions .ss-ds-kbd-card-action:hover,
.td-post-content .ss-editorial-essay .ss-editorial-term-actions .ss-ds-kbd-card-action:focus-visible {
  border-color: var(--sse-accent) !important;
  background: var(--sse-accent-soft) !important;
  color: var(--sse-accent) !important;
  transform: translateY(-1px);
  outline: none !important;
}

.td-post-content .ss-editorial-essay .ss-editorial-note-legend,
.td-post-content .ss-editorial-essay .ss-editorial-family-disclaimer {
  margin: 1rem 0 0;
  color: var(--sse-muted);
  font-size: 13px;
  line-height: 1.6;
}

.td-post-content .ss-editorial-essay .ss-editorial-family-disclaimer {
  padding-top: 1rem;
  border-top: 1px solid var(--sse-line);
}

/* =========================================================
   08. TABLET AND MOBILE
   Tetap horizontal-scroll; tidak ada transformasi menjadi kartu.
   ========================================================= */

@media (max-width: 1100px) {
  .td-post-content .ss-editorial-essay table.ss-editorial-term-table {
    min-width: 900px !important;
  }

  .td-post-content .ss-editorial-essay .ss-editorial-term-table th,
  .td-post-content .ss-editorial-essay .ss-editorial-term-table td {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }
}

@media (max-width: 767px) {
  .td-post-content .ss-editorial-essay {
    font-size: 17px;
    line-height: 1.76;
  }

  .td-post-content .ss-editorial-essay h2 {
    margin-top: 3.8rem;
    font-size: 29px;
  }

  .td-post-content .ss-editorial-essay h3 {
    font-size: 23px;
  }

  .td-post-content .ss-editorial-essay h4 {
    font-size: 20px;
  }

  .td-post-content .ss-editorial-essay .ss-editorial-term-family {
    width: calc(100vw - 24px);
    margin-top: 4rem;
    margin-bottom: 4rem;
    padding: 14px;
    border-radius: 18px;
  }

  .td-post-content .ss-editorial-essay .ss-editorial-table-wrap {
    border-radius: 14px !important;
  }

  .td-post-content .ss-editorial-essay table.ss-editorial-term-table {
    min-width: 900px !important;
    font-size: 14px !important;
  }

  .td-post-content .ss-editorial-essay .ss-editorial-term-table th,
  .td-post-content .ss-editorial-essay .ss-editorial-term-table td {
    padding: 12px 11px !important;
  }

  .td-post-content .ss-editorial-essay .ss-editorial-term-table th {
    font-size: 11px !important;
  }
}

/* =========================================================
   09. DARK MODE
   ========================================================= */

@media (prefers-color-scheme: dark) {
  .td-post-content .ss-editorial-essay {
    --sse-text: #d9dde0;
    --sse-muted: #a9b0b5;
    --sse-heading: #f3f5f6;
    --sse-accent: #d0ac73;
    --sse-accent-soft: rgba(208, 172, 115, 0.14);
    --sse-line: rgba(255, 255, 255, 0.13);
    --sse-surface: #202428;
    --sse-surface-strong: #292e33;
    --sse-table-bg: #171a1d;
  }
}

/* =========================================================
   10. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .td-post-content .ss-editorial-essay a.ss-editorial-term-link,
  .td-post-content .ss-editorial-essay .ss-editorial-term-actions .ss-ds-kbd-card-action {
    transition: none !important;
  }
}
