/* ==========================================================================
   KCTC Royal Theme — สีม่วงกษัตรา + ทองราชพฤกษ์
   ใช้ร่วมกับ style.css (โหลดต่อท้าย)
   ========================================================================== */

:root {
  /* ม่วงกษัตรา (Royal Purple) */
  --royal-950: #1c0634;
  --royal-900: #2a0a4e;
  --royal-800: #3a0f6b;
  --royal-700: #4b1a8a;
  --royal-600: #5e2ba6;
  --royal-500: #7646c2;
  --royal-300: #b9a2e3;
  --royal-200: #d9cdf1;
  --royal-100: #efe8fa;
  --royal-50: #f8f5fd;

  /* ทองราชพฤกษ์ (Golden Shower Gold) */
  --gold-600: #c99400;
  --gold-500: #e9b10a;
  --gold-400: #f5c842;
  --gold-100: #fff6d6;

  --ink: #23173a;
  --ink-soft: #5d5470;
  --line: #e7e1f2;
  --surface: #ffffff;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(42, 10, 78, .06);
  --shadow: 0 10px 30px rgba(42, 10, 78, .10);
  --shadow-lg: 0 24px 60px rgba(42, 10, 78, .18);

  --grad-royal: linear-gradient(135deg, var(--royal-900) 0%, var(--royal-700) 55%, var(--royal-500) 100%);
  --grad-gold: linear-gradient(135deg, var(--gold-400), var(--gold-500));
}

body {
  color: var(--ink);
}

::selection {
  background: var(--royal-200);
  color: var(--royal-900);
}

a {
  color: var(--royal-700);
}

:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 2px;
}

/* ---------- Navbar ---------- */
.navbar-modern {
  background: var(--grad-royal) !important;
  box-shadow: 0 6px 24px rgba(28, 6, 52, .25);
}

.navbar-modern::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--grad-gold);
}

.navtop {
  background: var(--royal-50) !important;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1199.98px) {
  .navbar-modern .navbar-collapse {
    background: linear-gradient(160deg, rgba(42, 10, 78, .98), rgba(75, 26, 138, .98)) !important;
  }
}

.kc-apply-nav {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--grad-gold);
  color: var(--royal-950) !important;
  font-weight: 600;
  border-radius: 999px;
  padding: .55rem 1.1rem !important;
  box-shadow: 0 6px 18px rgba(233, 177, 10, .35);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}

.kc-apply-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(233, 177, 10, .45);
  color: var(--royal-950) !important;
}

/* ---------- Buttons (override เดิม) ---------- */
.btn-apply,
.btn-outline-brand {
  background: var(--royal-700);
  border-color: var(--royal-700);
  color: #fff;
}

.btn-apply:hover,
.btn-outline-brand:hover {
  background: var(--royal-600);
  border-color: var(--royal-600);
  color: #fff;
}

.kc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 999px;
  padding: .7rem 1.4rem;
  font-weight: 500;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all .2s ease;
  cursor: pointer;
  line-height: 1.2;
}

.kc-btn-gold {
  background: var(--grad-gold);
  color: var(--royal-950);
}

.kc-btn-gold:hover {
  color: var(--royal-950);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(233, 177, 10, .4);
}

.kc-btn-royal {
  background: var(--royal-700);
  color: #fff;
}

.kc-btn-royal:hover {
  background: var(--royal-600);
  color: #fff;
}

.kc-btn-ghost {
  background: transparent;
  color: var(--royal-700);
  border-color: var(--royal-200);
}

.kc-btn-ghost:hover {
  background: var(--royal-50);
  border-color: var(--royal-500);
  color: var(--royal-800);
}

.kc-btn-ghost-light {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}

.kc-btn-ghost-light:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

/* ---------- Section header ---------- */
.kc-section {
  padding: 72px 0;
  position: relative;
}

.kc-section-tint {
  background: var(--royal-50);
}

.kc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.kc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--gold-600);
  text-transform: uppercase;
  margin-bottom: .35rem;
}

.kc-eyebrow::before {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad-gold);
}

