/* =========================================================
   TeacherFon Online Classroom (ห้องเรียนอาจารย์ฝน) · วิทยาลัยเทคนิคฉะเชิงเทรา
   ชุดสีม่วง + ทอง ให้เข้ากับ KruFon Academy (#F9E5FF #E3B7FF #C47CFF #7F46B8 #FFF6FF)
   ========================================================= */

:root {
  /* brand */
  --brand: #7f46b8; /* ม่วงหลัก (ผ่าน AA บนพื้นขาว 6:1) */
  --brand-700: #62329a;
  --brand-50: #f9e5ff;
  --brand-200: #e3b7ff;
  --brand-400: #c47cff;
  --gold: #ffbe1a; /* ทองสดตัดกับม่วง (คู่สีตรงข้าม) */
  --gold-text: #8f5d00; /* ทองเข้มสำหรับตัวหนังสือบนพื้นอ่อน (ผ่าน AA) */
  --gold-50: #fff1c7;
  --mist: #efe4f7;

  /* neutrals */
  --paper: #fff6ff;
  --surface: #ffffff;
  --ink: #1e1828;
  --ink-2: #4a4257;
  --muted: #6b6378;
  --line: #efe2f5;
  --line-strong: #dccbe6;

  /* states */
  --ok: #2f6b45;
  --ok-50: #e7f1ea;
  --err: #b42318;

  /* spacing (B2) */
  --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px; --s-200: 16px;
  --s-300: 24px; --s-400: 32px; --s-500: 40px; --s-600: 48px;
  --s-700: 64px; --s-800: 80px; --s-900: 96px;

  /* radius (tailwind) */
  --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px; --r-3xl: 24px; --r-full: 9999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "IBM Plex Sans Thai", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --container: 1160px;
  --shadow: 0 1px 2px rgb(30 24 40 / 0.04), 0 8px 24px rgb(30 24 40 / 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- text styles (B1, line heights ปรับให้รองรับสระ/วรรณยุกต์ไทย) ---------- */
.heading-1 { font-size: 3.75rem; line-height: 1.22; font-weight: 600; letter-spacing: -0.01em; }
.heading-2 { font-size: 3rem; line-height: 1.25; font-weight: 600; }
.heading-3 { font-size: 2.25rem; line-height: 1.3; font-weight: 600; }
.heading-4 { font-size: 1.875rem; line-height: 1.35; font-weight: 600; }
.heading-5 { font-size: 1.5rem; line-height: 1.4; font-weight: 600; }
.heading-6 { font-size: 1.25rem; line-height: 1.45; font-weight: 600; }
.title-2 { font-size: 1.125rem; line-height: 1.55; font-weight: 500; }
.title-3 { font-size: 1rem; line-height: 1.5; font-weight: 500; }
.title-4 { font-size: 0.875rem; line-height: 1.45; font-weight: 500; }
.body-3 { font-size: 1rem; line-height: 1.7; font-weight: 400; }
.body-1 { font-size: 1rem; line-height: 1.6; font-weight: 600; }
.body-6 { font-size: 0.875rem; line-height: 1.6; font-weight: 400; }
.caption-1 { font-size: 0.875rem; line-height: 1.45; font-weight: 500; }
.caption-2 { font-size: 0.875rem; line-height: 1.45; font-weight: 400; }
.caption-4 { font-size: 0.75rem; line-height: 1.35; font-weight: 500; }
.mono { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0; }
.lead { font-size: 1.125rem; line-height: 1.75; color: var(--ink-2); }
.muted { color: var(--muted); }

@media (max-width: 860px) {
  .heading-1 { font-size: 2.25rem; line-height: 1.3; }
  .heading-2 { font-size: 1.875rem; line-height: 1.35; }
  .heading-3 { font-size: 1.875rem; line-height: 1.35; }
  .lead { font-size: 1rem; }
}

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-300); }
@media (max-width: 480px) { .container { padding-inline: var(--s-200); } }
.section { padding-block: var(--s-900); }
.section-tight { padding-block: var(--s-700); }
@media (max-width: 860px) { .section { padding-block: var(--s-700); } }

.section-head { max-width: 680px; margin-bottom: var(--s-600); }
.section-head .eyebrow { margin-bottom: var(--s-200); }
.section-head p { margin-top: var(--s-200); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-75);
  font-size: 0.875rem; line-height: 1.45; font-weight: 500;
  color: var(--brand);
}
.eyebrow::before {
  content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--gold);
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute; left: var(--s-200); top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: var(--s-75) var(--s-100);
  border-radius: var(--r-lg); text-decoration: none;
}
.skip-link:focus { top: var(--s-200); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75);
  min-height: 44px; padding: var(--s-75) var(--s-200);
  border-radius: var(--r-full); border: 1px solid transparent;
  font-size: 1rem; line-height: 1.5; font-weight: 600; text-decoration: none; cursor: pointer;
  white-space: nowrap;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn i { font-size: 1.125rem; transition: transform .3s var(--ease); }
