/* Landing - สวยงาม สบายตา */

:root {
  --primary: #1A4B7D;
  --primary-light: #2d6ba3;
  --primary-soft: #e8f2fa;
  --accent: #E74C7D;
  --accent-soft: #fce4ec;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --bg: #f8fafc;
  --bg-warm: #fefcfb;
  --bg-card: #fff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(26, 75, 125, 0.06);
  --shadow-hover: 0 8px 24px rgba(26, 75, 125, 0.1);
  --font: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  --dark-blue: #1A4B7D;
  --light-blue: #7EC8E3;
  --pink: #E74C7D;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Ambient background - เฉพาะหน้า index */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  will-change: transform;
}
.ambient-orb-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(126, 200, 227, 0.4), transparent 55%);
  top: 45%;
  left: 55%;
  transform: translate(-50%, -50%);
  animation: ambientFloat3 23s ease-in-out infinite;
}
@keyframes ambientFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-58%, -42%) scale(1.04); }
  66% { transform: translate(-42%, -58%) scale(0.96); }
}

/* ไอคอนลอย - ลูกเล่น */
.floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.floating-icon {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.28;
  color: var(--text-muted);
  animation: floatBobbing 6s ease-in-out infinite;
}
.floating-icon.fi-1 { top: 18%; left: 12%; animation-delay: 0s; animation-duration: 7s; }
.floating-icon.fi-2 { top: 35%; right: 15%; animation-delay: -2s; animation-duration: 8s; color: var(--teal); }
.floating-icon.fi-3 { top: 60%; left: 8%; animation-delay: -4s; animation-duration: 6.5s; font-size: 1.5rem; opacity: 0.32; }
.floating-icon.fi-4 { top: 25%; right: 8%; animation-delay: -1s; animation-duration: 9s; color: var(--teal); opacity: 0.26; }
.floating-icon.fi-5 { bottom: 30%; left: 18%; animation-delay: -3s; animation-duration: 7.5s; font-size: 1.6rem; opacity: 0.3; }
.floating-icon.fi-6 { bottom: 20%; right: 22%; animation-delay: -5s; animation-duration: 8.5s; }
@keyframes floatBobbing {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(4px, -8px) rotate(2deg); }
  50% { transform: translate(-3px, 4px) rotate(-1deg); }
  75% { transform: translate(6px, 2px) rotate(1deg); }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image:
    url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h4v4H0V0zm8 0h4v4H8V0zm8 0h4v4h-4V0zm8 0h4v4h-4V0zM0 8h4v4H0V8zm8 0h4v4H8V8zm8 0h4v4h-4V8zm8 0h4v4h-4V8z' fill='%231A4B7D' fill-opacity='0.03'/%3E%3C/svg%3E");
}

/* ===== Nav ===== */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--dark-blue);
  color: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.nav-logo {
  color: white !important;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none !important;
  white-space: nowrap;
}
.nav-logo:hover { opacity: 0.95; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 0.2s;
}
.nav-toggle:hover { background: rgba(255,255,255,0.25); }
.nav-toggle:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.nav-links { display: flex; gap: 0.25rem 0.75rem; flex-wrap: wrap; align-items: center; }
.nav-link {
  color: white !important;
  text-decoration: none !important;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.15); }
.nav-link.active { background: rgba(255,255,255,0.2); }
.nav-link:focus-visible { outline: 2px solid white; outline-offset: 2px; }

/* มือถือ: แสดงปุ่ม hamburger, เมนูเป็น dropdown */
@media (max-width: 768px) {
  .app-nav { flex-wrap: wrap; padding: 0.6rem 1rem; }
  .nav-logo { font-size: 0.95rem; max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; }
  .nav-toggle { display: flex; order: 2; }
  .nav-links {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s;
    background: rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    margin: 0.25rem 0 0;
    padding: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }
  .app-nav.nav-open .nav-links {
    max-height: 80vh;
    overflow-y: auto;
    opacity: 1;
    padding: 0.5rem 0;
  }
  .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.95rem;
  }
  .nav-link:last-child { border-bottom: none; }
}
.nav-admin {
  display: none !important; /* ซ่อนเมนูฟันเฟือง (เข้า Admin ตรง /admin ได้) */
}
.nav-admin:hover { background: rgba(90,105,125,1) !important; }
.nav-admin.active { background: rgba(100,115,135,1) !important; }
.nav-admin i { font-size: 1.1rem; color: white !important; }

