/* ==========================================================
 * style.css - เว็บไซต์โรงเรียนภูกระดึงวิทยาคม
 * โทนสี: น้ำเงินเข้ม (Navy) + ขาว + ทอง (Gold)
 * ========================================================== */

:root {
  --primary: #0a2756;
  --primary-dark: #061a3d;
  --primary-light: #1a4080;
  --gold: #d4a93d;
  --gold-dark: #b08a26;
  --gold-light: #f0d77a;
  --text: #2c3e50;
  --text-muted: #6c757d;
  --bg-light: #f8f9fc;
  --border: #e3e6ed;
  --shadow-sm: 0 2px 8px rgba(10, 39, 86, 0.06);
  --shadow: 0 4px 20px rgba(10, 39, 86, 0.10);
  --shadow-lg: 0 12px 40px rgba(10, 39, 86, 0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --transition: all .3s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-dark); }

/* ===== Buttons ===== */
.btn-primary-school {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .65rem 1.5rem;
  border-radius: 50px;
  font-weight: 500;
  transition: var(--transition);
}
.btn-primary-school:hover {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(10, 39, 86, 0.35);
}
.btn-outline-primary-school {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: .55rem 1.4rem;
  border-radius: 50px;
  font-weight: 500;
  transition: var(--transition);
}
.btn-outline-primary-school:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== Topbar ===== */
.topbar {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: .5rem 0;
  font-size: .85rem;
}
.topbar a { color: rgba(255,255,255,0.85); }
.topbar a:hover { color: var(--gold-light); }
.topbar-admin {
  border: 1px solid rgba(255,255,255,0.3);
  padding: .15rem .65rem;
  border-radius: 50px;
  transition: var(--transition);
}
.topbar-admin:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--primary-dark) !important;
}

/* ===== Navbar ===== */
.navbar-main {
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: .55rem 0;
}
.brand-logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
  transition: var(--transition);
}
.navbar-brand:hover .brand-logo-img { transform: rotate(-5deg) scale(1.05); }
.brand-text { display: inline-block; }
.brand-th {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  color: var(--primary);
  font-size: 1.05rem;
  line-height: 1.2;
}
.brand-en { font-size: .75rem; color: var(--text-muted); }
.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--text);
  padding: .5rem 1rem !important;
  position: relative;
  transition: var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary);
}
.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 1rem; right: 1rem;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.dropdown-menu {
  border: none;
  border-radius: var(--radius-sm);
  margin-top: .5rem !important;
  box-shadow: 0 8px 24px rgba(10, 39, 86, 0.12) !important;
  padding: .5rem 0;
}
.dropdown-item {
  padding: .5rem 1rem;
  font-size: .92rem;
  color: var(--text);
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-light); color: var(--primary); padding-left: 1.25rem; }
.dropdown-header {
  color: var(--gold-dark);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: .5rem 1rem;
}

/* ========== Mega Menu (Multi-column) ========== */
.dropdown-menu-mega {
  min-width: 720px;
  max-width: 90vw;
  padding: 1rem 1rem .5rem;
  border: none;
}
/* ตำแหน่งกึ่งกลาง dropdown แม่ */
.dropdown-mega-pos { position: static; }
@media (min-width: 992px) {
  .dropdown-mega-pos {
    position: relative;
  }
  .dropdown-mega-pos > .dropdown-menu-mega {
    left: 50%;
    transform: translateX(-50%);
  }
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 0.5rem 1.5rem;
}
.mega-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mega-col-header {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 600;
  font-size: .92rem;
  color: var(--primary);
  padding: .35rem 0 .5rem;
  margin-bottom: .25rem;
  border-bottom: 2px solid var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mega-link {
  display: flex;
  align-items: center;
  padding: .45rem .5rem;
  font-size: .9rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.mega-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.mega-link i { color: var(--gold-dark); flex-shrink: 0; }
.mega-link:hover {
  background: var(--bg-light);
  color: var(--primary);
  transform: translateX(2px);
}
.mega-bottom-divider { margin: .5rem 0 !important; }

/* Mobile: stack เป็นคอลัมน์เดียว */
@media (max-width: 991px) {
  .dropdown-menu-mega {
    min-width: 100%;
    max-width: 100%;
    padding: .5rem;
  }
  .mega-grid {
    grid-template-columns: 1fr !important;
    gap: .25rem;
  }
  .mega-col-header {
    background: var(--bg-light);
    padding: .5rem .75rem;
    border-radius: 6px;
    border-bottom: none;
    margin-top: .5rem;
  }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  color: #fff;
  padding: 5rem 0 6rem;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; }

.hero-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
  animation: heroFloat 4s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Hero theme presets อยู่ใน hero-themes.css */
.min-vh-75 { min-height: 50vh; }
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: rgba(212, 169, 61, 0.2);
  border: 1px solid rgba(212, 169, 61, 0.5);
  color: var(--gold-light);
  padding: .35rem 1rem;
  border-radius: 50px;
  font-size: .85rem;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: .5rem;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--gold-light);
  font-weight: 400;
  margin-bottom: 1.5rem;
  font-family: 'Prompt', sans-serif;
}
.hero-description {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Quick Links ===== */
.quick-links {
  background: var(--bg-light);
  padding: 3rem 0;
  margin-top: -3rem;
  position: relative;
  z-index: 2;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
  text-decoration: none;
  color: var(--text);
}
.quick-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.quick-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 1rem;
}
.quick-card-blue .quick-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.quick-card-green .quick-icon { background: linear-gradient(135deg, #10b981, #059669); }
.quick-card-orange .quick-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.quick-card-purple .quick-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.quick-text {
  font-weight: 600;
  font-size: .95rem;
  font-family: 'Prompt', sans-serif;
}

/* ===== Section ===== */
.section-news, .section-gallery, .section-services, .section-staff,
.section-news-list, .section-news-detail, .section-gallery-detail,
.section-documents, .section-ita, .section-contact, .section-about {
  padding: 4rem 0;
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-tag {
  display: inline-block;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: .75rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--gold);
  margin: 1rem auto 0;
  border-radius: 2px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ===== News Card ===== */
.news-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
}
.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.news-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.news-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--bg-light);
}
.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .5s ease;
}
.news-card:hover .news-card-image img { transform: scale(1.08); }
.news-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 3rem;
  color: rgba(0,0,0,0.15);
}
.news-card-image .news-card-placeholder {
  display: none;
}
.news-card-image.is-fallback img {
  display: none;
}
.news-card-image.is-fallback .news-card-placeholder {
  display: flex;
}
.news-card-category {
  position: absolute;
  top: 1rem; left: 1rem;
  color: #fff;
  padding: .25rem .75rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.news-card-body { padding: 1.5rem; }
.news-card-date {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.news-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--primary);
}
.news-card-excerpt {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-more {
  color: var(--gold-dark);
  font-weight: 500;
  font-size: .9rem;
}

.news-carousel {
  position: relative;
}

.news-spotlight {
  background: #fff;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(10, 39, 86, 0.08);
}

.news-spotlight-media {
  display: block;
  min-height: 320px;
  height: 100%;
  background: linear-gradient(135deg, #dfe8f6 0%, #f7f9fc 100%);
}

.news-spotlight-media img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
}

.news-spotlight-placeholder {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  font-size: 4rem;
}
.news-spotlight-media .news-spotlight-placeholder {
  display: none;
}
.news-spotlight-media.is-fallback img {
  display: none;
}
.news-spotlight-media.is-fallback .news-spotlight-placeholder {
  display: flex;
}

.news-spotlight-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2rem 2.25rem;
}