.btn:hover i.ph-arrow-right, .btn:hover i.ph-arrow-up-right { transform: translateX(2px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-2); }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--gold-50); }
.btn-sm { min-height: 36px; font-size: 0.875rem; padding: var(--s-50) var(--s-100); }
.btn-lg { min-height: 52px; padding: var(--s-100) var(--s-300); font-size: 1.125rem; }
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--paper); color: var(--muted); border-color: var(--line); cursor: not-allowed; transform: none;
}
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s-50);
  color: var(--brand); font-weight: 500; text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.link-arrow:hover { border-color: currentColor; }

/* ---------- nav ---------- */
.nav-wrap { position: fixed; inset: var(--s-200) 0 auto 0; z-index: 50; padding-inline: var(--s-200); pointer-events: none; }
.nav {
  pointer-events: auto;
  max-width: var(--container); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-300);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-100);
  background: rgb(255 255 255 / 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgb(239 226 245 / 0.9);
  border-radius: var(--r-full);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: var(--s-100); text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.brand-text { display: grid; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.brand-text span { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: var(--s-50); }
.nav-links a {
  font-size: 0.875rem; font-weight: 500; text-decoration: none; color: var(--ink-2);
  padding: var(--s-75) var(--s-100); border-radius: var(--r-full);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.nav-links a:hover { background: var(--paper); color: var(--ink); }
.nav-links a[aria-current="true"], .nav-links a[aria-current="page"] { color: var(--brand); background: var(--brand-50); }
.nav-cta { display: flex; align-items: center; gap: var(--s-75); }
.menu-toggle {
  display: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-full);
  background: var(--paper); cursor: pointer; position: relative;
}
.menu-toggle span {
  position: absolute; left: 13px; width: 18px; height: 1.75px; border-radius: 2px; background: var(--ink);
  transition: transform .5s var(--ease), opacity .3s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 25px; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

.mobile-panel {
  position: fixed; inset: 0; z-index: 40;
  background: rgb(255 246 255 / 0.94);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  padding: 112px var(--s-300) var(--s-400);
  display: flex; flex-direction: column; gap: var(--s-75);
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility .5s;
}
.menu-open .mobile-panel { opacity: 1; visibility: visible; }
.mobile-panel a.m-link {
  font-size: 1.5rem; line-height: 1.4; font-weight: 600; text-decoration: none;
  padding: var(--s-100) 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.mobile-panel a.m-link i { font-size: 1.25rem; color: var(--muted); }
.menu-open .mobile-panel a.m-link { opacity: 1; transform: none; }
.mobile-panel .btn { margin-top: var(--s-300); opacity: 0; transition: opacity .5s var(--ease) .35s; }
.menu-open .mobile-panel .btn { opacity: 1; }

@media (max-width: 940px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .nav-cta .btn { display: none; }
}
@media (min-width: 941px) { .mobile-panel { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: 128px; padding-bottom: var(--s-800); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-700); align-items: center; }
.hero-tag {
  display: inline-flex; align-items: center; gap: var(--s-75);
  padding: var(--s-50) var(--s-100) var(--s-50) var(--s-50);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full);
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
}
.hero-tag img { width: 24px; height: 24px; border-radius: 50%; }
.hero h1 {
  max-width: 680px; margin-top: var(--s-300);
  background: linear-gradient(90deg, #1e1828 0%, #6b5a80 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero h1 .accent-word {
  white-space: nowrap; display: inline-block;
  background: linear-gradient(90deg, var(--brand) 0%, #a764e8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { max-width: 560px; margin-top: var(--s-300); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-300); margin-top: var(--s-500); }
.hero-proof {
  display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-300); margin-top: var(--s-600);
  padding-top: var(--s-300); border-top: 1px solid var(--line);
}
.hero-proof li { display: flex; align-items: center; gap: var(--s-75); font-size: 0.875rem; color: var(--ink-2); }
.hero-proof i { color: var(--gold-text); font-size: 1.125rem; }

@media (max-width: 940px) {
  .hero { padding-top: 128px; padding-bottom: var(--s-700); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-600); }
}

/* hero board (ภาพประกอบหลัก) */
.board {
  position: relative; background: var(--brand); border-radius: var(--r-3xl);
  padding: var(--s-300); color: #fff; overflow: hidden; isolation: isolate;
}
.board-art { position: absolute; inset: 0; z-index: -1; opacity: 1; }
.board-art svg { width: 100%; height: 100%; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-200); }
.board-head .mono { color: rgb(255 255 255 / 0.7); }
.live-dot { display: inline-flex; align-items: center; gap: var(--s-75); font-size: 0.75rem; font-weight: 500; color: rgb(255 255 255 / 0.85); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.board-figure { height: 220px; }
.next-class {
  background: var(--surface); color: var(--ink); border-radius: var(--r-xl); /* 24 - 12 gap */
  padding: var(--s-300);
}
.next-class .row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-200); }
.next-class .label { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.next-class .when { font-size: 1.25rem; line-height: 1.45; font-weight: 600; margin-top: var(--s-50); }
.next-class .course { margin-top: var(--s-100); font-size: 0.875rem; color: var(--ink-2); }
.next-class .status {
  flex: none; font-size: 0.75rem; font-weight: 500; padding: var(--s-25) var(--s-75); border-radius: var(--r-full);
  background: var(--gold-50); color: var(--gold-text);
}
.next-class .status.is-live { background: var(--ok-50); color: var(--ok); }
.next-class .meta { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-200); margin-top: var(--s-200); padding-top: var(--s-200); border-top: 1px dashed var(--line-strong); }
.next-class .meta span { display: inline-flex; align-items: center; gap: var(--s-50); font-size: 0.875rem; color: var(--ink-2); }
.next-class .meta i { color: var(--brand); }

.teacher-strip {
  display: flex; align-items: center; gap: var(--s-100); margin-top: var(--s-100);
  background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--r-xl); padding: var(--s-100);
}
.teacher-strip .avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--gold); color: var(--brand-700); display: grid; place-items: center; font-weight: 600;
}
.teacher-strip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-strip strong { display: block; font-size: 0.875rem; font-weight: 600; }
.teacher-strip span { display: block; font-size: 0.75rem; color: rgb(255 255 255 / 0.75); }

