:root {
  --emerald-950: #052219;
  --emerald-900: #064E3B;
  --emerald-800: #065F46;
  --emerald-soft: #F2F6F3;
  --emerald-mint: #E9F3EC;
  --cream-canvas: #FAFBF9;
  --gold-accent: #9A6F1C;
  --gold-bright: #FBBF24;
  --border-subtle: rgba(5, 34, 25, 0.10);
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--cream-canvas);
  color: #10241B;
  line-height: 1.65;
  overflow-x: clip;
}

section[id],
div[id] {
  scroll-margin-top: 84px;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Subtle Islamic Geometric Lattice */
.islamic-lattice-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23064E3B' stroke-width='0.8' stroke-opacity='0.06'%3E%3Cpath d='M32 4 L40 24 L60 32 L40 40 L32 60 L24 40 L4 32 L24 24 Z'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

.islamic-lattice-light {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-width='0.8' stroke-opacity='0.08'%3E%3Cpath d='M32 4 L40 24 L60 32 L40 40 L32 60 L24 40 L4 32 L24 24 Z'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

/* Navbar */
.madrasah-navbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  background-color: #FAFBF9;
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
  isolation: isolate;
}

.madrasah-navbar.scrolled {
  background-color: #ffffff;
  box-shadow: 0 4px 20px rgba(5, 34, 25, 0.08);
}

.madrasah-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: var(--emerald-900);
  color: #FDE68A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.madrasah-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  padding: 2px;
  border: 1px solid rgba(5, 34, 25, 0.1);
  flex-shrink: 0;
}

.madrasah-brand-title {
  font-size: 0.98rem;
  line-height: 1.15;
}

.madrasah-brand-tagline {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gold-accent);
  line-height: 1.2;
  margin-top: 2px;
  max-width: 240px;
}

.navbar-nav .nav-link {
  color: #10241B;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.5rem 0.85rem;
  white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--emerald-900);
}

.dropdown-menu {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 32px rgba(5, 34, 25, 0.10);
  padding: 0.45rem;
}

.dropdown-item {
  border-radius: 10px;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  color: #10241B;
}

.dropdown-item:hover {
  background-color: var(--emerald-soft);
  color: var(--emerald-900);
}

