/* ============================================================
   MAN 1 BANGKA — Main Stylesheet
   Theme: Modern Islamic Elegant
   Primary: #0B3D2E (Deep Emerald)
   Accent:  #C9A84C (Gold)
   ============================================================ */

/* Google Fonts dimuat via <link> di HTML head dengan media="print" trick
   untuk non-blocking load. Hapus @import dari sini agar tidak ada
   request duplikat dan tidak memblokir render CSS. */

/* ---- RESET & VARIABLES ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* hilangkan kotak abu saat tap di mobile */
}

/* Font fallback stack — tampilkan teks system font sambil font kustom dimuat */
:root {
  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-arabic: "Amiri", "Georgia", serif;
}

button,
a,
.btn,
input,
select,
textarea,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

:root {
  --green-dark: #0b3d2e;
  --green-mid: #1a6b3c;
  --green: #2e9e5e;
  --green-light: #2e9e5e;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dark: #a07c2a;
  --cream: #faf7f0;
  --white: #ffffff;
  --gray-100: #f4f4f0;
  --gray-200: #e8e4dc;
  --gray-400: #a0998a;
  --gray-500: #857d72;
  --gray-600: #6b6259;
  --gray-800: #2d2a24;
  --shadow-sm: 0 2px 8px rgba(11, 61, 46, 0.08);
  --shadow-md: 0 8px 30px rgba(11, 61, 46, 0.14);
  --shadow-lg: 0 20px 60px rgba(11, 61, 46, 0.18);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-arabic: "Amiri", "Georgia", serif;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--gray-800);
  line-height: 1.7;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--green-mid);
  border-radius: 3px;
}

/* ---- TYPOGRAPHY ---- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--green-dark);
}
h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}
h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
}
h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
}
p {
  font-size: 0.975rem;
  color: var(--gray-600);
}
a {
  text-decoration: none;
  color: inherit;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  height: 72px;
  background: rgba(11, 61, 46, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 168, 76, 0.25);
  transition: var(--transition);
}
.navbar.scrolled {
  height: 62px;
  background: rgba(11, 61, 46, 0.98);
  box-shadow: var(--shadow-md);
}
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}
.navbar__logo {
  width: 44px;
  height: 44px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.navbar__title {
  display: flex;
  flex-direction: column;
}
.navbar__title span:first-child {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.navbar__title span:last-child {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.navbar__nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
  white-space: nowrap;
}
.navbar__nav a:hover,
.navbar__nav a.active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}
.navbar__nav a:focus {
  outline: none;
}
.navbar__nav a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
.navbar__nav a i {
  font-size: 0.9rem;
}
.navbar__cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Siswa info di navbar (desktop) ---- */
.navbar__siswa {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50px;
  padding: .28rem .65rem .28rem .28rem;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s;
}
.navbar__siswa:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(201,168,76,.4);
}

/* Avatar inisial — gradient gold ring */
.siswa-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 900;
  font-family: 'Georgia', serif;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(201,168,76,.35), 0 2px 8px rgba(0,0,0,.25);
  letter-spacing: 0;
  text-transform: uppercase;
}

.siswa-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 0;
}
.siswa-nama {
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: .1px;
}
.siswa-kelas {
  font-size: .62rem;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: .2px;
}

/* Logout button */
.siswa-logout {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(220,38,38,.15);
  color: #fca5a5;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
  text-decoration: none;
  transition: background .2s, color .2s, transform .15s;
  flex-shrink: 0;
  margin-left: .1rem;
}
.siswa-logout:hover {
  background: #dc2626;
  color: #fff;
  transform: scale(1.1);
}

/* Mobile nav logout item */
.mobile-nav-logout {
  color: #dc2626 !important;
  border-top: 1px solid rgba(0,0,0,.06) !important;
  margin-top: .25rem;
  padding-top: .75rem !important;
}

/* Mobile nav login item */
.mobile-nav-login {
  color: var(--gold) !important;
  font-weight: 700 !important;
  border-top: 1px solid rgba(201, 168, 76, 0.3) !important;
  margin-top: 8px;
}
.mobile-nav-login:hover {
  background: rgba(201, 168, 76, 0.15) !important;
}

.btn-nav {
  padding: 8px 20px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--green-dark) !important;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
  transition: var(--transition);
}
.btn-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201, 168, 76, 0.4);
  background: linear-gradient(
    135deg,
    var(--gold-light),
    var(--gold)
  ) !important;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Login Button — Desktop Navbar */
.navbar__login-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--gold);
  color: var(--green-dark) !important;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: var(--transition);
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.navbar__login-btn:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-1px);
}
.navbar__login-btn:focus {
  outline: none;
}
.navbar__login-btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
.navbar__login-btn i {
  font-size: 0.85rem;
}

/* Mobile Profile Card */
.mob-profile-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: 14px;
  padding: .85rem 1rem;
  margin-bottom: .25rem;
}
.mob-profile-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8c97a 0%, #c9a84c 50%, #a07c2a 100%);
  color: #0b3d2e;
  font-size: 1rem; font-weight: 900;
  font-family: Georgia, serif;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2.5px rgba(201,168,76,.4), 0 3px 10px rgba(0,0,0,.3);
  text-transform: uppercase;
}
.mob-profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mob-profile-nama {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-profile-kelas {
  font-size: .72rem;
  color: #e8c97a;
  font-weight: 600;
  letter-spacing: .2px;
}
.mob-profile-logout {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(220,38,38,.18);
  color: #fca5a5;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.mob-profile-logout:hover {
  background: #dc2626;
  color: #fff;
}
.mob-nav-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: .75rem 0;
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--green-dark);
  z-index: 999;
  overflow-y: auto;
  padding: 1.5rem;
  transform: translateX(-100%);
  transition: transform var(--transition);
}
.mobile-nav.open {
  transform: translateX(0);
}
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: var(--transition);
}
.mobile-nav a:hover {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}
.mobile-nav a i {
  font-size: 1.1rem;
  color: var(--gold);
  width: 20px;
  text-align: center;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: linear-gradient(
    160deg,
    var(--green-dark) 0%,
    #0d4a30 40%,
    #155e40 100%
  );
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 90px clamp(1rem, 5vw, 4rem) 2.5rem;
  text-align: center;
}
.hero__pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 20% 80%,
      rgba(201, 168, 76, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(201, 168, 76, 0.06) 0%,
      transparent 50%
    );
  pointer-events: none;
}
.hero__geo {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: clamp(700px, 65vw, 1100px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease both;
}
.hero__badge::before {
  content: "✦";
  font-size: 0.65rem;
}
.hero__arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  color: var(--gold-light);
  margin-bottom: 0.6rem;
  direction: rtl;
  animation: fadeInUp 0.7s 0.1s ease both;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 0.6rem;
  animation: fadeInUp 0.7s 0.2s ease both;
}
.hero__title span {
  color: var(--gold);
}
.hero__subtitle {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  animation: fadeInUp 0.7s 0.3s ease both;
}
.hero__desc {
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 1.25rem;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.7s 0.4s ease both;
}
.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.7s 0.5s ease both;
}
.hero__stats {
  display: flex;
  gap: 2rem;
  z-index: 2;
  animation: fadeInUp 0.7s 0.6s ease both;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 720px;
}
.stat {
  text-align: center;
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.6rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.stat__label {
  font-size: clamp(0.65rem, 0.78vw, 0.85rem);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}
.hero__scroll {
  margin-top: 0.75rem;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 2;
  animation: bounce 2s infinite;
}
.hero__scroll i {
  font-size: 1rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: var(--transition);
}
.btn:hover::before {
  background: rgba(255, 255, 255, 0.08);
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--green-dark);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(201, 168, 76, 0.45);
}
.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}
.btn-green {
  background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
  color: var(--white);
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.3);
}
.btn-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(26, 107, 60, 0.4);
}
.btn-sm {
  padding: 9px 20px;
  font-size: 0.82rem;
}

/* ============================================================
   SECTION COMMON
   ============================================================ */
