/* เลือกเฉพาะข้อความย่อหน้าธรรมดาในเนื้อหาหลัก ไม่รวมใน list, สารบัญ, และพวก caption/จัดกึ่งกลาง */
main p:not(li p):not(nav p):not(.caption):not([style*="text-align: center"]):not([style*="text-align:center"]) {
  text-indent: 1.5em;
  margin-top: 0;
  margin-bottom: 0.8em;
  
  /* 🛠️ ส่วนที่เพิ่ม: จัดข้อความกระจายชิดขอบซ้าย-ขวาพอดีเหมือน Microsoft Word */
/*  text-align: justify; */
/*  text-justify: inter-word; */
  
  /* 🛠️ ส่วนที่แนะนำให้เพิ่ม: ช่วยควบคุมการตัดคำภาษาไทยและการจัดการบรรทัดบนเว็บให้เนียนตาขึ้น */
  word-break: break-word;
  line-height: 1.6; /* ปรับระยะห่างระหว่างบรรทัดให้โปร่ง อ่านง่าย ไม่เบียดกันเกินไปเมื่อกระจายคำ */
}

/* แถม: ปรับให้ระยะห่างของ List ดูกระชับและสวยงามปกติ ไม่โดนเอฟเฟกต์ย่อหน้า */
main ul, main ol {
  margin-bottom: 0.8em;
}
main li {
  margin-bottom: 0.2em;
  /* 🛠️ ปรับเพิ่ม: หากต้องการให้ข้อความใน List จัดกระจายชิดขอบด้วย สามารถเปิดใช้บรรทัดนี้ได้ครับ */
  /* text-align: justify; */
}


.prototype-cost-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.prototype-cost-table th,
.prototype-cost-table td {
  border: 1px solid #333;
  padding: 6px 10px;
  vertical-align: top;
}

.prototype-cost-table .product-title {
  background-color: #D4A97D;
  color: white;
  text-align: left;
  font-size: 1.6rem;
  font-weight: bold;
}

.prototype-cost-table .image-cell {
  height: 280px;
  vertical-align: top;
}

