/* หน้าแรก — สไตล์เฉพาะส่วนต่าง ๆ ของหน้าแรก (สีและตัวแปรกลางอยู่ใน site.css) */

/* ---------- Hero ---------- */
.hero { padding: 20px 0 8px; }
.hero-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--tint); }
.hero-frame img { aspect-ratio: 1920 / 476; object-fit: cover; height: auto; }
.hero .carousel-indicators { margin-bottom: 14px; gap: 6px; }
.hero .carousel-indicators [data-bs-target] {
  width: 10px; height: 10px; border-radius: 999px; border: 0; margin: 0;
  background: var(--navy); opacity: .3; transition: width .3s, opacity .3s;
}
.hero .carousel-indicators .active { width: 28px; opacity: 1; background: var(--navy); }
.hero .carousel-control-prev, .hero .carousel-control-next { width: 72px; opacity: 0; transition: opacity .25s; }
.hero-frame:hover .carousel-control-prev, .hero-frame:hover .carousel-control-next,
.hero .carousel-control-prev:focus-visible, .hero .carousel-control-next:focus-visible { opacity: 1; }
.hero-ctrl {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--navy); box-shadow: var(--shadow);
}
@media (max-width: 767.98px) {
  .hero { padding: 12px 0 0; }
  .hero-frame { border-radius: var(--radius-sm); }
  .hero .carousel-indicators { margin-bottom: 6px; }
  .hero .carousel-indicators [data-bs-target] { width: 7px; height: 7px; }
  .hero .carousel-indicators .active { width: 18px; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-tint { background: var(--tint); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-strong);
}
.section-head .eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--brand); }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); margin: 4px 0 0; font-weight: 500; }
.link-more { font-weight: 500; color: var(--navy); display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--brand-soft); transition: background .2s, gap .2s; }
.link-more:hover { background: var(--brand); color: var(--navy-deep); gap: 12px; }
@media (max-width: 767.98px) { .section { padding: 48px 0; } .section-head { margin-bottom: 22px; } }

/* ---------- Tiles (สารสนเทศ / หลักสูตร) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 991.98px) { .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 479.98px) { .tile-grid { grid-template-columns: 1fr; } }
.tile {
  display: block; position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--navy); box-shadow: var(--shadow); aspect-ratio: 612 / 200;
  transition: transform .25s ease, box-shadow .25s ease;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 0 var(--brand); transition: box-shadow .25s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile:hover img { transform: scale(1.05); }
.tile:hover::after, .tile:focus-visible::after { box-shadow: inset 0 0 0 3px var(--brand); }
.tile-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px;
  background: radial-gradient(120% 120% at 0% 0%, #3a3790 0%, var(--navy) 50%, var(--navy-deep) 100%);
  font-family: var(--font-head); font-size: clamp(1.05rem, .9rem + .6vw, 1.45rem); color: var(--brand);
}

/* ---------- Stats ---------- */
.stats {
  background: linear-gradient(120deg, var(--navy-deep), var(--navy) 60%, #2f2c7a);
  color: #fff; padding: 44px 0; position: relative; overflow: hidden;
}
.stats::before {
  content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,209,47,.22), transparent 70%);
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.stat { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stat + .stat { border-left: 1px solid rgba(255,255,255,.12); }
.stat-icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: rgba(255,209,47,.14); color: var(--brand); font-size: 1.5rem;
}
.stat-num { font-family: var(--font-head); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 500; color: var(--brand); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: rgba(255,255,255,.8); font-size: 1rem; }
@media (max-width: 767.98px) {
  .stats { padding: 28px 0; }
  .stats-grid { grid-template-columns: 1fr; gap: 16px; }
  .stat { justify-content: flex-start; }
  .stat + .stat { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; }
}

/* ---------- News ---------- */
.news-tabs { gap: 8px; margin-bottom: 24px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.news-tabs::-webkit-scrollbar { display: none; }
.news-tabs .nav-link {
  white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  font-weight: 500; padding: 9px 18px; background: var(--surface); transition: all .2s;
}
.news-tabs .nav-link i { margin-right: 6px; }
.news-tabs .nav-link:hover { border-color: var(--brand); color: var(--navy); }
.news-tabs .nav-link.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.news-tabs .nav-link.active i { color: var(--brand); }

.news-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 991.98px) { .news-cols { grid-template-columns: 1fr; } }
.news-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.news-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.news-card h3 { font-size: 1.15rem; margin: 0; }
.news-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tone-blue  .news-ico { background: #E8EEFF; color: #2F55D4; }
.tone-green .news-ico { background: #E3F6EC; color: #16865A; }
.tone-amber .news-ico { background: var(--brand-soft); color: #B37800; }
.news-list { list-style: none; padding: 0; margin: 0 0 8px; flex: 1; }
.news-list li + li { border-top: 1px dashed var(--line); }
.news-list a { display: block; padding: 11px 0; color: var(--ink); }
.news-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.55; transition: color .15s;
}
.news-list a:hover .news-title { color: var(--navy); text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 3px; }
.news-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: .82rem; color: var(--muted); }
.news-meta:empty { display: none; }
.badge-new {
  display: inline-block; background: #E5484D; color: #fff; font-size: .7rem; font-weight: 600;
  padding: 1px 9px; border-radius: 999px; line-height: 1.6;
}
.news-more { font-weight: 500; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.news-more i { transition: transform .2s; }
.news-more:hover i { transform: translateX(4px); }
.news-empty { color: var(--muted); padding: 14px 0; margin: 0; }
.news-card.wide { max-width: 100%; }

.proc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 767.98px) { .proc-grid { grid-template-columns: 1fr; } }
.proc-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.proc-item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--navy); }
.proc-no {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: #9A6A00; font-family: var(--font-head); font-size: .95rem;
}
.proc-text { flex: 1; line-height: 1.5; }
.proc-item > i { color: var(--muted); font-size: .8rem; }
.proc-archive { background: var(--tint); }
.proc-archive .proc-no { background: #ECEAF5; color: var(--navy); }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 991.98px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 479.98px) { .gallery-grid { grid-template-columns: 1fr; } }
.album {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); color: var(--ink); transition: transform .25s, box-shadow .25s;
}
.album:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.album-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #E9E6DE; }
.album-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.album:hover .album-img img { transform: scale(1.06); }
.album-img.no-img { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-soft), #F3EEE2); }
.album-img.no-img::before { content: "\f03e"; font-family: "Font Awesome 6 Free"; font-weight: 400; font-size: 2.4rem; color: #D9C58A; }
.album-img .badge-new { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.album-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.album-date { font-size: .8rem; color: var(--muted); }
.album-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; font-weight: 500; }
.album:hover .album-title { color: var(--navy); }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 991.98px) { .cal-grid { grid-template-columns: 1fr; } }
.cal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.cal-card h3 { font-size: 1.1rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.cal-card h3 i { color: var(--brand-strong); }
.cal-frame { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--tint); }
.cal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 575.98px) { .cal-frame { aspect-ratio: 3 / 4; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