section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem);
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-tag {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 50px;
  background: rgba(11, 61, 46, 0.08);
  color: var(--green-mid);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-header h2 {
  margin-bottom: 0.75rem;
}
.section-header p {
  max-width: 560px;
  margin: 0 auto;
}
.section-divider {
  width: 60px;
  height: 3px;
  margin: 1rem auto 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
}

/* ============================================================
   CARDS GRID
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.card__img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__img-placeholder {
  font-size: 3rem;
  opacity: 0.3;
}
.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__body {
  padding: 1.5rem;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}
.card__tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.tag-lomba {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.tag-kegiatan {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.tag-akademik {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}
.tag-ekskul {
  background: rgba(26, 107, 60, 0.1);
  color: var(--green-mid);
}
/* Kategori tambahan — sesuai ENUM tabel pengumuman */
.tag-umum {
  background: rgba(107, 114, 128, 0.1);
  color: #4b5563;
}
.tag-keagamaan {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}
.tag-libur {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}
.tag-pendaftaran {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.tag-gold {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold-dark);
}
.tag-nasional {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.tag-provinsi {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}
.tag-kabupaten {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.card__title {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.card__text {
  font-size: 0.87rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--gray-400);
  /* Deskripsi panjang TIDAK lagi memanjangkan kartu. Tinggi dibatasi (~5 baris)
     dan sisanya bisa di-scroll di dalam kotak, jadi semua kartu dalam satu grid
     tetap konsisten ukurannya tanpa kehilangan teks. */
  max-height: 8em;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}
.card__text::-webkit-scrollbar {
  width: 6px;
}
.card__text::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 99px;
}
.card__text::-webkit-scrollbar-track {
  background: transparent;
}
/* Utilitas deskripsi yang bisa di-scroll (dipakai di luar .card__text juga,
   mis. paragraf inline di kartu beranda). Tinggi tetap -> kartu konsisten. */
.desc-scroll {
  line-height: 1.6;
  max-height: 8em;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}
.desc-scroll::-webkit-scrollbar {
  width: 6px;
}
.desc-scroll::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 99px;
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
  overflow: hidden;
}
.card__meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.card__meta i {
  color: var(--gold-dark);
  margin-right: 4px;
}
.card__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================================
   PENGUMUMAN — HIGHLIGHT BANNER
   ============================================================ */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.highlight-card {
  background: linear-gradient(135deg, var(--green-dark) 0%, #1a5c3a 100%);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  border: 1px solid rgba(201, 168, 76, 0.2);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.highlight-card::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.08);
}
.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.highlight-card .card__tag {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
}
.highlight-card h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.highlight-card p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}
.highlight-card .date {
  color: var(--gold-light);
  font-size: 0.78rem;
  margin-top: 0.75rem;
}

/* ============================================================
   AGENDA — CALENDAR-STYLE
   ============================================================ */
.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.agenda-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--green-mid);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.agenda-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}
.agenda-date {
  flex-shrink: 0;
  text-align: center;
  background: var(--green-dark);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 60px;
}
.agenda-date .day {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}
.agenda-date .month {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-top: 2px;
}
.agenda-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.agenda-info h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}
.agenda-info p {
  font-size: 0.83rem;
}
.agenda-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--gray-400);
}
.agenda-meta i {
  color: var(--gold-dark);
  margin-right: 3px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  margin-bottom: 2rem;
}
.tabs__nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--gray-100);
  padding: 6px;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 9px 20px;
  border-radius: calc(var(--radius-lg) - 4px);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--gray-600);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn.active {
  background: var(--white);
  color: var(--green-dark);
  box-shadow: var(--shadow-sm);
}
.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ============================================================
   EKSKUL CARDS
   ============================================================ */
.ekskul-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.ekskul-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.ekskul-card__header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  padding: 2rem;
  text-align: center;
  position: relative;
}
.ekskul-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.2);
  border: 2px solid rgba(201, 168, 76, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 0.75rem;
  color: var(--gold);
}
.ekskul-card__title {
  color: var(--white);
  font-size: 1.05rem;
  line-height: 1.3;
  /* Pesan ruang tetap setinggi 2 baris. Tanpa ini, judul 1 baris membuat blok
     hijau (header) lebih pendek dari kartu berjudul 2 baris di baris grid yang
     sama -> tinggi hijau tampak tidak konsisten (lihat kartu prestasi beranda).
     Dengan min-height 2 baris, semua header hijau jadi seragam. */
  min-height: calc(1.3em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ekskul-card__body {
  padding: 1.5rem;
  /* Jaring pengaman: deskripsi/teks ditulis inline (mis. di highlight prestasi
     beranda) tanpa class clamp. word-break inherited memastikan string panjang
     tanpa spasi tetap terpecah & tidak meluber keluar kartu. */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ekskul-card__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ekskul-card__row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ekskul-card__row i {
  color: var(--gold-dark);
  margin-top: 2px;
  flex-shrink: 0;
}
.ekskul-card__footer {
  padding: 1rem 1.5rem;
  background: var(--gray-100);
  display: flex;
  justify-content: center;
}

/* ============================================================
   PRESTASI — PODIUM STYLE
   ============================================================ */
.prestasi-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter-btn {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  transition: var(--transition);
}
.filter-btn.active,
.filter-btn:hover {
  background: var(--green-dark);
  color: var(--gold);
  border-color: var(--green-dark);
}
.prestasi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.prestasi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.prestasi-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.prestasi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green-dark), var(--green-light));
}
.prestasi-card.nasional::before {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}
.prestasi-card.provinsi::before {
  background: linear-gradient(90deg, #ea580c, #fb923c);
}
.prestasi-card.kabupaten::before {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.prestasi-medali {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
}
.prestasi-card h4 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  padding-right: 2.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.prestasi-siswa {
  font-size: 0.85rem;
  color: var(--green-mid);
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prestasi-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.prestasi-year {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gray-200);
  font-weight: 700;
  margin-top: 0.75rem;
  line-height: 1;
}

/* ============================================================
   TESTIMONI — CAROUSEL
   ============================================================ */
.testimoni-section {
  background: var(--green-dark);
}
.testimoni-section .section-tag {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
}
.testimoni-section .section-header h2 {
  color: var(--white);
}
.testimoni-section .section-header p {
  color: rgba(255, 255, 255, 0.6);
}
.testimoni-section .section-divider {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.testimoni-slider {
  position: relative;
  overflow: hidden;
}
.testimoni-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.testimoni-card {
  flex: 0 0 calc(33.333% - 1rem);
  min-width: min(280px, 85vw);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 2rem;
  backdrop-filter: blur(8px);
}
.testimoni-card .quote {
  font-size: 2.5rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.testimoni-card .text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.testimoni-card .author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimoni-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--green-dark);
  font-size: 1rem;
  flex-shrink: 0;
}
.testimoni-card .author-info span:first-child {
  display: block;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}
.testimoni-card .author-info span:last-child {
  font-size: 0.78rem;
  color: var(--gold-light);
}
.testimoni-card .stars {
  color: var(--gold);
  font-size: 0.85rem;
  margin-top: 4px;
}
.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.slider-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.slider-btn:hover {
  background: var(--gold);
  color: var(--green-dark);
  border-color: var(--gold);
}
.slider-dots {
  display: flex;
  gap: 6px;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition);
}
.slider-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

/* ============================================================
   FORM
   ============================================================ */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full {
  grid-column: 1 / -1;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
}
.form-group label span {
  color: #dc2626;
}
.form-control {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--gray-100);
  transition: var(--transition);
  width: 100%;
  /* Mencegah placeholder overflow di layar kecil */
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
/* Placeholder truncation untuk semua input — penting di mobile */
input::placeholder,
.form-control::placeholder {
  color: var(--gray-400);
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-control:focus {
  outline: none;
  border-color: var(--green-mid);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
}
textarea.form-control {
  resize: vertical;
  min-height: 120px;
  /* Override: textarea harus bisa wrap — batalkan nowrap dari .form-control */
  white-space: pre-wrap;
  overflow: auto;
}
select.form-control {
  appearance: none;
  cursor: pointer;
  /* Override: select butuh overflow visible agar dropdown muncul normal */
  overflow: visible;
  white-space: nowrap; /* tetap nowrap agar teks terpotong rapi */
}
.rating-input {
  display: flex;
  gap: 6px;
}
.rating-input i {
  font-size: 1.5rem;
  color: var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
}
.rating-input i.active {
  color: var(--gold);
}
.rating-input i:hover {
  color: var(--gold);
  transform: scale(1.15);
}
.form-success {
  display: none;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(26, 107, 60, 0.08);
  border: 1px solid rgba(26, 107, 60, 0.2);
  color: var(--green-mid);
  font-weight: 600;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.form-success.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   GALERI
   ============================================================ */
.galeri-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.galeri-item {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.galeri-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 61, 46, 0);
  transition: var(--transition);
}
.galeri-item:hover::after {
  background: rgba(11, 61, 46, 0.5);
}
.galeri-item .galeri-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  z-index: 2;
  color: var(--white);
  font-size: 1.5rem;
}
.galeri-item:hover .galeri-overlay {
  opacity: 1;
}
.galeri-item .placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  color: var(--white);
}
.galeri-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.galeri-item:hover img {
  transform: scale(1.08);
}