.news-spotlight-meta {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.news-spotlight-category {
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border-radius: 999px;
}

.news-spotlight-date {
  color: var(--text-muted);
  font-size: .92rem;
}

.news-spotlight-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin-bottom: 1rem;
}

.news-spotlight-title a {
  color: var(--primary);
}

.news-spotlight-title a:hover {
  color: var(--gold-dark);
}

.news-spotlight-text {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.news-spotlight-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.news-spotlight-regno {
  color: var(--text-muted);
  font-size: .9rem;
}

.news-carousel-control {
  width: 56px;
  opacity: 1;
}

.news-carousel-control .carousel-control-prev-icon,
.news-carousel-control .carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: rgba(10, 39, 86, 0.8);
  background-size: 55%;
  box-shadow: var(--shadow);
}

.news-carousel-indicators {
  margin-bottom: 1rem;
}

.news-carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background-color: rgba(10, 39, 86, 0.25);
}

.news-carousel-indicators .active {
  background-color: var(--gold);
}

.section-header-compact {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
}

/* ===== Gallery Card ===== */
.section-gallery { background: var(--bg-light); }
.gallery-card {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.gallery-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.gallery-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery-card:hover .gallery-card-image img { transform: scale(1.1); }
.gallery-card-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 3rem; color: rgba(0,0,0,0.15);
  background: var(--bg-light);
}
.gallery-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  padding: 2rem 1rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
}
.gallery-card-body { padding: 1rem; }
.gallery-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-card-date, .gallery-card-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ===== Highlights ===== */
.section-highlights {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 4rem 0;
}
.highlight-card {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  transition: var(--transition);
  height: 100%;
}
.highlight-card:hover {
  background: rgba(212, 169, 61, 0.1);
  border-color: var(--gold);
  transform: translateY(-5px);
}
.highlight-icon {
  width: 70px; height: 70px;
  margin: 0 auto 1rem;
  background: rgba(212, 169, 61, 0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light);
  font-size: 1.8rem;
}
.highlight-card h4 { color: #fff; margin-bottom: .75rem; }
.highlight-card p { color: rgba(255,255,255,0.8); font-size: .95rem; margin: 0; }

/* ===== CTA ===== */
.section-cta { padding: 3rem 0; background: var(--bg-light); }
.cta-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.cta-box h3 { color: #fff; margin-bottom: .5rem; }
.cta-box p { color: rgba(255,255,255,0.85); margin: 0; }

/* ===== Page Header ===== */
.page-header {
  background-image:
    url('/images/hero-mountains.svg'),
    linear-gradient(135deg, var(--primary-dark), var(--primary));
  background-repeat: no-repeat, no-repeat;
  background-position: center bottom, center;
  background-size: cover, cover;
  color: #fff;
  padding: 3rem 0 2rem;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(212, 169, 61, 0.15), transparent 50%),
    rgba(10, 39, 86, 0.55);
  pointer-events: none;
}
.page-header > .container { position: relative; z-index: 1; }
.page-header h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: .5rem;
}
.breadcrumb-light .breadcrumb-item { color: rgba(255,255,255,0.7); }
.breadcrumb-light .breadcrumb-item a { color: var(--gold-light); }
.breadcrumb-light .breadcrumb-item.active { color: rgba(255,255,255,0.9); }
.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.5); }

