/**
 * Child Template Styles
 * 
 * CSS สำหรับ Child Page Template ที่ใช้ Sidebar Layout เดียวกับ page-about-china.php
 * 
 * @package WordPress
 * @subpackage Chinis School
 * @since Chinis School 1.0
 */

/* Layout */
.hero-section img {
  display: block;
  width: 100%;
}

/* ค่าเริ่มต้น (มือถือ/แท็บเล็ตเล็ก): ไม่ใช้ flex */
.content-layout {
  display: block;
  /* กันปัญหาบน mobile */
}

/* จอใหญ่ค่อยเปิด flex */
@media (min-width: 1024px) {

  /* จะใช้ 769px ก็ได้ตามดีไซน์ */
  .content-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    /* ไม่ใช่ start */
  }

  .sidebar {
    flex: 0 0 300px;
  }

  .main-content {
    flex: 1;
  }
}


.about-china-main {
  background: #fff;
  padding: 30px;
  background-image: none;
}

/* จอ ≥ 769px: ใช้สไตล์เดิมเต็ม ๆ */
@media (min-width: 769px) {
  .about-china-main {
    background: #ffffff;
    padding: 100px;
    background-image: url('../images/pattern-background.png');
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 25% auto;
  }
}

/* มือถือ: ใช้ dropdown; ซ่อนเมนูเดิม */
@media (max-width: 768px) {

  .sidebar-toggle,
  .sidebar-nav {
    display: none !important;
  }

  .sidebar-dropdown {
    margin: 12px 0 16px;
    position: relative;
    /* เผื่อวาง caret/เงาในอนาคต */
  }

  .sidebar-select {
    width: 100%;
    min-height: 44px;
    /* แตะง่ายตามมาตรฐาน mobile */
    padding: 12px 16px;

    /* เผื่อที่ให้ caret ไม่ทับข้อความ */
    border: 2px solid #A41F22;
    border-radius: 14px;
    background: #fff;
    color: #A41F22;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
    text-align: center;
    text-align-last: center;
    /* จัดตัวเลือกที่เลือกอยู่ให้กึ่งกลาง */
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;

    /* ซ่อนลูกศร native */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* วาด caret */
    background-image:
      linear-gradient(45deg, transparent 50%, currentColor 50%),
      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
      calc(100% - 26px) calc(50% - 3px),
      calc(100% - 18px) calc(50% - 3px);
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
  }

  .sidebar-select:hover {
    background-color: #ffffff;
    /* โทนอ่อน ๆ */
    border-color: #8C0B0B;
    /* เข้มขึ้นเล็กน้อย */
  }

  .sidebar-select:focus-visible {
    outline: none;
    /* วงเหลืองแบรนด์ */
    border-color: #8C0B0B;
  }

  /* ตัวเลือกยาวให้ตัดบรรทัดได้ และน้ำหนักตัวอักษรอ่านง่าย */
  .sidebar-select option {
    white-space: normal;
    font-weight: 600;
  }

  /* placeholder/ตัวเลือก disabled */
  .sidebar-select option[disabled] {
    color: #9a9a9a;
  }

  /* ป้องกัน double-tap zoom บน iOS: ให้ขนาดฟอนต์ ≥16px */
  @supports (-webkit-touch-callout: none) {
    .sidebar-select {
      font-size: 16px;
    }
  }
}

/* เดสก์ท็อป/แท็บเล็ต: ใช้ sidebar เดิม */
@media (min-width: 769px) {
  .sidebar-dropdown {
    display: none;
  }
}


/* Sidebar */
.sidebar {
  flex: 0 0 300px;
  top: 20px;
}

.sidebar-section {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 100px;
}

.sidebar-icon {
  width: 40px;
  /* ปรับขนาดตามที่ต้องการ เช่น 20px */
  height: 40px;
  vertical-align: middle;
  fill: currentColor;
  stroke: currentColor;
}

.sidebar-title {
  font-size: 20px;
  margin-left: 20px;
}

.sidebar-button .fa-arrow-right {
  margin-left: auto;
  /* ดันไปชิดขวา */
  font-size: 15px;
  /* ปรับขนาดลูกศร */
  color: currentColor;
  /* ให้ตามสีปุ่ม */
}