.kc-title {
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  color: var(--royal-900);
  margin: 0;
  line-height: 1.25;
}

.kc-subtitle {
  color: var(--ink-soft);
  margin: .35rem 0 0;
  font-size: 1rem;
  font-weight: 300;
}

.kc-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 500;
  color: var(--royal-700);
  text-decoration: none;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--royal-200);
  background: #fff;
  font-size: .95rem;
  transition: all .2s ease;
}

.kc-more:hover {
  background: var(--royal-700);
  border-color: var(--royal-700);
  color: #fff;
}

.kc-more i {
  transition: transform .2s ease;
}

.kc-more:hover i {
  transform: translateX(3px);
}

/* ---------- Hero ---------- */
.kc-hero {
  position: relative;
  background: var(--royal-950);
}

.kc-hero .carousel-item img {
  width: 100%;
  max-height: 640px;
  object-fit: cover;
}

.kc-hero .carousel-indicators {
  margin-bottom: 4.5rem;
}

.kc-hero .carousel-indicators [data-bs-target] {
  width: 26px;
  height: 5px;
  border-radius: 5px;
  border: 0;
  background: #fff;
  opacity: .5;
}

.kc-hero .carousel-indicators .active {
  background: var(--gold-400);
  opacity: 1;
  width: 40px;
}

.kc-hero .carousel-control-prev,
.kc-hero .carousel-control-next {
  width: 56px;
  opacity: 0;
  transition: opacity .2s ease;
}

.kc-hero:hover .carousel-control-prev,
.kc-hero:hover .carousel-control-next {
  opacity: .9;
}

.kc-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(to top, rgba(28, 6, 52, .55), transparent);
  pointer-events: none;
  z-index: 1;
}

/* ---------- Quick access bar ---------- */
.kc-quick-wrap {
  position: relative;
  z-index: 5;
  margin-top: -36px;
}

.kc-quick {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
}

.kc-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .55rem;
  padding: 16px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.3;
  transition: background .2s ease, transform .2s ease;
}

.kc-quick-item:hover {
  background: var(--royal-50);
  color: var(--royal-800);
  transform: translateY(-3px);
}

.kc-quick-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: var(--royal-100);
  color: var(--royal-700);
  transition: all .2s ease;
}

.kc-quick-item:hover .kc-quick-icon {
  background: var(--royal-700);
  color: #fff;
}

.kc-quick-item.is-primary {
  background: var(--grad-royal);
  color: #fff;
}

.kc-quick-item.is-primary .kc-quick-icon {
  background: var(--grad-gold);
  color: var(--royal-950);
}

.kc-quick-item.is-primary:hover {
  color: #fff;
  box-shadow: var(--shadow);
}

.kc-quick-item small {
  display: block;
  font-weight: 300;
  font-size: .78rem;
  opacity: .8;
}

@media (max-width: 991.98px) {
  .kc-quick {
    grid-template-columns: repeat(3, 1fr);
  }

  .kc-quick-wrap {
    margin-top: -32px;
  }
}

@media (max-width: 575.98px) {
  .kc-quick {
    grid-template-columns: repeat(3, 1fr);
    padding: 10px;
    gap: 4px;
  }

  .kc-quick-item {
    padding: 12px 4px;
    font-size: .82rem;
  }

  .kc-quick-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .kc-quick-wrap {
    margin-top: 16px;
  }

  .kc-hero .carousel-indicators {
    margin-bottom: 1rem;
  }

  .kc-section {
    padding: 48px 0;
  }
}

/* ---------- Philosophy strip ---------- */
.kc-motto {
  text-align: center;
  padding: 36px 0 0;
  color: var(--ink-soft);
  font-weight: 300;
}

.kc-motto strong {
  color: var(--royal-800);
  font-weight: 600;
}

/* ---------- News card ---------- */
.kc-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}

.kc-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--royal-200);
}

.kc-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--royal-100);
  overflow: hidden;
}

.kc-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.kc-card:hover .kc-card-media img {
  transform: scale(1.05);
}