/* ===== Sidebar ===== */
.sidebar-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-title {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--gold);
}
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li { margin-bottom: .35rem; }
.category-list a {
  --cat-color: var(--primary);
  display: flex;
  align-items: center;
  padding: .6rem .85rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  border-left: 4px solid color-mix(in srgb, var(--cat-color) 35%, transparent);
  background: color-mix(in srgb, var(--cat-color) 6%, transparent);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.category-list a:hover {
  background: color-mix(in srgb, var(--cat-color) 14%, transparent);
  border-left-color: var(--cat-color);
  color: var(--cat-color);
  transform: translateX(2px);
}
.category-list a.active {
  background: var(--cat-color);
  border-left-color: var(--cat-color);
  color: #fff;
  font-weight: 600;
}
.category-list a.active .cat-dot {
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.news-content-ajax {
  position: relative;
  transition: opacity .2s ease;
  min-height: 240px;
}
.news-content-ajax.is-loading {
  opacity: .45;
  pointer-events: none;
}
.news-content-ajax.is-loading::after {
  content: '';
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(10, 39, 86, 0.18);
  border-top-color: var(--primary);
  animation: newsSpin .9s linear infinite;
  z-index: 5;
}
@keyframes newsSpin {
  to { transform: translateX(-50%) rotate(360deg); }
}
.cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: .6rem;
  display: inline-block;
  flex-shrink: 0;
}

/* ===== About Page ===== */
.about-block {
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
  position: relative;
}
.about-icon {
  position: absolute;
  top: -25px; left: 2rem;
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 16px rgba(212, 169, 61, 0.4);
}
.about-title { color: var(--primary); margin-bottom: 1.5rem; padding-top: .5rem; }
.about-content p { color: var(--text); line-height: 1.85; margin-bottom: 1rem; }

.info-card {
  padding: 2rem;
  border-radius: var(--radius);
  height: 100%;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.info-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.info-card-blue {
  background: linear-gradient(135deg, rgba(10, 39, 86, 0.04), rgba(10, 39, 86, 0.08));
  border-color: rgba(10, 39, 86, 0.15);
}
.info-card-gold {
  background: linear-gradient(135deg, rgba(212, 169, 61, 0.06), rgba(212, 169, 61, 0.12));
  border-color: rgba(212, 169, 61, 0.3);
}
.info-card-icon {
  font-size: 2rem;
  color: var(--gold-dark);
  margin-bottom: 1rem;
}
.info-card-blue .info-card-icon { color: var(--primary); }

.info-card-mini {
  background: #fff;
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  height: 100%;
}
.info-card-mini:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}
.mini-icon {
  width: 60px; height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.basic-info-box {
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--gold);
}
.table-info-school { margin: 0; }
.table-info-school th {
  width: 40%;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.table-info-school td {
  border-bottom: 1px solid var(--border);
}

/* ===== ข้อมูลโรงเรียน (info boxes) ===== */
.school-info-section { margin-top: 3rem; }
.info-box {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem 1.75rem 1.25rem;
  box-shadow: 0 6px 22px rgba(10, 39, 86, 0.06);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  transition: transform .2s, box-shadow .2s;
}
.info-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(10, 39, 86, 0.10);
}
.info-box-blue   { border-top-color: #1e4a8a; }
.info-box-gold   { border-top-color: var(--gold); }
.info-box-teal   { border-top-color: #0d9488; }
.info-box-purple { border-top-color: #7c3aed; }

.info-box-head {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--border);
}
.info-box-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f1f5fa, #dbe9ff);
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 1.35rem;
  color: var(--primary);
  flex-shrink: 0;
}
.info-box-blue   .info-box-icon { background: linear-gradient(135deg, #dbeafe, #93c5fd); color: #1e3a8a; }
.info-box-gold   .info-box-icon { background: linear-gradient(135deg, #fef3c7, #fcd34d); color: #92400e; }
.info-box-teal   .info-box-icon { background: linear-gradient(135deg, #ccfbf1, #5eead4); color: #115e59; }
.info-box-purple .info-box-icon { background: linear-gradient(135deg, #ede9fe, #c4b5fd); color: #5b21b6; }
.info-box-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.info-box-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(150px, 40%) 1fr;
  row-gap: .65rem;
  column-gap: 1rem;
  font-size: .95rem;
}
.info-box-list dt {
  color: #64748b;
  font-weight: 500;
  padding: .15rem 0;
}
.info-box-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  padding: .15rem 0;
  word-break: break-word;
}
.info-box-list a { color: var(--primary); text-decoration: none; }
.info-box-list a:hover { text-decoration: underline; }

@media (max-width: 575px) {
  .info-box { padding: 1.25rem; }
  .info-box-list {
    grid-template-columns: 1fr;
    row-gap: .25rem;
  }
  .info-box-list dt { color: var(--primary); font-weight: 600; margin-top: .35rem; }
  .info-box-list dd { padding-left: .25rem; }
}

.info-mini-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fff8e1, #fef3c7);
  border-radius: 14px;
  border-left: 4px solid var(--gold);
}
.info-mini-card > i {
  font-size: 1.75rem;
  color: var(--gold-dark);
}
.info-mini-label { font-size: .85rem; color: #78716c; }
.info-mini-value { font-weight: 600; color: var(--primary-dark); }

/* ===== Staff ===== */
.staff-section { margin-bottom: 4rem; }
.staff-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 3rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(212, 169, 61, 0.18), transparent 28%),
    linear-gradient(135deg, #f9fbff 0%, #eef4ff 100%);
  border: 1px solid rgba(10, 39, 86, 0.08);
  box-shadow: 0 24px 60px rgba(10, 39, 86, 0.08);
}
.staff-overview-copy .section-title {
  margin-bottom: .85rem;
}
.staff-overview-copy .section-subtitle {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted);
  line-height: 1.8;
}
.staff-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.staff-metric-card {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(10, 39, 86, 0.08);
  border-radius: 22px;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.staff-metric-label {
  display: block;
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: .45rem;
}
.staff-metric-card strong {
  display: block;
  color: var(--primary);
  font-size: clamp(1.5rem, 2vw, 2rem);
}
.staff-executive-section {
  margin-bottom: 4.5rem;
}
.staff-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(10, 39, 86, 0.08);
  transition: var(--transition);
  text-align: center;
  padding: 1.5rem;
  height: 100%;
  border: 1px solid rgba(10, 39, 86, 0.08);
}
.staff-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.staff-card-executive {
  padding: 2rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(10, 39, 86, 0.03) 0%, rgba(255,255,255,0) 52%),
    #fff;
}
.staff-card-executive-lead {
  border-color: rgba(212, 169, 61, 0.32);
  position: relative;
}
.staff-card-executive-deputy {
  min-height: 100%;
}
.staff-card-executive-lead::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}
.staff-photo {
  width: 140px; height: 140px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 12px rgba(212, 169, 61, 0.3);
}
.staff-photo-lg {
  width: 180px;
  height: 180px;
}
.staff-photo-sm {
  width: 180px;
  height: 180px;
}
.staff-photo img { width: 100%; height: 100%; object-fit: cover; }
.staff-photo-image {
  opacity: 0;
  transform: scale(1.035);
  transition: opacity .45s ease, transform .55s ease;
}
.staff-photo.is-loaded .staff-photo-image {
  opacity: 1;
  transform: scale(1);
}
.staff-photo-loading {
  position: relative;
  background: linear-gradient(145deg, #edf4ff 0%, #dfeafb 100%);
}
.staff-photo-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,0) 24%, rgba(255,255,255,.72) 50%, rgba(255,255,255,0) 76%);
  transform: translateX(-130%);
  animation: staffPhotoShimmer 1.55s infinite;
  z-index: 1;
}
.staff-photo-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  margin-left: -18px;
  border-radius: 50%;
  border: 3px solid rgba(212, 169, 61, 0.22);
  border-top-color: var(--gold);
  animation: staffPhotoSpin .9s linear infinite;
  z-index: 2;
}
.staff-photo.is-loaded::before,
.staff-photo.is-loaded::after,
.staff-photo.has-error::before,
.staff-photo.has-error::after {
  opacity: 0;
  animation: none;
  pointer-events: none;
}
.staff-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; background: var(--bg-light);
  font-size: 3rem; color: rgba(0,0,0,0.2);
  position: relative;
  z-index: 3;
}
.staff-info h3,
.staff-info h4,
.staff-info h5 {
  font-size: 1.05rem;
  margin-bottom: .35rem;
  color: var(--primary);
  line-height: 1.45;
}
.staff-info h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}
.staff-info h4 {
  font-size: 1rem;
}
.staff-rank,
.staff-position,
.staff-department {
  color: var(--text-muted);
  margin: 0;
}
.staff-department {
  margin-top: .35rem;
  font-size: .92rem;
}
.staff-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-bottom: .9rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: rgba(212, 169, 61, 0.14);
  color: var(--gold-dark);
  font-size: .85rem;
  font-weight: 700;
}
.staff-card-executive-deputy .staff-chip {
  background: rgba(10, 39, 86, 0.09);
  color: var(--primary);
}
.staff-groups-shell {
  background: #fff;
  border-radius: 30px;
  padding: 2rem;
  border: 1px solid rgba(10, 39, 86, 0.08);
  box-shadow: 0 24px 60px rgba(10, 39, 86, 0.08);
}
.staff-groups-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.staff-groups-note {
  margin: 0;
  max-width: 360px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.8;
}
.staff-tabs-scroll {
  overflow-x: auto;
  padding-bottom: .25rem;
  margin-bottom: 1.75rem;
}
.staff-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: .85rem;
  min-width: 100%;
}
.staff-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 200px;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(10, 39, 86, 0.12);
  border-radius: 20px;
  background: #fff;
  color: var(--primary);
  transition: var(--transition);
  box-shadow: none;
}
.staff-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 169, 61, 0.55);
}
.staff-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 18px 36px rgba(10, 39, 86, 0.2);
}
.staff-tab-name {
  display: block;
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.45;
}
.staff-tab-count {
  margin-top: .35rem;
  font-size: .88rem;
  opacity: .78;
}
.staff-tab-content .tab-pane {
  outline: none;
}
.staff-group-panel {
  background: linear-gradient(180deg, rgba(10, 39, 86, 0.03), rgba(255,255,255,0));
  border-radius: 24px;
  padding: 1.5rem;
}
.staff-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.staff-group-title {
  margin: 0;
  color: var(--primary);
}
.staff-group-desc {
  margin: .35rem 0 0;
  color: var(--text-muted);
}
.staff-card-member {
  padding: 1.85rem 1.3rem 1.45rem;
  border-radius: 26px;
}
.staff-card-member .staff-photo {
  margin-bottom: 1.4rem;
  border-width: 4px;
  box-shadow: 0 12px 28px rgba(212, 169, 61, 0.24);
}
.staff-card-member .staff-info h4 {
  font-size: 1.1rem;
  line-height: 1.55;
  min-height: 3.3em;
}
.staff-card-member .staff-position {
  font-size: 1rem;
}