/* ---------- facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); }
.fact { padding: var(--s-300); }
.fact + .fact { box-shadow: -1px 0 0 var(--line); }
.fact strong { display: block; font-size: 1.875rem; line-height: 1.3; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.fact span { font-size: 0.875rem; color: var(--muted); }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { box-shadow: 0 -1px 0 var(--line); }
  .fact:nth-child(4) { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
}

/* ---------- glyph (custom icons) ---------- */
.glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.glyph svg .accent { stroke: var(--glyph-accent, var(--gold)); }
.glyph svg .dot { fill: var(--glyph-accent, var(--gold)); stroke: none; }
.glyph svg .fill-bg { fill: var(--glyph-bg, #fff); }
.glyph { display: block; }

/* ---------- courses ---------- */
.courses-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-300); flex-wrap: wrap; margin-bottom: var(--s-500); }
.courses-top .section-head { margin-bottom: 0; }
.tabs { display: inline-flex; gap: var(--s-50); padding: var(--s-50); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full); }
.tab {
  border: 0; background: transparent; cursor: pointer;
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
  padding: var(--s-75) var(--s-200); border-radius: var(--r-full); min-height: 36px;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.tab:hover { color: var(--ink); background: var(--paper); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.tab .count { font-family: var(--mono); font-size: 0.75rem; opacity: .7; margin-left: var(--s-50); }

.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-300); }
@media (max-width: 1020px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .course-grid { grid-template-columns: 1fr; } }

.course-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl);
  padding: var(--s-300); text-decoration: none; color: inherit;
  transition: transform .5s var(--ease), border-color .3s var(--ease), box-shadow .5s var(--ease);
}
.course-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.course-card:active { transform: translateY(-2px); }
.course-card.is-featured { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-400); }
@media (max-width: 1020px) { .course-card.is-featured { grid-column: span 2; } }
@media (max-width: 640px) { .course-card.is-featured { grid-column: auto; grid-template-columns: 1fr; gap: var(--s-300); } }
.course-card[hidden] { display: none; }
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-200); }
.cc-icon {
  width: 56px; height: 56px; padding: var(--s-75); border-radius: var(--r-xl);
  background: var(--brand-50); color: var(--brand);
}
.badges { display: flex; flex-wrap: wrap; gap: var(--s-50); justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; gap: var(--s-50);
  font-size: 0.75rem; line-height: 1.35; font-weight: 500;
  padding: var(--s-25) var(--s-75); border-radius: var(--r-full);
  background: var(--paper); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.open { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.badge.open::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.soon { background: var(--gold-50); color: var(--gold-text); border-color: transparent; }
.badge.sample { background: var(--gold-50); color: var(--gold-text); border-color: transparent; }
.cc-code { margin-top: var(--s-300); color: var(--muted); }
.cc-title { margin-top: var(--s-50); }
.cc-en { font-size: 0.875rem; color: var(--muted); }
.cc-summary { margin-top: var(--s-100); color: var(--ink-2); font-size: 0.875rem; line-height: 1.7; }
.cc-foot { margin-top: auto; padding-top: var(--s-300); }
.cc-meta { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-200); font-size: 0.875rem; color: var(--ink-2); }
.cc-meta span { display: inline-flex; align-items: center; gap: var(--s-50); }
.cc-meta i { color: var(--muted); }
.progress { margin-top: var(--s-200); }
.progress-row { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-bottom: var(--s-50); }
.bar { height: 6px; background: var(--paper); border-radius: var(--r-full); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transform-origin: left; transition: transform .8s var(--ease); }
.cc-cta { margin-top: var(--s-200); display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--brand); font-size: 0.875rem; }
.cc-cta i { transition: transform .5s var(--ease); font-size: 1.125rem; }
.course-card:hover .cc-cta i { transform: translateX(4px); }
.cc-cta.is-soon { color: var(--muted); }

