/* ====== SBAC OPEN HOUSE 2025 base theme ====== */

:root {
  --sbac-red: #e31e24;
  --sbac-blue: #0b3aa4;
  --sbac-dark: #081226;
  --sbac-bg: #f5f7fb;
}

@font-face {
    font-family: 'AP'; /* ตั้งชื่อฟอนต์ว่า AP */
    src: url('fonts/AP-MEDIUM.ttf') format('truetype'); /* ชี้ไปที่ไฟล์ฟอนต์ของคุณ */
    font-weight: normal;
    font-style: normal;
}

/* พื้นหลังรวม ๆ ของหน้า */
body {
  background: #ffffff;
  color: var(--sbac-dark);
  font-family: 'AP', sans-serif; /* ให้ใช้ AP ก่อน ถ้าไม่มีให้ใช้ sans-serif */
}

h1, h2, h3, h4, h5, h6, .dept-layout-wrapper {
    font-family: 'AP', sans-serif;
}

/* ====== HERO SECTION ====== */

.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, #ffe5e5 0, transparent 60%),
    radial-gradient(circle at bottom right, #dde7ff 0, transparent 60%),
    #ffffff;
}

.hero-card {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(6, 23, 52, 0.15);
  padding: 32px 28px;
}

.hero-logo {
  max-width: 420px;
  width: 100%;
  height: auto;
}

.badge-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sbac-red), var(--sbac-blue));
  color: #fff;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.badge-next span {
  font-weight: 700;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--sbac-red), var(--sbac-blue));
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: .25rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sbac-dark);
}

.hero-meta {
  font-size: .95rem;
  color: #4a5163;
}

.hero-meta strong {
  color: var(--sbac-dark);
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sbac-red), var(--sbac-blue));
  flex-shrink: 0;
}

/* ====== ปุ่มหลัก (ลงทะเบียน) ====== */

.btn-main {
  background: linear-gradient(90deg, var(--sbac-red), var(--sbac-blue));
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  font-weight: 700;
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #ffffff !important;
  box-shadow: 0 12px 30px rgba(11, 58, 164, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    filter 0.18s ease;
}

.btn-main::after {
  content: "›";
  font-size: 1.2rem;
  line-height: 1;
}

.btn-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(11, 58, 164, 0.55);
  filter: brightness(1.03);
  opacity: 0.98;
}

.btn-main:active {
  transform: translateY(1px);
  box-shadow: 0 8px 20px rgba(11, 58, 164, 0.4);
}

/* ปุ่มรอง (ghost) */

.btn-ghost {
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-weight: 500;
  font-size: 0.94rem;
  border: 1px solid rgba(11, 58, 164, 0.28);
  color: var(--sbac-blue) !important;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.btn-ghost:hover {
  background: rgba(11, 58, 164, 0.06);
  border-color: rgba(11, 58, 164, 0.45);
  color: var(--sbac-blue) !important;
}

/* เว้นระยะระหว่างปุ่มใน hero */
.hero-cta {
  gap: 0.75rem;
}

/* ====== section generic ====== */

.section {
  padding: 3.5rem 0;
}

.section-light {
  background: var(--sbac-bg);
}

/* การ์ด feature */

.feature-card {
  border-radius: 18px;
  border: none;
  box-shadow: 0 8px 25px rgba(7, 17, 43, .06);
  height: 100%;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(227, 30, 36, 0.12), rgba(11, 58, 164, 0.12));
  font-size: 1.3rem;
}

/* pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f3ff;
  color: var(--sbac-blue);
}

/* CTA contact card */
.contact-card {
  border-radius: 18px;
  border: 1px solid rgba(11, 58, 164, 0.08);
  background: #ffffff;
}

/* ====== responsive ====== */

@media (max-width: 767.98px) {
  .hero-card {
    padding: 22px 18px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-main,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }
}

/* แก้ปัญหาจุดตกบรรทัดในมือถือ */
@media (max-width: 575.98px) {
  .meta-line {
    gap: 0.35rem;
  }

  /* ถ้ารู้สึกว่าจุดยังรก สามารถซ่อนจุดไปเลยบนจอเล็ก */
  .meta-line .timeline-dot {
    display: none;
  }
}

