/* ===== Public site ===== */
.public-body {
  background: #f4f8fd;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column
}

.public-body>footer {
  margin-top: auto !important
}

.pub-nav {
  box-shadow: 0 2px 12px rgba(13, 71, 161, .07)
}

.pub-nav .nav-link {
  font-weight: 500;
  color: #334155;
  border-radius: 10px;
  padding: .45rem .8rem !important
}

.pub-nav .nav-link.active,
.pub-nav .nav-link:hover {
  color: #1565c0;
  background: #e3f2fd
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1565c0, #29b6f6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem
}

.brand-title {
  color: #0d47a1;
  font-size: 1rem
}

.brand-sub {
  font-size: .72rem
}

.hero {
  background: radial-gradient(1200px 400px at 85% -10%, rgba(41, 182, 246, .45), transparent), linear-gradient(135deg, #0d47a1 0%, #1565c0 55%, #1e88e5 100%);
  color: #fff;
  border-radius: 0 0 32px 32px;
  padding: 56px 0 80px;
  position: relative;
  overflow: hidden
}

.hero:after {
  content: "";
  position: absolute;
  inset: auto -10% -60px -10%;
  height: 120px;
  background: #f4f8fd;
  border-radius: 50%
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.6rem)
}

.hero .hero-chip {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .85rem;
  display: inline-block
}

.hero-stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(4px)
}

.hero-stat b {
  font-size: 1.5rem;
  display: block
}

.event-card {
  border-radius: 18px;
  overflow: hidden;
  transition: .2s;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(13, 71, 161, .14)
}

.event-cover {
  height: 180px;
  background: linear-gradient(135deg, #1565c0, #4fc3f7);
  position: relative;
  background-size: cover;
  background-position: center
}

.event-cover .badge {
  position: absolute;
  top: 12px;
  left: 12px
}

.event-cover .date-box {
  position: absolute;
  right: 12px;
  bottom: -22px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  text-align: center;
  padding: 6px 12px;
  min-width: 64px
}

.event-cover .date-box b {
  display: block;
  font-size: 1.35rem;
  color: #0d47a1;
  line-height: 1.1
}

.event-cover .date-box small {
  color: #64748b;
  font-size: .72rem
}

.event-cover .cover-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .35);
  font-size: 4.5rem
}

.progress-thin {
  height: 8px;
  border-radius: 99px;
  background: #e2e8f0
}