.unit-peek { background: var(--paper); border-radius: var(--r-lg); padding: var(--s-200); align-self: stretch; }
.unit-peek h4 { font-size: 0.875rem; font-weight: 500; color: var(--muted); margin-bottom: var(--s-100); }
.unit-peek li { display: flex; gap: var(--s-100); align-items: baseline; padding: var(--s-75) 0; border-top: 1px solid var(--line); font-size: 0.875rem; }
.unit-peek li:first-child { border-top: 0; }
.unit-peek .n { font-family: var(--mono); font-size: 0.75rem; color: var(--gold-text); flex: none; width: 20px; }

/* ---------- materials ---------- */
.materials { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-300); }
@media (max-width: 1100px) { .materials { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .materials { grid-template-columns: 1fr; } }
.material { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: var(--s-400) var(--s-300); }
.material .glyph { width: 56px; height: 56px; color: var(--ink); }
.material h3 { margin-top: var(--s-300); }
.material p { margin-top: var(--s-75); color: var(--ink-2); }
.material .use { margin-top: var(--s-300); padding-top: var(--s-200); border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); display: flex; gap: var(--s-75); }
.material .use i { color: var(--gold-text); margin-top: 3px; }

/* ---------- steps ---------- */
.steps-wrap { background: var(--ink); color: #fff; border-radius: var(--r-3xl); padding: var(--s-700) var(--s-600); }
@media (max-width: 760px) { .steps-wrap { padding: var(--s-500) var(--s-300); border-radius: var(--r-2xl); } }
.steps-wrap .eyebrow { color: var(--gold); }
.steps-wrap .section-head p { color: rgb(255 255 255 / 0.72); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-400); counter-reset: step; position: relative; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: var(--s-500); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 0.75rem; color: var(--gold);
}
.step::after { content: ""; position: absolute; top: 8px; left: 32px; right: 0; height: 1px; background: rgb(255 255 255 / 0.18); }
.step h3 { color: #fff; }
.step p { margin-top: var(--s-75); color: rgb(255 255 255 / 0.72); }

/* ---------- tagline reveal ---------- */
.tagline { padding-block: var(--s-900); }
.tagline p {
  max-width: 900px; font-size: 3rem; line-height: 1.35; font-weight: 600; color: var(--ink);
}
.tagline .w { opacity: .28; transition: opacity .8s var(--ease), color .8s var(--ease); }
.tagline .w.on { opacity: 1; }
.tagline .w.hl.on { color: var(--brand); }
@media (max-width: 860px) { .tagline p { font-size: 1.875rem; line-height: 1.45; } }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: var(--s-700); align-items: start; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: 1fr; gap: var(--s-400); } }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s-200);
  padding: var(--s-300) 0; font-size: 1.125rem; line-height: 1.55; font-weight: 500;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary i { flex: none; font-size: 1.25rem; color: var(--muted); transition: transform .5s var(--ease); }
.faq-list details[open] summary i { transform: rotate(45deg); color: var(--brand); }
.faq-list .answer { padding: 0 var(--s-500) var(--s-300) 0; color: var(--ink-2); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--s-300); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--brand); color: #fff; border-radius: var(--r-3xl); padding: var(--s-500); display: flex; flex-direction: column; }
@media (max-width: 480px) { .contact-card { padding: var(--s-300); } }
.contact-card .eyebrow { color: var(--gold); }
.contact-card h2 { margin-top: var(--s-200); }
.contact-card > p { margin-top: var(--s-200); color: rgb(255 255 255 / 0.78); }
.channels { margin-top: var(--s-500); display: grid; gap: var(--s-75); }
.channel {
  display: flex; align-items: center; gap: var(--s-200); padding: var(--s-100) var(--s-200);
  background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.14); border-radius: var(--r-xl);
  text-decoration: none; transition: background-color .3s var(--ease);
}
a.channel:hover { background: rgb(255 255 255 / 0.14); }
.channel i { font-size: 1.5rem; color: var(--gold); flex: none; }
.channel small { display: block; font-size: 0.75rem; color: rgb(255 255 255 / 0.7); }
.channel span { display: block; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; }
.channel.is-missing span { color: rgb(255 255 255 / 0.55); font-weight: 400; }