.staff-card-clickable {
  display: block;
  width: 100%;
  font-family: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(10, 39, 86, 0.08);
  cursor: pointer;
  position: relative;
}
.staff-card-clickable:focus-visible {
  outline: 3px solid rgba(212, 169, 61, 0.55);
  outline-offset: 3px;
}
.staff-card-clickable .staff-card-view-hint {
  display: inline-flex;
  align-items: center;
  margin-top: .55rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: rgba(10, 39, 86, 0.06);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease, background .25s ease, color .25s ease;
}
.staff-card-clickable:hover .staff-card-view-hint,
.staff-card-clickable:focus-visible .staff-card-view-hint {
  opacity: 1;
  transform: translateY(0);
  background: rgba(212, 169, 61, 0.18);
  color: var(--gold-dark);
}

#committeeMemberModal .modal-dialog {
  padding: 1.25rem;
}
.committee-profile-modal {
  border-radius: 26px;
  border: 0;
  box-shadow: 0 36px 90px rgba(10, 39, 86, 0.35);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #0a2756 0%, #1d4dab 100%);
  background-size: 200% 200%;
  animation: profileBgShift 14s ease-in-out infinite;
  transition: background .5s ease;
  color: #fff;
}
@keyframes profileBgShift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
#committeeMemberModal.show .committee-profile-modal {
  animation: profileBgShift 14s ease-in-out infinite, profilePopIn .55s cubic-bezier(.2,.9,.25,1.15);
}
@keyframes profilePopIn {
  0% { transform: translateY(18px) scale(.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.committee-profile-modal::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,0.18) 0, transparent 35%),
    radial-gradient(circle at 82% 8%, rgba(255,255,255,0.12) 0, transparent 38%);
  pointer-events: none;
  z-index: 0;
}
.committee-profile-hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: .85;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}
.committee-profile-hero-shape.s1 {
  width: 130px; height: 130px;
  left: 6%; top: 8%;
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 70%);
  animation: profileShapeDrift1 9s ease-in-out infinite, profileShapePulse 3.6s ease-in-out infinite;
}
.committee-profile-hero-shape.s2 {
  width: 180px; height: 180px;
  right: -40px; top: -40px;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
  animation: profileShapeDrift2 11s ease-in-out infinite, profileShapePulse 4.2s ease-in-out infinite;
}
.committee-profile-hero-shape.s3 {
  width: 90px; height: 90px;
  right: 20%; top: 32%;
  background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 70%);
  animation: profileShapeDrift3 7.5s ease-in-out infinite, profileShapePulse 2.8s ease-in-out infinite;
}
@keyframes profileShapePulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: .95; }
}
@keyframes profileShapeDrift1 {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(14px, 18px); }
}
@keyframes profileShapeDrift2 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50%      { transform: translate(-18px, 12px) rotate(8deg); }
}
@keyframes profileShapeDrift3 {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(-10px, -14px); }
}

