/* ===== Thailand – 5 โบรกเกอร์, 2 cột, sidebar phải, theme สีธงไทย ===== */
:root {
  --red-dk: #A51931;
  --red-md: #c41e3a;
  --blue-dk: #241D4C;
  --blue-soft: #e8eaf0;
  --bg: #f5f5f8;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #4a4a5c;
  --border: rgba(36, 29, 76, 0.12);
  --link: #241D4C;
  --font: 'Sarabun', 'Plus Jakarta Sans', system-ui, sans-serif;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 2px 10px rgba(36, 29, 76, 0.06);
  --shadow-sidebar: 0 4px 20px rgba(36, 29, 76, 0.08);
  --main-width: min(720px, 100%);
  --sidebar-width: 300px;
  --gap: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.seo-h1 {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ===== Hero Thailand ===== */
.hero {
  background: var(--blue-dk);
  padding: 0;
  text-align: center;
}
.hero-thailand {
  background: #241D4C;
  padding: calc(1.5rem - 16px) 1rem;
  line-height: 1.35;
}
.hero-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.hero-banner-title {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
@media (max-width: 960px) {
  .hero-thailand { padding: calc(1.1rem - 4px) 1rem; }
}

/* ===== 2 cột: main + sidebar ===== */
.page-wrap {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--gap);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 2rem;
}
@media (max-width: 960px) {
  .page-wrap {
    grid-template-columns: 1fr;
    padding: 0.6rem 1rem 1.5rem;
  }
}

.main { min-width: 0; }

/* ===== Sections ===== */
.section { padding: 1.25rem 0; }
.main .intro.section { padding: 0.5rem 0 0.35rem; }
.main .quick-table.section { padding: 0.4rem 0 1rem; }
.main .quick-table.section .section-title { margin-bottom: 0.5rem; font-size: 1.05rem; }
.section-alt {
  background: var(--blue-soft);
  margin: 0 -0.5rem;
  padding: 1.25rem 0.5rem;
  border-radius: var(--radius);
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem;
}

/* ===== Intro (Thailand) ===== */
.intro-bullets {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.intro-bullets li {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red-dk);
  padding: 0.45rem 0.85rem;
  background: rgba(165, 25, 49, 0.1);
  border-radius: 8px;
  border: 2px solid rgba(165, 25, 49, 0.35);
  box-shadow: 0 2px 6px rgba(165, 25, 49, 0.12);
}
.intro-bullets li:hover {
  background: rgba(165, 25, 49, 0.14);
  border-color: rgba(165, 25, 49, 0.5);
  box-shadow: 0 3px 10px rgba(165, 25, 49, 0.18);
}
.intro-block {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}
.intro-highlight {
  color: var(--red-dk);
  font-weight: 600;
}
.intro-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.intro-note-italic {
  font-style: italic;
}
/* Disclaimer nằm trong khối 5 box, full width dưới 5 cột */
.broker-usage-note {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

/* ===== Quick table – 5 โบรกเกอร์ ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(36, 29, 76, 0.18);
  border: 2px solid rgba(36, 29, 76, 0.25);
  margin: 0 auto 1rem;
}
.table-wrapper.five-brokers-table { max-width: 560px; }
.quick-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.quick-ref-table thead tr {
  background: var(--blue-dk);
}
.quick-ref-table th {
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border: none;
}
.quick-ref-table th.col-no { width: 2.5rem; text-align: center; border-radius: 12px 0 0 0; }
.quick-ref-table th.col-logo { width: 4rem; text-align: center; }
.quick-ref-table th.col-ref { text-align: center; min-width: 6rem; border-radius: 0 12px 0 0; }
.quick-ref-table tbody tr {
  background: #fff;
  border-bottom: 2px solid rgba(36, 29, 76, 0.2);
  transition: background 0.15s ease;
}
.quick-ref-table tbody tr:last-child { border-bottom: none; }
.quick-ref-table tbody tr:hover { background: var(--blue-soft); }
.quick-ref-table tbody td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
  border: none;
}
.quick-ref-table tbody .col-no {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--red-dk);
  background: rgba(165, 25, 49, 0.14);
}
.quick-ref-table .broker-logo-table {
  width: 56px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  padding: 4px;
  display: block;
  margin: 0 auto;
}
.quick-ref-table .col-ref { text-align: center; }
.quick-ref-table .col-ref a,
.table-ref-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #fff;
  background: var(--red-dk);
  padding: 0.45rem 0.7rem;
  min-width: 4.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(165, 25, 49, 0.25);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.quick-ref-table .col-ref a:hover,
.table-ref-link:hover {
  box-shadow: 0 4px 14px rgba(165, 25, 49, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

/* ===== Usage boxes (การใช้งานแต่ละโบรกเกอร์) ===== */
.broker-usage-boxes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.35rem;
  margin-top: 1.75rem;
  padding: 1.5rem;
  background: rgba(36, 29, 76, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(36, 29, 76, 0.12);
}
.usage-box {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  background: var(--bg-card);
  border: 2px solid rgba(36, 29, 76, 0.28);
  border-radius: 12px;
  padding: 1.25rem 1rem 1.25rem;
  box-shadow: 0 6px 24px rgba(36, 29, 76, 0.14), 0 2px 10px rgba(36, 29, 76, 0.1);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}
.usage-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--red-dk);
}
.usage-box:hover {
  box-shadow: 0 12px 36px rgba(36, 29, 76, 0.2), 0 6px 16px rgba(36, 29, 76, 0.12);
  border-color: rgba(36, 29, 76, 0.45);
  transform: translateY(-4px);
}
.usage-box-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid rgba(36, 29, 76, 0.18);
}
.usage-box-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  padding: 6px;
  border: 1px solid rgba(36, 29, 76, 0.2);
  flex-shrink: 0;
}
.usage-box-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.usage-box-text {
  flex: 1;
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  min-height: 0;
  overflow-y: auto;
}
.usage-box-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.9rem;
  background: var(--red-dk);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(165, 25, 49, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  text-align: center;
  border: 2px solid rgba(165, 25, 49, 0.5);
}
.usage-box-cta:hover {
  background: #7a1225;
  box-shadow: 0 6px 22px rgba(165, 25, 49, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

/* ===== Trust comparison / criteria ===== */
.trust-comparison p { margin: 0 0 0.5rem; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.criteria-list-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

/* ===== Article images ===== */
.article-img-wrap {
  margin: 0 auto 1.25rem;
  max-width: 520px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(36, 29, 76, 0.1);
  border: 1px solid var(--border);
}
.article-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}
.article-img-caption {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--blue-soft);
  line-height: 1.4;
}
.article-img-inline { max-width: 340px; margin-bottom: 1rem; }
/* ảnh checklist gần cuối: cùng cỡ với các ảnh inline khác (340×~200) */
.id-local .article-img-wrap.article-img-inline .article-img {
  max-height: 200px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ===== Criterion sections ===== */
.criterion-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.criterion-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--blue-dk);
  border-radius: var(--radius-sm);
}
.criterion-lead {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}
.criterion p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.data-table th,
.data-table td {
  padding: 0.45rem 0.65rem;
  border: 2px solid rgba(36, 29, 76, 0.22);
  text-align: left;
}
.data-table th {
  background: var(--blue-dk);
  color: #fff;
  font-weight: 700;
}
/* Thống nhất: hàng không highlight = nền trắng; chỉ hàng .row-highlight = nền đỏ nhạt */
.data-table tbody tr td { background: #fff; }
.data-table tbody tr.row-highlight td { background: rgba(165, 25, 49, 0.14); }
.table-note {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== สำหรับเทรดเดอร์ไทย (id-local) ===== */
.id-local .section-title { margin-bottom: 0.75rem; }
.id-local-block {
  margin-bottom: 1.25rem;
}
.id-local-block:last-child { margin-bottom: 0; }
.id-local-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.4rem;
}
.id-local-block p { margin: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ===== Conclusion / wrap-up table ===== */
.conclusion p { margin: 0; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.wrap-up-table.table-wrapper { max-width: 560px; margin-top: 1rem; }

/* ===== Sidebar ===== */
.sidebar { position: relative; }
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sidebar);
}
.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--red-dk);
}
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-list li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.sidebar-list a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}
.sidebar-list a:hover { text-decoration: underline; }