.sidebar-button {
  background: var(--primary-red);
  color: #ffffff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-button:hover {
  background: var(--primary-red-dark, #A41F22);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-button.active {
  color: #FFB119;
  cursor: default;
}

.sidebar-button.active:hover {
  background: #A41F22;
}

.sidebar-button i:first-child {
  margin-right: 12px;
}

/* Sidebar Navigation */

.sidebar-nav {
  background: transparent;
  padding: 0;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-nav li:last-child {
  border-bottom: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: var(--primary-red, #A41F22);
  background: #F1E1E1;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: all 0.3s ease;
}

.sidebar-nav li+li {
  margin-top: 14px;
}

.sidebar-nav a:hover {
  background: #FFB119;
  color: var(--primary-red);
}

.sidebar-nav a.active {
  border: 2px solid #A41F22;
  background-color: #FFB119;
  color: white;
}

.sidebar-nav i {
  margin-left: auto;
  margin-right: 0;
  color: var(--primary-red);
  font-size: 0.9rem;
}

.sidebar-nav a.active i {
  color: white;
}

/* Main Content */
.main-content {
  flex: 1;
  border-radius: 12px;
  padding: 0 40px 40px 40px;
}

.content-header h2 {
  font-size: 2.5rem;
  color: var(--primary-red);
  margin-bottom: 20px;
  position: relative;
}

.content-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 200px;
  height: 4px;
  background: #FFB119;
  border-radius: 2px;
}

/* Child Page Content */
.child-page-content h1 {
  color: #333;
  margin-bottom: 30px;
  font-size: 2rem;
}

.content-body {
  line-height: 1.6;
}

.title-section h3 {
  color: #007cba;
  margin-bottom: 20px;
}

.body-text-section {
  margin-top: 40px;
  margin-bottom: 30px;
}

.image-section {
  text-align: center;
  margin: 30px 0;
}

.page-id-161 .button-section {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .62rem 1.15rem;
  border-radius: 26px;
  font-weight: 700;
  border: 1px solid #A41F22;
  line-height: 1;
  background: #ffffff;
  color: #A41F22;
}


.content-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Debug Info */
.debug-info {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
}

.school-tour-form input[type="text"],
.school-tour-form input[type="email"],
.school-tour-form input[type="tel"],
.school-tour-form input[type="date"],
.school-tour-form textarea {
  border: 2px solid #A41F22 !important;
  /* สีแดง */
  border-radius: 4px;
}

:root {
  --red: #A41F22;
  --ink: #222;
  --muted: #666;
}

/* โครง + หัวข้อ */
.app-step {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 0 18px;
}

.app-step .step-title {
  margin: 22px 0 12px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 800;
}

.app-step .step-title .label {
  color: var(--red);
  font-weight: 800;
}

/* รายการขั้นตอน = กล่องเส้นแดง */
.app-step .step-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.app-step .step-item {
  margin: 0;
  padding: 14px 18px;
  line-height: 1.6;
  background: #fff;
  border: 2px solid var(--red);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
  transition: background .2s, box-shadow .15s, transform .15s;
}

/* ตัด pseudo เดิมทิ้ง */
.app-step .step-item::before,
.app-step .step-item::after {
  content: none;
}

/* hover effect เบา ๆ */
.app-step .step-item:hover {
  background: #fff7f8;
  box-shadow:
    0 0 0 2px rgba(164, 31, 34, .15),
    0 2px 6px rgba(0, 0, 0, .05);
  transform: translateY(-1px);
}

/* (ตัวเลือก) ถ้ามี .is-active ค่อยทำให้เป็นพื้นแดงตัวอักษรขาว */
.app-step .step-item.is-active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: none;
}


/* ===== L8 Page 2 – Table-like grid refinement ===== */
.app-form {
  --b: #c9c9c9;
  --head: #A41F22;
  --ink: #222;
}

.app-form .section-title {
  background: var(--head);
  color: #fff;
  font-weight: 700;
  padding: .55rem .9rem;
  border: 1px solid var(--head);
  margin-top: 22px;
  border-radius: 4px 4px 0 0;
}

/* กริดแบบตาราง */
.app-form .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  border: 1px solid var(--b);
  border-top: none;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
}