.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl); padding: var(--s-500); }
@media (max-width: 480px) { .form-card { padding: var(--s-300); } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-200); }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: var(--s-75); }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; font-weight: 500; }
.field label .req { color: var(--brand); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: var(--s-100) var(--s-200); min-height: 48px;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.field textarea { min-height: 128px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(127 70 184 / 0.12); }
.field .error { display: none; font-size: 0.75rem; color: var(--err); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err); }
.field.invalid .error { display: flex; align-items: center; gap: var(--s-50); }
.form-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-200); margin-top: var(--s-300); }
.form-foot p { font-size: 0.75rem; color: var(--muted); max-width: 320px; }
.form-status { margin-top: var(--s-200); padding: var(--s-100) var(--s-200); border-radius: var(--r-xl); font-size: 0.875rem; display: none; }
.form-status.ok { display: flex; gap: var(--s-75); background: var(--ok-50); color: var(--ok); }

/* ---------- final CTA ---------- */
.final-cta { text-align: center; padding-block: var(--s-900); }
.final-cta h2 { max-width: 680px; margin-inline: auto; }
.final-cta p { max-width: 560px; margin: var(--s-200) auto 0; }
.final-cta .btn { margin-top: var(--s-400); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: var(--s-600) var(--s-400); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-400); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.footer h4 { font-size: 0.875rem; font-weight: 500; color: var(--muted); margin-bottom: var(--s-100); }
.footer li a { display: inline-block; padding: var(--s-50) 0; font-size: 0.875rem; text-decoration: none; color: var(--ink-2); }
.footer li a:hover { color: var(--brand); }
.footer .about { margin-top: var(--s-200); font-size: 0.875rem; color: var(--muted); max-width: 360px; }
.footer-bottom { margin-top: var(--s-600); padding-top: var(--s-300); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-100); font-size: 0.75rem; color: var(--muted); }
.footer-bottom a { color: inherit; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .2s !important; animation: none !important; }
  .reveal { transform: none; }
  .mobile-panel a.m-link { transform: none; }
  .tagline .w { opacity: 1; }
  .course-card:hover { transform: none; }
}

/* =========================================================
   หน้า course
   ========================================================= */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-75); font-size: 0.875rem; color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--brand); }
.course-hero { padding-top: 144px; padding-bottom: var(--s-600); }
.course-hero-grid { display: grid; grid-template-columns: 1fr 360px; gap: var(--s-600); align-items: start; margin-top: var(--s-400); }
@media (max-width: 940px) { .course-hero-grid { grid-template-columns: 1fr; gap: var(--s-400); } .course-hero { padding-top: 120px; } }
.course-hero .cc-icon { width: 64px; height: 64px; }
.course-hero h1 { margin-top: var(--s-300); }
.course-hero .en { margin-top: var(--s-50); color: var(--muted); }
.course-hero .lead { margin-top: var(--s-300); max-width: 640px; }
.course-hero .actions { display: flex; flex-wrap: wrap; gap: var(--s-100); margin-top: var(--s-400); }

.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: var(--s-300); }
.info-card dl { margin: 0; display: grid; gap: 0; }
.info-card dl > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-100); padding: var(--s-100) 0; border-top: 1px solid var(--line); font-size: 0.875rem; }
.info-card dl > div:first-child { border-top: 0; padding-top: 0; }
.info-card dt { color: var(--muted); }
.info-card dd { margin: 0; font-weight: 500; }
.info-card .progress { margin-top: var(--s-300); padding-top: var(--s-200); border-top: 1px solid var(--line); }

