/* ============================================================
   Kurikulum Unggul & Berakhlak — global styles
   The page content carries its own inline styles (design-system
   fidelity); this file adds resets, responsiveness, and a11y.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: #3F4B55;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { transition: color .15s ease, opacity .15s ease, background .15s ease; }

/* keyboard focus ring in brand blue */
a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(0,97,149,.4);
  outline-offset: 2px;
  border-radius: 4px;
}

/* thin, unobtrusive scrollbar for the horizontal nav chip row */
nav ::-webkit-scrollbar { height: 6px; }
nav ::-webkit-scrollbar-thumb { background: #D5DEE6; border-radius: 999px; }

/* ---------- Responsive grids ----------
   Content grids use fixed inline `grid-template-columns`. These
   attribute-scoped rules collapse them gracefully on smaller screens. */
@media (max-width: 820px) {
  [style*="grid-template-columns:repeat(5,1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 560px) {
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* scale down the large display headings on phones */
  [style*="font-size:38px"] { font-size: 27px !important; }
  [style*="font-size:32px"] { font-size: 23px !important; }
  [style*="font-size:19px"] { font-size: 17px !important; }
}

/* chapter prev/next cards — subtle hover lift */
.navcard { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.navcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16,42,66,.08);
  border-color: #C9D6E0 !important;
}

/* Hero: center the Goal Curriculum diagram on smaller screens */
@media (max-width: 900px) {
  .hero-inner { justify-content: center; }
  .hero-goal { width: 100%; }
}

@media (max-width: 560px) {
  .hero-lockup { gap: 12px !important; padding: 10px 14px !important; }
  .chapter-nav .navcard { text-align: left !important; }
}

@media print {
  nav, footer { display: none !important; }
}
