/*
 * Website Sekolah — penyesuaian tema dan komponen bersama.
 * Tema utama (CSS referensi Sekolahku): gray + indigo accent.
 */

:root {
  --primary: #475569;
  --primary-dark: #1e293b;
  --primary-light: #94a3b8;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, .12);
  --hero-end: #334155;
  --warm: #f59e0b;
  --bg: #f8fafc;
}
[data-theme="dark"] {
  --primary: #94a3b8;
  --primary-dark: #475569;
  --primary-light: #cbd5e1;
  --accent: #818cf8;
  --accent-dark: #6366f1;
  --accent-glow: rgba(129, 140, 248, .15);
  --hero-end: #334155;
}

/* Menu dinamis dengan label panjang */
.nav { align-items: center; }
.nav a, .nav-dd-btn { white-space: nowrap; }
.header .logo { flex: 0 0 auto; white-space: nowrap; font-size: 1.15rem; }
.header .logo span { white-space: nowrap; }
.header-inner { gap: 14px; }
.header .nav { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.header .nav a { padding-left: 10px; padding-right: 10px; font-size: .8rem; }
.header .nav-dd-btn { padding-left: 10px; padding-right: 10px; font-size: .8rem; }
.header .nav-spmb { flex: 0 0 auto; }
.header .header-actions { flex: 0 0 auto; }
@media (max-width: 1024px) {
  .header .logo { font-size: 1rem; gap: 7px; }
  .header .logo i { font-size: 1.2rem; }
  .header .nav { gap: 0; }
  .header .nav a, .header .nav-dd-btn { padding-left: 7px; padding-right: 7px; font-size: .75rem; }
}
.header-top-left { flex-wrap: wrap; }
.ht-hide-mobile { display: inline-flex; align-items: center; gap: 6px; }

/* Informasi sambutan di hero */
.hero-card-principal .hc-body { padding: 22px 24px; }
.hero-card-principal .hc-body p { margin-bottom: 0; }
.hero-card-principal .hc-body .hc-signature {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
}

/* Kartu galeri placeholder */
.gallery-placeholder {
  width: 100%; height: 100%; min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: rgba(255,255,255,.88);
  background: linear-gradient(135deg, #475569, #334155);
}
.gallery-placeholder:nth-child(3n+2) { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.gallery-placeholder i { font-size: 2rem; }
.gallery-placeholder span { font-family: var(--font); font-weight: 600; font-size: .88rem; }

/* Berita */
.news-card .bc-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.news-card .bc-excerpt { color: var(--text-soft); margin-top: 8px; }
.news-card .bc-meta span { display: inline-flex; gap: 5px; align-items: center; }
.news-detail { max-width: 850px; margin: 0 auto; }
.news-detail .nd-hero { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 28px; }
.news-detail .nd-meta { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 28px; color: var(--text-soft); font-size: .85rem; }
.news-detail .nd-meta span { display: inline-flex; gap: 7px; align-items: center; }
.news-detail .nd-content { color: var(--text); font-size: 1rem; line-height: 1.9; }
.news-detail .nd-content h2, .news-detail .nd-content h3 { color: var(--primary); margin: 1.5em 0 .65em; }
.news-detail .nd-content p { margin: 0 0 1.15em; }
.news-detail .nd-content ul, .news-detail .nd-content ol { padding-left: 1.5em; margin-bottom: 1.15em; }
.news-detail .nd-content blockquote { border-left: 4px solid var(--accent); padding: 12px 22px; margin: 24px 0; background: var(--accent-glow); border-radius: 0 var(--radius) var(--radius) 0; }

/* Halaman statis */
.page-content { max-width: 860px; margin: 0 auto; }
.page-content h2, .page-content h3 { color: var(--primary); margin: 1.6em 0 .65em; }
.page-content h2:first-child, .page-content h3:first-child { margin-top: 0; }
.page-content p { margin: 0 0 1.2em; color: var(--text-soft); line-height: 1.9; }
.page-content ul, .page-content ol { padding-left: 1.5em; margin-bottom: 1.3em; color: var(--text-soft); }
.page-content li { padding: 3px 0; }
.page-content blockquote { border-left: 4px solid var(--accent); padding: 12px 22px; margin: 24px 0; background: var(--accent-glow); }
.page-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.page-content th, .page-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.page-content th { background: var(--bg); color: var(--primary); }

/* Kontak dan formulir */
.form-notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; font-size: .9rem; }
.form-notice.success { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.form-notice.error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.form-notice.info { color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; }
[data-theme="dark"] .form-notice.success { color: #6ee7b7; background: #064e3b; border-color: #047857; }
[data-theme="dark"] .form-notice.error { color: #fca5a5; background: #7f1d1d; border-color: #b91c1c; }
[data-theme="dark"] .form-notice.info { color: #c7d2fe; background: #312e81; border-color: #4338ca; }
.contact-form .form-row input, .contact-form .form-row textarea { width: 100%; }
.contact-form .form-row { margin-bottom: 14px; }
.contact-form button:disabled { opacity: .65; cursor: wait; }

/* Galeri */
.gallery-grid { grid-auto-rows: 220px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Panel program lengkap */
.programs-grid.programs-grid-wide { grid-template-columns: repeat(4, 1fr); }

/* Tombol section */
.section-cta .btn { margin-top: 0; }

/* Responsive: tema referensi dibangun dari 1024px; rapikan topbar */
@media (max-width: 880px) {
  .ht-hide-mobile { display: none; }
  .programs-grid.programs-grid-wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .programs-grid.programs-grid-wide { grid-template-columns: 1fr; }
  .header-top-left { gap: 10px; font-size: .73rem; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Tombol teks lengkap "Baca selengkapnya" pada kartu sambutan hero
   (berbeda dari .hc-link referensi yang hanya ikon bulat 36px) */
.hc-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  transition: background .3s, border-color .3s, transform .3s;
}
.hc-more:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateX(3px);
}
.hc-more i { font-size: .68rem; transition: transform .3s; }
.hc-more:hover i { transform: translateX(3px); }

/* ===== Logo gambar (diunggah dari admin) ===== */
.logo .logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.footer-brand .logo .logo-img {
  width: 40px; height: 40px;
  box-shadow: none;
  background: transparent;
}

/* ===== Kartu guru (beranda) ===== */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.teacher-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s;
}
.teacher-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.tc-img {
  height: 220px;
  background: linear-gradient(150deg, var(--primary-dark), var(--primary));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tc-img img { width: 100%; height: 100%; object-fit: cover; }
.tc-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.25);
  display: grid; place-items: center;
  color: rgba(255,255,255,.8);
  font-size: 2.2rem;
}
.tc-body { padding: 20px 18px 24px; }
.tc-body h3 {
  font-size: .95rem;
  color: var(--primary);
  margin-bottom: 4px;
}
.tc-subject {
  display: inline-block;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.tc-competency {
  font-size: .8rem;
  line-height: 1.6;
  color: var(--text-soft);
}
@media (max-width: 1024px) { .teachers-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .teachers-grid { grid-template-columns: 1fr; } }

/* ===== Modal Sambutan Kepala Sekolah (muncul saat diklik) ===== */
.sambutan-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sambutan-modal.is-open { display: flex; }

.sambutan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(4px);
  animation: sambutanFade .25s ease both;
}

.sambutan-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  padding: 34px;
  animation: sambutanPop .3s cubic-bezier(.22, 1, .36, 1) both;
}

.sambutan-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .25s;
  z-index: 2;
}
.sambutan-modal-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

.sambutan-modal-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.sambutan-modal-photo {
  width: 108px; height: 108px;
  flex: 0 0 108px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent-glow);
  background: var(--bg);
}
.sambutan-modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.sambutan-modal-intro .st-badge { margin-bottom: 8px; }
.sambutan-modal-intro h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--primary); margin-bottom: 4px; }
.sambutan-modal-intro h3 { font-size: 1rem; color: var(--primary); margin: 8px 0 2px; }
.sambutan-modal-role { font-size: .82rem; color: var(--accent); font-weight: 600; }

.sambutan-modal-body h4 {
  font-family: var(--font);
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 14px;
}
.sambutan-modal-body p {
  color: var(--text-soft);
  line-height: 1.9;
  margin-bottom: 1em;
  font-size: .95rem;
}

.sambutan-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.sambutan-modal-sign {
  font-family: var(--font);
  font-weight: 700;
  color: var(--primary);
  font-size: .9rem;
}

@keyframes sambutanFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sambutanPop { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

body.sambutan-open { overflow: hidden; }

@media (max-width: 640px) {
  .sambutan-modal { padding: 12px; }
  .sambutan-modal-dialog { padding: 24px 18px; max-height: calc(100vh - 24px); }
  .sambutan-modal-head { gap: 16px; }
  .sambutan-modal-photo { width: 84px; height: 84px; flex-basis: 84px; }
}

/* ===== Counter di dalam area biru (hero) DISHILANGKAN =====
   Angka ini sudah diwakili oleh kartu counter putih di bawah hero,
   sehingga tidak perlu tampil dua kali di halaman biru. */
.hero-meta { display: none !important; }