/* JJK-themed gradient variants — each inspired by a character / domain */
/* v1 — Gojo Satoru (Limitless / Six Eyes): cyan-white energy */
.committee-profile-modal.bg-v1 {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.35) 0, transparent 38%),
    radial-gradient(circle at 75% 80%, rgba(0,200,255,0.45) 0, transparent 45%),
    linear-gradient(135deg, #0b1e54 0%, #1f4fbf 45%, #6bb6ff 100%);
}
/* v2 — Sukuna (King of Curses): blood crimson + black */
.committee-profile-modal.bg-v2 {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,40,40,0.45) 0, transparent 40%),
    radial-gradient(circle at 80% 75%, rgba(120,0,20,0.6) 0, transparent 50%),
    linear-gradient(135deg, #0a0000 0%, #4a0010 50%, #c8141f 100%);
}
/* v3 — Megumi Fushiguro (Ten Shadows): deep violet shadow */
.committee-profile-modal.bg-v3 {
  background:
    radial-gradient(circle at 25% 20%, rgba(140,70,255,0.35) 0, transparent 42%),
    radial-gradient(circle at 80% 85%, rgba(20,0,50,0.7) 0, transparent 50%),
    linear-gradient(135deg, #06000f 0%, #2b0a55 50%, #5d2c9a 100%);
}
/* v4 — Yuji Itadori (Cursed Energy): black + pink/red swirl */
.committee-profile-modal.bg-v4 {
  background:
    radial-gradient(circle at 70% 30%, rgba(255,80,120,0.4) 0, transparent 38%),
    radial-gradient(circle at 25% 75%, rgba(80,0,0,0.55) 0, transparent 45%),
    linear-gradient(135deg, #100506 0%, #3a0a16 50%, #b8324a 100%);
}
/* v5 — Nobara Kugisaki (Straw Doll Technique): rust + amber */
.committee-profile-modal.bg-v5 {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,180,80,0.35) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(120,30,20,0.6) 0, transparent 45%),
    linear-gradient(135deg, #1f0a06 0%, #6b2814 50%, #d97a3a 100%);
}
/* v6 — Mahito (Idle Transfiguration): sickly teal-green */
.committee-profile-modal.bg-v6 {
  background:
    radial-gradient(circle at 30% 25%, rgba(140,255,200,0.30) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(10,40,30,0.6) 0, transparent 45%),
    linear-gradient(135deg, #061310 0%, #14443a 50%, #3a8c70 100%);
}
/* v7 — Geto Suguru (Cursed Spirit Manipulation): cold purple-grey */
.committee-profile-modal.bg-v7 {
  background:
    radial-gradient(circle at 25% 75%, rgba(180,120,255,0.30) 0, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(10,5,30,0.7) 0, transparent 45%),
    linear-gradient(135deg, #0a0814 0%, #2a1f4a 50%, #5d4a8a 100%);
}
/* v8 — Malevolent Shrine (Domain Expansion): inferno red-orange-black */
.committee-profile-modal.bg-v8 {
  background:
    radial-gradient(circle at 50% 30%, rgba(255,140,0,0.45) 0, transparent 38%),
    radial-gradient(circle at 50% 85%, rgba(255,40,0,0.55) 0, transparent 50%),
    linear-gradient(180deg, #050000 0%, #3a0500 40%, #b82800 75%, #ff7a1a 100%);
}

/* === JJK skill effects =================================================== */
.committee-profile-skill {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.committee-profile-skill-label {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.35);
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  white-space: nowrap;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- v1: Gojo Hollow Purple --------------------------------------------- */
.bg-v1 .skill-a {
  opacity: 1;
  width: 220px; height: 220px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(220,170,255,0.85) 20%, rgba(140,60,230,0.7) 55%, rgba(70,0,140,0) 80%);
  filter: blur(2px);
  mix-blend-mode: screen;
  animation: gojoPurplePulse 2.4s ease-in-out infinite;
}
.bg-v1 .skill-b {
  opacity: 1;
  width: 280px; height: 280px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(80,180,255,0.6);
  box-shadow:
    0 0 30px rgba(80,180,255,0.5),
    inset 0 0 30px rgba(80,180,255,0.3);
  animation: gojoBlueSpin 4s linear infinite;
}
.bg-v1 .skill-c {
  opacity: 1;
  width: 340px; height: 340px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed rgba(255,80,80,0.55);
  box-shadow: 0 0 24px rgba(255,80,80,0.4);
  animation: gojoRedSpin 6s linear infinite reverse;
}
@keyframes gojoPurplePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); filter: blur(2px) brightness(1); }
  50%      { transform: translate(-50%, -50%) scale(1.08); filter: blur(1px) brightness(1.3); }
}
@keyframes gojoBlueSpin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes gojoRedSpin  { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* --- v2: Sukuna Dismantle (slashes) ------------------------------------- */
.bg-v2 .skill-a, .bg-v2 .skill-b, .bg-v2 .skill-c {
  opacity: 1;
  width: 140%; height: 4px;
  left: -20%; top: 30%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,80,80,0.95) 40%, #fff 50%, rgba(255,80,80,0.95) 60%, transparent 100%);
  box-shadow: 0 0 20px rgba(255,40,40,0.9), 0 0 40px rgba(255,0,0,0.6);
  filter: blur(.6px);
}
.bg-v2 .skill-a { transform: rotate(-22deg); animation: sukunaSlash 3s ease-in-out infinite; }
.bg-v2 .skill-b { top: 55%; transform: rotate(18deg); animation: sukunaSlash 3.4s ease-in-out infinite .4s; }
.bg-v2 .skill-c { top: 18%; transform: rotate(-8deg); animation: sukunaSlash 2.8s ease-in-out infinite .8s; }
@keyframes sukunaSlash {
  0%       { opacity: 0; transform: rotate(var(--r, -22deg)) translateX(-30%); }
  20%, 80% { opacity: 1; transform: rotate(var(--r, -22deg)) translateX(0); }
  100%     { opacity: 0; transform: rotate(var(--r, -22deg)) translateX(20%); }
}

/* --- v3: Megumi Ten Shadows (shadow chains) ----------------------------- */
.bg-v3 .skill-a {
  opacity: 1;
  width: 160px; height: 160px;
  left: 15%; top: 20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,0.9) 0%, rgba(80,40,160,0.4) 50%, transparent 80%);
  filter: blur(4px);
  animation: megumiShadow 5s ease-in-out infinite;
}
.bg-v3 .skill-b {
  opacity: 1;
  width: 120px; height: 120px;
  right: 12%; top: 55%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,0.85) 0%, rgba(100,60,180,0.35) 55%, transparent 80%);
  filter: blur(5px);
  animation: megumiShadow 4.2s ease-in-out infinite 1s;
}
.bg-v3 .skill-c {
  opacity: 1;
  width: 80px; height: 80px;
  left: 50%; top: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180,120,255,0.6) 0%, transparent 70%);
  filter: blur(3px);
  animation: megumiShadow 3.6s ease-in-out infinite .5s;
}
@keyframes megumiShadow {
  0%, 100% { transform: scale(1) translateY(0); opacity: .8; }
  50%      { transform: scale(1.15) translateY(-12px); opacity: 1; }
}

