/* ========== Demo เว็บโรงเรียน (เมนูครบ) ========== */
.demo-school-body { background: #f8fafc; }
.demo-school-header {
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.demo-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  flex-wrap: wrap;
}
.demo-school-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1e40af;
  text-decoration: none;
}
.demo-school-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.demo-school-nav a {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}
.demo-school-nav a:hover { color: #1e40af; background: #eff6ff; }
.demo-school-nav a.active { color: #1e40af; background: #dbeafe; }
.demo-back-main { color: #64748b !important; font-size: 0.9rem; }
.demo-school-main { padding: 2rem 0 4rem; min-height: 50vh; }
.demo-school-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}
.demo-school-footer a { color: #93c5fd; }

.demo-hero { text-align: center; padding: 2rem 0 2.5rem; }
.demo-hero-logo { border-radius: 12px; margin-bottom: 1rem; }
.demo-hero-title { font-size: 1.75rem; color: #0f172a; margin-bottom: 0.5rem; }
.demo-hero-desc { color: #475569; font-size: 1.05rem; }
.demo-section { padding: 1rem 0; }
.demo-section h1, .demo-section h2 { font-size: 1.35rem; color: #1e40af; margin-bottom: 0.75rem; }
.demo-content { line-height: 1.8; }
.demo-placeholder-list { margin: 1rem 0; padding-left: 1.5rem; }
.demo-placeholder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin: 1rem 0; }
.demo-placeholder-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.demo-placeholder-box { background: #f1f5f9; padding: 1.25rem; border-radius: 8px; margin: 1rem 0; }
.demo-form-placeholder { background: #f8fafc; padding: 1rem; border-radius: 8px; margin: 1rem 0; border: 1px dashed #cbd5e1; }

/* หน้าแรก — รายละเอียดเพิ่ม */
.demo-welcome { padding: 1.5rem 0; }
.demo-stats-grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; padding: 0; }
@media (max-width: 500px) { .demo-stats-grid { grid-template-columns: 1fr; } }
.demo-stat { text-align: center; padding: 1.25rem; background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.demo-stat-num { display: block; font-size: 1.5rem; font-weight: 700; color: #1e40af; }
.demo-stat-label { font-size: 0.9rem; color: #64748b; }
.demo-news-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.demo-news-list li { padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; }
.demo-news-list a { color: #1e40af; text-decoration: none; }
.demo-news-list a:hover { text-decoration: underline; }
.demo-more { color: #1e40af; font-weight: 500; text-decoration: none; }
.demo-more:hover { text-decoration: underline; }
.demo-activities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }
.demo-activity-card { background: #fff; padding: 1.25rem; border-radius: 10px; border: 1px solid #e2e8f0; }
.demo-activity-card h3 { font-size: 1rem; color: #1e40af; margin-bottom: 0.5rem; }
.demo-activity-card p { font-size: 0.9rem; color: #475569; margin: 0; }
.demo-announce-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.demo-announce-list li { padding: 0.5rem 0; padding-left: 1rem; border-left: 3px solid #1e40af; margin-bottom: 0.5rem; background: #f8fafc; border-radius: 0 6px 6px 0; }
.demo-links-wrap { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.demo-quick-link { display: inline-block; padding: 0.5rem 1rem; background: #1e40af; color: #fff !important; border-radius: 8px; text-decoration: none; font-weight: 500; transition: background 0.2s; }
.demo-quick-link:hover { background: #1e3a8a; }

/* ข่าวรายการ + หน้าโพสต์เดียว */
.demo-news-list { padding: 1rem 0 3rem; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { margin-bottom: 1rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 1rem; }
.news-link { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; text-decoration: none; color: inherit; }
.news-link:hover .news-title { color: #1e40af; }
.news-thumb { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.news-meta { width: 100%; font-size: 0.85rem; color: #64748b; margin-bottom: 0.25rem; }
.news-badge { display: inline-block; margin-left: 0.5rem; padding: 0.15rem 0.4rem; background: #dbeafe; color: #1d4ed8; border-radius: 4px; font-size: 0.75rem; }
.news-title { font-size: 1.1rem; font-weight: 600; margin: 0; color: #0f172a; }
.demo-post-single { padding: 1rem 0 3rem; }
.post-article { max-width: 720px; margin: 0 auto; }
.post-header { margin-bottom: 1rem; }
.post-date { font-size: 0.9rem; color: #64748b; }
.post-badge { margin-left: 0.5rem; padding: 0.2rem 0.5rem; background: #dbeafe; color: #1d4ed8; border-radius: 4px; font-size: 0.8rem; }
.post-title { font-size: 1.5rem; margin: 0.5rem 0 0; color: #0f172a; }
.post-figure { margin: 1rem 0; }
.post-image { max-width: 100%; height: auto; border-radius: 8px; }
.post-content { line-height: 1.8; margin-top: 1rem; }
.post-content p { margin-bottom: 1rem; }

/* รายการเว็บโรงเรียน */
.demo-list-page { padding: 2rem 0 4rem; }
.demo-list-title { font-size: 1.5rem; margin-bottom: 0.5rem; color: #0f172a; }
.demo-list-lead { color: #475569; margin-bottom: 2rem; }
.demo-list-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.demo-list-card { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; overflow: hidden; }
.demo-list-link { display: block; padding: 1rem 1.25rem; text-decoration: none; color: inherit; }
.demo-list-link:hover { background: #f8fafc; }
.demo-list-name { font-weight: 600; color: #1e40af; display: block; }
.demo-list-meta { font-size: 0.9rem; color: #64748b; }

/* หลังบ้าน Admin */
.admin-body { background: #f1f5f9; min-height: 100vh; padding: 2rem 0; }
.admin-login-wrap, .admin-wrap { max-width: 560px; margin: 0 auto; padding: 0 1.5rem; }
.admin-login-wrap h1, .admin-wrap h1 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.admin-login-desc { color: #64748b; margin-bottom: 1.5rem; }
.admin-error { color: #dc2626; margin-bottom: 1rem; }
.admin-form label { display: block; margin-bottom: 1rem; }
.admin-form input[type="text"], .admin-form input[type="password"], .admin-form input[type="url"], .admin-form input[type="email"], .admin-form textarea {
  width: 100%; padding: 0.5rem 0.75rem; margin-top: 0.25rem; border: 1px solid #e2e8f0; border-radius: 6px;
}
.admin-form h2 { margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }
.admin-form h3 { margin: 1rem 0 0.5rem; font-size: 1rem; color: #64748b; }
.admin-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.admin-header a { color: #1e40af; }
.admin-logout { color: #64748b; }
.admin-saved { color: #16a34a; margin-bottom: 1rem; }
.admin-theme-options { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.admin-theme-option { display: block; padding: 1rem; border: 2px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.admin-theme-option:hover { border-color: #93c5fd; background: #f8fafc; }
.admin-theme-option input:checked + .admin-theme-name { font-weight: 700; color: #1e40af; }
.admin-theme-option input { margin-right: 0.5rem; }
.admin-theme-name { display: block; font-size: 1rem; }
.admin-theme-desc { display: block; font-size: 0.85rem; color: #64748b; margin-top: 0.25rem; }

/* ========== ธีม 1: เรียบ สวย ปัง (clean) ========== */
.theme-clean .demo-school-body { background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 40%, #e0e7ff 100%); }
.theme-clean .demo-school-header { background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, #1e40af, #7c3aed, #1e40af) 1; box-shadow: 0 4px 20px rgba(30,64,175,0.1); }
.theme-clean .demo-hero-title { background: linear-gradient(135deg, #1e40af, #4f46e5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 2rem; }
.theme-clean .demo-stat { box-shadow: 0 4px 14px rgba(30,64,175,0.08); border-color: rgba(30,64,175,0.15); }
.theme-clean .demo-activity-card { box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.theme-clean .demo-school-footer { background: linear-gradient(180deg, #0f172a, #1e293b); }

/* ========== ธีม 2: อนิเมชันเยอะ (animated) ========== */
.theme-animated .demo-school-body { background: #f0f9ff; }
.theme-animated .demo-school-header { animation: theme-anim-header 0.5s ease; }
@keyframes theme-anim-header { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.theme-animated .demo-hero { animation: theme-anim-hero 0.6s ease 0.1s both; }
@keyframes theme-anim-hero { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.theme-animated .demo-section { animation: theme-anim-fade 0.5s ease both; }
.theme-animated .demo-section:nth-child(2) { animation-delay: 0.15s; }
.theme-animated .demo-section:nth-child(3) { animation-delay: 0.2s; }
.theme-animated .demo-section:nth-child(4) { animation-delay: 0.25s; }
.theme-animated .demo-section:nth-child(5) { animation-delay: 0.3s; }
.theme-animated .demo-section:nth-child(6) { animation-delay: 0.35s; }
.theme-animated .demo-section:nth-child(7) { animation-delay: 0.4s; }
.theme-animated .demo-section:nth-child(8) { animation-delay: 0.45s; }
.theme-animated .demo-section:nth-child(9) { animation-delay: 0.5s; }
.theme-animated .demo-section:nth-child(10) { animation-delay: 0.55s; }
@keyframes theme-anim-fade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.theme-animated .demo-school-nav a { transition: transform 0.2s, background 0.2s; }
.theme-animated .demo-school-nav a:hover { transform: translateY(-2px); }
.theme-animated .demo-stat { transition: transform 0.3s, box-shadow 0.3s; }
.theme-animated .demo-stat:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(30,64,175,0.15); }
.theme-animated .demo-activity-card { transition: transform 0.3s, box-shadow 0.3s; }
.theme-animated .demo-activity-card:hover { transform: scale(1.02); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.theme-animated .demo-quick-link { transition: transform 0.2s, box-shadow 0.2s; }
.theme-animated .demo-quick-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30,64,175,0.3); }

/* ========== ธีม 3: ทางการ (formal) ========== */
.theme-formal .demo-school-body { background: #fff; }
.theme-formal .demo-school-header { background: #1e3a8a; border-bottom: none; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.theme-formal .demo-school-logo { color: #fff !important; }
.theme-formal .demo-school-nav a { color: #bfdbfe; }
.theme-formal .demo-school-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.theme-formal .demo-school-nav a.active { color: #fff; background: rgba(255,255,255,0.2); }
.theme-formal .demo-back-main { color: #93c5fd !important; }
.theme-formal .demo-hero { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.theme-formal .demo-hero-title { color: #1e3a8a; font-size: 1.75rem; }
.theme-formal .demo-hero-desc { color: #475569; }
.theme-formal .demo-section h2 { color: #1e3a8a; border-bottom: 2px solid #1e3a8a; padding-bottom: 0.35rem; display: inline-block; }
.theme-formal .demo-stat { background: #f8fafc; border-color: #e2e8f0; }
.theme-formal .demo-stat-num { color: #1e3a8a; }
.theme-formal .demo-activity-card { background: #f8fafc; border-color: #e2e8f0; }
.theme-formal .demo-activity-card h3 { color: #1e3a8a; }
.theme-formal .demo-quick-link { background: #1e3a8a; }
.theme-formal .demo-quick-link:hover { background: #172554; }
.theme-formal .demo-school-footer { background: #1e3a8a; color: #bfdbfe; }
.theme-formal .demo-school-footer a { color: #fff; }
.theme-formal .nav-toggle-btn span { background: #fff; }

@media (max-width: 768px) {
  .demo-school-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 0 1rem;
  }
  .theme-formal .demo-school-nav { background: #1e3a8a; }
  .theme-formal .demo-school-nav a { color: #bfdbfe; border-bottom-color: rgba(255,255,255,0.1); }
  .demo-header-inner .nav-checkbox:checked ~ .demo-school-nav { max-height: 360px; opacity: 1; padding: 0.5rem 1rem; }
  .demo-header-inner .nav-toggle-btn { display: flex; }
}

/* ========== สไลด์รูปโชว์งานโรงเรียน ========== */
.school-slider-wrap {
  position: relative;
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  background: #0f172a;
}
.school-slider { position: relative; width: 100%; height: 100%; }
.school-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.school-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.school-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.school-slide-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
}
.school-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px; height: 48px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.school-slider-btn:hover { background: rgba(255,255,255,0.4); color: #fff; }
.school-slider-prev { left: 1rem; }
.school-slider-next { right: 1rem; }
.school-slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.school-slider-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.school-slider-dot:hover { background: rgba(255,255,255,0.4); }
.school-slider-dot.active { background: #fff; }
@media (max-width: 768px) {
  .school-slider-wrap { max-height: 280px; }
  .school-slider-btn { width: 40px; height: 40px; font-size: 1.25rem; }
  .school-slider-prev { left: 0.5rem; }
  .school-slider-next { right: 0.5rem; }
}

/* หน้าแกลเลอรี่ */
.school-gallery-page { padding: 1.5rem 0 3rem; }
.school-gallery-title { font-size: 1.5rem; margin-bottom: 1.5rem; color: #0f172a; }
.school-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.school-gallery-fig { margin: 0; border-radius: 10px; overflow: hidden; background: #f1f5f9; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.school-gallery-fig img { width: 100%; height: 200px; object-fit: cover; display: block; }
.school-gallery-fig figcaption { padding: 0.75rem 1rem; font-size: 0.95rem; color: #475569; }
.school-gallery-empty { color: #64748b; padding: 2rem; text-align: center; }