.sidebar-broker-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-broker-logos-only {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.sidebar-broker-logos-only .sidebar-broker-item {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  min-height: 52px;
  background: var(--blue-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sidebar-broker-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
/* Vantage, IC Markets: logo to hơn 25% */
.sidebar-broker-logos-only .sidebar-broker-item:nth-child(3) .sidebar-broker-logo,
.sidebar-broker-logos-only .sidebar-broker-item:nth-child(5) .sidebar-broker-logo {
  width: 60px;
  height: 60px;
}

.sidebar-tv .tv-embed-wrap {
  overflow: hidden;
  border-radius: var(--radius-sm);
  height: 338px;
}
.sidebar-tv .tv-embed {
  height: 380px;
  min-height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transform: scale(0.88);
  transform-origin: top center;
}

/* ===== Footer ===== */
.disclaimer {
  background: var(--blue-dk);
  padding: 1.5rem 1.5rem 4rem;
  margin: 0;
}
.disclaimer-inner {
  max-width: 720px;
  margin: 0 auto;
}
.disclaimer-title {
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.disclaimer-p {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.92);
  line-height: 1.6;
}
.disclaimer-p:last-child {
  margin-bottom: 0;
}
.disclaimer-p--highlight {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .broker-usage-boxes {
    grid-template-columns: repeat(2, 1fr);
    padding: 1.25rem;
  }
}
@media (max-width: 600px) {
  .intro-bullets {
    flex-direction: column;
  }
  .intro-bullets li {
    white-space: normal;
    min-width: 0;
  }
  .broker-usage-boxes {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .usage-box { min-height: 0; }
  .table-wrapper.five-brokers-table,
  .wrap-up-table.table-wrapper { max-width: 100%; }
  .quick-ref-table th,
  .quick-ref-table td { padding: 0.5rem 0.5rem; }
  .quick-ref-table { font-size: 0.85rem; }
  .quick-ref-table .broker-logo-table { width: 48px; height: 34px; }
  .usage-box-head { flex-wrap: wrap; }
  .usage-box-logo { width: 56px; height: 56px; }
}

/* ===== Nút sticky lên đầu trang (hiện khi scroll 75%) ===== */
.scroll-top-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--red-dk);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(165, 25, 49, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s ease;
}
.scroll-top-btn--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.scroll-top-btn:hover {
  background: #7a1225;
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(165, 25, 49, 0.5);
}
.scroll-top-btn:focus {
  outline: 2px solid var(--red-dk);
  outline-offset: 2px;
}