.ctabs { display: flex; gap: var(--s-50); border-bottom: 1px solid var(--line); margin-bottom: var(--s-400); overflow-x: auto; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctab {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: var(--s-100) var(--s-200); font-size: 1rem; font-weight: 500; color: var(--muted);
  box-shadow: inset 0 -2px 0 transparent; transition: color .3s var(--ease), box-shadow .3s var(--ease);
}
.ctab:hover { color: var(--ink); }
.ctab[aria-selected="true"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.cpanel[hidden] { display: none; }

.units { display: grid; gap: var(--s-200); }
.unit {
  display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s-300); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: var(--s-300);
  transition: border-color .3s var(--ease);
}
.unit.done { border-color: rgb(47 107 69 / 0.35); }
.unit-no {
  width: 56px; height: 56px; border-radius: var(--r-xl); display: grid; place-items: center;
  background: var(--paper); font-family: var(--mono); font-size: 1.125rem; color: var(--brand);
}
.unit.done .unit-no { background: var(--ok-50); color: var(--ok); }
.unit h3 { font-size: 1.25rem; line-height: 1.45; font-weight: 600; }
.unit .topics { margin-top: var(--s-50); font-size: 0.875rem; color: var(--ink-2); }
.unit .files { display: flex; flex-wrap: wrap; gap: var(--s-75); margin-top: var(--s-200); }
.file-btn {
  display: inline-flex; align-items: center; gap: var(--s-75); min-height: 40px;
  padding: var(--s-75) var(--s-100); border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--paper); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.file-btn .glyph { width: 20px; height: 20px; color: var(--brand); --glyph-bg: var(--paper); }
.file-btn .glyph svg { stroke-width: 2.4; }
.file-btn:hover { background: #fff; border-color: var(--line-strong); }
.file-btn:active { transform: scale(0.98); }
.file-btn.off { color: var(--muted); background: transparent; border-style: dashed; cursor: not-allowed; }
.file-btn.off .glyph { color: var(--muted); }
.file-btn small { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.check {
  display: inline-flex; align-items: center; gap: var(--s-75); cursor: pointer; user-select: none;
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
  padding: var(--s-75) var(--s-100); border-radius: var(--r-full); border: 1px solid var(--line); min-height: 40px;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.check:hover { border-color: var(--line-strong); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: background-color .3s var(--ease), border-color .3s var(--ease); }
.check .box i { font-size: 0.75rem; color: #fff; opacity: 0; transition: opacity .3s var(--ease); }
.check input:checked + .box { background: var(--ok); border-color: var(--ok); }
.check input:checked + .box i { opacity: 1; }
.check:has(input:checked) { color: var(--ok); background: var(--ok-50); border-color: transparent; }
.check:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 640px) {
  .unit { grid-template-columns: 44px 1fr; gap: var(--s-200); padding: var(--s-200); }
  .unit-no { width: 44px; height: 44px; font-size: 1rem; }
  .unit .check { grid-column: 1 / -1; justify-self: start; }
}

.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); overflow: hidden; }
.tl-row { display: grid; grid-template-columns: 88px 1fr 240px; gap: var(--s-300); padding: var(--s-200) var(--s-300); border-top: 1px solid var(--line); font-size: 0.875rem; align-items: start; }
.tl-row:first-child { border-top: 0; }
.tl-row.head { background: var(--paper); font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.tl-row .wk { font-family: var(--mono); font-size: 0.75rem; color: var(--brand); padding-top: 2px; }
.tl-row.exam { background: var(--gold-50); }
.tl-row.now { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-50); }
.tl-row .media { color: var(--muted); }
@media (max-width: 760px) {
  .tl-row { grid-template-columns: 64px 1fr; gap: var(--s-100) var(--s-200); }
  .tl-row .media { grid-column: 2; }
  .tl-row.head { display: none; }
}

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-300); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid ol { margin: 0; padding-left: var(--s-300); display: grid; gap: var(--s-100); color: var(--ink-2); }

.empty {
  text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-3xl);
  padding: var(--s-800) var(--s-300);
}
.empty .glyph { width: 72px; height: 72px; margin-inline: auto; color: var(--brand); }
.empty h2 { margin-top: var(--s-300); }
.empty p { margin: var(--s-100) auto 0; max-width: 520px; color: var(--ink-2); }
.empty .preview-list { margin: var(--s-400) auto 0; max-width: 520px; display: grid; gap: var(--s-75); text-align: left; }
.empty .preview-list li { display: flex; align-items: center; gap: var(--s-100); padding: var(--s-100) var(--s-200); background: var(--paper); border-radius: var(--r-xl); font-size: 0.875rem; color: var(--ink-2); }
.empty .preview-list .glyph { width: 24px; height: 24px; margin: 0; }
.empty .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s-100); margin-top: var(--s-400); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: var(--s-300); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: var(--r-full); padding: var(--s-75) var(--s-200);
  font-size: 0.875rem; display: flex; align-items: center; gap: var(--s-75); white-space: nowrap;
  transition: opacity .3s var(--ease), transform .5s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* simple pages */
.simple { padding-top: 160px; padding-bottom: var(--s-900); }
.simple .prose { max-width: 720px; }
.simple .prose h2 { margin-top: var(--s-500); }
.simple .prose p, .simple .prose li { margin-top: var(--s-200); color: var(--ink-2); }
.simple .prose ul { list-style: disc; padding-left: var(--s-300); }

/* =========================================================
   รายวิชาแบบจัดกลุ่มตามระดับ + การ์ดแนวนอนพร้อมปก
   ========================================================= */
#course-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-700); }
.level-group[hidden] { display: none; }
.level-head {
  display: flex; align-items: center; gap: var(--s-200);
  padding-bottom: var(--s-300); margin-bottom: var(--s-300); border-bottom: 1px solid var(--line);
}
.level-head > div { flex: 1; min-width: 0; }
.level-head p { font-size: 0.875rem; color: var(--muted); }
.level-tile {
  flex: none; width: 56px; height: 56px; border-radius: var(--r-xl);
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-size: 0.875rem; font-weight: 600;
}
.level-group[data-level="diploma"] .level-tile { background: var(--ink); color: var(--gold); }
@media (max-width: 640px) { .level-head { flex-wrap: wrap; align-items: flex-start; } .level-head > div { flex: 1 1 calc(100% - 72px); } .level-head .badge { margin-left: 72px; } }