/* Buttons */
.btn-emerald {
  background-color: var(--emerald-900);
  color: #ffffff;
  border: 1px solid var(--emerald-900);
  border-radius: 12px;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-emerald:hover {
  background-color: var(--emerald-800);
  border-color: var(--emerald-800);
  color: #ffffff;
}

.btn-outline-emerald {
  background-color: #ffffff;
  color: #10241B;
  border: 1px solid rgba(5, 34, 25, 0.18);
  border-radius: 12px;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  transition: background-color 0.2s ease;
}

.btn-outline-emerald:hover {
  background-color: var(--emerald-soft);
  color: var(--emerald-900);
}

.btn-gold {
  background-color: var(--gold-bright);
  color: #052219;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  padding: 0.75rem 1.45rem;
}

.btn-gold:hover {
  background-color: #FCD34D;
  color: #052219;
}

/* Hero Mihrab Frame */
.hero-mihrab-frame {
  border-top-left-radius: 160px;
  border-top-right-radius: 160px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(5, 34, 25, 0.08);
}

.hero-mihrab-inner {
  border-top-left-radius: 152px;
  border-top-right-radius: 152px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  overflow: hidden;
  position: relative;
  min-height: 360px;
  height: 100%;
}

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

.hero-scrim {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 1.25rem 1.15rem;
  background: linear-gradient(to top, rgba(5, 34, 25, 0.80), rgba(5, 34, 25, 0.25), transparent);
  color: #ffffff;
}

/* Cards & Surfaces */
.surface-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.surface-card:hover {
  border-color: rgba(6, 78, 59, 0.25);
  box-shadow: 0 10px 26px rgba(5, 34, 25, 0.06);
}

.surface-soft {
  background-color: var(--emerald-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}

.icon-box-emerald {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--emerald-soft);
  color: var(--emerald-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kicker-gold {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-accent);
  letter-spacing: 0.02em;
}

/* Vision Box */
.vision-panel {
  background-color: var(--emerald-mint);
  border: 1px solid rgba(6, 78, 59, 0.14);
  border-radius: 26px;
}

/* PPDB Dark Emerald Section */
.ppdb-emerald-section {
  background-color: #063B2D;
  color: #ffffff;
}

/* Segmented Filter Controls */
.segmented-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background-color: var(--emerald-soft);
  border: 1px solid var(--border-subtle);
}

.segmented-btn {
  border: none;
  background: transparent;
  color: rgba(16, 36, 27, 0.75);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented-btn.active {
  background-color: var(--emerald-900);
  color: #ffffff;
}

/* Masonry Gallery */
.masonry-grid {
  column-count: 1;
  column-gap: 1.25rem;
}

@media (min-width: 576px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 992px) {
  .masonry-grid {
    column-count: 3;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
}

/* Footer & Floating Actions */
.madrasah-footer {
  background-color: #062C22;
  color: rgba(236, 253, 245, 0.85);
}

.madrasah-footer a {
  color: rgba(236, 253, 245, 0.8);
  text-decoration: none;
}

.madrasah-footer a:hover {
  color: #ffffff;
}

.floating-actions {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-wa-btn {
  background-color: #065F46;
  color: #ffffff;
  border: 1px solid #047857;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(5, 34, 25, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.floating-wa-btn:hover {
  background-color: #047857;
  color: #ffffff;
}

.back-to-top-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background-color: #ffffff;
  color: #10241B;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 6px 18px rgba(5, 34, 25, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Responsive Hero & Mobile Typography Scale */
.hero-section {
  padding-top: 1.5rem;
  padding-bottom: 2.25rem;
}

.hero-title {
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: 0.92rem;
  line-height: 1.58;
  font-weight: 400;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-stat-value {
  font-size: 1.45rem;
  line-height: 1.15;
}

.hero-stat-label {
  font-size: 0.78rem;
  line-height: 1.35;
}

@media (max-width: 575.98px) {
  .madrasah-navbar .navbar-brand {
    max-width: calc(100% - 58px);
  }

  .madrasah-logo-badge,
  .madrasah-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .madrasah-brand-title {
    font-size: 0.9rem;
  }

  .madrasah-brand-tagline {
    font-size: 0.64rem;
    max-width: 205px;
  }

  .kicker-gold {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  .hero-actions .btn-emerald,
  .hero-actions .btn-outline-emerald {
    font-size: 0.84rem;
    padding: 0.56rem 1rem;
    border-radius: 10px;
  }

  .hero-mihrab-frame {
    border-top-left-radius: 112px;
    border-top-right-radius: 112px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    padding: 6px;
  }

  .hero-mihrab-inner {
    border-top-left-radius: 106px;
    border-top-right-radius: 106px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    min-height: 220px;
    max-height: 260px;
  }

  .hero-scrim {
    padding: 1rem 1rem 0.85rem;
  }

  .hero-scrim .small {
    font-size: 0.76rem;
  }

  .display-6 {
    font-size: 1.45rem;
  }

  h2, .h2 {
    font-size: 1.32rem;
  }

  .lead {
    font-size: 0.95rem;
  }

  .floating-actions {
    right: 12px;
    bottom: 12px;
    gap: 6px;
  }

  .floating-wa-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.76rem;
  }

  .back-to-top-btn {
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 576px) {
  .hero-section {
    padding-top: 2.25rem;
    padding-bottom: 3rem;
  }

  .hero-title {
    font-size: 2.15rem;
    line-height: 1.16;
  }

  .hero-subtitle {
    font-size: 1.04rem;
    line-height: 1.62;
  }

  .hero-actions {
    gap: 0.85rem;
  }

  .hero-stat-value {
    font-size: 1.85rem;
  }

  .hero-stat-label {
    font-size: 0.85rem;
  }
}

@media (min-width: 992px) {
  .hero-section {
    padding-top: 3.25rem;
    padding-bottom: 4rem;
  }

  .hero-title {
    font-size: 2.95rem;
    line-height: 1.14;
  }

  .hero-subtitle {
    font-size: 1.12rem;
  }

  .hero-stat-value {
    font-size: 2.1rem;
  }
}