.progress-thin .progress-bar {
  background: linear-gradient(90deg, #1565c0, #29b6f6)
}

.section-title {
  font-weight: 700;
  color: #0d2b5c
}

.pub-footer {
  background: #0b2f6b;
  color: #dbeafe
}

/* ticket */
.ticket {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(13, 71, 161, .12);
  max-width: 760px;
  margin: auto
}

.ticket-head {
  background: linear-gradient(135deg, #0d47a1, #1e88e5);
  color: #fff;
  padding: 22px 26px
}

.ticket-body {
  padding: 24px 26px;
  position: relative
}

.ticket-cut {
  border-top: 2px dashed #cbd5e1;
  position: relative;
  margin: 0 18px
}

.ticket-cut:before,
.ticket-cut:after {
  content: "";
  position: absolute;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4f8fd
}

.ticket-cut:before {
  left: -32px
}

.ticket-cut:after {
  right: -32px
}

@media print {

  .pub-nav,
  .pub-footer,
  .no-print {
    display: none !important
  }

  .public-body {
    background: #fff
  }

  .ticket {
    box-shadow: none;
    border: 1px solid #cbd5e1
  }

  @page {
    size: 90mm 130mm;
    margin: 0
  }
}

/* ===== บัตรเข้างานสำหรับพิมพ์ 9 x 13 ซม. ===== */
.ticket-card { display: none }
.ticket-card.tc-show { display: flex; margin: 0 auto 24px; box-shadow: 0 8px 30px rgba(13, 71, 161, .15) }
.ticket-card {
  width: 90mm; height: 130mm; box-sizing: border-box; overflow: hidden; background: #fff; color: #1e293b;
  flex-direction: column; font-family: "IBM Plex Sans Thai", "Sarabun", sans-serif; line-height: 1.25;
  -webkit-print-color-adjust: exact; print-color-adjust: exact
}
.ticket-card .tc-head { padding: 4mm 5mm 3.2mm; position: relative; border-radius: 0 }
.ticket-card .tc-head::after { display: none }
.ticket-card .tc-school { font-size: 7pt; opacity: .85 }
.ticket-card .tc-title { font-size: 12.5pt; font-weight: 700; margin: .6mm 0 .8mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ticket-card .tc-meta { font-size: 7.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ticket-card .tc-id { display: flex; justify-content: space-between; align-items: baseline; padding: 2.2mm 5mm 0 }
.ticket-card .tc-id span { font-size: 6.5pt; color: #64748b; letter-spacing: .05em }
.ticket-card .tc-id b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13pt; color: #0d47a1 }
.ticket-card .tc-qr { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding: 1mm 5mm }
.ticket-card .tc-qr-box { width: 46mm; height: 46mm }
.ticket-card .tc-qr-box img, .ticket-card .tc-qr-box canvas { width: 100% !important; height: 100% !important; display: block }
.ticket-card .tc-qr-note { font-size: 7pt; color: #15803d; font-weight: 600; margin-top: 1.2mm }
.ticket-card .tc-locked { border: 1px dashed #cbd5e1; border-radius: 3mm; padding: 4mm; text-align: center; font-size: 8pt; color: #64748b }
.ticket-card .tc-locked b { color: #b45309; font-size: 9pt }
.ticket-card .tc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4mm 3mm; padding: 0 5mm 2mm }
.ticket-card .tc-wide { grid-column: 1 / -1 }
.ticket-card .tc-row span, .ticket-card .tc-places span { display: block; font-size: 6.5pt; color: #64748b }
.ticket-card .tc-row b { display: block; font-size: 9pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ticket-card .tc-cut { border-top: 1.5px dashed #cbd5e1; margin: 0 4mm }
.ticket-card .tc-places { padding: 2mm 5mm 4mm }
.ticket-card .tc-places b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 9pt; color: #0d47a1 }
.theme-christmas .ticket-card .tc-id b, .theme-christmas .ticket-card .tc-places b { color: #8e0000 }

@media print {
  html, body { width: 90mm; height: 130mm; margin: 0 !important; padding: 0 !important; background: #fff !important }
  body.has-ticket-card > *:not(.tc-print-root) { display: none !important }
  body.has-ticket-card .tc-print-root { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; width: 90mm }
  body.has-ticket-card .tc-print-root > *:not(.ticket-card) { display: none !important }
  .ticket-card { display: flex !important; margin: 0 !important; box-shadow: none !important; page-break-inside: avoid; break-inside: avoid }
}
/* ===== แถบเมนูบนจอเล็ก: ชื่อโรงเรียนยาวไม่ดันปุ่มเมนูลงบรรทัดใหม่ ===== */
@media (max-width: 991.98px) {
  .pub-nav .container { flex-wrap: wrap }
  .pub-nav .navbar-brand { flex: 1 1 0; min-width: 0; margin-right: .5rem; gap: .5rem !important }
  .pub-nav .navbar-brand img { height: 34px; width: auto }
  .pub-nav .navbar-brand > span.lh-sm { min-width: 0; display: block }
  .pub-nav .brand-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem }
  .pub-nav .brand-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .pub-nav .navbar-toggler { flex: 0 0 auto; padding: .3rem .5rem }
  .pub-nav { padding-top: .35rem; padding-bottom: .35rem }
}
@media (max-width: 575.98px) {
  .pub-nav .brand-title { font-size: .88rem }
  .pub-nav .brand-sub { font-size: .66rem }
  .brand-badge { width: 34px; height: 34px; font-size: .95rem }
}
