/* ============================================================
   TepUmNouy Hadyai — modern theme overlay for Cassiopeia
   Loaded automatically by Cassiopeia as `template.user` asset
   ============================================================ */

/* 1. Modern Thai + Latin font ----------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@400;500;600;700&display=swap');

:root {
  --tep-blue:        #2a2fbd;
  --tep-blue-dark:   #1a1f8a;
  --tep-blue-light:  #eef1ff;
  --tep-accent:      #ffe600;
  --tep-text:        #2a2d3a;
  --tep-text-muted:  #6b7280;
  --tep-surface:     #ffffff;
  --tep-page-bg:     #f3f4f8;
  --tep-radius:      14px;
  --tep-shadow:      0 4px 20px rgba(42, 47, 189, .08);
  --tep-shadow-lg:   0 10px 40px rgba(42, 47, 189, .14);
}

/* 2. Base typography -------------------------------------- */
body,
html {
  font-family: 'Prompt', 'Sarabun', 'Noto Sans Thai', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--tep-page-bg);
  color: var(--tep-text);
  line-height: 1.65;
  letter-spacing: .01em;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Prompt', 'Sarabun', sans-serif; font-weight: 600; color: var(--tep-text); }
h1 { font-weight: 700; letter-spacing: -.01em; }
a { color: var(--tep-blue); transition: color .2s; }
a:hover { color: var(--tep-blue-dark); }

/* 3. Page container give it some breathing room ----------- */
.container-main, main { max-width: 1200px; margin: 0 auto; }
.site-grid { gap: 28px !important; padding: 20px 16px !important; }

/* 4. Modern site header (logo + name + address) ----------- */
.container-header { padding: 0 !important; margin: 0 !important; background: transparent !important; }

.tep-site-head {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1200px 400px at 10% 0%, rgba(255,230,0,.08), transparent 60%),
    radial-gradient(900px 400px at 100% 100%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(135deg, #1a1f8a 0%, #2a2fbd 55%, #3b40d6 100%);
}
.tep-head-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.06) 2px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.04) 2px, transparent 2px);
  background-size: 60px 60px, 90px 90px;
  pointer-events: none;
}
.tep-head-inner {
  position: relative; z-index: 1;
  max-width: 1240px; margin: 0 auto;
  padding: 22px 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}

/* Logo in rounded white tile */
.tep-logo-link { display: inline-block; line-height: 0; }
.tep-logo-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 118px; height: 118px;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, .25),
    0 0 0 3px rgba(255, 230, 0, .55),
    inset 0 0 0 1px rgba(42, 47, 189, .08);
  padding: 6px;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), box-shadow .35s;
}
.tep-logo-link:hover .tep-logo-wrap {
  transform: scale(1.08) rotate(-6deg);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, .35),
    0 0 0 4px #ffe600,
    inset 0 0 0 1px rgba(42, 47, 189, .08);
}
.tep-logo-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.08));
}

/* Centre text — school name */
.tep-head-text { min-width: 0; }
.tep-school-th {
  margin: 0 0 2px !important;
  font-family: 'Prompt','Sarabun',sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem) !important;
  line-height: 1.15 !important;
  color: #fff !important;
  letter-spacing: .005em;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.tep-school-en {
  font-family: 'Prompt',sans-serif;
  font-weight: 400;
  font-size: clamp(.95rem, 1.4vw, 1.15rem);
  color: #ffe600;
  letter-spacing: .04em;
}

/* Right-side address block */
.tep-head-contact {
  display: flex; flex-direction: column; gap: 6px;
  text-align: right;
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.18);
}
.tep-addr {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 6px;
  color: rgba(255,255,255,.92);
}
.tep-addr-th { font-size: .9rem; font-weight: 500; }
.tep-addr-en { font-size: .78rem; color: rgba(255,255,255,.72); font-weight: 400; }
.tep-addr svg { opacity: .85; flex-shrink: 0; }
.tep-divider { opacity: .4; margin: 0 4px; }