/* ============================================================
   STATS SECTION
   ============================================================ */
.stats-section {
  background: linear-gradient(135deg, var(--green-dark), #0d4a30);
  padding: 4rem clamp(1rem, 5vw, 4rem);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
}
.stat-item {
  text-align: center;
}
.stat-item .num {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  display: block;
  margin-bottom: 0.4rem;
}
.stat-item .label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ============================================================
   KONTAK
   ============================================================ */
.kontak-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: var(--transition);
}
.kontak-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.kontak-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gold);
}
.kontak-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.kontak-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.kontak-info .jabatan {
  font-size: 0.78rem;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 6px;
}
.kontak-info .contact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-bottom: 2px;
}
.kontak-info .contact-row i {
  color: var(--green-mid);
  font-size: 0.8rem;
}

/* ============================================================
   FOOTER — MODERN ANIMATED BACKGROUND ("Aurora Madrasah")
   Layer-layer beranimasi:
   - Aurora mesh gradient (3 blob radial yang drift pelan)
   - Pola Islamic geometric (subtle, lambat berotasi)
   - Floating gold particles (twinkle + naik)
   - Glowing orbs (pulse halus)
   - Top shine line (shimmer emas)
   ============================================================ */
footer,
footer.footer-modern {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, #031a10 0%, #051f14 45%, #03130d 100%);
  color: rgba(255, 255, 255, 0.72);
  padding: 4.5rem clamp(1rem, 5vw, 4rem) 1.5rem;
}

/* Container layer animasi — di belakang konten */
.footer-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ---------- Aurora mesh ---------- */
.footer-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  will-change: transform;
}
.aurora-1 {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(46, 158, 94, 0.55) 0%, rgba(46, 158, 94, 0) 70%);
  animation: footerAurora1 24s ease-in-out infinite;
}
.aurora-2 {
  width: 460px; height: 460px;
  bottom: -160px; right: -100px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.42) 0%, rgba(201, 168, 76, 0) 70%);
  animation: footerAurora2 30s ease-in-out infinite;
}
.aurora-3 {
  width: 380px; height: 380px;
  top: 30%; left: 45%;
  background: radial-gradient(circle, rgba(232, 201, 122, 0.28) 0%, rgba(232, 201, 122, 0) 70%);
  animation: footerAurora3 36s ease-in-out infinite;
}

@keyframes footerAurora1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(120px, 60px) scale(1.15); }
}
@keyframes footerAurora2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-100px, -50px) scale(1.2); }
}
@keyframes footerAurora3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-30%, -60%) scale(1.25); }
}

/* ---------- Islamic geometric pattern (pelan rotate) ---------- */
.footer-pattern {
  position: absolute;
  inset: -10%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23e8c97a' stroke-width='0.8'><path d='M40 0 L80 40 L40 80 L0 40 Z'/><path d='M40 14 L66 40 L40 66 L14 40 Z'/><circle cx='40' cy='40' r='6'/><path d='M40 0 L40 80 M0 40 L80 40'/></g></svg>");
  background-size: 80px 80px;
  animation: footerPatternDrift 180s linear infinite;
  will-change: transform;
}
@keyframes footerPatternDrift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-80px, -80px) rotate(360deg); }
}

/* ---------- Glowing orbs (pulse) ---------- */
.footer-orbs { position: absolute; inset: 0; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  will-change: opacity, transform;
}
.orb-1 {
  width: 200px; height: 200px;
  top: 20%; left: 15%;
  background: radial-gradient(circle, rgba(232, 201, 122, 0.25) 0%, rgba(232, 201, 122, 0) 70%);
  animation: footerOrbPulse 7s ease-in-out infinite;
}
.orb-2 {
  width: 240px; height: 240px;
  bottom: 15%; right: 20%;
  background: radial-gradient(circle, rgba(46, 158, 94, 0.30) 0%, rgba(46, 158, 94, 0) 70%);
  animation: footerOrbPulse 9s ease-in-out infinite reverse;
}
@keyframes footerOrbPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.18); }
}

/* ---------- Floating gold particles (twinkle + rise) ---------- */
.footer-particles { position: absolute; inset: 0; }
.fp {
  position: absolute;
  bottom: -20px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-light, #e8c97a);
  box-shadow: 0 0 8px rgba(232, 201, 122, 0.85), 0 0 14px rgba(232, 201, 122, 0.45);
  opacity: 0;
  animation-name: footerParticleRise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
@keyframes footerParticleRise {
  0%   { transform: translateY(0) scale(0.6);  opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translateY(-50vh) scale(1.1); opacity: 0.9; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-100vh) scale(0.4); opacity: 0; }
}

/* ---------- Top glow line + shimmer ---------- */
footer.footer-modern::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 201, 122, 0.2) 20%,
    rgba(232, 201, 122, 0.85) 50%,
    rgba(232, 201, 122, 0.2) 80%,
    transparent 100%);
  z-index: 2;
}
.footer-shine {
  position: absolute;
  top: 0; left: -50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 230, 160, 0) 30%,
    rgba(255, 230, 160, 0.95) 50%,
    rgba(255, 230, 160, 0) 70%,
    transparent 100%);
  filter: blur(1px);
  animation: footerShine 6s ease-in-out infinite;
  z-index: 3;
}
@keyframes footerShine {
  0%   { left: -50%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ---------- Konten footer naik di atas layer animasi ---------- */
.footer-grid,
.footer-bottom {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand .logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}
.footer-brand .logo-wrap .logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-dark);
  font-size: 0.9rem;
}
.footer-brand .logo-text span:first-child {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(232, 201, 122, 0.35);
}
.footer-brand .logo-text span:last-child {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
}
.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.footer-socials {
  display: flex;
  gap: 8px;
}
.footer-socials a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 201, 122, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.footer-socials a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: -1;
}
.footer-socials a:hover {
  color: var(--green-dark);
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(201, 168, 76, 0.45);
}
.footer-socials a:hover::before { opacity: 1; }

.footer-col h4 {
  font-size: 0.9rem;
  color: var(--white);
  margin-bottom: 1rem;
  font-family: var(--font-display);
  position: relative;
  padding-bottom: 8px;
}
.footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col ul li a {
  font-size: 0.83rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
}
.footer-col ul li a i {
  font-size: 0.7rem;
  color: var(--gold);
  transition: var(--transition);
}
.footer-col ul li a:hover {
  color: var(--gold-light);
  padding-left: 6px;
}
.footer-col ul li a:hover i {
  transform: translateX(2px);
}
.footer-bottom {
  border-top: 1px solid rgba(232, 201, 122, 0.15);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom span {
  color: var(--gold);
}

/* Reduced motion — matikan semua animasi footer */
@media (prefers-reduced-motion: reduce) {
  .footer-aurora,
  .footer-pattern,
  .orb,
  .fp,
  .footer-shine {
    animation: none !important;
  }
  .fp { display: none; }
}

/* ============================================================
   PAGE HERO (sub pages) — Animated backdrop sama seperti hero beranda
   ============================================================ */
.page-hero {
  min-height: 280px;
  padding: 120px clamp(1rem, 5vw, 4rem) 3rem;
  background: #03130d;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* dot-pattern lama dinonaktifkan; digantikan oleh layer animasi di bawah */
.page-hero::before {
  content: none;
}

/* pastikan konten teks tetap di atas semua layer animasi */
.page-hero .breadcrumb,
.page-hero h1,
.page-hero p {
  position: relative;
  z-index: 5;
}
.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
}
.page-hero .breadcrumb a {
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}
.page-hero .breadcrumb a:hover {
  color: var(--gold);
}
.page-hero .breadcrumb i {
  font-size: 0.6rem;
}
.page-hero h1 {
  color: var(--white);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}
.page-hero p {
  color: rgba(255, 255, 255, 0.65);
  max-width: 540px;
}

/* === Layer 0: gradient hijau emas dengan tone hangat === */
.page-hero .bg-grad {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 18% 12%, rgba(217,119,6,.15) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 100%, rgba(217,119,6,.10) 0%, transparent 55%),
    radial-gradient(ellipse 110% 80% at 50% 50%, #1a7547 0%, #0e5234 32%, #073926 65%, #03130d 100%);
  z-index: 0;
}

/* === Layer 1: heritage grid bermotif arab yang bergeser perlahan === */
.page-hero .heritage-grid {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23e8c97a' stroke-width='0.7' opacity='0.5'><path d='M40 6 L48 32 L74 40 L48 48 L40 74 L32 48 L6 40 L32 32 Z'/><path d='M40 18 L60 40 L40 62 L20 40 Z'/><circle cx='40' cy='40' r='3.5'/></g></svg>");
  background-size: 80px 80px;
  opacity: .13;
  z-index: 1;
  pointer-events: none;
  animation: ph-heritage-drift 70s linear infinite;
}
@keyframes ph-heritage-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 80px 80px; }
}