.app-form .cell {
  border-top: 1px solid var(--b);
  border-right: 1px solid var(--b);
  padding: .5rem .6rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ตัดเส้นขวาของคอลัมน์สุดท้ายในแต่ละแถว */
.app-form .cell.end {
  border-right: none;
}

/* หัวช่อง 2 บรรทัด (หลัก + จีนใต้บรรทัด) */
.app-form label {
  font-size: .92rem;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
}

.app-form label .sub {
  display: block;
  font-weight: 500;
  font-size: .82rem;
  color: #555;
  margin-top: .15rem;
}

.app-form input[type="text"],
.app-form input[type="email"],
.app-form input[type="date"],
.app-form input[type="number"] {
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: .42rem .55rem;
  font-size: .95rem;
  margin-top: .35rem;
}

/* utilities */
.app-form .span-2 {
  grid-column: span 2;
}

.app-form .span-3 {
  grid-column: span 3;
}

.app-form .span-4 {
  grid-column: span 4;
}

.app-form .span-6 {
  grid-column: span 6;
}

.app-form .span-8 {
  grid-column: span 8;
}

.app-form .span-12 {
  grid-column: 1 / -1;
}

.app-form .radio-line {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: .35rem;
}

.app-form .table-head {
  background: #f7f7f7;
  font-weight: 700;
}

/* มือถือ */
@media (max-width: 768px) {
  .app-form .grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .app-form .span-8 {
    grid-column: span 6;
  }

  .app-form .span-6 {
    grid-column: span 6;
  }

  .app-form .span-4 {
    grid-column: span 5;
  }

  .app-form .span-3 {
    grid-column: span 6;
  }

  .app-form .span-2 {
    grid-column: span 3;
  }
}

/* L8 Page 3 tweaks */
.app-form .note-line {
  font-size: .9rem;
  color: #444;
  margin: .35rem 0 .2rem;
}

.app-form .numcell {
  width: 48px;
  text-align: center;
  font-weight: 700;
  background: #fafafa;
}

.app-form .tight input {
  min-height: 40px;
}

/* ช่องตารางแคบลงหน่อย */

/* หัวตาราง 2 บรรทัด */
.app-form .head-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* จัดกึ่งกลางแนวนอน */
  justify-content: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
  min-height: 48px;
  /* ความสูงบังคับ */
}

.app-form .head-cell .main {
  font-size: .95rem;
}

.app-form .head-cell .sub {
  font-size: .8rem;
  color: #555;
  margin-top: 2px;
  font-weight: 500;
}

/* ===== Page 3: Proficiency blocks ===== */
/* แถบหัวสีแดงแบบหลายบรรทัด */
.app-form .section-title.stack {
  display: block;
  padding: .6rem .9rem;
  background: var(--head);
  color: #fff;
  border: 1px solid var(--head);
  border-radius: 4px 4px 0 0;
}

.app-form .section-title.stack .ttl-main {
  font-weight: 700;
  line-height: 1.2;
}

.app-form .section-title.stack .ttl-scale {
  margin-top: .15rem;
  font-weight: 600;
  line-height: 1.2;
}

.app-form .section-title.stack .ttl-scale .scale-chunk {
  display: inline-block;
}

.app-form .section-title.stack .ttl-zh {
  margin-top: .2rem;
  font-weight: 700;
}

/* แถวหัวของตาราง (Student/Listening/...) */
.app-form .grid.proficiency .head-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.15;
  min-height: 44px;
}

.app-form .grid.proficiency .head-cell .sub {
  font-weight: 500;
  font-size: .82rem;
  color: #555;
  margin-top: 2px;
}

.app-form .grid.proficiency.tight .cell {
  min-height: 56px;
}

/* แถว input */

/* ===== Page 3: Medical + Emergency hospital ===== */

/* แถวหัวข้อย่อยสีขาวใต้แถบแดง */
.app-form .subhead-cell {
  grid-column: 1 / -1;
  padding: .55rem .75rem;
  font-weight: 700;
  background: #fff;
  border-top: 1px solid var(--b);
  border-bottom: 1px solid var(--b);
}

.app-form .subhead-cell .sub {
  display: block;
  font-weight: 700;
  margin-top: .2rem;
}

/* คอลัมน์ตัวเลข 1., 2. แคบ ๆ */
.app-form .numcell {
  grid-column: span 1;
  min-width: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #fafafa;
}

/* ช่องอินพุตให้กินเต็มเซลล์และ “ไร้กรอบ” เหมือนตาราง */
.app-form .input-cell {
  grid-column: span 11;
}