/* ====== Register page layout ====== */

.page-section {
  padding: 3.5rem 0;
}

.page-section-light {
  background: var(--sbac-bg);
}

.page-header-min {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--sbac-dark);
}

.page-subtitle {
  font-size: 0.95rem;
  color: #4a5163;
  max-width: 540px;
}

.page-header-meta {
  text-align: left;
}

/* การจัด layout สองคอลัมน์ */
.register-layout .info-card,
.register-layout .form-card {
  border-radius: 20px;
  border: none;
  box-shadow: 0 10px 30px rgba(7, 17, 43, .06);
}

.info-card {
  background: #ffffff;
}

.info-card .highlight-box {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(11, 58, 164, 0.05);
  border: 1px dashed rgba(11, 58, 164, 0.25);
}

.form-card {
  background: #ffffff;
}

/* ปรับฟอร์มให้ดูแน่นขึ้นเล็กน้อย */
.form-card .form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sbac-dark);
}

.form-card .form-control,
.form-card .form-select {
  font-size: 0.9rem;
}

/* ปุ่มในฟอร์ม */
.w-md-auto {
  width: auto;
}

@media (max-width: 767.98px) {
  .page-section {
    padding: 2.5rem 0;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .page-header-min {
    flex-direction: column;
  }

  .page-header-meta {
    margin-top: 0.5rem;
  }

  .register-layout .info-card {
    order: 2;
  }

  .register-layout .form-card {
    order: 1;
  }
}

/* ====== Departments (เลือกสาขา) ====== */

.dept-grid {
  margin-top: 0.5rem;
}

.dept-card-link {
  text-decoration: none;
  color: inherit;
}

.dept-card {
  border-radius: 20px;
  border: none;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(7, 17, 43, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dept-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(7, 17, 43, 0.12);
}

.dept-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(11, 58, 164, 0.06);
  color: var(--sbac-blue);
  font-size: 0.78rem;
  font-weight: 600;
}

.campus-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #fef2f2;
  color: var(--sbac-red);
  font-weight: 600;
}

.dept-name {
  font-weight: 700;
  color: var(--sbac-dark);
}

.dept-name-en {
  font-size: 0.85rem;
  color: #6b7280;
}

.dept-desc {
  min-height: 3.4em; /* ให้สูงพอๆ กันในแต่ละการ์ด */
}

.btn-dept-more {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sbac-blue);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(11, 58, 164, 0.35);
  background: rgba(255, 255, 255, 0.9);
}

.btn-dept-more::after {
  content: " ›";
}

/* มือถือ: ให้แต่ละการ์ดเต็มกว้าง อ่านง่าย */
@media (max-width: 767.98px) {
  .dept-card {
    border-radius: 18px;
  }

  .dept-desc {
    min-height: 0;
  }
}

/* ====== Department detail page ====== */

.dept-page {
  padding-top: 3rem;
  padding-bottom: 3.5rem;
}

.dept-hero {
  margin-bottom: 1.5rem;
}

.dept-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--sbac-dark);
}

.dept-hero-subtitle {
  font-size: 0.95rem;
  color: #6b7280;
}

.back-link {
  color: #6b7280;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* การ์ดส่วนต่าง ๆ */
.dept-section-card {
  border-radius: 18px;
  border: none;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(7, 17, 43, 0.06);
}

.dept-desc-long {
  font-size: 0.92rem;
  line-height: 1.7;
}

/* layout image */
.dept-layout-wrapper {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f9fafb;
}

.dept-layout-img {
  width: 100%;
  display: block;
}

/* gallery */
.dept-gallery-item {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  background: #000;
}

.dept-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dept-gallery-section h5 {
  font-size: 1.1rem;
}

/* responsive */
@media (max-width: 767.98px) {
  .dept-page {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }

  .dept-hero-title {
    font-size: 1.5rem;
  }

  .dept-section-card {
    border-radius: 16px;
  }
}