/* === Layer 2: arabesque rings pulsing === */
.page-hero .arabesque-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    transparent 0, transparent calc(18% - 1px),
    rgba(232,201,122,.16) calc(18% - 1px), rgba(232,201,122,.16) calc(18% + 1px),
    transparent calc(18% + 1px), transparent calc(33% - 1px),
    rgba(232,201,122,.12) calc(33% - 1px), rgba(232,201,122,.12) calc(33% + 1px),
    transparent calc(33% + 1px), transparent calc(50% - 1px),
    rgba(232,201,122,.10) calc(50% - 1px), rgba(232,201,122,.10) calc(50% + 1px),
    transparent calc(50% + 1px), transparent calc(70% - 1px),
    rgba(232,201,122,.06) calc(70% - 1px), rgba(232,201,122,.06) calc(70% + 1px),
    transparent calc(70% + 1px));
  will-change: transform, opacity;
  animation: ph-arabesque-pulse 8s ease-in-out infinite;
}
@keyframes ph-arabesque-pulse {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  50%      { opacity: .85; transform: translate(-50%, -50%) scale(1.06) rotate(8deg); }
}

/* === Layer 2: dawn arch sweep === */
.page-hero .dawn-arch {
  position: absolute;
  top: -12%;
  left: 50%;
  width: 180vw;
  height: 65vw;
  max-width: 2400px;
  max-height: 600px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(232,201,122,.14) 0%, rgba(232,201,122,.06) 40%, transparent 75%);
  filter: blur(28px);
  will-change: transform, opacity;
  animation: ph-dawn-sweep 14s ease-in-out infinite alternate;
}
@keyframes ph-dawn-sweep {
  0%   { transform: translateX(-58%) scaleX(1);    opacity: .55; }
  50%  { transform: translateX(-50%) scaleX(1.05); opacity: .85; }
  100% { transform: translateX(-42%) scaleX(1);    opacity: .55; }
}

/* === Layer 2: rasi bintang berputar perlahan === */
.page-hero .constellation {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1000px;
  height: 1000px;
  max-width: 140vw;
  max-height: 140vw;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  opacity: .42;
  will-change: transform;
  animation: ph-constellation-rotate 90s linear infinite;
}
.page-hero .constellation svg {
  width: 100%;
  height: 100%;
}
@keyframes ph-constellation-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === Layer 2: dua bola cahaya hangat melayang === */
.page-hero .glow-tr {
  position: absolute;
  top: -200px;
  right: -200px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,201,122,.42) 0%, rgba(232,201,122,.10) 45%, transparent 75%);
  filter: blur(72px);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
  animation: ph-glow-tr-drift 20s ease-in-out infinite alternate;
}
@keyframes ph-glow-tr-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-9%, 7%) scale(1.1); }
}
.page-hero .glow-bl {
  position: absolute;
  bottom: -220px;
  left: -220px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,158,94,.38) 0%, rgba(46,158,94,.10) 45%, transparent 75%);
  filter: blur(82px);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
  animation: ph-glow-bl-drift 24s ease-in-out infinite alternate;
}
@keyframes ph-glow-bl-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8%, -8%) scale(1.12); }
}

/* === Layer 3: lampion melayang naik === */
.page-hero .lanterns {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}
.page-hero .lantern {
  position: absolute;
  bottom: -40px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,235,170,.95) 0%, rgba(232,201,122,.55) 45%, rgba(201,168,76,.10) 80%, transparent 100%);
  box-shadow: 0 0 28px rgba(232,201,122,.55), 0 0 60px rgba(232,201,122,.25);
  filter: blur(.5px);
  will-change: transform, opacity;
  animation: ph-lantern-rise linear infinite;
}
@keyframes ph-lantern-rise {
  0%   { transform: translate(0, 0)         scale(.7); opacity: 0; }
  8%   { opacity: .9; }
  45%  { transform: translate(15px, -260px) scale(1);  opacity: 1; }
  85%  { opacity: .65; }
  100% { transform: translate(-10px, -520px) scale(.45); opacity: 0; }
}

/* === Layer 4: partikel emas mengambang === */
.page-hero .h-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
.page-hero .h-particles .p {
  position: absolute;
  border-radius: 50%;
  background: rgba(232,201,122,.7);
  will-change: transform, opacity;
  animation: ph-float-up linear infinite;
}
@keyframes ph-float-up {
  0%   { transform: translateY(0)      scale(1);  opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: .6; }
  100% { transform: translateY(-440px) scale(.4); opacity: 0; }
}

/* === Mobile tweak: kurangi beban GPU === */
@media (max-width: 768px) {
  .page-hero .arabesque-rings { width: 520px; height: 520px; }
  .page-hero .constellation { display: none; }
  .page-hero .dawn-arch { filter: blur(20px); }
  .page-hero .lantern:nth-child(n+5) { display: none; }
  .page-hero .h-particles .p:nth-child(n+7) { display: none; }
  .page-hero .glow-tr { width: 280px; height: 280px; filter: blur(50px); }
  .page-hero .glow-bl { width: 280px; height: 280px; filter: blur(60px); }
}

/* === Reduced motion: matikan semua animasi === */
@media (prefers-reduced-motion: reduce) {
  .page-hero .heritage-grid,
  .page-hero .arabesque-rings,
  .page-hero .dawn-arch,
  .page-hero .constellation,
  .page-hero .lantern,
  .page-hero .glow-tr,
  .page-hero .glow-bl,
  .page-hero .h-particles .p {
    animation: none !important;
  }
}

/* ============================================================
   PAGE HERO → BODY WAVE DIVIDER
   Lekukan halus dari hero gelap ke body cream
   ============================================================ */
.page-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 60px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'><path d='M0,30 C300,60 900,0 1200,30 L1200,60 L0,60 Z' fill='%23faf7f0'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 6;
  pointer-events: none;
}

/* ============================================================
   SOFT HERITAGE CANVAS — backdrop body untuk halaman/* saja
   • Aurora wash drifting perlahan (desktop)
   • Heritage texture tipis (static)
   • Otomatis tidak aktif di beranda (tidak ada .page-hero)
   ============================================================ */
body:has(.page-hero) {
  position: relative;
}
body:has(.page-hero)::before,
body:has(.page-hero)::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}
/* aurora blob — gold hangat di kiri-atas */
body:has(.page-hero)::before {
  top: -20%;
  left: -15%;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(232, 201, 122, 0.22) 0%,
    rgba(232, 201, 122, 0.08) 40%,
    transparent 70%);
  filter: blur(60px);
  will-change: transform;
  animation: ph-aurora-warm 28s ease-in-out infinite alternate;
}
/* aurora blob — mint sejuk di kanan-bawah */
body:has(.page-hero)::after {
  bottom: -25%;
  right: -20%;
  width: 80vw;
  height: 80vw;
  max-width: 1000px;
  max-height: 1000px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(46, 158, 94, 0.18) 0%,
    rgba(46, 158, 94, 0.05) 45%,
    transparent 75%);
  filter: blur(70px);
  will-change: transform;
  animation: ph-aurora-cool 34s ease-in-out infinite alternate;
}
@keyframes ph-aurora-warm {
  0%   { transform: translate(0, 0)       scale(1);   opacity: 1; }
  100% { transform: translate(8%, 6%)     scale(1.1); opacity: 0.8; }
}
@keyframes ph-aurora-cool {
  0%   { transform: translate(0, 0)       scale(1);   opacity: 0.9; }
  100% { transform: translate(-7%, -5%)   scale(1.12); opacity: 1; }
}