.app-form .input-cell input {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: .35rem .45rem;
  font-size: .95rem;
}

/* ให้เส้นกรอบมาจากเซลล์ตาราง ไม่ใช่กรอบของ input */
.app-form .grid.hospital .cell {
  min-height: 46px;
}

/* ===== L8 Page 4: Declaration ===== */
.declaration {
  margin-top: 20px;
  padding-bottom: 20px;
}

.declaration .section-title {
  background: #A41F22;
  color: #ffffff;
  font-weight: 700;
  padding: .6rem .9rem;
  border: 1px solid var(--head);
  border-radius: 4px 4px 0 0;
}

.declaration .section-title .sub {
  margin-left: .5rem;
  font-weight: 700;
}

.declaration .box {
  border: 1px solid #000000;
  border-top: none;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
}

.declaration .decl-item {
  padding: .7rem .85rem;
  border-top: 1px solid #000000;
  background: #fff;
}

.declaration .decl-item:first-child {
  border-top: none;
}

.declaration .decl-item p {
  margin: .2rem 0;
  line-height: 1.45;
}

.declaration .decl-item p.zh {
  margin-top: .35rem;
}


/* ===== Signature table - grid 3(head)/4(body) ===== */
.layout-08 .sign-table {
  border: none;
  /* ไม่ใช้ border ตรงนี้ */
  position: relative;
}

.layout-08 .sign-table::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #000;
  border-radius: 5px;
  pointer-events: none;
}

/* ทุกแถวให้เป็น grid 4 คอลัมน์ */
.layout-08 .sign-table .row {
  display: grid;
  grid-template-columns: var(--col1) var(--col2) var(--col3) var(--col4);
}

/* cell พื้นฐาน + เส้น */
.layout-08 .sign-table .cell {
  border: none;
  /* ไม่ซ้อน */
  border-right: 1px solid #000;
  /* เส้นในแนวตั้ง */
  border-bottom: 1px solid #000;
  /* เส้นในแนวนอน */
  padding: 12px 14px;
}

.layout-08 .sign-table .row .cell.end {
  border-right: none;
}

.layout-08 .sign-table .row:last-child .cell {
  border-bottom: none;
}

/* หัวตาราง 3 ช่องขวา + ช่องซ้าย (stub) ว่าง */
.layout-08 .sign-table .row.head .cell.th {
  background: #A41F22;
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.layout-08 .sign-table .row.head .cell.stub {
  background: transparent;
  /* ช่องซ้ายว่าง */
}

.layout-08 .sign-table .head-cell .main {
  display: block;
}

.layout-08 .sign-table .head-cell .sub {
  display: block;
  font-weight: 700;
}

/* คอลัมน์ซ้าย: label ผู้ปกครอง */
.layout-08 .sign-table .cell.label {
  font-weight: 700;
}

.layout-08 .sign-table .cell.label .sub {
  font-weight: 400;
}

/* ช่องกรอกค่าให้ดูเหมือนกล่องว่างในตาราง */
.layout-08 .sign-table .cell:not(.label):not(.th) {
  display: flex;
  align-items: center;
}

.layout-08 .sign-table input[type="text"] {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: .35rem 0;
  font-size: 1rem;
}

.layout-08 .sign-table input::placeholder {
  color: #9aa0a6;
}

/* ปุ่มด้านล่างให้ตรงภาพ */
.layout-08 .sign-actions {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  min-height: 45px;
  /* ความสูงอย่างน้อย */
  align-items: center;
  /* จัดปุ่มให้อยู่กึ่งกลางแนวตั้ง */
}

.layout-08 .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  border: 1px solid #A41F22;
  line-height: 1;
  background: #A41F22;
  color: #ffffff;
  width: 117px;
  height: 45px;
}

/* โซนปุ่มใน layout-08 เท่านั้น เพื่อไม่ให้ไปกระทบที่อื่น */
.layout-08 .sign-actions .btn {
  /* ตั้งค่าพื้นฐานร่วมกันของสองปุ่ม */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  line-height: 1;
  text-decoration: none;
  border: 0;
  appearance: none;
  -webkit-appearance: none;

  /* ฟอนต์ให้เหมือนปุ่ม Download */
  font-family: Kanit, "Noto Sans Thai", Arial, sans-serif;
  font-size: 16px;
}