.kc-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(42, 10, 78, .85);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  padding: .3rem .7rem;
  border-radius: 999px;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-chip-inline {
  position: static;
  display: inline-block;
  background: var(--royal-100);
  color: var(--royal-700);
  backdrop-filter: none;
}

.kc-card-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.kc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .8rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.kc-meta i {
  color: var(--royal-500);
  margin-right: 4px;
}

.kc-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kc-card-title a {
  color: var(--royal-900);
  text-decoration: none;
}

.kc-card-title a:hover {
  color: var(--royal-600);
}

.kc-card-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kc-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 500;
  padding: .25rem .6rem;
  border-radius: 999px;
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition: all .2s ease;
}

.kc-tag-pdf {
  background: #fdecee;
  color: #b4232f;
}

.kc-tag-pdf:hover {
  background: #b4232f;
  color: #fff;
}

.kc-tag-fb {
  background: #e8f0fe;
  color: #1659c7;
}

.kc-tag-fb:hover {
  background: #1659c7;
  color: #fff;
}

/* ---------- Share button ---------- */
.kc-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--royal-200);
  background: #fff;
  color: var(--royal-700);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  padding: .3rem .8rem;
  cursor: pointer;
  position: relative;
  z-index: 3;
  transition: all .2s ease;
  white-space: nowrap;
}

.kc-share-btn:hover {
  background: var(--royal-700);
  border-color: var(--royal-700);
  color: #fff;
}

.kc-share-btn.is-float {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border: 0;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
}

.kc-share-btn.is-float:hover {
  background: var(--royal-700);
}

/* ---------- List item (student / job / procurement) ---------- */
.kc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kc-list-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: all .2s ease;
  position: relative;
  align-items: flex-start;
}

.kc-list-item:hover {
  border-color: var(--royal-300);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.kc-list-thumb {
  flex: 0 0 112px;
  width: 112px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--royal-100);
  display: block;
}

.kc-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kc-list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kc-list-title {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kc-list-title a {
  color: var(--royal-900);
  text-decoration: none;
}

.kc-list-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kc-list-title a:hover {
  color: var(--royal-600);
}

.kc-list-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

@media (max-width: 575.98px) {
  .kc-list-thumb {
    flex-basis: 88px;
    width: 88px;
    height: 70px;
  }
}

.kc-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--line);
  height: 100%;
}

.kc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 18px;
}

.kc-panel-title {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--royal-900);
  margin: 0;
}

.kc-panel-title .kc-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--royal-100);
  color: var(--royal-700);
  font-size: 1rem;
}

/* ---------- Admission CTA band ---------- */
.kc-cta {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--grad-royal);
  color: #fff;
  padding: 44px 48px;
  box-shadow: var(--shadow-lg);
}

.kc-cta::before,
.kc-cta::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.kc-cta::before {
  width: 360px;
  height: 360px;
  right: -80px;
  top: -140px;
  background: radial-gradient(circle, rgba(245, 200, 66, .35), transparent 70%);
}

.kc-cta::after {
  width: 280px;
  height: 280px;
  left: -100px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(185, 162, 227, .35), transparent 70%);
}

.kc-cta>* {
  position: relative;
  z-index: 1;
}

.kc-cta h2 {
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: .3rem 0 .5rem;
}

.kc-cta p {
  color: rgba(255, 255, 255, .8);
  font-weight: 300;
  margin: 0;
}

.kc-cta .kc-eyebrow {
  color: var(--gold-400);
}

.kc-cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kc-cta-points {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: .9rem;
  color: rgba(255, 255, 255, .85);
}

.kc-cta-points i {
  color: var(--gold-400);
  margin-right: 6px;
}

@media (max-width: 767.98px) {
  .kc-cta {
    padding: 32px 24px;
    text-align: center;
  }

  .kc-cta-actions {
    justify-content: center;
    margin-top: 20px;
  }

  .kc-cta-points {
    justify-content: center;
  }
}

/* ---------- e-Service hub ---------- */
.kc-tabs {
  display: inline-flex;
  gap: 6px;
  background: #fff;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.kc-tabs .nav-link {
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 500;
  padding: .55rem 1.2rem;
  border: 0;
  background: transparent;
  font-size: .95rem;
}