/* --- v4: Yuji Black Flash ------------------------------------------------ */
.bg-v4 .skill-a {
  opacity: 1;
  width: 240px; height: 240px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(200,80,255,0.5) 30%, transparent 70%);
  filter: blur(2px);
  mix-blend-mode: screen;
  animation: yujiFlash 2.6s ease-out infinite;
}
.bg-v4 .skill-b {
  opacity: 1;
  width: 300px; height: 300px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.7);
  animation: yujiShockwave 2.6s ease-out infinite;
}
.bg-v4 .skill-c {
  opacity: 1;
  width: 400px; height: 400px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255,120,180,0.5);
  animation: yujiShockwave 2.6s ease-out infinite .3s;
}
@keyframes yujiFlash {
  0%, 90%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  5%, 15%       { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}
@keyframes yujiShockwave {
  0%   { opacity: .9; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* --- v5: Nobara Hairpin (nails) ----------------------------------------- */
.bg-v5 .skill-a, .bg-v5 .skill-b, .bg-v5 .skill-c {
  opacity: 1;
  width: 4px; height: 50px;
  background: linear-gradient(180deg, #fff 0%, #ffd070 40%, #c8501a 100%);
  box-shadow: 0 0 12px rgba(255,180,80,0.7);
  border-radius: 2px;
}
.bg-v5 .skill-a { left: 22%; top: 18%; transform: rotate(15deg); animation: nobaraNail 3.4s ease-in-out infinite; }
.bg-v5 .skill-b { right: 25%; top: 30%; transform: rotate(-25deg); animation: nobaraNail 3.8s ease-in-out infinite .6s; }
.bg-v5 .skill-c { left: 45%; top: 55%; transform: rotate(10deg); animation: nobaraNail 3s ease-in-out infinite 1.2s; }
@keyframes nobaraNail {
  0%, 100% { opacity: .9; transform: translateY(0) rotate(var(--r, 15deg)); }
  50%      { opacity: 1; transform: translateY(-10px) rotate(var(--r, 15deg)); }
}

/* --- v6: Mahito Soul Touch (ripples) ------------------------------------ */
.bg-v6 .skill-a, .bg-v6 .skill-b, .bg-v6 .skill-c {
  opacity: 1;
  width: 100px; height: 100px;
  left: 50%; top: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(140,255,200,0.6);
  box-shadow: 0 0 18px rgba(140,255,200,0.4);
}
.bg-v6 .skill-a { animation: mahitoRipple 3.2s ease-out infinite; }
.bg-v6 .skill-b { animation: mahitoRipple 3.2s ease-out infinite 1s; }
.bg-v6 .skill-c { animation: mahitoRipple 3.2s ease-out infinite 2s; }
@keyframes mahitoRipple {
  0%   { opacity: .9; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.8); }
}

/* --- v7: Geto Cursed Spirits (floating orbs) ---------------------------- */
.bg-v7 .skill-a, .bg-v7 .skill-b, .bg-v7 .skill-c {
  opacity: 1;
  border-radius: 50%;
  filter: blur(1px);
  mix-blend-mode: screen;
}
.bg-v7 .skill-a {
  width: 90px; height: 90px;
  left: 18%; top: 25%;
  background: radial-gradient(circle, rgba(180,120,255,0.85) 0%, rgba(80,40,140,0.5) 50%, transparent 80%);
  animation: getoOrb 5s ease-in-out infinite;
}
.bg-v7 .skill-b {
  width: 70px; height: 70px;
  right: 20%; top: 18%;
  background: radial-gradient(circle, rgba(220,180,255,0.85) 0%, rgba(120,80,180,0.5) 50%, transparent 80%);
  animation: getoOrb 4.4s ease-in-out infinite .8s;
}
.bg-v7 .skill-c {
  width: 60px; height: 60px;
  left: 60%; top: 55%;
  background: radial-gradient(circle, rgba(150,100,220,0.85) 0%, rgba(60,30,120,0.5) 50%, transparent 80%);
  animation: getoOrb 3.8s ease-in-out infinite 1.4s;
}
@keyframes getoOrb {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(18px,-14px) scale(1.1); }
  66%      { transform: translate(-12px,16px) scale(.95); }
}

/* --- v8: Malevolent Shrine (dismantle + cleave crosshatch) -------------- */
.bg-v8 .skill-a, .bg-v8 .skill-b, .bg-v8 .skill-c {
  opacity: 1;
  background: linear-gradient(90deg, transparent 0%, rgba(255,180,40,0.9) 40%, #fff 50%, rgba(255,80,0,0.9) 60%, transparent 100%);
  box-shadow: 0 0 24px rgba(255,120,0,0.8), 0 0 48px rgba(255,40,0,0.5);
  filter: blur(.4px);
}
.bg-v8 .skill-a {
  width: 4px; height: 140%;
  left: 30%; top: -20%;
  animation: shrineSlashV 2.2s ease-in-out infinite;
}
.bg-v8 .skill-b {
  width: 4px; height: 140%;
  left: 65%; top: -20%;
  animation: shrineSlashV 2.6s ease-in-out infinite .4s;
}
.bg-v8 .skill-c {
  width: 140%; height: 4px;
  top: 45%; left: -20%;
  animation: shrineSlashH 2.4s ease-in-out infinite .2s;
}
@keyframes shrineSlashV {
  0%, 100% { opacity: 0; transform: translateY(-10%); }
  20%, 80% { opacity: 1; transform: translateY(0); }
}
@keyframes shrineSlashH {
  0%, 100% { opacity: 0; transform: translateX(-10%); }
  20%, 80% { opacity: 1; transform: translateX(0); }
}

/* Cursed-energy domain pattern overlay — subtle radial rings + diagonal lines */
.committee-profile-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(from 0deg at 50% 35%, rgba(255,255,255,0.04) 0deg 6deg, transparent 6deg 18deg),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 14px);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
  opacity: .85;
  animation: profileDomainSpin 60s linear infinite;
}
@keyframes profileDomainSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.committee-profile-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.92);
  background-position: center;
  background-size: 14px;
  opacity: 1;
  box-shadow: 0 6px 16px rgba(10, 39, 86, 0.25);
  transition: transform .2s ease, background-color .2s ease;
}
.committee-profile-close:hover {
  background-color: #fff;
  transform: scale(1.06);
  opacity: 1;
}
.committee-profile-body {
  padding: 0;
  position: relative;
  z-index: 1;
  background: transparent;
}
.committee-profile-top {
  padding: 3.25rem 2.5rem 2.25rem;
  display: flex;
  justify-content: center;
}
.committee-profile-sheet {
  background: #fff;
  color: var(--text);
  border-radius: 32px 32px 0 0;
  padding: 2.25rem 2rem 2rem;
  margin: 0 1rem;
  box-shadow: 0 -10px 28px rgba(10, 39, 86, 0.12);
  position: relative;
  animation: profileSheetUp .55s cubic-bezier(.2,.9,.25,1.15) .1s both;
}
@keyframes profileSheetUp {
  0% { transform: translateY(28px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.committee-profile-footer {
  position: relative;
  z-index: 1;
  background: #fff;
  color: var(--text);
  padding: .5rem 2rem 1.75rem;
  margin: 0 1rem;
  justify-content: center;
  gap: .75rem;
}
.committee-profile-sheet + .modal-footer,
.committee-profile-modal .modal-footer { border-top: 0; }

.committee-profile-photo {
  margin: 0;
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid rgba(255,255,255,0.95);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  background: #f5f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-radius .35s ease, width .35s ease, height .35s ease, box-shadow .35s ease;
  animation: profilePhotoFloat 5s ease-in-out infinite;
}
@keyframes profilePhotoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.committee-profile-photo:hover {
  transform: translateY(-8px) scale(1.03);
  animation-play-state: paused;
}
.committee-profile-photo.is-zoomed {
  animation: none;
}
.committee-profile-photo:hover { transform: scale(1.03); }
.committee-profile-photo.is-zoomed {
  width: min(86vw, 420px);
  height: min(86vw, 420px);
  border-radius: 18px;
  cursor: zoom-out;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  transform: none;
}
.committee-profile-photo.is-zoomed:hover { transform: none; }
.committee-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.committee-profile-meta { width: 100%; text-align: center; padding-bottom: .5rem; }
.committee-profile-meta h3 {
  margin-bottom: .55rem;
  font-size: 1.55rem;
  line-height: 1.3;
}
.committee-profile-meta p { margin-bottom: .35rem; }
.committee-profile-meta p:last-child { margin-bottom: 0; }
@media (min-width: 576px) {
  .committee-profile-photo {
    width: 230px;
    height: 230px;
  }
}
.committee-profile-meta { min-width: 0; flex: 1; }
.committee-profile-role {
  color: var(--gold-dark);
  font-weight: 600;
}
.committee-profile-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(10, 39, 86, 0.08);
}
.committee-profile-section-title {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: .85rem;
}
.committee-profile-section p { line-height: 1.7; }
.committee-profile-contact li { margin-bottom: .65rem; }
.committee-profile-contact a { color: var(--primary); text-decoration: none; }
.committee-profile-contact a:hover { text-decoration: underline; }

.committee-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.committee-attachment-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(10, 39, 86, 0.12);
  box-shadow: 0 14px 30px rgba(10, 39, 86, 0.08);
  color: var(--text);
  transition: var(--transition);
}
.committee-attachment-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 169, 61, 0.48);
  box-shadow: 0 18px 36px rgba(10, 39, 86, 0.12);
  color: var(--text);
}
.committee-attachment-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10, 39, 86, 0.12), rgba(10, 39, 86, 0.04));
  color: var(--primary);
  font-size: 1.4rem;
  flex-shrink: 0;
}
.committee-attachment-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.committee-attachment-copy strong {
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.35;
}
.committee-attachment-copy span {
  margin-top: .2rem;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.55;
}
.committee-attachment-copy small {
  margin-top: .4rem;
  color: var(--gold-dark);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.committee-attachment-action {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 169, 61, 0.16);
  color: var(--gold-dark);
  font-size: 1rem;
  flex-shrink: 0;
}

@keyframes staffPhotoShimmer {
  100% { transform: translateX(130%); }
}

@keyframes staffPhotoSpin {
  to { transform: rotate(360deg); }
}