/* สี/พื้นหลังให้เหมือนกัน */
.layout-08 .sign-actions .btn.primary,
.layout-08 .sign-actions .btn.outline {
  background: #A41F22;
  /* ปรับตามสีหลักของธีม */
  color: #fff;
  border: none;
}

/* เฉพาะปุ่ม Submit – ให้ใช้สไตล์เดียวกับ Download */
#l8-submit.btn.primary {
  font-family: Kanit, "Noto Sans Thai", Arial, sans-serif;
  font-size: 16px;
}

.layout-08 .btn.primary {
  background: #A41F22;
  color: #fff;
}

.layout-08 .btn:hover {
  filter: brightness(.97);
  text-decoration: none;
}

/* ขนาดคอลัมน์มาตรฐานของทั้งตาราง (4 คอลัมน์ในบอดี้) */
.layout-08 .sign-table {
  --col1: 24%;
  --col2: 32%;
  --col3: 22%;
  --col4: 22%;
}

/* แถวบอดี้: 4 คอลัมน์ปกติ */
.layout-08 .sign-table .row {
  display: grid;
  grid-template-columns: var(--col1) var(--col2) var(--col3) var(--col4);
}

/* แถวหัว: รวมช่องซ้าย (stub) + ชื่อ–นามสกุล ให้เป็นคอลัมน์เดียว */
.layout-08 .sign-table .row.head {
  grid-template-columns: calc(var(--col1) + var(--col2)) var(--col3) var(--col4);
}

/* ซ่อนช่อง stub เพราะถูกรวมแล้ว */
.layout-08 .sign-table .row.head .cell.stub {
  display: none;
}

/* สไตล์หัวตารางเดิม ใช้ต่อได้ */
.layout-08 .sign-table .row.head .cell.th {
  background: #A41F22;
  color: #fff;
  text-align: center;
  font-weight: 700;
}

/* เส้นขอบให้ต่อเนื่องสวย */
.layout-08 .sign-table .cell {
  border: 1px solid #000000;
  padding: 12px 14px;
}

.layout-08 .sign-table .row.head .cell.th:first-child {
  border-left: 1px solid #A41F22;
}

.layout-08 .sign-table .row .cell.end {
  border-right: none;
}

.layout-08 .sign-table .row:last-child .cell {
  border-bottom: none;
}


/* โครงกริด */
.grid.proficiency {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  /* ไม่มีรอยต่อสีขาว */
}

/* ตัวช่วย span คอลัมน์ */
.grid .span-2 {
  grid-column: span 2;
}

.grid .span-3 {
  grid-column: span 3;
}

/* รวม 2 แถวให้ช่อง "นักเรียน" */
.grid.proficiency .row-span-2 {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* สไตล์หัวตาราง */
.grid.proficiency .head-cell {
  background: #ffffff;
  /* แดงเข้มตาม PDF */
  color: #000000;
  /* ตัวอักษรสีดำ */
  font-weight: 600;
  text-align: center;
  padding: 6px 4px;
}



/* สไตล์เซลล์อินพุต */
.grid.proficiency .cell.t ight {
  border: 1px solid #ddd;
  border-top: none;
  /* ต่อขอบกับหัวด้านบน */
  padding: .5rem;
}

.grid.proficiency .cell.end {
  border-right-width: 1px;
}

/* อินพุตให้สูงเท่ากันดูเป็นช่อง */
.grid.proficiency input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 6px 8px;
  border-radius: 4px;
  box-sizing: border-box;
}


/* ===== CIS Modal (shared by L8 & L9) ===== */
.cis-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999
}

.cis-modal.is-open {
  display: flex
}

.cis-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5)
}

.cis-modal__dialog {
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: calc(100% - 2rem);
  background: #fff;
  /* บังคับขาว */
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  padding: 24px 20px 20px;
  animation: cis-pop .18s ease-out;
  color: #111
}

@keyframes cis-pop {
  from {
    transform: translateY(8px);
    opacity: .6
  }

  to {
    transform: none;
    opacity: 1
  }
}

.cis-modal__close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer
}

.cis-modal__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700
}

.cis-modal__desc {
  margin: 0 0 16px;
  font-size: 16px;
  color: #333
}

.cis-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cis-modal__actions .cis-btn.cis-btn--primary {
  background: #A41F22;
  color: #fff;
}

.cis-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1rem;
  border-radius: 10px;
  border: 0;
  cursor: pointer
}