/* Mobile stack */
@media (max-width: 900px) {
  .tep-head-inner {
    grid-template-columns: auto 1fr;
    gap: 16px;
    padding: 16px 18px;
  }
  .tep-head-contact {
    grid-column: 1 / -1;
    text-align: center;
    border-left: 0; border-top: 1px solid rgba(255,255,255,.18);
    padding: 14px 0 0;
  }
  .tep-addr { justify-content: center; }
  .tep-logo-wrap { width: 72px; height: 72px; border-radius: 14px; }
}
@media (max-width: 480px) {
  .tep-addr { font-size: .8rem !important; }
  .tep-addr-en { font-size: .72rem !important; }
  .tep-divider { display: none; }
}

/* 5. Hero slideshow refinements --------------------------- */
.tep-hero {
  border-radius: 0 !important;
  box-shadow: 0 2px 24px rgba(0,0,0,.14);
}
.tep-stage { height: 500px !important; }
@media (max-width: 768px) { .tep-stage { height: 280px !important; } }
.tep-caption {
  background: linear-gradient(90deg, rgba(42,47,189,.92), rgba(42,47,189,.75)) !important;
  padding: 16px 28px !important;
  font-size: 1.05rem !important;
  font-weight: 500 !important;
}
.tep-arrow {
  width: 52px !important; height: 52px !important;
  background: rgba(255,255,255,.9) !important; color: var(--tep-blue) !important;
  font-size: 22px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.2) !important;
}
.tep-arrow:hover { background: var(--tep-accent) !important; }
.tep-dot.tep-active { background: var(--tep-accent) !important; box-shadow: 0 0 0 3px rgba(255,230,0,.3); }

/* 6. Breadcrumbs - cleaner look --------------------------- */
.mod-breadcrumbs,
.breadcrumb {
  background: transparent !important;
  padding: 8px 4px !important;
  margin-bottom: 16px !important;
  font-size: .9rem;
  color: var(--tep-text-muted);
}