/* ===== News Detail ===== */
.section-news-detail .news-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .5rem; margin-bottom: 1rem; color: var(--text-muted);
  font-size: .9rem;
}
.news-category-tag {
  color: #fff; padding: .3rem .8rem;
  border-radius: 50px; font-size: .85rem;
}
.news-detail-title-page { font-size: 1.5rem !important; }
.news-detail-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary);
  line-height: 1.4;
}
.news-detail-cover {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #eef4ff 0%, #dbe8ff 100%);
}
.news-detail-cover img { width: 100%; height: auto; }
.news-detail-cover-placeholder {
  display: none;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
.news-detail-cover-placeholder i {
  font-size: 3rem;
  color: var(--primary);
}
.news-detail-cover.is-fallback img {
  display: none;
}
.news-detail-cover.is-fallback .news-detail-cover-placeholder {
  display: flex;
}
.news-excerpt {
  background: var(--bg-light);
  border-left: 4px solid var(--gold);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--text);
  font-style: italic;
}
.news-detail-content {
  font-size: 1.05rem;
  line-height: 1.85;
}
.news-detail-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1rem 0; }
.news-detail-content h2, .news-detail-content h3, .news-detail-content h4 {
  margin-top: 2rem; margin-bottom: 1rem;
}
.news-author {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .9rem;
}
/* รูปประกอบในหน้ารายละเอียดข่าว */
.news-images-gallery h4 {
  color: var(--primary);
  font-size: 1.2rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
}
.news-image-thumb {
  display: block;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.news-image-thumb:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow);
}
.news-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--text);
  margin-right: .35rem;
  transition: var(--transition);
}
.share-fb:hover { background: #1877f2; color: #fff; }
.share-line:hover { background: #00b900; color: #fff; }

/* ===== Services ===== */
.service-card {
  display: block;
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  height: 100%;
  border: 1px solid transparent;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
  color: inherit;
}
.service-icon {
  width: 70px; height: 70px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}
.service-card h4 { font-size: 1.15rem; margin-bottom: .5rem; }
.service-card p { color: var(--text-muted); font-size: .95rem; margin-bottom: 1rem; }
.service-link { color: var(--gold-dark); font-weight: 600; }

/* ===== Documents ===== */
.document-list {
  display: flex; flex-direction: column; gap: .75rem;
}
.document-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.document-item:hover { box-shadow: var(--shadow); transform: translateX(4px); }
.document-icon { font-size: 2.5rem; flex-shrink: 0; }
.document-info { flex: 1; min-width: 0; }
.document-info h5 { margin: 0 0 .25rem; font-size: 1.05rem; color: var(--primary); }
.document-meta {
  display: flex; flex-wrap: wrap; gap: 1rem;
  color: var(--text-muted); font-size: .85rem;
}

/* ===== ITA ===== */
.section-ita { background: var(--bg-light); }
.ita-group {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.ita-group-title {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--gold);
}
.ita-badge {
  background: var(--primary);
  color: #fff;
  padding: .25rem .65rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
}
.ita-doc-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  margin-bottom: .5rem;
}
.ita-doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.ita-doc-info { flex: 1; min-width: 0; }
.ita-doc-info h6 { margin: 0; font-size: .95rem; }

/* ===== Contact ===== */
.section-contact { background: var(--bg-light); }
.contact-info-box {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  display: flex; gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.contact-icon {
  width: 45px; height: 45px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.contact-list h6 { font-size: .9rem; color: var(--text-muted); margin-bottom: .15rem; font-weight: 500; }
.contact-list p { margin: 0; color: var(--text); }
.contact-map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: 100%;
  min-height: 450px;
}
.contact-map iframe { display: block; height: 100%; min-height: 450px; }
.social-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--text);
  margin-right: .5rem;
  transition: var(--transition);
}
.social-fb:hover { background: #1877f2; color: #fff; transform: translateY(-3px); }
.social-line:hover { background: #00b900; color: #fff; transform: translateY(-3px); }
.social-yt:hover { background: #ff0000; color: #fff; transform: translateY(-3px); }

/* ===== Footer ===== */
.footer-main {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: rgba(255,255,255,0.85);
  padding: 4rem 0 2rem;
}
.footer-main h5 { color: #fff; }
.footer-brand { display: flex; align-items: center; }
.footer-logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}
.footer-name-th { font-family: 'Prompt'; font-weight: 600; color: #fff; font-size: 1.1rem; }
.footer-name-en { font-size: .8rem; color: rgba(255,255,255,0.7); }
.footer-title {
  color: var(--gold-light) !important;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: .5rem;
}
.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 30px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a {
  color: rgba(255,255,255,0.75);
  font-size: .92rem;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--gold-light); padding-left: 4px; }
.footer-contact li {
  display: flex; gap: .75rem;
  margin-bottom: .75rem;
  font-size: .92rem;
}
.footer-contact i { color: var(--gold-light); flex-shrink: 0; margin-top: .25rem; }
.footer-contact a { color: rgba(255,255,255,0.85); }
.footer-contact a:hover { color: var(--gold-light); }
.footer-social a {
  display: inline-flex;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 50%;
  align-items: center; justify-content: center;
  margin-right: .35rem;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--gold); transform: translateY(-3px); }
.footer-divider { border-color: rgba(255,255,255,0.15); margin: 2rem 0 1.5rem; }

/* ===== Back to top ===== */
.btn-back-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.btn-back-top.show { opacity: 1; visibility: visible; }
.btn-back-top:hover { background: var(--gold); transform: translateY(-3px); }

/* ===== Pagination ===== */
.pagination .page-link {
  border-color: var(--border);
  color: var(--primary);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ===== Empty State ===== */
.empty-state { color: var(--text-muted); }

/* ===== Flash ===== */
.flash-container {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 1050;
  max-width: 400px;
}

/* ===== Error ===== */
.error-section {
  padding: 5rem 0;
  min-height: 70vh;
  display: flex;
  align-items: center;
}
.error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 700;
  color: var(--gold);
  font-family: 'Prompt';
  line-height: 1;
}
.error-title { font-size: 1.75rem; margin: 1rem 0; }
.error-text { color: var(--text-muted); margin-bottom: 2rem; }

/* ===== Gallery Grid (detail) ===== */
.gallery-grid .gallery-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.gallery-grid .gallery-thumb:hover { transform: scale(1.04); box-shadow: var(--shadow); }
.gallery-grid .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-detail-meta {
  display: flex; flex-wrap: wrap; gap: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.gallery-detail-desc {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== FAQ Accordion ===== */
.section-faq { padding: 4rem 0; }
.faq-group { }
.faq-group-title {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #dbe9ff, #c7dcff);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 1.15rem;
  padding: .55rem 1.25rem .55rem 1rem;
  border-radius: 12px 12px 12px 0;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(10, 39, 86, 0.08);
}
.faq-group-count {
  margin-left: .5rem;
  color: var(--primary);
  font-weight: 500;
  opacity: .75;
  font-size: .9em;
}
.faq-accordion .accordion-item {
  border: none;
  margin-bottom: .75rem;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-accordion .accordion-button {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary);
  background: #fff;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.faq-accordion .accordion-button:not(.collapsed) {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: none;
}
.faq-accordion .accordion-button:focus { box-shadow: none; }
.faq-q-icon, .faq-a-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--gold);
  color: #fff;
  font-family: 'Prompt';
}
.faq-a-icon { background: var(--primary); margin-right: 1rem; }
.faq-accordion .accordion-button:not(.collapsed) .faq-q-icon { background: var(--gold-light); color: var(--primary-dark); }
.faq-q-text { flex: 1; }
.faq-accordion .accordion-body {
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--bg-light);
}
.faq-a-text {
  flex: 1;
  line-height: 1.85;
  font-size: 1rem;
}
.faq-accordion .accordion-button::after {
  margin-left: auto;
}

/* ===== Page Detail ===== */
.section-page-detail { padding: 3rem 0 4rem; }

/* ===== Organization Structure ===== */
.organization-block {
  margin-top: 2rem;
}

.organization-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.96) 0%, #ffffff 100%);
  border: 1px solid rgba(10, 39, 86, 0.08);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-sm);
  position: relative;
  padding-right: 180px;
  min-height: 96px;
}