.cis-btn--primary {
  background: #A41F22;
  color: #fff
}

.cis-btn--primary:hover {
  color: #fff
}

/* บังคับให้ dark mode ก็ยังพื้นหลังขาว/ตัวอักษรดำ */
@media (prefers-color-scheme: dark) {
  .cis-modal__dialog {
    background: #fff;
    color: #111
  }

  .cis-modal__desc {
    color: #333
  }
}

/* ปิด scroll เมื่อ modal เปิด */
html.cis-modal-open,
body.cis-modal-open {
  overflow: hidden
}


/* ========== L9: BASE SCOPE (เฉพาะหน้านี้) ========== */
.layout-9-wrapper {
  max-width: 760px;
}

/* ระยะฟอร์ม */
.layout-9-wrapper .l9-form {
  margin-top: 10px;
}

.layout-9-wrapper .l9-form .l9-field {
  margin-bottom: 22px;
}

/* Label: สีน้ำเงิน แต่ไม่หนาเกินไป */
.layout-9-wrapper .l9-form label {
  display: block;
  color: #112D55;
  margin: 0 0 6px;
  font-weight: 500;
  /* เดิม 600 → ลดความหนา */
}

/* ช่องกรอก */
.layout-9-wrapper .l9-form input[type="text"],
.layout-9-wrapper .l9-form input[type="tel"],
.layout-9-wrapper .l9-form input[type="email"] {
  width: 100%;
  height: 56px;
  padding: 12px 14px;
  border: 1px solid #8c2a31;
  border-radius: 3px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .03);
  transition: border-color .15s, box-shadow .15s;
}

.layout-9-wrapper .l9-form input:focus {
  outline: 0;
  border-color: #A41F22;
  box-shadow: 0 0 0 3px rgba(164, 31, 34, .15);
}

/* ปุ่ม */
.layout-9-wrapper .l9-actions {
  margin-top: 8px;
}

.layout-9-wrapper .l9-btn-submit {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 24px;
  border: 1px solid #A41F22;
  background: #A41F22;
  color: #fff;
  font-weight: 700;
}

.layout-9-wrapper .l9-btn-submit:hover {
  opacity: .9;
}

/* ========== L9: Course select boxes (ใช้ร่วมกับสัปดาห์) ========== */
.layout-9-wrapper .l9-course-select {
  margin: 18px 0 8px;
}

.layout-9-wrapper .l9-select {
  width: 100%;
  max-width: 420px;
  height: 44px;
  padding: 8px 12px;
  border: 1px solid #A41F22;
  border-radius: 4px;
  background: #fff;
}

.layout-9-wrapper fieldset.l9-course {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
}

.layout-9-wrapper fieldset.l9-course>legend {
  font-weight: 700;
  padding: 0 8px;
}

.layout-9-wrapper .l9-hidden {
  display: none !important;
}

/* รายการแบบการ์ดที่กดได้ (ใช้กับ week list และ consent) */
.layout-9-wrapper .l9-weeklist {
  list-style: none;
  margin: 10px 0;
  padding: 0;
}

.layout-9-wrapper .l9-weeklist li {
  margin: 12px 0;
}

.layout-9-wrapper .l9-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.layout-9-wrapper .l9-option>input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.layout-9-wrapper .l9-box {
  padding: 14px 16px;
  border: 1px solid #A41F22;
  border-radius: 8px;
  background: #fff;
  color: #000;
  transition: background .15s, color .15s, box-shadow .15s;
}

.layout-9-wrapper .l9-option:hover .l9-box {
  box-shadow: 0 0 0 4px rgba(140, 42, 49, .12);
}

.layout-9-wrapper .l9-option>input:checked+.l9-box {
  background: #A41F22;
  color: #fff;
  box-shadow: none;
}

/* ข้อความบนการ์ด “ไม่ให้หนา” */
.layout-9-wrapper .l9-box .l9-title {
  font-weight: 400;
}

/* ========== L9: Consent section ========== */
.layout-9-wrapper .l9-consent-head {
  font-size: 1.05rem;
  /* ~17px–18px */
  margin: 12px 0 6px;
  color: #112D55;
  font-weight: 500;
  /* ลดความหนา */
}

.layout-9-wrapper .l9-consent-text {
  margin: 6px 0;
  line-height: 1.6;
  font-size: 1.05rem;
}