/* heritage texture — motif geometri Islami sangat tipis, ditumpuk di body bg.
   Aurora di pseudo-elements melayang di atas tekstur ini. */
body:has(.page-hero) {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%230b3d2e' stroke-width='0.6' opacity='0.05'><path d='M60 10 L72 48 L110 60 L72 72 L60 110 L48 72 L10 60 L48 48 Z'/><circle cx='60' cy='60' r='3'/></g></svg>");
  background-repeat: repeat;
  background-size: 120px 120px;
  background-color: var(--cream);
}

/* ============================================================
   STICKY FILTER BAR — frosted glass di desktop, solid di mobile
   Otomatis aktif di section yang punya .filter-search-wrap
   ============================================================ */
.filter-search-wrap {
  position: sticky;
  top: 80px;
  z-index: 50;
  background: rgba(250, 247, 240, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(11, 61, 46, 0.06);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 16px rgba(11, 61, 46, 0.04);
  margin-bottom: 2rem;
}

/* ============================================================
   CARD REFINEMENT — sedikit lebih bulat & hover lebih elegan
   ============================================================ */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(11, 61, 46, 0.06);
  position: relative;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.5px solid transparent;
  pointer-events: none;
  transition: border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -12px rgba(11, 61, 46, 0.18);
}
.card:hover::after {
  border-color: rgba(201, 168, 76, 0.5);
}

/* ============================================================
   SECTION ORNAMENT — pemisah dekoratif Islami antar blok body
   Tambahkan class .section-ornament pada <div></div> kosong
   ============================================================ */
.section-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 3rem 0;
  opacity: 0.55;
}
.section-ornament::before,
.section-ornament::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.5), transparent);
}
.section-ornament i {
  font-size: 0.85rem;
  color: var(--gold);
}

/* ============================================================
   MOBILE TWEAKS — matikan beban GPU di layar kecil
   ============================================================ */
@media (max-width: 768px) {
  body:has(.page-hero)::before,
  body:has(.page-hero)::after {
    animation: none;
    opacity: 0.7;
    filter: blur(45px);
  }
  body:has(.page-hero) {
    background-size: 80px 80px;
  }
  .filter-search-wrap {
    position: static;
    background: rgba(250, 247, 240, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  .card:hover::after {
    border-color: transparent;
  }
}

/* ============================================================
   REDUCED MOTION — hormati preferensi user
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  body:has(.page-hero)::before,
  body:has(.page-hero)::after {
    animation: none !important;
  }
}

/* ============================================================
   BADGE & LABELS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  /* Sama seperti perbaikan .card__footer .badge sebelumnya, tapi digeneralisasi
     ke SEMUA badge: konten dinamis panjang (posisi, penghargaan, tingkat, dll.)
     membungkus alih-alih meluber keluar kartu. */
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
}
.badge > i,
.badge > svg {
  flex-shrink: 0;
}
.badge-green {
  background: rgba(26, 107, 60, 0.1);
  color: var(--green-mid);
}
.badge-gold {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-dark);
}
.badge-red {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.badge-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--gray-200);
  border-top-color: var(--green-mid);
  animation: spin 0.8s linear infinite;
}
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--gray-400);
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.4;
}
.empty-state p {
  font-size: 0.9rem;
}

/* ============================================================
   MODAL / LIGHTBOX
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.3s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s ease;
}
.modal__header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal__header h3 {
  font-size: 1.1rem;
}
.modal__close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-400);
  transition: var(--transition);
}
.modal__close:hover {
  color: var(--gray-800);
}
.modal__body {
  padding: 2rem;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
  max-width: 440px;
}
.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--white);
  color: var(--gray-800);
  transition: var(--transition);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
}
.search-bar i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
#scrollTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--gold);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 800;
}
#scrollTop.show {
  display: flex;
}
#scrollTop:hover {
  background: var(--gold);
  color: var(--green-dark);
  transform: translateY(-3px);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE — LENGKAP & KONSISTEN UNTUK HP
   ============================================================ */