/* ===== Page ===== */
.page { max-width: 960px; margin: 0 auto; padding: 0 1.5rem 3rem; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 4rem 2rem 3.5rem;
  margin: 0 -1.5rem 2.5rem;
  background: linear-gradient(165deg, var(--primary) 0%, #0f3460 50%, #1A4B7D 100%);
  color: white;
  border-radius: 0 0 24px 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
  pointer-events: none;
}

/* Ambient orbs ใน Hero - ลอยช้าๆ บนพื้นน้ำเงิน */
.hero-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(45px);
  will-change: transform;
}
.hero-ambient-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 60%);
  top: 10%;
  left: 15%;
  animation: heroAmbient1 18s ease-in-out infinite;
}
.hero-ambient-2 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 60%);
  bottom: 20%;
  right: 20%;
  animation: heroAmbient2 22s ease-in-out infinite;
}
.hero-ambient-3 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 60%);
  top: 50%;
  left: 70%;
  animation: heroAmbient3 20s ease-in-out infinite;
}
@keyframes heroAmbient1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8%, -10%) scale(1.06); }
}
@keyframes heroAmbient2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10%, 8%) scale(0.96); }
}
@keyframes heroAmbient3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5%, 10%) scale(1.04); }
}

/* ไอคอนลอยใน Hero - สีขาวบนพื้นน้ำเงิน */
.hero-floating-icons {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-icon {
  position: absolute;
  font-size: 1.6rem;
  color: rgba(255,255,255,0.45);
  animation: heroIconFloat 8s ease-in-out infinite;
}
.hero-icon.hi-1 { top: 25%; left: 10%; animation-delay: 0s; }
.hero-icon.hi-2 { top: 15%; right: 20%; animation-delay: -3s; animation-duration: 10s; font-size: 1.3rem; }
.hero-icon.hi-3 { top: 55%; left: 15%; animation-delay: -2s; animation-duration: 9s; }
.hero-icon.hi-4 { bottom: 25%; right: 12%; animation-delay: -5s; animation-duration: 11s; }
.hero-icon.hi-5 { bottom: 35%; left: 25%; animation-delay: -4s; animation-duration: 7s; font-size: 1.4rem; }
@keyframes heroIconFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(-12px) scale(1.1); opacity: 0.6; }
}

/* กล่องลงคะแนน decorative */
.hero-ballot {
  position: absolute;
  right: 8%;
  bottom: 15%;
  width: 100px;
  height: 100px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.hero-ballot svg { width: 100%; height: 100%; fill: white; }
.hero-ballot-left {
  left: 6%;
  right: auto;
  transform: scaleX(-1);
}

.hero-inner { max-width: 480px; margin: 0 auto; position: relative; z-index: 1; }

.hero-logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.hero-logo img { width: 100%; height: 100%; object-fit: cover; }

.hero-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.hero-subtitle { font-size: 1.05rem; opacity: 0.95; }
.hero-english {
  font-size: 0.9rem;
  opacity: 0.85;
  font-style: italic;
  margin-bottom: 0.5rem;
}
.hero-contact {
  font-size: 0.8rem;
  opacity: 0.88;
  margin: 0.85rem 0 1rem;
  line-height: 1.5;
}
.hero-contact-line { margin: 0.15rem 0; }
.hero-contact-addr { margin: 0.25rem 0; }
.hero-contact-phone { font-weight: 600; margin-top: 0.35rem; }
.hero-credit {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.hero-year {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 1.75rem;
  padding: 0.35rem 1rem;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: inline-block;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, var(--accent) 0%, #d63d6b 100%);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: 0.25s;
  box-shadow: 0 4px 14px rgba(231, 76, 125, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 125, 0.4);
}
.btn-primary:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: 0.25s;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-1px);
}

