/* ====================================================================
   CUSTOM STYLES - SDN CENGKARENG TIMUR 10
   Digunakan untuk hal yang tidak praktis lewat utility Tailwind semata:
   - Animasi scroll reveal & prefers-reduced-motion
   - Lightbox modal transisi & overlay
   - Offset scroll untuk sticky navigation bar
   - Variabel warna kustom sekolah
   ==================================================================== */

:root {
  --color-primary-red: #B91C1C;
  --color-primary-dark: #991B1B;
  --color-primary-light: #FEF2F2;
  --color-accent-blue: #1D4ED8;
  --color-accent-yellow: #D97706;
  --color-text-main: #1E293B;
  --color-text-muted: #64748B;
  --color-bg-light: #F8FAFC;
}

/* Scroll smooth & offset untuk sticky header */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  color: var(--color-text-main);
  background-color: var(--color-bg-light);
  font-family: 'Plus Jakarta Sans', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====================================================================
   ANIMASI SCROLL REVEAL (INTERSECTION OBSERVER)
   ==================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay helpers */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Hormati preferensi pengguna untuk reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ====================================================================
   NAVBAR & ACTIVE LINK INDICATOR
   ==================================================================== */
.nav-link {
  position: relative;
  transition: color 0.2s ease-in-out;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary-red);
  transition: width 0.25s ease-out;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-primary-red);
  font-weight: 600;
}

/* ====================================================================
   LIGHTBOX MODAL
   ==================================================================== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-backdrop.is-open .lightbox-content {
  transform: scale(1);
}

/* ====================================================================
   AKSESIBILITAS & FOCUS RING
   ==================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-primary-red);
  outline-offset: 3px;
}

/* Cetak (Print Friendly) */
@media print {
  header, footer, #galeri, #berita-search, .no-print {
    display: none !important;
  }
  body {
    background: #FFFFFF;
    color: #000000;
  }
}