.kc-tabs .nav-link.active {
  background: var(--royal-700);
  color: #fff;
  box-shadow: 0 6px 16px rgba(75, 26, 138, .3);
}

.kc-tabs .nav-link:not(.active):hover {
  color: var(--royal-700);
  background: var(--royal-50);
}

.kc-services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.kc-service {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: all .2s ease;
  min-height: 76px;
}

.kc-service:hover {
  border-color: var(--royal-300);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--royal-800);
}

.kc-service-icon {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--royal-100);
  color: var(--royal-700);
  font-size: 1.15rem;
  transition: all .2s ease;
}

.kc-service:hover .kc-service-icon {
  background: var(--royal-700);
  color: #fff;
}

.kc-service-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.kc-service-text strong {
  display: block;
  font-weight: 500;
  font-size: .95rem;
}

.kc-service-text small {
  display: block;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-service-go {
  color: var(--royal-300);
  transition: all .2s ease;
}

.kc-service:hover .kc-service-go {
  color: var(--royal-700);
  transform: translateX(3px);
}

.kc-service.is-featured {
  background: var(--grad-royal);
  color: #fff;
  border-color: transparent;
}

.kc-service.is-featured .kc-service-icon {
  background: var(--grad-gold);
  color: var(--royal-950);
}

.kc-service.is-featured small,
.kc-service.is-featured .kc-service-go {
  color: rgba(255, 255, 255, .75);
}

.kc-service.is-featured:hover {
  color: #fff;
}

@media (max-width: 575.98px) {
  .kc-services {
    grid-template-columns: 1fr;
  }
}

.kc-calendar {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.kc-calendar-head {
  padding: 16px 20px;
  background: var(--grad-royal);
  color: #fff;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 500;
}

.kc-calendar-head i {
  color: var(--gold-400);
}

.kc-calendar iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}

/* ---------- Honors (reward tiles) ---------- */
.kc-honor {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--royal-100);
  box-shadow: var(--shadow-sm);
}

.kc-honor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.kc-honor:hover img {
  transform: scale(1.05);
}

.kc-honor-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 14px 12px;
  background: linear-gradient(to top, rgba(28, 6, 52, .9), transparent);
  color: #fff;
  font-size: .85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: all .25s ease;
}