.section .btn-secondary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(26, 75, 125, 0.2);
}
.section .btn-secondary:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Sections ===== */
.section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.section::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.25;
}

.section:last-of-type::before { display: none; }
.section:last-of-type { border-bottom: none; }

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.2s;
}
.section-title-link:hover {
  opacity: 0.85;
  color: inherit;
  text-decoration: none;
}
.section-contact .section-title-link { color: white; }

.section-title::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 2px;
}

.section-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 10px;
  font-size: 1rem;
}

.section-contact .section-icon {
  background: rgba(255,255,255,0.2);
  color: white;
}

.section-menu {
  position: relative;
  background: linear-gradient(165deg, var(--primary) 0%, #0f3460 100%);
  padding: 2.5rem 1.5rem;
  margin: 0 -1.5rem;
  border-radius: var(--radius-lg);
  color: white;
}

.section-menu-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-menu-title .section-title-link {
  color: white;
  text-decoration: none;
}
.section-menu-title .section-title-link:hover {
  color: white;
  opacity: 0.9;
  text-decoration: none;
}

.section-menu-underline {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  margin: 0 auto 1.75rem;
  position: relative;
}
.section-menu-underline::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* ===== Menu Grid ===== */
.section-menu .menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.section-menu .menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);
  text-decoration: none;
  color: white;
  font-weight: 500;
  transition: 0.25s;
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  cursor: pointer;
}

.section-menu .menu-item:hover {
  background: rgba(255,255,255,0.2);
  color: white;
  transform: translateY(-1px);
}
.section-menu .menu-item:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.menu-item-text { flex: 1; }
.menu-item-arrow {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.menu-item-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  pointer-events: none;
}

@media (max-width: 600px) {
  .section-menu .menu-grid { grid-template-columns: 1fr; }
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: 0.25s;
}