.organization-toolbar-copy {
  flex: 1 1 420px;
  min-width: 0;
}

.organization-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .25rem;
}

.organization-subtitle {
  margin: 0;
  color: var(--text-muted);
}

.organization-year-form {
  display: flex;
  align-items: center;
  width: 148px;
  min-width: 148px;
  margin-left: 0;
  padding: .22rem;
  background: linear-gradient(135deg, #6dce70, #52ae58);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(79, 157, 88, 0.22);
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.organization-year-label {
  display: none !important;
}

.organization-year-form .form-select {
  min-width: 100%;
  border: 0;
  border-radius: 11px;
  font-weight: 700;
  color: #fff;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  padding: .58rem 2.15rem .58rem .85rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 1.05rem;
  line-height: 1.1;
}

.organization-year-form::after {
  content: '\F282';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.organization-year-form .form-select:focus {
  box-shadow: none;
  outline: none;
}

.organization-tabs-wrap {
  display: grid;
  gap: 1rem;
}

.organization-tabs-scroll {
  overflow-x: auto;
  padding-bottom: .15rem;
  scrollbar-width: thin;
}

.organization-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: .75rem;
  min-width: 100%;
}

.organization-tab {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: min(220px, 70vw);
  padding: .75rem 1rem;
  border: 1px solid rgba(10, 39, 86, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-align: left;
}

.organization-tab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--primary);
}

.organization-tab.active {
  background: linear-gradient(135deg, rgba(10, 39, 86, 0.98), rgba(31, 82, 156, 0.94));
  border-color: rgba(10, 39, 86, 0.18);
  color: #fff;
  box-shadow: 0 14px 28px rgba(10, 39, 86, 0.18);
}

.organization-tab-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.organization-tab-title {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.organization-tab-meta {
  display: none !important;
}

.organization-tab-content .tab-pane {
  margin-top: 0;
}

.organization-tab-index,
.organization-section-index {
  display: none !important;
}

.organization-section-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid rgba(10, 39, 86, 0.08);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.organization-section-header {
  display: flex;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(10, 39, 86, 0.98), rgba(31, 82, 156, 0.92));
  color: #fff;
}

.organization-section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.organization-section-meta {
  margin: .25rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: .92rem;
}

.organization-items {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.organization-item {
  border: 1px solid rgba(10, 39, 86, 0.08);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: #fff;
}

.organization-item-title {
  margin: 0 0 .75rem;
  color: var(--primary);
  font-size: 1.02rem;
  font-weight: 700;
}

.organization-concept-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
}

.organization-concept-list li + li {
  margin-top: .45rem;
}

@media (max-width: 768px) {
  .organization-toolbar {
    padding: 1rem;
    padding-right: 1rem;
    min-height: auto;
  }

  .organization-year-form {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    position: static;
  }

  .organization-tab {
    min-width: 190px;
    width: 190px;
  }

  .organization-section-header {
    align-items: flex-start;
  }

  .organization-items {
    padding: 1rem;
  }
}
.page-cover img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}
.attached-file-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  transition: var(--transition);
}
.attached-file-link:hover {
  border-color: var(--gold);
  background: #fff;
  color: var(--text);
  transform: translateX(4px);
}
.attached-file-icon { font-size: 2.5rem; flex-shrink: 0; }
.attached-file-info { flex: 1; min-width: 0; }
.attached-file-info strong { display: block; color: var(--primary); }

/* ===== Complaint Form ===== */
.section-complaint { padding: 3rem 0 4rem; background: var(--bg-light); }
.section-complaint .card {
  border: none;
  border-radius: var(--radius);
}
.section-complaint .form-control,
.section-complaint .form-control-lg {
  border-radius: var(--radius-sm);
}
.success-card {
  background: #fff;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.success-icon {
  width: 80px; height: 80px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}
.success-card h3 { color: var(--primary); margin-bottom: 1rem; }

/* ===== Responsive ===== */
@media (max-width: 991px) {
  .topbar { font-size: .8rem; }
  .quick-links { margin-top: 0; padding: 2.5rem 0; }
  .hero { padding: 3.5rem 0 4.5rem; }
  .navbar-nav .nav-link.active::after { display: none; }
  .navbar-nav .nav-link.active { color: var(--gold-dark); }
  .section-news, .section-gallery, .section-services, .section-staff,
  .section-news-list, .section-news-detail, .section-gallery-detail,
  .section-documents, .section-ita, .section-contact, .section-about {
    padding: 3rem 0;
  }
  .staff-overview {
    grid-template-columns: 1fr;
  }
  .staff-groups-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .staff-groups-note {
    max-width: none;
    text-align: left;
  }
  .news-spotlight-body {
    padding: 1.5rem;
  }
  .news-spotlight-media,
  .news-spotlight-media img,
  .news-spotlight-placeholder {
    min-height: 240px;
  }
}
@media (max-width: 575px) {
  .topbar-info { display: none; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-logo { width: 110px; height: 110px; }
  .btn-back-top { bottom: 1rem; right: 1rem; width: 42px; height: 42px; }
  .flash-container { right: 10px; left: 10px; max-width: none; }
  .news-card-image { height: 180px; }
  .brand-logo-img { width: 44px; height: 44px; }
  .brand-th { font-size: .95rem !important; }
  .brand-en { font-size: .68rem !important; }
  .staff-overview,
  .staff-groups-shell,
  .staff-group-panel {
    padding: 1.25rem;
    border-radius: 22px;
  }
  .staff-metrics {
    grid-template-columns: 1fr;
  }
  .staff-tab {
    min-width: 150px;
    padding: .85rem 1rem;
  }
  .staff-photo-lg {
    width: 148px;
    height: 148px;
  }
  .staff-photo-sm {
    width: 148px;
    height: 148px;
  }
  .committee-attachment-card {
    grid-template-columns: auto 1fr;
  }
  .committee-attachment-action {
    display: none;
  }
  .staff-card {
    padding: 1.15rem;
    border-radius: 20px;
  }
  .staff-card-member {
    padding: 1.35rem 1rem 1.15rem;
  }
  .staff-card-member .staff-info h4 {
    min-height: auto;
    font-size: 1rem;
  }
}