/* ---- 1024px ---- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero {
    flex-direction: column;
  }
  .testimoni-card {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

/* ---- 768px: tablet & HP landscape ---- */
@media (max-width: 768px) {
  /* Navbar */
  .navbar__nav,
  .navbar__cta,
  .navbar__siswa {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .mobile-nav {
    display: block;
  }

  /* Login button tetap tampil di mobile — versi compact */
  .navbar__login-btn {
    padding: 7px 14px;
    font-size: 0.78rem;
    gap: 6px;
    margin-right: 0.5rem;
  }
  .navbar__login-btn i {
    font-size: 0.8rem;
  }

  /* Layout */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  section, .home-section, footer, .page-hero {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  /* Hero */
  .hero {
    padding: 90px 1rem 50px;
    text-align: center;
    align-items: center;
    min-height: auto;
  }
  .hero__content {
    max-width: 100%;
    align-items: center;
  }
  .hero__actions {
    justify-content: center;
  }
  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero__stats {
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
  }

  /* Grids */
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .highlight-grid,
  .prestasi-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Testimoni */
  .testimoni-card {
    flex: 0 0 100%;
    min-width: 0;
  }

  /* Ensure flex children don't overflow */
  .kontak-card,
  .agenda-item {
    flex-wrap: nowrap;
    overflow: hidden;
  }
}

/* ---- 480px: HP portrait standar ---- */
@media (max-width: 480px) {
  /* Global overflow lock */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  *, *::before, *::after {
    max-width: 100%;
    box-sizing: border-box;
  }
  img, video, iframe, table {
    max-width: 100%;
  }

  /* All sections */
  section, .home-section, footer, .page-hero,
  .stats-section, .testimoni-section {
    overflow-x: hidden;
    padding-left: clamp(0.85rem, 4vw, 1.5rem) !important;
    padding-right: clamp(0.85rem, 4vw, 1.5rem) !important;
  }

  /* Navbar */
  .navbar {
    padding: 0 0.85rem;
    height: 64px;
  }
  .navbar__title span:first-child {
    font-size: 0.9rem;
  }
  .navbar__title span:last-child {
    font-size: 0.6rem;
  }
  .navbar__logo {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }

  /* Page hero (sub-pages) */
  .page-hero {
    padding-top: 100px;
    padding-bottom: 2rem;
    min-height: auto;
  }
  .page-hero h1 {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    word-break: break-word;
  }
  .page-hero p {
    max-width: 100%;
    font-size: 0.85rem;
  }
  .page-hero .breadcrumb {
    flex-wrap: wrap;
    font-size: 0.72rem;
  }

  /* Hero (index) */
  .hero {
    padding-top: 80px;
    padding-bottom: 40px;
  }
  .hero__title {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    word-break: break-word;
  }
  .hero__arabic {
    font-size: clamp(1rem, 5vw, 1.4rem);
  }
  .hero__actions {
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
  }
  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .hero__stats {
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero__badge {
    font-size: 0.68rem;
    padding: 4px 10px;
    letter-spacing: 1px;
  }

  /* Section header */
  .section-header {
    margin-bottom: 2rem;
  }
  .section-header h2 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    word-break: break-word;
  }
  .section-header p {
    font-size: 0.85rem;
    max-width: 100%;
  }

  /* Grids — semua kolaps ke 1 kolom */
  .cards-grid,
  .highlight-grid,
  .prestasi-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Agenda */
  .agenda-item {
    padding: 1rem;
    gap: 0.85rem;
  }
  .agenda-date {
    min-width: 50px;
    padding: 8px 10px;
  }
  .agenda-date .day {
    font-size: 1.25rem;
  }
  .agenda-info {
    overflow: hidden;
    min-width: 0;
  }
  .agenda-info h4 {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .agenda-meta {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Cards */
  .card, .highlight-card, .prestasi-card {
    overflow: hidden;
  }
  .card__body {
    padding: 1rem;
  }
  .card__title {
    font-size: 0.95rem;
    word-break: break-word;
  }
  .card__footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Ekskul cards */
  .ekskul-card {
    overflow: hidden;
  }
  .ekskul-card__header {
    padding: 1.25rem;
  }
  .ekskul-card__title {
    font-size: 0.9rem;
    word-break: break-word;
  }
  .ekskul-card__body {
    padding: 0.85rem 1rem;
  }
  .ekskul-card__row {
    overflow: hidden;
    min-width: 0;
  }
  .ekskul-card__row span {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 24px);
  }
  .ekskul-card__footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
  }

  /* Kontak cards */
  .kontak-card {
    gap: 0.85rem;
    padding: 1rem;
    overflow: hidden;
  }
  .kontak-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    flex-shrink: 0;
  }
  .kontak-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  .kontak-info h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
  }
  .kontak-info .contact-row {
    overflow: hidden;
    word-break: break-all;
    font-size: 0.78rem;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Testimoni */
  .testimoni-card {
    flex: 0 0 100%;
    min-width: 0;
    padding: 1.25rem;
  }
  .testimoni-card .text {
    font-size: 0.85rem;
  }

  /* Form */
  .form-card {
    padding: 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: 1;
  }

  /* Buttons */
  .btn {
    padding: 10px 16px;
    font-size: 0.82rem;
  }
  .btn-nav {
    padding: 8px 14px;
    font-size: 0.78rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-brand .logo-wrap {
    flex-wrap: wrap;
  }
  footer {
    overflow-x: hidden;
  }

  /* Galeri */
  .galeri-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  /* Tabs */
  .tabs {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .tab-btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }

  /* Table */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* Badges */
  .badge {
    font-size: 0.65rem;
    padding: 2px 8px;
  }

  /* Pembina / OSIM cards */
  .pembina-grid,
  .osim-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Search bar — full width di mobile supaya tidak kejepit di samping filter tabs */
  .search-bar {
    width: 100%;
    max-width: 100%;
  }
  .search-bar input {
    width: 100%;
  }

  /* Filter + search wrapper: stack vertikal, stretch search bar */
  .filter-search-wrap {
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
}

/* ---- 360px: HP sangat kecil ---- */
@media (max-width: 360px) {
  .navbar {
    padding: 0 0.65rem;
    height: 60px;
  }
  /* Login button: icon-only di HP sangat kecil supaya hamburger tetap muat */
  .navbar__login-btn {
    padding: 7px 11px;
    font-size: 0.75rem;
  }
  .navbar__login-btn .login-text {
    display: none;
  }
  .navbar__logo {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }
  .navbar__title span:first-child {
    font-size: 0.78rem;
  }
  .hero {
    padding-top: 72px;
  }
  .hero__actions .btn {
    font-size: 0.78rem;
    padding: 9px 14px;
  }
  .cards-grid,
  .highlight-grid,
  .prestasi-grid,
  .galeri-grid,
  .pembina-grid,
  .osim-grid {
    grid-template-columns: 1fr !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   PLACEHOLDER FONT-SIZE — mobile fallback (halaman siswa)
   ================================================================ */
@media (max-width: 480px) {
  input::placeholder,
  .form-control::placeholder {
    font-size: 0.8rem;
  }
  .search-bar input::placeholder {
    font-size: 0.78rem;
  }
}
@media (max-width: 360px) {
  input::placeholder,
  .form-control::placeholder {
    font-size: 0.75rem;
  }
  .search-bar input::placeholder {
    font-size: 0.72rem;
  }
}

/* ================================================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   Peningkatan kecepatan untuk perangkat mobile (PageSpeed)
   ================================================================ */

/* ---- 1. Touch Action — hilangkan 300ms tap delay di semua browser ---- */
a,
button,
.btn,
[role="button"],
input,
select,
textarea,
label,
.tab-btn,
.hamburger,
.slider-btn,
#scrollTop {
  touch-action: manipulation;
}

/* ---- 2. Disable backdrop-filter di mobile — property ini sangat berat di GPU HP ---- */
@media (max-width: 768px) {
  .navbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Ganti dengan warna solid agar tetap terbaca */
    background: rgba(11, 61, 46, 0.98) !important;
  }
  .nav-siswa-wrap,
  .navbar__siswa {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .testimoni-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.08);
  }
  .modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Percepat semua transisi di mobile — 0.35s terasa lambat di HP */
  :root {
    --transition: 0.2s ease;
  }

  /* Reveal animation: kurangi translateY agar render lebih ringan */
  .reveal {
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

  /* Hero animations: lebih singkat di mobile */
  .hero__badge,
  .hero__arabic,
  .hero__title,
  .hero__subtitle,
  .hero__desc,
  .hero__actions,
  .hero__stats,
  .hero__scroll {
    animation-duration: 0.4s !important;
    animation-delay: 0s !important;
  }
}

/* ---- 3. content-visibility: auto — hanya pada footer yang tidak punya .reveal ----
   CATATAN: Tidak dipakai pada .home-section / .stats-section / .testimoni-section
   karena elemen .reveal di dalamnya pakai IntersectionObserver. Jika section
   di-skip render oleh content-visibility, IO callback tidak akan fire dan elemen
   akan tetap opacity:0 selamanya. Footer aman karena tidak ada .reveal di sana. */
footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

/* ---- 4. will-change hanya pada .reveal yang aktif dianimasikan ---- */
/* will-change: transform pada .mobile-nav dihapus karena display:none
   menyebabkan browser tidak release GPU layer saat menu tertutup */
.reveal {
  will-change: opacity, transform;
}
/* Hapus will-change setelah animasi selesai — bebaskan GPU memory */
.reveal.visible {
  will-change: auto;
}

/* ---- 5. Contain pada wrapper section saja — card punya position:absolute di dalam
         sehingga contain: layout bisa konflik dengan ::before dan .prestasi-medali ---- */
.cards-grid,
.highlight-grid,
.prestasi-grid {
  contain: layout;
}

/* ---- 6. Prefers Reduced Motion — untuk aksesibilitas & performa battery ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---- 7. Optimasi image rendering di mobile ---- */
@media (max-width: 768px) {
  img {
    image-rendering: auto;
  }
  /* Lazy load placeholder agar tidak ada layout shift */
  img[loading="lazy"] {
    min-height: 1px;
  }
}

/* ---- 8. Font rendering — percepat rendering teks di mobile ---- */
@media (max-width: 768px) {
  body {
    /* Gunakan system font sementara custom font dimuat */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
  }
  /* Heading besar: sub-pixel rendering kurang penting di mobile */
  h1, h2, h3 {
    text-rendering: optimizeSpeed;
  }
}

/* ---- 9. Scroll performance ---- */
.testimoni-slider,
.cards-grid,
.highlight-grid,
.prestasi-grid {
  -webkit-overflow-scrolling: touch;
}

/* ---- 10. Kurangi ukuran hero pattern di mobile (heavy background) ---- */
@media (max-width: 768px) {
  .hero__pattern {
    /* Nonaktifkan pattern kompleks di mobile — hemat paint cost */
    display: none;
  }
  .hero__geo {
    display: none;
  }
}

/* ============================================================
   MOBILE PERFORMANCE — tambahan optimasi paint & repaint
   ============================================================ */

/* ---- 11. Nonaktifkan hover transform di mobile
   Di HP, hover = tap. Transform pada tap menyebabkan extra repaint
   dan terasa "lag" karena browser harus composite ulang layer. ---- */
@media (hover: none), (max-width: 768px) {
  .card:hover,
  .highlight-card:hover,
  .ekskul-card:hover,
  .prestasi-card:hover,
  .kontak-card:hover,
  .agenda-item:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .galeri-item:hover img {
    transform: none !important;
  }
}

/* ---- 12. Override shadow variables ke versi ringan di mobile
   --shadow-lg = blur(60px) itu sangat berat di GPU HP mid-low.
   Ganti ke versi yang blur-nya lebih kecil. ---- */
@media (max-width: 768px) {
  :root {
    --shadow-sm: 0 1px 4px rgba(11, 61, 46, 0.08);
    --shadow-md: 0 3px 10px rgba(11, 61, 46, 0.10);
    --shadow-lg: 0 5px 14px rgba(11, 61, 46, 0.12);
  }
}

/* ---- 13. Nonaktifkan bounce animation hero scroll
   Animasi `bounce` infinite drain battery & menyebabkan continuous repaint. ---- */
@media (max-width: 768px) {
  .hero__scroll {
    animation: none;
    opacity: 0.45;
  }
}

/* ---- 14. Nonaktifkan will-change pada .reveal sebelum visible di mobile
   will-change: opacity, transform buat browser pre-allocate GPU memory
   untuk SETIAP elemen .reveal — di halaman penuh ini bisa puluhan elemen.
   Di mobile yang RAM terbatas, ini boros. Aktifkan hanya saat animasi. ---- */
@media (max-width: 768px) {
  .reveal {
    will-change: auto;
  }
}

/* ---- 15. Percepat slider transition di mobile (0.5s cubic terasa berat) ---- */
@media (max-width: 768px) {
  .testimoni-track {
    transition: transform 0.25s ease;
  }
}

/* ---- 16. Di layar sangat kecil (≤480px): skip hero fadeInUp sepenuhnya
   Animasi fadeInUp di hero tetap trigger meski durasi diperpendek.
   Di HP entry-level ini masih memperlambat LCP (Largest Contentful Paint).
   Langsung tampilkan konten tanpa delay. ---- */
@media (max-width: 480px) {
  .hero__badge,
  .hero__arabic,
  .hero__title,
  .hero__subtitle,
  .hero__desc,
  .hero__actions,
  .hero__stats {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- 17. Paint containment pada section yang punya banyak card
   `contain: paint` membatasi area repaint hanya di dalam section,
   tidak merambat ke seluruh halaman. ---- */
@media (max-width: 768px) {
  .home-section,
  .stats-section,
  .testimoni-section {
    contain: paint;
  }
}

/* ---- 18. Kurangi font-feature & rendering kompleks di mobile ---- */
@media (max-width: 768px) {
  .hero__title,
  .stat__num,
  h2 {
    font-kerning: none;
  }
}

/* ================================================================
   MOBILE PERFORMANCE — LAYER 2
   Optimasi tambahan untuk perceived speed di mobile
   ================================================================ */

/* ---- 19. Disable smooth scroll di mobile
   `scroll-behavior: smooth` menyebabkan animasi scroll ekstra yang
   di mobile entry-level menambah jank saat user scroll cepat.
   Native instant scroll terasa LEBIH RESPONSIF. ---- */
@media (max-width: 768px) {
  html {
    scroll-behavior: auto;
  }
}

/* ---- 20. Hilangkan transition pada navbar di mobile
   Navbar pakai `transition: var(--transition)` → setiap scroll yang
   trigger .scrolled class memicu LAYOUT REFLOW (height berubah dari
   72px → 62px). Di mobile cukup background-only transition. ---- */
@media (max-width: 768px) {
  .navbar {
    transition: background-color 0.2s ease;
  }
  .navbar.scrolled {
    height: 64px; /* sama dengan height default mobile — no reflow */
    box-shadow: 0 2px 8px rgba(11, 61, 46, 0.15);
  }
}

/* ---- 21. Naikkan threshold animasi instant ke ≤768px
   Sebelumnya hanya ≤480px yang skip animation hero. Padahal HP mid-range
   (Android ~390-420px lebar) tetap kena fadeInUp yang menunda LCP. ---- */
@media (max-width: 768px) {
  .hero__badge,
  .hero__arabic,
  .hero__title,
  .hero__subtitle,
  .hero__desc,
  .hero__actions,
  .hero__stats {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- 22. Reveal animation lebih cepat di mobile
   0.45s × stagger × banyak elemen = waktu total bisa >1 detik.
   Turunkan ke 0.25s — masih halus tapi tidak terasa "menunggu". ---- */
@media (max-width: 768px) {
  .reveal {
    transform: translateY(10px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  }
  /* Override inline transitionDelay yang dipasang oleh initReveal()
     → semua elemen reveal muncul tanpa stagger (perceived speed) */
  .reveal {
    transition-delay: 0s !important;
  }
}

/* ---- 23. Sederhanakan hero gradient di mobile
   Linear-gradient 3 stop dengan sudut 160deg di area 100vh = paint
   cost tinggi. Pakai gradient 2 stop saja + flat fallback. ---- */
@media (max-width: 768px) {
  .hero {
    background: linear-gradient(
      170deg,
      var(--green-dark) 0%,
      #155e40 100%
    );
  }
}

/* ---- 24. Containment lebih agresif untuk card
   `contain: content` = layout + paint + style + size containment.
   Browser bisa skip render card off-screen tanpa rusak IO observer
   karena card masih di-track sebagai bounding box. ---- */
@media (max-width: 768px) {
  .card,
  .ekskul-card,
  .highlight-card,
  .prestasi-card,
  .agenda-item,
  .kontak-card,
  .galeri-item {
    contain: layout style paint;
  }
}

/* ---- 25. Hindari box-shadow ganda di mobile (multi-layer paint)
   `box-shadow: 0 0 0 2px ..., 0 2px 8px ...` = 2 paint layer.
   Sederhanakan jadi single shadow di mobile. ---- */
@media (max-width: 768px) {
  .siswa-avatar,
  .nav-siswa-avatar,
  .mob-profile-avatar {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }
}

/* ---- 26. Disable transition pada scrollTop button toggle di mobile
   Tombol show/hide pakai transition opacity — saat scroll cepat
   fire berkali-kali memicu compositor work. Instant lebih ringan. ---- */
@media (max-width: 768px) {
  #scrollTop {
    transition: none;
  }
}

/* ---- 27. Jangan pakai `transition: all` (variabel --transition)
   pada elemen yang sering di-paint — ganti ke property spesifik
   biar GPU tidak alokasi composite layer berlebihan. ---- */
@media (max-width: 768px) {
  .btn {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .navbar__nav a,
  .mobile-nav a {
    transition: color 0.15s ease, background-color 0.15s ease;
  }
}

/* ---- 28. Pakai content-visibility pada section yang TIDAK punya
   reveal animations — hemat render budget di scroll panjang.
   Footer sudah dipakai di rule #3, tambah kontak/quick-links. ---- */
@media (max-width: 768px) {
  .quick-links-grid {
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
  }
}

/* ---- 29. Image rendering optimization untuk avatar & logo
   Gambar kecil (logo 44px, avatar 34px) tidak butuh sub-pixel
   smoothing tinggi. Pakai pixelated/auto cukup. ---- */
@media (max-width: 768px) {
  .navbar__brand img,
  .footer-brand img,
  .siswa-avatar,
  .nav-siswa-avatar {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ---- 30. Hilangkan border decoration & pseudo elements yang
   tidak terlihat / tidak penting di mobile ---- */
@media (max-width: 768px) {
  /* Highlight card decoration circle off-screen di mobile sempit */
  .highlight-card::after {
    display: none;
  }
}

/* ---- 31. Footer animation mobile gate
   Footer punya 6 layer infinite (aurora blob blur(70px), pattern drift,
   2 orb blur(40px), 11 particle, shine line). Di mobile, blur(70px) di
   layer 520px = paint cost sangat tinggi. Begitu user scroll ke footer,
   semua animasi langsung aktif & GPU work continuous.
   Strategi: HIDE aurora/orb/particle/shine + animation:none pattern.
   Visual footer di mobile tetap utuh (gradient hijau gelap + konten),
   user nggak akan tahu kekurangannya — orang scroll ke footer cuma
   buat klik link/social. ---- */
@media (max-width: 768px) {
  .footer-aurora,
  .orb,
  .fp,
  .footer-shine {
    display: none !important;
  }
  .footer-pattern {
    animation: none !important;
    will-change: auto !important;
  }
}

/* ============================================================
   MOBILE GATE — LOW-END DEVICE OPTIMIZATION
   ------------------------------------------------------------
   Mengikuti pola yang sudah berhasil di auth-siswa.css:
   • HIDE total — layer dengan filter: blur() besar (paling mahal
     di mobile GPU karena tiap frame harus render off-screen lalu
     composite ulang).
   • DISABLE animation — biarkan visible tapi static untuk yang
     masih kasih vibe (heritage-grid, arabesque-rings).
   • REDUCE jumlah — partikel & lantern dikurangi via :nth-child.
   • REPLACE backdrop-filter dengan solid background — backdrop
     blur adalah operation termahal di Safari/Chrome mobile.
   • DISABLE micro-animation infinite yang sering trigger
     compositor (orb pulse, shine, aurora drift, pattern rotate).

   Target: ≤768px (HP & tablet kecil).
   Visual desktop TIDAK terpengaruh.
   ============================================================ */
@media (max-width: 768px) {

  /* ===== NAVBAR — hilangkan backdrop-filter ===== */
  /* backdrop-filter di element fixed = recompositor tiap scroll
     frame. Diganti solid background yang visualnya hampir sama. */
  .navbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(11, 61, 46, 0.98) !important;
    transition: background-color .2s ease, height .2s ease !important;
  }
  .navbar.scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* ===== FOOTER — strip animasi paling berat ===== */
  /* HIDE total — biang keladi utama (3 aurora blur(70px) +
     2 orb blur(40px) + shine = compositor overload) */
  .footer-aurora,
  .footer-orbs,
  .footer-shine {
    display: none !important;
  }

  /* Pattern rotating: matikan animasi tapi tetap visible
     (kasih tekstur tanpa beban GPU continuous) */
  .footer-pattern {
    animation: none !important;
    will-change: auto !important;
  }

  /* Partikel: 11 → 3 (sisanya hide) + matikan animasi
     supaya tidak ada layer compositor aktif sama sekali */
  .footer-particles .fp:nth-child(n+4) {
    display: none !important;
  }
  .footer-particles .fp {
    animation: none !important;
    opacity: 0.7 !important;
    will-change: auto !important;
    box-shadow: 0 0 6px rgba(232, 201, 122, 0.6) !important;
  }

  /* ===== HERO BERANDA (.hero di index.html) — HIDE layer berat ===== */
  /* Inline CSS di index.html cuma resize; kita hide totally yang
     paling mahal. Selector .hero sama dengan inline di index.html. */
  .hero .glow-tr,
  .hero .glow-bl,
  .hero .dawn-arch,
  .hero .constellation {
    display: none !important;
  }
  .hero .heritage-grid,
  .hero .arabesque-rings {
    animation: none !important;
    will-change: auto !important;
  }
  /* Lantern: 7 → 2, particle: 10 → 3, dan matikan animasinya */
  .hero .lantern:nth-child(n+3) { display: none !important; }
  .hero .h-particles .p:nth-child(n+4) { display: none !important; }
  .hero .lantern,
  .hero .h-particles .p {
    animation: none !important;
    will-change: auto !important;
    filter: none !important;
    box-shadow: 0 0 12px rgba(232, 201, 122, 0.45) !important;
  }

  /* ===== PAGE-HERO (semua halaman siswa) — perketat mobile gate ===== */
  /* Rule existing di line 2235 cuma resize. Kita hide totally
     glow-tr/glow-bl/dawn-arch yang punya filter blur besar,
     dan matikan animasi heritage-grid + arabesque-rings. */
  .page-hero .glow-tr,
  .page-hero .glow-bl,
  .page-hero .dawn-arch {
    display: none !important;
  }
  .page-hero .heritage-grid,
  .page-hero .arabesque-rings {
    animation: none !important;
    will-change: auto !important;
  }
  /* Lantern & partikel: kurangi & matikan animasi */
  .page-hero .lantern:nth-child(n+3) { display: none !important; }
  .page-hero .h-particles .p:nth-child(n+4) { display: none !important; }
  .page-hero .lantern,
  .page-hero .h-particles .p {
    animation: none !important;
    will-change: auto !important;
    filter: none !important;
    box-shadow: 0 0 12px rgba(232, 201, 122, 0.45) !important;
  }

  /* ===== BODY AURORA BLOBS (halaman siswa) — strip filter blur ===== */
  /* Rule existing di line 2417 sudah matikan animation, tapi
     filter: blur(45px) di fixed element masih bikin paint cost.
     Pilihan terbaik: turunkan blur drastis + opacity kecil. */
  body:has(.page-hero)::before,
  body:has(.page-hero)::after {
    filter: blur(20px) !important;
    opacity: 0.4 !important;
    will-change: auto !important;
  }

  /* ===== STICKY ELEMENTS — hilangkan backdrop-filter sisa ===== */
  /* (.filter-search-wrap sudah dihandle di line 2426, ini jaring
     pengaman untuk element lain yang mungkin punya backdrop-filter) */
  .nav-siswa-wrap {
    animation: none !important;
  }

  /* ===== SCROLL TOP BUTTON & micro-animations sisa ===== */
  #scrollTop {
    transition: opacity .2s ease, transform .15s ease !important;
  }
}

/* ============================================================
   ULTRA AGGRESSIVE — HP ≤480px (low-end mainstream)
   ------------------------------------------------------------
   HP entry-level (≤480px portrait) sering punya GPU Mali-G52
   ke bawah / Adreno 610 ke bawah yang masih kewalahan. Di
   tier ini kita matikan SEMUA animasi background di hero +
   page-hero, biarkan cuma static gradient.
   ============================================================ */
@media (max-width: 480px) {
  /* HERO: hilangkan layer animasi sisa, tinggalkan bg-grad */
  .hero .lanterns,
  .hero .h-particles,
  .hero .heritage-grid {
    display: none !important;
  }
  .hero .arabesque-rings {
    opacity: 0.4 !important;
  }

  /* PAGE-HERO: sama */
  .page-hero .lanterns,
  .page-hero .h-particles,
  .page-hero .heritage-grid {
    display: none !important;
  }
  .page-hero .arabesque-rings {
    opacity: 0.4 !important;
  }

  /* FOOTER: hilangkan pattern juga (cuma sisain gradient bg) */
  .footer-pattern,
  .footer-particles {
    display: none !important;
  }

  /* BODY AURORA: matikan total */
  body:has(.page-hero)::before,
  body:has(.page-hero)::after {
    display: none !important;
  }
}

/* ============================================================
   PREFERS-REDUCED-MOTION — Override final
   ------------------------------------------------------------
   Aksesibilitas: user yang aktifkan "reduce motion" di OS
   (iOS/Android/Windows/macOS) dapat versi paling tenang.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* Footer */
  .footer-aurora,
  .footer-pattern,
  .orb,
  .fp,
  .footer-shine {
    animation: none !important;
  }
  .fp { display: none !important; }

  /* Hero & page-hero — semua layer animasi */
  .hero .heritage-grid,
  .hero .arabesque-rings,
  .hero .dawn-arch,
  .hero .constellation,
  .hero .lantern,
  .hero .glow-tr,
  .hero .glow-bl,
  .hero .h-particles .p,
  .page-hero .heritage-grid,
  .page-hero .arabesque-rings,
  .page-hero .dawn-arch,
  .page-hero .constellation,
  .page-hero .lantern,
  .page-hero .glow-tr,
  .page-hero .glow-bl,
  .page-hero .h-particles .p {
    animation: none !important;
  }

  /* Body aurora */
  body:has(.page-hero)::before,
  body:has(.page-hero)::after {
    animation: none !important;
  }

  /* Global fallback — semua animasi dipercepat sampai instant */
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   OVERFLOW FIX — teks panjang tanpa spasi (agenda & karya)
   Memaksa string panjang tanpa spasi agar membungkus (wrap)
   sehingga tidak menembus/keluar dari kartu.
   ============================================================ */

/* --- Agenda (beranda) --- */
/* Pastikan kolom grid tidak melebar karena konten panjang */
.agenda-two-col > div {
  min-width: 0;
}
.agenda-item {
  min-width: 0;
}
.agenda-info,
.agenda-info h4,
.agenda-info p {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.agenda-meta {
  min-width: 0;
  flex-wrap: wrap;
}
.agenda-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* --- Karya / kartu umum --- */
.card {
  min-width: 0;
}
.card__title,
.card__text {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Badge penghargaan pada footer kartu — string panjang dibungkus */
.card__footer {
  min-width: 0;
}
.card__footer .badge {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
}
/* Ikon di dalam badge jangan menyusut sehingga teks bebas membungkus */
.card__footer .badge i {
  flex-shrink: 0;
}