.kc-honor:hover .kc-honor-cap,
.kc-honor:focus-visible .kc-honor-cap {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .kc-honor-cap {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Stats band ---------- */
.kc-stats {
  background: var(--grad-royal);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.kc-stats::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.kc-stats .kc-title {
  color: #fff;
}

.kc-stats .kc-subtitle {
  color: rgba(255, 255, 255, .7);
}

.kc-stats .kc-eyebrow {
  color: var(--gold-400);
}

.kc-stat {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background .2s ease, transform .2s ease;
  backdrop-filter: blur(4px);
}

.kc-stat:hover {
  background: rgba(255, 255, 255, .12);
  transform: translateY(-3px);
}

.kc-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(245, 200, 66, .15);
  color: var(--gold-400);
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.kc-stat-num {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kc-stat-label {
  color: rgba(255, 255, 255, .75);
  font-size: .9rem;
  font-weight: 300;
  margin-top: 4px;
}

.kc-stat-link {
  margin-top: auto;
  padding-top: 12px;
  font-size: .82rem;
  color: var(--gold-400);
  text-decoration: none;
  font-weight: 500;
}

.kc-stat-link:hover {
  color: #fff;
}

/* ---------- Owl overrides ---------- */
.kc-owl .owl-stage {
  display: flex !important;
}

.kc-owl .owl-item {
  display: flex;
  flex: 0 0 auto !important;
}

.kc-owl .owl-item>.item {
  width: 100%;
  padding: 8px 0 14px;
}

.kc-owl.owl-theme .owl-dots .owl-dot span {
  width: 9px;
  height: 9px;
  background: var(--royal-200);
  transition: all .2s ease;
}

.kc-owl.owl-theme .owl-dots .owl-dot.active span,
.kc-owl.owl-theme .owl-dots .owl-dot:hover span {
  background: var(--royal-700);
  width: 26px;
}

.kc-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* ---------- Floating apply tab ---------- */
.kc-float-apply {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1030;
  writing-mode: vertical-rl;
  background: var(--grad-gold);
  color: var(--royal-950);
  font-weight: 600;
  padding: 18px 10px;
  border-radius: 14px 0 0 14px;
  text-decoration: none;
  box-shadow: -6px 6px 20px rgba(28, 6, 52, .2);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .03em;
  transition: padding .2s ease;
}

.kc-float-apply i {
  writing-mode: horizontal-tb;
}

.kc-float-apply:hover {
  padding-right: 16px;
  color: var(--royal-950);
}

@media (max-width: 575.98px) {
  .kc-float-apply {
    padding: 12px 7px;
    font-size: .85rem;
  }
}

/* ---------- Footer ---------- */
footer {
  background: linear-gradient(180deg, var(--royal-900), var(--royal-950)) !important;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-gold);
}

/* ==========================================================================
   Dialogs: Viewer + Share
   ========================================================================== */
.kc-modal .modal-content {
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.kc-modal .modal-header {
  background: var(--grad-royal);
  color: #fff;
  border: 0;
  padding: 14px 18px;
  gap: 12px;
}

.kc-modal .modal-title {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  min-width: 0;
}

.kc-modal .modal-title small {
  display: block;
  font-weight: 300;
  font-size: .78rem;
  opacity: .75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-modal .modal-title span {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kc-modal-tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.kc-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 0;
  text-decoration: none;
  transition: background .2s ease;
  cursor: pointer;
}

.kc-icon-btn:hover {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

.kc-icon-btn.is-close:hover {
  background: var(--gold-500);
  color: var(--royal-950);
}

#kcViewer .modal-body {
  padding: 0;
  background: var(--royal-50);
  position: relative;
  height: min(80vh, 900px);
}

@media (max-width: 767.98px) {
  #kcViewer .modal-body {
    height: auto;
    flex: 1;
  }
}

#kcViewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

#kcViewer .kc-viewer-img {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--royal-950);
  padding: 12px;
}

#kcViewer .kc-viewer-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.kc-viewer-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--royal-50);
  z-index: 2;
  color: var(--royal-700);
  gap: 10px;
  text-align: center;
}

.kc-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--royal-200);
  border-top-color: var(--royal-700);
  animation: kcSpin .8s linear infinite;
  margin: 0 auto 8px;
}

@keyframes kcSpin {
  to {
    transform: rotate(360deg);
  }
}

.kc-viewer-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(28, 6, 52, .9);
  color: #fff;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  max-width: calc(100% - 24px);
}

.kc-viewer-hint button {
  border: 0;
  background: var(--gold-400);
  color: var(--royal-950);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 500;
  white-space: nowrap;
}

.kc-viewer-hint .kc-hint-x {
  background: transparent;
  color: #fff;
  padding: 4px 8px;
}

.kc-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  text-align: center;
}

.kc-fallback-card {
  max-width: 460px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.kc-fallback-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--royal-100);
}

.kc-fallback-icon img {
  width: 36px;
  height: 36px;
}

.kc-fallback h5 {
  color: var(--royal-900);
  font-weight: 600;
  margin-bottom: 6px;
}

.kc-fallback .kc-host {
  display: inline-block;
  font-size: .85rem;
  color: var(--royal-700);
  background: var(--royal-50);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 12px;
  word-break: break-all;
}

.kc-fallback p {
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 300;
}

/* Share dialog */
#kcShare .modal-body {
  padding: 22px;
}

.kc-share-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--royal-50);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.kc-share-preview img {
  width: 84px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--royal-100);
}

.kc-share-preview strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
  font-size: .95rem;
  color: var(--royal-900);
  line-height: 1.4;
}

.kc-share-preview small {
  color: var(--ink-soft);
  font-size: .75rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.kc-share-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: var(--radius);
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s ease;
}

.kc-share-opt:hover {
  background: var(--royal-50);
}

.kc-share-opt .ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  transition: transform .2s ease;
}

.kc-share-opt:hover .ico {
  transform: scale(1.08);
}

