*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #fff;
  color: #1a1a1a;
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  font-weight: 400;
  min-height: 100vh;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  transition: background .3s;
}
nav.scrolled {
  background: rgba(255,255,255,.97);
  box-shadow: 0 1px 0 #f0f0f0;
}
.logo {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: #fff;
  text-decoration: none;
  transition: color .3s, text-shadow .3s;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
nav.scrolled .logo { color: #111; text-shadow: none; }
nav.scrolled .search-btn { color: #333; }
nav.scrolled .hamburger span { background: #111; }
.search-btn {
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
  transition: color .3s, filter .3s;
}
nav.scrolled .search-btn { filter: none; }
.hamburger span {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: background .3s, box-shadow .3s;
}
nav.scrolled .hamburger span { box-shadow: none; }

/* WRAPPER */
.wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}



/* SECTIONS */
.sections {
  padding: 40px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.group-header {
  margin-bottom: 20px;
  padding-top: 36px;
}
.group-title {
  font-family: 'Sarabun', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #111;
}


/* COURSE LINES */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-line { position: relative; }
.course-line {
  font-size: 16px;
  line-height: 1.5;
}

.course-line > a {
  text-decoration: none;
}
.course-line > a:hover .course-link { text-decoration: underline; }

.course-code {
  font-weight: 400;
  color: #222;
}

.course-link {
  font-weight: 400;
  color: #222;
}

.course-line > a:hover .course-code,
.course-line > a:hover .course-link { color: #0078d4; }

/* HERO IMAGE */
.hero-wrap {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,.15) 40%, rgba(0,0,0,.25) 100%);
}

/* HERO CONTENT OVERLAY */
.hero-timestamp {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  z-index: 2;
}
.hero-timestamp .ts-time {
  display: block;
  font-weight: 500;
}
.hero-timestamp .ts-date {
  display: block;
  opacity: .85;
  margin-top: 2px;
}

.hero-content {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 440px;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.hero-content p {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  margin: 0 0 32px 0;
  letter-spacing: 0;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid rgba(255,255,255,.6);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background .25s, border-color .25s;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(2px);
}
.hero-cta:hover {
  background: rgba(255,255,255,.15);
  border-color: #fff;
}
.hero-cta .arrow {
  font-size: 14px;
  transform: rotate(180deg);
  display: inline-block;
}

@media (max-width: 720px) {
  .hero-timestamp {
    left: 20px;
    top: auto;
    bottom: 32px;
    transform: none;
    font-size: 11px;
  }
  .hero-content {
    right: 20px;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    max-width: none;
    text-align: left;
  }
  .hero-content p {
    font-size: 14px;
    margin-bottom: 20px;
  }
  .hero-cta {
    padding: 12px 20px;
    font-size: 11px;
  }
}

/* LATEST DATE */
.date-label {
  font-size: 13px;
  font-weight: 400;
  color: #aaa;
  min-width: 110px;
  flex-shrink: 0;
}
.course-line.has-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  
}
.course-line.has-date:last-child { border-bottom: none; }
.course-line.has-date > a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.has-date-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}
.has-date-meta .date-label::after {
  content: ' ·';
  color: #ddd;
}
.delivery-type {
  font-size: 13px;
  font-weight: 400;
  color: #aaa;
}
.course-line.has-date > a:hover .course-code,
.course-line.has-date > a:hover .course-link { color: #0078d4; }
.footer-full {
  padding: 48px 0 32px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-top: 48px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
}

.footer-left-col { display: flex; flex-direction: column; gap: 12px; }
.footer-right-col { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.footer-brand-name {
  font-weight: 500;
  color: #333;
  margin-top: 8px;
}
.footer-brand-desc {
  font-weight: 400;
  color: #888;
  line-height: 1.7;
  max-width: 240px;
  margin: 4px 0 8px;
}
.footer-brand-addr {
  font-weight: 400;
  color: #999;
  line-height: 1.7;
  max-width: 260px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 4px;
}
.footer-social { display: flex; gap: 16px; align-items: center; }
.footer-social a { color: #bbb; transition: color .15s; display: flex; }
.footer-social a:hover { color: #555; }
.footer-contact { display: flex; flex-direction: column; gap: 6px; }
.footer-contact a { font-weight: 400; color: #777; text-decoration: none; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.footer-contact a:hover { color: #333; }
.footer-copy { color: #bbb; font-weight: 400; }

/* MEDIUM ARTICLES */
.article-list { display: flex; flex-direction: column; }
.article-card {
  display: block;
  padding: 14px 0;
  
  text-decoration: none;
  color: inherit;
}
.article-card:last-child { border-bottom: none; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.article-tag { font-size: 11px; font-weight: 500; color: #0078d4; letter-spacing: .04em; }
.article-dot { font-size: 11px; color: #ddd; }
.article-date, .article-read { font-size: 11px; color: #bbb; font-weight: 400; }
.article-title { font-family: 'Sarabun', sans-serif; font-size: 16px; font-weight: 400; color: #222; line-height: 1.5; }
.article-card:hover .article-title { color: #0078d4; }

/* YOUTUBE VIDEOS */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.video-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}
.video-thumb-bg {
  position: absolute;
  inset: 0;
}
.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.3);
  transition: background .2s;
}
.video-card:hover .video-play { background: rgba(0,0,0,.5); }
.video-play svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  background: rgba(0,0,0,.6);
  padding: 2px 6px;
  border-radius: 4px;
}
.video-thumb-label {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  background: rgba(0,120,212,.8);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.video-title {
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #222;
  line-height: 1.5;
}
.video-card:hover .video-title { color: #0078d4; }
.video-meta {
  font-size: 11px;
  font-weight: 400;
  color: #bbb;
  margin-top: 2px;
}

/* SEARCH */
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.search-btn:hover { color: #0078d4; }

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.96);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }

.search-box {
  width: 100%;
  max-width: 560px;
  padding: 0 24px;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1.5px solid #111;
  padding-bottom: 8px;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 20px;
  font-weight: 400;
  color: #111;
  background: transparent;
}
.search-input::placeholder { color: #ccc; }
.search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 20px;
  padding: 0;
  line-height: 1;
  transition: color .15s;
}
.search-close:hover { color: #111; }
.search-results {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.search-result-item {
  display: block;
  padding: 12px 0;
  
  text-decoration: none;
  color: #111;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover .search-result-name { color: #0078d4; }
.search-result-code {
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
  margin-bottom: 2px;
}
.search-result-name {
  font-size: 14px;
  font-weight: 400;
  color: #111;
  transition: color .15s;
}
.search-empty {
  font-size: 14px;
  font-weight: 400;
  color: #aaa;
  margin-top: 8px;
}

/* HAMBURGER */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 200;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px 0;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: none;
  flex-direction: column;
  z-index: 100;
}
.nav-menu.open { display: flex; }
.nav-menu a {
  font-size: 14px;
  font-weight: 400;
  color: #333;
  text-decoration: none;
  padding: 10px 20px;
  transition: background .15s;
}
.nav-menu a:hover { background: #f7f9fc; color: #0078d4; }

/* CHATBOX */
.chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  background: #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 100;
  border: none;
  transition: background .2s;
}
.chat-btn:hover { background: #333; }

.chat-window {
  position: fixed;
  bottom: 88px;
  right: 28px;
  width: 300px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}
.chat-window.open { display: flex; }

.chat-header {
  padding: 14px 16px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-header-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

.chat-messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
  max-height: 240px;
  overflow-y: auto;
  background: #fafafa;
}

.chat-msg {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  max-width: 85%;
}
.chat-msg.bot {
  background: #fff;
  border: 1px solid #e8e8e8;
  color: #333;
  align-self: flex-start;
}
.chat-msg.user {
  background: #111;
  color: #fff;
  align-self: flex-end;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
}
.chat-input {
  flex: 1;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  color: #222;
}
.chat-input:focus { border-color: #bbb; }
.chat-send {
  background: #111;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.chat-send:hover { background: #333; }

/* MOBILE */
@media (max-width: 600px) {
  nav { padding: 0 20px; }

  .wrapper { padding: 0 30px; }

  .sections { padding: 28px 0 48px; gap: 28px; }

  .group-header { margin-bottom: 12px; }

  .course-line { padding: 10px 0; }



  /* Hero image */
  .hero-wrap { height: 100vh; min-height: 480px; }

  /* Video grid — 1 column on mobile */
  .video-grid { grid-template-columns: 1fr; gap: 20px; }

  /* Footer — stack vertically */
  .footer-full {
    flex-direction: column;
    gap: 24px;
    padding: 36px 0 24px;
  }
  .footer-right-col { align-items: flex-start; }
  .footer-contact a { justify-content: flex-start; }
  .footer-brand-desc,
  .footer-brand-addr { max-width: 100%; }

  /* Chatbox */
  .chat-window { width: calc(100vw - 40px); right: 20px; }

  /* Search overlay */
  .search-overlay { padding-top: 60px; }
  .search-input { font-size: 16px; }
}
