/* ================= PlazaGold — Site-wide Styles ================ */
:root {
  --gp-gold:#d8be59;
  --gp-gold-dark:#c3a84b;
  --gp-brown:#3b2b00;
  --gp-soft:#f9f7ef;
  --gp-soft-2:#f3f0e2;
  --gp-note:#fff7da;
}

/* พื้นฐานตัวอักษร + ตัวเลขเรียงสวย */
.plazagold-site {
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-variant-numeric: tabular-nums;
}

/* ====== TABLE BASE ====== */
.plazagold-site .table {
  width:100%;
  table-layout:fixed;
  background:#fff;
  border-collapse:separate;
  border-spacing:0;
}
.plazagold-site .table thead th {
  background:var(--gp-gold);
  color:var(--gp-brown);
  font-weight:700;
  border-top:0;
  border-bottom:2px solid var(--gp-gold-dark);
  padding:.65rem .75rem;
  line-height:1.2;
  white-space:nowrap;
}
.plazagold-site .table th,
.plazagold-site .table td {
  padding:.55rem .75rem;
  vertical-align:middle;
  border-color:#eee;
  word-wrap:break-word;
}

/* แถวหัวส่วนที่เป็นคำนำ (เช่น “ราคาทองคำ 18 ต.ค. 2568”) */
.plazagold-site .table .section-head th {
  background:#F0D980;
  color:var(--gp-brown);
  font-weight:700;
  border-top:1px solid #e3cb72;
  border-bottom:1px solid #e3cb72;
}

/* zebra + hover */
.plazagold-site .table.table-striped tbody tr:nth-child(even){ background:var(--gp-soft); }
.plazagold-site .table tbody tr:hover{ background:var(--gp-soft-2); }

/* ช่อง rowspan “รวม/วัน” */
.plazagold-site .table td:first-child[rowspan] {
  background:var(--gp-note);
  font-weight:700;
  text-align:center;
}

/* แถวสรุป/ผลต่าง */
.plazagold-site .table .result-diff td {
  background:var(--gp-note);
  font-weight:600;
}

/* ====== RESPONSIVE ====== */
@media (max-width:992px){ .plazagold-site .table{ font-size:14px; } }
@media (max-width:768px){
  .plazagold-site .table{ font-size:13px; }
  .plazagold-site .table thead tr th:nth-child(8),
  .plazagold-site .table tbody tr td:nth-child(8){ display:none; }
}
@media (max-width:576px){
  .plazagold-site .table{ font-size:12.5px; }
  .plazagold-site .table thead tr th:nth-child(9),
  .plazagold-site .table tbody tr td:nth-child(9){ display:none; }
}

/* ====== CHART / EMBED ====== */
.plazagold-site .chart-card,
.plazagold-site .embed-box {
  background:#fff;
  border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  padding:12px;
  overflow:hidden;
}
.plazagold-site .embed-16x9 {
  position:relative;
  width:100%;
  padding-top:56.25%;
}
.plazagold-site .embed-16x9 > iframe,
.plazagold-site .embed-16x9 > div iframe {
  position:absolute; inset:0;
  width:100%; height:100%;
  border:0;
}

/* หัวคงที่เวลา scroll */
.plazagold-site .table-responsive thead th {
  position:sticky; top:0; z-index:2;
}

/* ====== UTIL ====== */
.plazagold-site .muted{ color:#777; }
.plazagold-site .nowrap{ white-space:nowrap; }

/* ===================================================== */
/* ====== Colored Gold Tables (Fixed Version) ====== */
/* ===================================================== */
.plazagold-site .gp-table.gp-colored thead .gp-group {
  color:#2b1f00;
  font-weight:800;
}
.plazagold-site .gp-table.gp-colored thead .gp-group.gp-bar {
  background:#eac07a;
  border-radius:16px 0 0 16px;
  border:0;
}
.plazagold-site .gp-table.gp-colored thead .gp-group.gp-jewelry {
  background:#9ed6a1;
  border-radius:0 16px 16px 0;
  border:0;
}

/* === ใช้ class ตรงจาก PHP แทน nth-child === */

/* กลุ่มทองคำแท่ง */
.gp-table.gp-colored td.col-bar-b,
.gp-table.gp-colored td.col-bar-s {
  background:rgba(234,192,122,.35) !important;
}

/* กลุ่มทองรูปพรรณ */
.gp-table.gp-colored td.col-jew-b,
.gp-table.gp-colored td.col-jew-s {
  background:rgba(158,214,161,.35) !important;
}

/* ช่อง +/- */
.gp-table.gp-colored td.col-adj.pos {
  color:#1b8a3a !important;
  background:rgba(158,214,161,.25) !important;
  font-weight:700;
}
.gp-table.gp-colored td.col-adj.neg {
  color:#b73333 !important;
  background:rgba(255,120,120,.18) !important;
  font-weight:700;
}

/* ช่องรวมทั้งวัน */
.gp-table.gp-colored td.col-sum {
  background:#fff7da !important;
  font-weight:700;
  text-align:center;
}

/* การจัดแนวคอลัมน์ */
.gp-table.gp-colored td.col-times,
.gp-table.gp-colored td.col-adj,
.gp-table.gp-colored td.col-bar-b,
.gp-table.gp-colored td.col-bar-s,
.gp-table.gp-colored td.col-jew-b,
.gp-table.gp-colored td.col-jew-s,
.gp-table.gp-colored td.col-spot,
.gp-table.gp-colored td.col-rate {
  text-align:right;
  white-space:nowrap;
}
.gp-table.gp-colored td.col-time {
  text-align:center;
  white-space:nowrap;
}

/* เส้นแบ่งกลาง */
.gp-table.gp-colored td.col-bar-s,
.gp-table.gp-colored td.col-jew-s {
  box-shadow:inset -1px 0 0 rgba(0,0,0,.06);
}

/* Highlight เปิด/ปิดตลาด */
.gp-table tr.row-open td {
  background:linear-gradient(to right,#fff7d6,#fff1a8) !important;
  font-weight:700;
  border-top:2px solid #e3c000;
}
.gp-table tr.row-close td {
  background:linear-gradient(to right,#e1f7e7,#b3f5c5) !important;
  font-weight:700;
  border-bottom:2px solid #0a9445;
}
.gp-table tr.row-open:hover td,
.gp-table tr.row-close:hover td {
  filter:brightness(1.05);
}