.card:hover { box-shadow: var(--shadow-hover); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--primary-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.card:last-child { margin-bottom: 0; }

.card { position: relative; }
.card .badge { position: absolute; top: 1.25rem; right: 1.25rem; margin: 0; }

.card-muted {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
.card-muted i { margin-right: 0.5rem; }

.card-dark {
  background: linear-gradient(145deg, var(--primary) 0%, #0f3460 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(26, 75, 125, 0.25);
}

.card-dark .muted { color: rgba(255,255,255,0.7); }
.card-dark .reg-group {
  font-size: 1rem;
  margin: 1.25rem 0 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
}
.card-dark .reg-group:first-child { margin-top: 0; }
.card-dark .download-list { list-style: none; }
.card-dark .download-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.card-dark .download-list li:last-child { border-bottom: none; }
.card-dark .download-list a {
  color: var(--accent-soft);
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  transition: 0.2s;
}
.card-dark .download-list a:hover { background: rgba(255,255,255,0.2); }

/* บล็อกขยายตามเนื้อหา ไม่ตัด ไม่ล้น */
.card-scroll { overflow: visible; max-height: none; }

.calendar-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

/* ปฏิทิน — ตารางแบบละเอียดและสวยงาม */
.calendar-schedule {
  background: linear-gradient(180deg, #fafcff 0%, #f5f9fd 100%);
  border: 1px solid rgba(26, 75, 125, 0.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(26, 75, 125, 0.08);
}
.calendar-schedule .schedule-table,
.calendar-schedule .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
  margin: 0;
}
.calendar-schedule .schedule-table thead,
.calendar-schedule .table thead {
  background: linear-gradient(135deg, var(--primary) 0%, #0f3460 100%);
  color: white;
}
.calendar-schedule .schedule-table th,
.calendar-schedule .table th {
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: none;
}
.calendar-schedule .schedule-table th:first-child,
.calendar-schedule .table th:first-child {
  width: 32%;
  max-width: 280px;
}
.calendar-schedule .schedule-table tbody tr,
.calendar-schedule .table tbody tr {
  transition: background 0.15s ease;
}
.calendar-schedule .schedule-table tbody tr:nth-child(even),
.calendar-schedule .table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.6);
}
.calendar-schedule .schedule-table tbody tr:nth-child(odd),
.calendar-schedule .table tbody tr:nth-child(odd) {
  background: #fff;
}
.calendar-schedule .schedule-table tbody tr:hover,
.calendar-schedule .table tbody tr:hover {
  background: var(--primary-soft) !important;
}
.calendar-schedule .schedule-table td,
.calendar-schedule .table td {
  padding: 0.85rem 1.1rem;
  border: none;
  border-bottom: 1px solid rgba(26, 75, 125, 0.08);
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.calendar-schedule .schedule-table td:first-child,
.calendar-schedule .table td:first-child {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  width: 32%;
  max-width: 280px;
  border-right: 3px solid var(--primary-soft);
}
.calendar-schedule .schedule-table td.details-cell,
.calendar-schedule .table td.details-cell,
.calendar-schedule .schedule-table td:last-child,
.calendar-schedule .table td:last-child {
  color: #2d3748;
  line-height: 1.65;
  font-size: 0.9rem;
}
.calendar-schedule .schedule-table td:last-child br,
.calendar-schedule .table td:last-child br {
  display: block;
  content: '';
  margin-top: 0.25em;
}
@media (max-width: 640px) {
  .calendar-schedule .schedule-table th,
  .calendar-schedule .table th,
  .calendar-schedule .schedule-table td,
  .calendar-schedule .table td { padding: 0.65rem 0.85rem; font-size: 0.85rem; }
  .calendar-schedule .schedule-table td:first-child,
  .calendar-schedule .table td:first-child { width: 36%; max-width: none; }
}

.pamphlet-gallery {
  overflow: hidden;
}
.pamphlet-gallery .pamphlet-image {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.pamphlet-gallery .pamphlet-frame {
  max-width: 100%;
  width: 100%;
  height: 60vh;
  min-height: 350px;
  max-height: 600px;
  display: block;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: none;
}
.pamphlet-gallery .pamphlet-image:last-child,
.pamphlet-gallery .pamphlet-frame:last-child { margin-bottom: 0; }

/* ===== Card Link ===== */
.card-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #d63d6b 100%);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: 0.25s;
  box-shadow: 0 4px 16px rgba(231, 76, 125, 0.3);
}

.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(231, 76, 125, 0.35);
}
.card-link i { font-size: 1.25rem; margin-right: 0.25rem; }

/* ===== Table ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.table th {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #e0eef8 100%);
  font-weight: 600;
  color: var(--primary);
}
.table tbody tr:hover { background: #fafbfc; }

/* ===== Badge ===== */
.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #d63d6b 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-left: 0.5rem;
  box-shadow: 0 2px 6px rgba(231, 76, 125, 0.3);
}

/* ===== List ===== */
.list { list-style: none; }
.list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.list li::before {
  content: '›';
  color: var(--primary);
  font-weight: 700;
}
.list li:last-child { border-bottom: none; }
.muted { color: var(--text-muted); font-size: 0.9rem; }

/* ===== Committee ===== */
.intro {
  margin-bottom: 1.25rem;
  color: var(--text);
  line-height: 1.7;
  padding: 1rem 1.25rem;
  background: var(--primary-soft);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.committee-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.committee-card {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: 0.25s;
}

.committee-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.committee-avatar {
  width: 90px;
  height: 90px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft) 0%, #e0eef8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary);
  overflow: hidden;
  border: 3px solid white;
  box-shadow: 0 2px 12px rgba(26, 75, 125, 0.15);
}

.committee-avatar img { width: 100%; height: 100%; object-fit: cover; }

.committee-name { font-weight: 600; color: var(--primary); font-size: 0.95rem; word-wrap: break-word; overflow-wrap: break-word; text-align: center; }
.committee-role { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; word-wrap: break-word; overflow-wrap: break-word; text-align: center; }
.committee-phone { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; word-wrap: break-word; overflow-wrap: break-word; text-align: center; }

/* ===== Contact ===== */
.section-contact {
  background: linear-gradient(165deg, var(--primary) 0%, #0f3460 100%);
  color: white;
  margin: 0 -1.5rem;
  padding: 2.5rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

.section-contact::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.section-contact .section-title { color: white; }
.section-contact .section-title::before { background: linear-gradient(180deg, var(--accent-soft), white); }
.contact-phone {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent-soft);
}
.contact-address { opacity: 0.95; font-size: 0.95rem; line-height: 1.7; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.link-back {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, #0f3460 100%);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(26, 75, 125, 0.35);
  transition: 0.25s;
}
.link-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 75, 125, 0.4);
  text-decoration: none;
  color: white;
}
.link-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== Sub pages ===== */
.subpage {
  min-height: 100vh;
  background: var(--bg);
  padding: 1.5rem;
}

.subpage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subpage-title { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

.btn-main-menu {
  padding: 0.55rem 1.1rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: 0.2s;
}
.btn-main-menu:hover { opacity: 0.9; }

.subpage-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.subpage-content.dark-bg {
  background: linear-gradient(145deg, var(--primary) 0%, #0f3460 100%);
  color: white;
  border: none;
}
.subpage-content.dark-bg .download-list li { border-color: rgba(255,255,255,0.2); }
.subpage-content.dark-bg .btn-download { color: var(--accent-soft); }

.subpage-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  background: linear-gradient(135deg, var(--accent) 0%, #d63d6b 100%);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
}
.subpage-banner:hover { opacity: 0.95; transform: translateY(-1px); }

.download-list { list-style: none; }
.download-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-width: 0; }
.download-list li:last-child { border-bottom: none; }
.download-list li a, .download-list li span { word-wrap: break-word; overflow-wrap: break-word; }
.btn-download { color: var(--primary); text-decoration: none; }
.btn-download:hover { text-decoration: underline; }

.forms-box { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); padding: 1.25rem; border-radius: var(--radius); border: 1px solid #bbf7d0; }
.forms-box-title { font-weight: 600; margin-bottom: 0.75rem; color: var(--primary); }
.forms-list { list-style: none; }
.forms-list li { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.5rem 0; flex-wrap: wrap; min-width: 0; }
.forms-list li a, .forms-list li span { word-wrap: break-word; overflow-wrap: break-word; }
.form-icon { color: #22c55e; }
.form-subtitle { font-size: 0.85rem; margin-top: 0.25rem; }

.pdf-icon {
  color: #e11d48;
  font-size: 1rem;
}

.pdf-cell {
  text-align: center;
  width: 2.5rem;
  white-space: nowrap; /* ไอคอน PDF คงเป็นบรรทัดเดียว */
}
.polling-table td:not(.pdf-cell), .schedule-table td { min-width: 0; } /* ให้เซลล์ข้อความหดแล้วขึ้นบรรทัดใหม่ได้ */

.schedule-table, .polling-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed; }
.schedule-table th, .schedule-table td, .polling-table th, .polling-table td { padding: 0.6rem; text-align: left; border: 1px solid var(--border); word-wrap: break-word; overflow-wrap: break-word; white-space: normal; }
.schedule-table th, .polling-table th { background: var(--primary-soft); font-weight: 600; }

.update-badge { background: var(--accent); color: white; font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; }

/* Responsive */
@media (max-width: 600px) {
  .menu-grid { grid-template-columns: 1fr; }
  .committee-card { flex: 0 0 100%; max-width: 280px; margin: 0 auto; }
  .link-back { bottom: 1rem; right: 1rem; padding: 0.5rem 0.85rem; font-size: 0.85rem; }
  .hero-actions { flex-direction: column; }
  .hero { padding: 2.5rem 1rem 2rem; }
}
