/* =================================================================
   KhatamQuran.ID — Base Styles: Reset & Typography
   ================================================================= */

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--kq-text);
  background-color: var(--kq-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--kq-text);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.15rem; }

p { line-height: 1.75; color: var(--kq-text-muted); }

/* ── ARABIC / QURAN FONT ── */
.font-arabic  { font-family: var(--font-arabic); }
.font-quran   { font-family: var(--font-quran); line-height: 2; }
.text-arabic  { direction: rtl; text-align: right; }

/* ── CONTAINER ── */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}
.container-sm { max-width: 860px; }
.container-lg { max-width: 1440px; }

/* ── SECTION SPACING ── */
.section { padding-block: var(--space-20); }
.section-sm { padding-block: var(--space-12); }
.section-lg { padding-block: 120px; }

/* ── TEXT UTILITIES ── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.text-muted   { color: var(--kq-text-muted); }
.text-gold    { color: var(--kq-gold); }
.text-green   { color: var(--kq-600); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .75rem; }
.text-lg      { font-size: 1.125rem; }
.text-xl      { font-size: 1.25rem; }
.font-bold    { font-weight: 700; }
.font-semibold { font-weight: 600; }
.uppercase    { text-transform: uppercase; letter-spacing: .08em; }
.italic       { font-style: italic; }

/* ── DISPLAY / FLEX UTILITIES ── */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-5  { gap: 20px; }
.gap-6  { gap: 24px; }
.gap-8  { gap: 32px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ── GRID UTILITIES ── */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── VISIBILITY ── */
.hidden { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── OVERFLOW ── */
.overflow-hidden { overflow: hidden; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── BACKGROUND UTILITIES ── */
.bg-surface   { background: var(--kq-surface); }
.bg-surface-2 { background: var(--kq-surface-2); }
.bg-green-dk  { background: var(--kq-800); }
.bg-cream     { background: var(--kq-cream); }
.bg-gold-pale { background: var(--kq-gold-pale); }

/* ── ISLAMIC GEOMETRIC PATTERN (SVG background) ── */
.bg-geometric {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 0 L50 20 L70 20 L55 35 L60 55 L40 45 L20 55 L25 35 L10 20 L30 20Z' fill='none' stroke='%231C6B3A' stroke-opacity='.08' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}

.bg-pattern-dot {
  background-image: radial-gradient(circle, var(--kq-300) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: var(--space-12); }
  .container { padding-inline: 16px; }
}

/* ── PROSE (article) ── */
.prose { max-width: 72ch; margin-inline: auto; }
.prose p { margin-bottom: 1.2em; }
.prose h3 { margin-top: 1.8em; margin-bottom: .6em; }

/* ── TRANSITIONS (global smooth) ── */
*,
*::before,
*::after {
  transition-property: background-color, color, border-color, opacity, transform, box-shadow;
  transition-duration: 200ms;
  transition-timing-function: ease;
}
/* Disable transition on load to prevent flash */
.no-transition, .no-transition * {
  transition: none !important;
}