.ccard-list { display: grid; gap: var(--s-300); }
.ccard {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl);
  padding: var(--s-75); text-decoration: none; color: inherit;
  transition: transform .5s var(--ease), border-color .3s var(--ease), box-shadow .5s var(--ease);
}
.ccard:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.ccard:active { transform: translateY(-2px); }
.ccard:hover .btn-primary { background: var(--brand-700); }
.ccard:hover .btn i { transform: translateX(3px); }
.ccard-body { padding: var(--s-400); display: flex; flex-direction: column; min-width: 0; }
.ccard-dept { font-size: 0.875rem; font-weight: 500; color: var(--gold-text); }
.ccard-title { margin-top: var(--s-75); }
.ccard-desc { margin-top: var(--s-100); color: var(--ink-2); line-height: 1.75; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-75); margin-top: var(--s-300); }
.chips li { font-size: 0.875rem; padding: var(--s-50) var(--s-100); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); color: var(--ink-2); }
.ccard-foot {
  margin-top: auto; padding-top: var(--s-300); display: flex; align-items: center; justify-content: space-between; gap: var(--s-200); flex-wrap: wrap;
}
.ccard-body > .chips + .ccard-foot, .ccard-body > .ccard-desc + .ccard-foot { margin-top: var(--s-400); border-top: 1px solid var(--line); }
.ccard-progress { display: flex; align-items: center; gap: var(--s-100); }
.ccard-progress > div strong { display: block; font-size: 1rem; font-weight: 600; }
.ccard-progress > div span { display: block; font-size: 0.875rem; color: var(--muted); }
@media (max-width: 900px) {
  .ccard { grid-template-columns: 1fr; }
  .ccard-body { padding: var(--s-300) var(--s-200) var(--s-200); }
}

/* ring */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring b { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; }

/* cover */
.cover {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-2xl); /* 24 - 8 */
  min-height: 300px; color: #fff; background-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23fff' fill-opacity='.14'/%3E%3C/svg%3E");
  padding: var(--s-300);
  display: grid; grid-template-rows: auto 1fr auto; gap: var(--s-200);
}
.cover.lv-diploma { background-color: #2b1f40; }
.cover.lv-diploma .cover-art { color: var(--gold); opacity: .22; }
.cover-art {
  position: absolute; z-index: -1; right: -6%; top: 50%; width: 62%; aspect-ratio: 1;
  transform: translateY(-50%) rotate(-6deg); color: #fff; opacity: .16;
  transition: transform .8s var(--ease), opacity .5s var(--ease);
}
.cover-art svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cover-art svg .accent { stroke: var(--gold); }
.cover-art svg .dot { fill: var(--gold); }
.cover-art svg .fill-bg { fill: transparent; }
.ccard:hover .cover-art { transform: translateY(-50%) rotate(0deg) scale(1.04); opacity: .24; }
.cover-chips { display: flex; flex-wrap: wrap; gap: var(--s-75); align-self: start; }
.cchip {
  font-size: 0.75rem; font-weight: 500; padding: var(--s-25) var(--s-75); border-radius: var(--r-full);
  background: rgb(0 0 0 / 0.22); border: 1px solid rgb(255 255 255 / 0.22); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cchip.mono { font-family: var(--mono); color: var(--gold-50); }
.cover-title {
  align-self: center; max-width: 85%;
  font-size: 1.875rem; line-height: 1.3; font-weight: 600; text-wrap: balance;
}
.cover-title small { display: block; font-size: 0.875rem; font-weight: 500; color: var(--gold); margin-bottom: var(--s-50); }
.cover-count { display: flex; align-items: flex-end; gap: var(--s-100); }
.cover-count b { font-family: var(--mono); font-size: 3rem; line-height: 1; font-weight: 500; color: var(--gold); }
.cover-count span { font-size: 0.75rem; line-height: 1.35; color: rgb(255 255 255 / 0.8); }
.cover-count .soon { font-size: 0.875rem; padding: var(--s-50) var(--s-100); border: 1px dashed rgb(255 255 255 / 0.4); border-radius: var(--r-full); }
/* ปกแบบรูป: คงสัดส่วน 16:9 ให้ข้อความในรูปไม่โดนตัด */
.cover.has-img { padding: 0; display: block; min-height: 0; aspect-ratio: 16 / 9; align-self: center; background: var(--brand-700); }
.cover.has-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: -1; transition: transform .8s var(--ease); }
.ccard:hover .cover.has-img img { transform: scale(1.03); }
.ccard:has(.cover.has-img) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 900px) { .ccard:has(.cover.has-img) { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .cover { min-height: 220px; } .cover-title { font-size: 1.5rem; } }

/* ---------- hero: การ์ดผู้สอน ---------- */
.teacher-board { padding: var(--s-200); display: flex; flex-direction: column; gap: var(--s-200); }
.teacher-board .board-head { padding: var(--s-75) var(--s-75) 0; }
.tb-photo {
  margin: 0; position: relative; border-radius: var(--r-2xl); overflow: hidden; aspect-ratio: 4 / 3.2;
  background: var(--brand-200);
}
.tb-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.tb-card { background: var(--surface); color: var(--ink); border-radius: var(--r-lg); padding: var(--s-200); display: grid; gap: var(--s-200); }
.tb-who { display: grid; gap: var(--s-25); }
.tb-who span { font-size: 0.875rem; color: var(--muted); }
.tb-stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-75); }
.tb-stats div { background: var(--paper); border-radius: var(--r-md); padding: var(--s-75) var(--s-100); }
.tb-stats dt { font-size: 0.75rem; color: var(--muted); }
.tb-stats dd { margin: 0; font-family: var(--mono); font-size: 1.25rem; font-weight: 500; color: var(--brand); }
.tb-mail {
  display: flex; align-items: center; gap: var(--s-75); padding: var(--s-100) var(--s-200); min-height: 44px;
  border-radius: var(--r-md); background: var(--brand); color: #fff; text-decoration: none; font-size: 0.875rem; font-weight: 600;
  transition: background-color .3s var(--ease);
}
.tb-mail:hover { background: var(--brand-700); }
.tb-mail span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 940px) { .tb-photo { aspect-ratio: 4 / 3.6; } }
@media (min-width: 941px) and (max-height: 820px) { .tb-photo { aspect-ratio: 4 / 2.8; } }