.prototype-cost-table .image-heading {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.prototype-cost-table img {
  max-width: 85%;
  max-height: 230px;
  display: block;
  margin: 0 auto;
}

.prototype-cost-table .cost-header th {
  text-align: center;
  font-weight: bold;
  font-size: 1.05rem;
}

.prototype-cost-table .center {
  text-align: center;
}

.prototype-cost-table .note-cell {
  line-height: 1.8;
}

.prototype-cost-table .total-row td {
  background-color: #bdeebd;
  text-align: center;
  font-weight: bold;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "TH Sarabun New", sans-serif;
  font-size: 1.25rem;
}

.product-table th,
.product-table td {
  border: 1px solid #333;
  padding: 6px 10px;
  vertical-align: top;
}

.product-table .title {
  background: #D4A97D;
  color: white;
  text-align: left;
  font-size: 1.7rem;
  font-weight: bold;
}

.section-title {
  font-size: 1.45rem;
  font-weight: bold;
  margin-bottom: 6px;
}

.image-cell {
  width: 50%;
}

.product-img {
  width: 100%;
  height: auto;
  display: block;
}

.no-col {
  width: 8%;
}

.center {
  text-align: center;
}

.note-list {
  margin: 0;
  padding-left: 1.2em;
}

.total-row td {
  background: #b9e6a8;
  font-weight: bold;
  font-style: italic;
  text-align: center;
}

.dimension-text {
  margin-top: 12px;
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
}

.dimension-cell {
  vertical-align: middle;
  text-align: center;
}

.dimension-text {
  font-size: 1.3rem;
  font-weight: bold;
  line-height: 1.6;
}
.dimension-text {
  margin-top: 12px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
}

.sub-title {
  background: #efefef;
  text-align: left;
  font-size: 1.4rem;
}

.dimension-text {
  margin-top: 12px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.craft-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "TH Sarabun New", sans-serif;
  font-size: 1.1rem;
  line-height: 1.45;
}

.craft-table th,
.craft-table td {
  border: 1px solid #333;
  padding: 8px 10px;
  vertical-align: top;
}

.craft-table th {
  background: #D4A97D;
  color: white;
  text-align: center;
  font-weight: bold;
}

.craft-table ul,
.craft-table ol {
  margin-top: 4px;
  margin-bottom: 4px;
  padding-left: 1.2em;
}

.word-table {
  width: 100%;
  border-collapse: collapse;
}

.word-table th,
.word-table td {
  border: 1px solid black;
  padding: 6px;
  vertical-align: top;
}

.word-table {
  width: 100%;
  border-collapse: collapse;
}

.word-table th,
.word-table td {
  border: 1px solid black;
  padding: 8px;
  vertical-align: top;
  text-align: left;
}

.word-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.word-table th,
.word-table td {
  border: 1px solid black;
  padding: 6px 8px;
  vertical-align: top;
  text-align: left;
}

.word-table th {
  font-weight: bold;
  text-align: center;
}

.word-table .center {
  text-align: center;
  vertical-align: middle;
}

.word-table th:nth-child(1),
.word-table td:nth-child(1) {
  width: 7%;
  text-align: center;
}

.word-table th:nth-child(2),
.word-table td:nth-child(2) {
  width: 58%;
}

.word-table th:nth-child(3),
.word-table td:nth-child(3) {
  width: 12%;
}

.word-table th:nth-child(4),
.word-table td:nth-child(4) {
  width: 23%;
}


.dotted-line {
  display: flex;
  align-items: center;
  width: 100%;
}

.dotted-line span {
  white-space: nowrap;
}

.dotted-line::after {
  content: "";
  flex: 1;
  border-bottom: 2px dotted black;
  margin-left: 8px;
}

.tg .img-cell {
  text-align: center;
  vertical-align: middle;
  padding: 8px;
}

.tg .img-cell img {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
  margin: auto;
}
.img-cell img {
  width: 100%;
  height: auto;
  object-fit: contain;
}




/* Quarto HTML book: section/subsection/subsubsection */
main h1,
main h2,
main h3,
main h4 {
  color: #D4A97D;
}

/* Right-side TOC only (more specific to beat cerulean link styles) */
.quarto-container #TOC a,
.quarto-container #TOC a:visited {
  color: #D4A97D !important;
}

.quarto-container #TOC a:hover,
.quarto-container #TOC a:focus {
  color: #D4A97D !important;
  text-decoration: underline;
}

.quarto-container #TOC a.active {
  color: #D4A97D !important;
  font-weight: 700;
}

/* optional: TOC title */
.quarto-container #TOC .toc-title {
  color: #D4A97D !important;
}

/* Caption ใต้รูปภาพ */
main figure figcaption,
main .figure-caption,
main figcaption {
  color: #D4A97D !important;
  text-align: center !important;
  font-weight: normal;
  margin-top: 0.5em;
  text-indent: 0;
}

/* ป้องกันการเลือกข้อความในเนื้อหาหลัก */
main {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* อนุญาตให้เลือกข้อความในส่วนที่กำหนด */
main input,
main textarea,
main pre,
main code,
main .allow-copy {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* ปุ่มเพิ่ม–ลดขนาดตัวอักษร */
.font-controls {
  position: fixed;
  top: 70px;
  right: 18px;
  z-index: 1050;

  display: flex;
  align-items: center;
  gap: 4px;

  padding: 5px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #D4A97D;
  border-radius: 8px;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.font-controls button {
  min-width: 36px;
  height: 34px;

  border: none;
  border-radius: 5px;
  background: transparent;
  color: #D4A97D;

  font-family: sans-serif;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.font-controls button:hover,
.font-controls button:focus {
  background: #D4A97D;
  color: white;
}

/* ป้องกันกฎ no-copy รบกวนปุ่ม */
.font-controls,
.font-controls button {
  -webkit-user-select: none;
  user-select: none;
}

/* ซ่อนข้อความสำหรับ Screen Reader */
.visually-hidden-control {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}