/* ใช้กฎ .l9-option / .l9-box จาก weeklist ได้เลย ไม่ต้องซ้ำ */

/* ========== L9: Red notices (ให้แดงแน่ๆ) ========== */
.layout-9-wrapper .l9-notes {
  margin: 18px 0 6px;
}

.layout-9-wrapper .l9-note {
  color: #A41F22 !important;
  text-align: center;
  font-weight: 800;
  margin: 6px 0;
}

/* ====== (B) Modal CSS ====== */
.l9-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.l9-modal.is-open {
  display: flex;
}

.l9-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
}

.l9-modal__dialog {
  position: relative;
  z-index: 1;
  max-width: 540px;
  width: calc(100% - 2rem);
  background: #fff;
  /* พื้นหลังขาว */
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  padding: 24px 20px 20px;
  animation: l9-pop .18s ease-out;
  color: #111;
  /* ข้อความดำ */
}

@keyframes l9-pop {
  from {
    transform: translateY(8px);
    opacity: .6
  }

  to {
    transform: none;
    opacity: 1
  }
}

.l9-modal__close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer
}

.l9-modal__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700
}

.l9-modal__desc {
  margin: 0 0 16px;
  font-size: 16px;
  color: #333
}

.l9-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px
}

.l9-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1rem;
  border-radius: 10px;
  border: 0;
  cursor: pointer
}

.l9-btn--primary {
  background: var(--cis-accent, #A41F22);
  color: #fff
}

/* รูปภาพข่าว */
.post-thumb {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover ที่ลิงก์รูป */
.post-link:hover .post-thumb {
  transform: scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ลิงก์ชื่อข่าว */
.post-title-link {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-title-link:hover {
  color: #A41F22;
  /* ใช้สีแดงหลักของเว็บคุณ */
  text-decoration: underline;
}

/* การ์ดวันที่ให้เท่ากันทุกใบ */
.visit-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.visit-date-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  min-width: 140px;
  /* ความกว้างคงที่ */
  height: 92px;
  /* ความสูงคงที่ */
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.visit-date-item:hover {
  border-color: #8B0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.08);
}

/* กล่องวันที่แบบเลข dd/mm/YYYY */
.visit-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.visit-date-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  /* ให้ปรับขนาดตามข้อความ ไม่ fix กล่อง */
  min-width: auto;
  height: auto;
}

.date-chip {
  display: block;
  font-weight: 600;
  line-height: 1.2;
}

/* ไฮไลต์เมื่อถูกเลือก (ใช้ :has; ถ้าบราวเซอร์ไม่รองรับดู JS ด้านล่าง) */
.visit-date-item:has(input[type="checkbox"]:checked) {
  border-color: #8B0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, .12);
}

/* มือถือ */
@media (max-width:768px) {
  .visit-date-item {
    padding: 10px 14px;
  }
}


/* มือถือ */
@media (max-width:768px) {
  .visit-date-item {
    min-width: 46%;
    height: 90px;
  }
}


@media (prefers-color-scheme: dark) {
  .l9-modal__dialog {
    background: #fff;
    /* บังคับขาว */
    color: #111;
    /* ข้อความดำ */
  }

  .l9-modal__desc {
    color: #333;
  }
}

/* ป้องกัน scroll พื้นหลังตอนเปิด modal */
html.l9-modal-open,
body.l9-modal-open {
  overflow: hidden
}

/* พิมพ์ PDF ให้สวยขึ้นคร่าว ๆ */
@media print {

  .l9-actions-row,
  .l9-course-select,
  .site-header,
  .site-footer {
    display: none !important;
  }

  .layout-9-wrapper fieldset.l9-course {
    border-color: #aaa;
  }
}



/* พิมพ์ */
@media print {
  .layout-08 .sign-table {
    page-break-inside: avoid;
  }

  .layout-08 .sign-table input[type="text"] {
    border: none;
    outline: none;
  }
}



/* Responsive */
@media (max-width: 768px) {
  .content-layout {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    flex: none;
    margin-bottom: 20px;
  }

  .main-content {
    padding: 0 20px 20px 20px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    flex: 0 0 100%;
  }

  .sidebar-button {
    padding: 15px;
    font-size: 1rem;
  }

  .sidebar-nav a {
    padding: 12px 15px;
  }
}