.ico.fb { background: #1877f2; }
.ico.ms { background: linear-gradient(45deg, #0a7cff, #a033ff 60%, #ff5c87); }
.ico.line { background: #06c755; }
.ico.x { background: #0f0f0f; }
.ico.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.ico.tt { background: #010101; box-shadow: inset -2px 0 0 #fe2c55, inset 2px 0 0 #25f4ee; }
.ico.mail { background: var(--royal-600); }
.ico.more { background: var(--gold-500); color: var(--royal-950); }

.kc-share-link {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.kc-share-link input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px !important;
  padding: 10px 16px !important;
  font-size: .85rem !important;
  background: var(--royal-50);
  color: var(--ink-soft);
}

.kc-share-qr {
  display: none;
  margin-top: 16px;
  text-align: center;
}

.kc-share-qr.show {
  display: block;
}

.kc-share-qr #kcQr {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.kc-share-note {
  font-size: .78rem;
  color: var(--ink-soft);
  margin-top: 12px;
  text-align: center;
  font-weight: 300;
}

@media (max-width: 400px) {
  .kc-share-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .kc-share-opt .ico {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }
}

/* Toast */
.kc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--royal-950);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: .9rem;
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  text-align: center;
}

.kc-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.kc-toast i {
  color: var(--gold-400);
  margin-right: 8px;
}

/* ==========================================================================
   Embed mode (หน้าเว็บที่แสดงภายใน Dialog)
   ========================================================================== */
body.kc-embed .navtop,
body.kc-embed .navbar-modern,
body.kc-embed footer,
body.kc-embed .black-ribbon,
body.kc-embed .kc-float-apply,
body.kc-embed .chatbot-toggler,
body.kc-embed .chatbot-container,
body.kc-embed .back-to-top,
body.kc-embed #cookieConsentBanner,
body.kc-embed #myModal {
  display: none !important;
}

body.kc-embed {
  background: #fff;
}

/* ==========================================================================
   News detail page
   ========================================================================== */
.kc-article {
  max-width: 920px;
  margin: 0 auto;
}

.kc-article-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--royal-900);
  line-height: 1.4;
  margin: 12px 0 14px;
}

.kc-article-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--royal-100);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.kc-article-cover img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: var(--royal-950);
  display: block;
}

.kc-share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--royal-50);
  border: 1px solid var(--line);
  margin: 18px 0;
}

.kc-share-bar>span {
  font-weight: 500;
  color: var(--royal-800);
  margin-right: 4px;
  font-size: .95rem;
}

.kc-share-bar .ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: transform .2s ease;
  font-size: 1.05rem;
}

.kc-share-bar .ico:hover {
  transform: translateY(-2px);
}

.kc-embed-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 20px;
}

.kc-embed-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--royal-50);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  color: var(--royal-800);
  font-size: .95rem;
  gap: 8px;
}

.kc-embed-frame iframe {
  width: 100%;
  border: 0;
  display: block;
}

/* list item ในกริด ให้สูงเท่ากัน */
.row>[class*="col"]>.kc-list-item {
  height: 100%;
}

/* ==========================================================================
   Navbar 2 แถว: (1) โลโก้ + ชื่อสถานศึกษา + ปุ่มสมัครเรียน  (2) เมนูนำทาง
   ========================================================================== */
.navbar-modern.kc-navbar {
  display: block;
  height: auto !important;
  min-height: 0;
  padding: 0;
}

.kc-nav-container {
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 1200px) {
  .kc-nav-container {
    max-width: 1680px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

.kc-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap !important;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  transition: padding .25s ease;
}

/* ----- Brand ----- */
.navbar-modern .kc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.navbar-modern .kc-brand .kc-brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 2px rgba(245, 200, 66, .6), 0 6px 16px rgba(0, 0, 0, .25);
  transition: width .25s ease, height .25s ease;
}

.kc-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .25);
}

.kc-brand-th {
  display: flex;
  flex-direction: column;
  color: #fff;
}

.kc-brand-th-1 {
  font-size: .82rem;
  font-weight: 400;
  color: rgba(255, 255, 255, .85);
}