/* ช่องทางติดต่อ: รูปผู้สอน */
.contact-person { display: flex; align-items: center; gap: var(--s-200); margin-top: var(--s-400); }
.contact-person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.contact-person strong { display: block; font-size: 1rem; font-weight: 600; }
.contact-person span { display: block; font-size: 0.875rem; color: rgb(255 255 255 / 0.75); }

/* skeleton ระหว่างโหลดรายวิชา */
.sk-card { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s-400); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl); padding: var(--s-75); }
.sk-cover { min-height: 260px; border-radius: var(--r-2xl); background: var(--paper); animation: sk 1.4s var(--ease) infinite alternate; }
.sk-lines { display: grid; align-content: start; gap: var(--s-200); padding: var(--s-400) var(--s-200); }
.sk-lines i { height: 14px; border-radius: var(--r-full); background: var(--paper); animation: sk 1.4s var(--ease) infinite alternate; }
.sk-lines i:nth-child(1) { width: 40%; } .sk-lines i:nth-child(2) { width: 75%; height: 24px; } .sk-lines i:nth-child(3) { width: 92%; } .sk-lines i:nth-child(4) { width: 60%; }
@keyframes sk { from { opacity: 1; } to { opacity: .45; } }
@media (max-width: 900px) { .sk-card { grid-template-columns: 1fr; gap: 0; } .sk-cover { min-height: 200px; } }
@media (prefers-reduced-motion: reduce) { .sk-cover, .sk-lines i { animation: none; } }

/* ---------- KruFon Academy: การ์ดเล็กในการ์ดผู้สอน (hero) ---------- */
.tb-academy {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-100) var(--s-200);
  padding: var(--s-200);
  background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.18); border-radius: var(--r-lg);
}
.tb-academy[hidden] { display: none; }
.tba-text { flex: 999 1 240px; min-width: 0; display: grid; gap: 2px; line-height: 1.4; }
.tba-text small { font-size: 0.75rem; font-weight: 500; color: var(--gold); }
.tba-text strong { font-size: 0.9375rem; font-weight: 600; color: #fff; }
.tba-text span { font-size: 0.75rem; color: rgb(255 255 255 / 0.75); }
.tba-actions { display: flex; align-items: center; gap: var(--s-50); flex: 1 0 auto; }
.tba-actions .tba-main { flex: 1; justify-content: center; }
.tba-main {
  display: inline-flex; align-items: center; gap: var(--s-50); min-height: 40px; padding: 0 var(--s-200);
  border-radius: var(--r-full); background: var(--gold); color: var(--ink); text-decoration: none;
  font-size: 0.875rem; font-weight: 600; white-space: nowrap; transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.tba-main:hover { background: #ffd04f; }
.tba-main:active { transform: scale(0.98); }
.tba-main i { font-size: 1.125rem; }
.tba-icon {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: rgb(255 255 255 / 0.12); color: #fff; text-decoration: none; font-size: 1.125rem;
  transition: background-color .3s var(--ease);
}
.tba-icon:hover { background: rgb(255 255 255 / 0.22); }