/* 7. Article cards (featured list on home) ---------------- */
.blog-featured,
.blog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.blog-featured .item,
.blog .item {
  background: var(--tep-surface);
  padding: 28px 32px;
  border-radius: var(--tep-radius);
  box-shadow: var(--tep-shadow);
  border: 1px solid rgba(42,47,189,.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.blog-featured .item:hover,
.blog .item:hover {
  transform: translateY(-3px);
  box-shadow: var(--tep-shadow-lg);
}
.blog-featured .item .page-header,
.blog .item .page-header,
.item-page .page-header {
  border-bottom: 2px solid var(--tep-blue-light);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.blog-featured h2, .blog h2, .item-page h2,
.blog-featured .page-header h1, .item-page .page-header h1 {
  color: var(--tep-blue-dark) !important;
  font-size: 1.6rem !important;
  margin: 0 0 .35em !important;
}
.blog-featured h2 a, .blog h2 a { color: var(--tep-blue-dark); text-decoration: none; }
.blog-featured h2 a:hover, .blog h2 a:hover { color: var(--tep-blue); }

/* Article meta row (Written by / Category / Published) */
dl.article-info,
.article-info {
  background: var(--tep-blue-light);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: .82rem;
  color: var(--tep-text-muted);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-bottom: 16px;
}
.article-info dd { margin: 0; }
.article-info .icon-user, .article-info .icon-folder-open,
.article-info .icon-calendar, .article-info .icon-eye { color: var(--tep-blue); }

/* Images inside articles — subtle rounding + spacing */
.item-page img, .blog-featured img, .blog .items-row img {
  border-radius: 10px;
  max-width: 100%; height: auto;
}

/* "Read more" button -------------------------------------- */
.readmore a, a.btn, button.btn, .btn-primary {
  background: linear-gradient(135deg, var(--tep-blue), var(--tep-blue-dark)) !important;
  color: #fff !important;
  padding: 10px 22px !important;
  border-radius: 999px !important;
  border: 0 !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  display: inline-block;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(42,47,189,.25);
}
.readmore a:hover, a.btn:hover, button.btn:hover, .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42,47,189,.4);
  color: #fff !important;
}

/* 8. Sidebar modules — card look -------------------------- */
.container-sidebar-right .card,
.container-sidebar-left .card {
  background: var(--tep-surface);
  border: 0;
  border-radius: var(--tep-radius);
  box-shadow: var(--tep-shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.container-sidebar-right .card-header,
.container-sidebar-left .card-header {
  background: linear-gradient(135deg, var(--tep-blue), var(--tep-blue-dark)) !important;
  color: #fff !important;
  padding: 14px 20px !important;
  border: 0 !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}
.container-sidebar-right .card-body,
.container-sidebar-left .card-body {
  padding: 10px 0 !important;
}

/* 9. Main Menu — modern navigation ------------------------ */
.mod-menu {
  list-style: none;
  padding: 0; margin: 0;
}
.mod-menu .nav-item {
  margin: 0;
  border-bottom: 1px solid var(--tep-blue-light);
}
.mod-menu .nav-item:last-child { border-bottom: 0; }
.mod-menu .nav-item > a,
.mod-menu .nav-item > .nav-header {
  display: block;
  padding: 12px 20px !important;
  color: var(--tep-text) !important;
  text-decoration: none;
  transition: background .2s, color .2s, padding-left .2s;
  font-weight: 500;
  position: relative;
}
.mod-menu .nav-item > a:hover,
.mod-menu .nav-item.current > a,
.mod-menu .nav-item.active > a {
  background: var(--tep-blue-light) !important;
  color: var(--tep-blue-dark) !important;
  padding-left: 26px !important;
}
.mod-menu .nav-item > a::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tep-blue);
  margin-right: 10px;
  opacity: .4;
  transition: opacity .2s, transform .2s;
  vertical-align: middle;
}
.mod-menu .nav-item > a:hover::before,
.mod-menu .nav-item.current > a::before,
.mod-menu .nav-item.active > a::before { opacity: 1; transform: scale(1.4); background: var(--tep-accent); }
.mod-menu .nav-header {
  font-weight: 600; color: var(--tep-blue-dark) !important;
  padding: 14px 20px 6px !important;
  text-transform: none;
  font-size: .95rem;
  letter-spacing: .02em;
}
.mod-menu ul { /* sub-menu */
  list-style: none; padding-left: 20px; margin: 0 0 6px;
  border-left: 2px solid var(--tep-blue-light);
}
.mod-menu ul .nav-item { border-bottom: 0; }
.mod-menu ul .nav-item > a { padding: 7px 12px !important; font-size: .9rem; font-weight: 400; }

/* 10. Footer — darker look, better typography ------------- */
.container-footer {
  background: linear-gradient(135deg, #1a1f3a 0%, #2a2fbd 100%) !important;
  margin-top: 60px !important;
}
.container-footer, .container-footer * { color: #e8ebff !important; }
.container-footer a { color: #ffe600 !important; text-decoration: underline; }
.container-footer a:hover { color: #fff !important; }

/* 11. Smooth scrolling + selection color ------------------ */
html { scroll-behavior: smooth; }
::selection { background: var(--tep-accent); color: var(--tep-text); }

/* 12. Scrollbar polish (webkit) --------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tep-page-bg); }
::-webkit-scrollbar-thumb { background: var(--tep-blue); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--tep-blue-dark); }

/* 13. Fade-in on page load -------------------------------- */
main > * { animation: tepFadeIn .5s ease both; }
@keyframes tepFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 14. Mobile tweaks --------------------------------------- */
@media (max-width: 768px) {
  .blog-featured .item, .blog .item, .item-page { padding: 20px !important; }
  h1 { font-size: 1.5rem !important; }
  .site-grid { padding: 12px 10px !important; }
}