.kc-brand-th-2 {
  font-size: 1.12rem;
  font-weight: 600;
  color: #fff;
}

.kc-brand-en {
  font-size: .68rem;
  font-weight: 300;
  color: var(--gold-400);
  letter-spacing: .03em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* เดสก์ท็อป: ชื่อเต็มบรรทัดเดียว (แถวนี้มีพื้นที่เต็ม) */
@media (min-width: 1200px) {
  .navbar-modern .kc-brand .kc-brand-logo {
    width: 62px;
    height: 62px;
  }

  .kc-brand-th {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .kc-brand-th-1,
  .kc-brand-th-2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
  }

  .kc-brand-en {
    font-size: .8rem;
  }
}

/* ----- Actions (แถวบน ขวา) ----- */
.kc-nav-actions {
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.kc-nav-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
  font-size: .95rem;
  white-space: nowrap;
}

.kc-nav-contact i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  color: var(--gold-400);
  font-size: .85rem;
}

.kc-nav-contact:hover {
  color: #fff;
}

/* ----- แถวเมนู ----- */
.kc-nav-bottom {
  background: rgba(28, 6, 52, .35);
  border-top: 1px solid rgba(255, 255, 255, .1);
}

@media (min-width: 1200px) {
  .kc-nav-bottom .navbar-collapse {
    display: flex !important;
  }

  /* เมนูมากเกินพื้นที่ให้ขึ้นบรรทัดใหม่ ไม่ล้นกรอบ */
  .kc-nav-list {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 4px;
    padding: 6px 0;
  }

  .kc-nav-list>.nav-item {
    margin: 0 !important;
  }

  .kc-nav-list .nav-link {
    white-space: nowrap;
    padding: .5rem .85rem !important;
    font-size: .98rem;
  }

  .kc-nav-list .nav-link.btn-lg {
    font-size: .95rem;
    padding: .4rem 1rem !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
  }

  .kc-nav-list .nav-link.btn-lg:hover {
    background: rgba(255, 255, 255, .22);
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .kc-nav-list .nav-link {
    font-size: .92rem;
    padding: .5rem .6rem !important;
  }
}

/* มือถือ: แถวเมนูคือพื้นที่ collapse */
@media (max-width: 1199.98px) {
  .kc-nav-bottom {
    background: transparent;
    border-top: 0;
  }

  .kc-nav-bottom .navbar-collapse {
    margin-top: 0 !important;
    margin-bottom: 12px;
  }

  /* เว้นที่ให้ริบบิ้นไว้อาลัย (มุมซ้ายบน) ไม่ทับโลโก้ — ลบได้เมื่อเอาริบบิ้นออก */
  .kc-nav-top {
    padding-left: 52px;
  }
}

@media (max-width: 400px) {
  .navbar-modern .kc-brand .kc-brand-logo {
    width: 44px;
    height: 44px;
  }

  .kc-brand-text {
    padding-left: 10px;
  }

  .kc-brand-th-1 {
    font-size: .75rem;
  }

  .kc-brand-th-2 {
    font-size: 1rem;
  }

  .kc-brand-en {
    display: none;
  }
}

/* ย่อแถวชื่อเมื่อเลื่อนหน้าลง (ประหยัดพื้นที่ sticky) */
@media (min-width: 1200px) {
  .kc-navbar.is-scrolled .kc-nav-top {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .kc-navbar.is-scrolled .kc-brand .kc-brand-logo {
    width: 44px;
    height: 44px;
  }

  .kc-navbar.is-scrolled .kc-brand-en {
    display: none;
  }

  .kc-navbar.is-scrolled .kc-brand-th-1,
  .kc-navbar.is-scrolled .kc-brand-th-2 {
    font-size: 1.15rem;
  }
}

/* ริบบิ้นไว้อาลัยกว้าง 100px บนเดสก์ท็อป: เว้นที่เมื่อโลโก้อยู่ชิดขอบซ้าย */
@media (min-width: 1200px) and (max-width: 1899.98px) {
  .kc-nav-top {
    padding-left: 84px;
  }
}
