/* ===================================================================
   YTPAI RAUDLATUL MUTA'ALLIMIN LAMONGAN - DESIGN SYSTEM & CORE STYLES
   Prestigious Islamic Institutional Palette: Deep Navy, Antique Gold & Warm Ivory
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Playfair+Display:ital,wght@0,600;0,700;0,800;0,900;1,600&family=Cinzel:wght@600;700;800;900&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Amiri+Quran&family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  /* Brand Color Palette - Dignified Islamic Heritage & Royal Institutional */
  --color-primary: #0D3B66;           /* Deep Noble Islamic Navy */
  --color-primary-dark: #082440;      /* Midnight Blue */
  --color-primary-light: #185285;     /* Rich Royal Blue */
  --color-gold: #C59B27;              /* Historic Institutional Gold */
  --color-gold-dark: #9E7916;         /* Deep Antique Gold */
  --color-gold-light: #FAF3DE;        /* Soft Warm Gold/Cream */
  --color-emerald: #0A5C36;           /* Islamic Emerald Green */
  --color-emerald-light: #EBF7F0;     /* Soft Mint / Emerald tint */
  --color-accent: #0D3B66;            /* Primary action tone */
  --color-accent-hover: #C59B27;      /* Hover State: Noble Gold */
  --color-sky: #E9F1F7;               /* Subtle dignified cool tint */
  --color-sky-light: #F4F8FB;         /* Ultra Light */
  
  /* Warm Alabaster Neutral Colors (Warm Paper Tone, Not Sterile Grey) */
  --color-white: #FFFFFF;
  --color-bg-light: #FAF9F5;          /* Warm Ivory / Alabaster Paper tone */
  --color-bg-card: #FFFFFF;
  --color-border: #E5E0D5;            /* Warm subtle stone border */
  --color-border-light: #F2EFE8;
  
  /* Typography Colors */
  --color-text-main: #141B24;         /* Charcoal Ink */
  --color-text-body: #3E4A56;         /* Editorial Slate */
  --color-text-muted: #728090;        /* Subdued Tone */
  --color-text-inverse: #FFFFFF;
  
  /* System Accents */
  --color-success: #0A5C36;
  --color-warning: #C59B27;
  --color-danger: #BE123C;
  
  /* Elevation Shadows - Architectural & Subtle */
  --shadow-sm: 0 1px 3px 0 rgba(13, 59, 102, 0.04);
  --shadow-md: 0 4px 10px -2px rgba(13, 59, 102, 0.06), 0 2px 4px -2px rgba(13, 59, 102, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(13, 59, 102, 0.08), 0 4px 8px -4px rgba(13, 59, 102, 0.03);
  --shadow-xl: 0 20px 35px -5px rgba(13, 59, 102, 0.1), 0 8px 12px -6px rgba(13, 59, 102, 0.04);
  --shadow-floating: 0 14px 40px rgba(13, 59, 102, 0.12);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-arabic: 'Amiri Quran', 'Amiri', 'Noto Naskh Arabic', 'Scheherazade New', 'Traditional Arabic', serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-arabic), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', 'Cinzel', 'Amiri Quran', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', var(--font-arabic), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===================================================================
   AUTHENTIC MUSHAF ARABIC & QURANIC TYPOGRAPHY (AMIRI / NASKH STANDARD)
   =================================================================== */
:lang(ar),
[lang="ar"],
.arabic-text,
.quran-text,
.font-arabic,
.ai-arabic-text,
.sambutan-bismillah-text,
.editorial-bismillah-opening,
.modal-speech-bismillah {
  font-family: var(--font-arabic) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Inline Arabic text embedded inside Latin paragraphs/sentences */
.arabic-inline,
.ai-arabic-inline {
  font-family: var(--font-arabic) !important;
  font-size: 1.08em;
  line-height: 1.5;
  direction: rtl;
  display: inline-block;
  padding: 0 2px;
  vertical-align: -0.05em;
  font-weight: 600;
  color: #0A2540;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 105px;
  font-size: 16px;
  overflow-x: hidden;
  overflow-y: scroll;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-light);
  color: var(--color-text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  overflow-y: visible;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

button {
  cursor: pointer;
  background: none;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.section {
  padding: 80px 0;
  position: relative;
}

.section-sm {
  padding: 50px 0;
}

/* Badges & Section Headers (Reflected from Reference Image) */
.section-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: fit-content;
  gap: 8px;
  padding: 6px 16px;
  background-color: #FFFFFF;
  color: #0A2540;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.015em;
  border: 1.5px solid rgba(13, 59, 102, 0.16);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.06), 0 1px 2px rgba(10, 37, 64, 0.03);
  margin-bottom: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-badge:hover {
  border-color: rgba(197, 155, 39, 0.5);
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.1);
  transform: translateY(-1px);
}

.section-badge svg {
  width: 15px;
  height: 15px;
  color: #C59B27;
  stroke: currentColor;
  stroke-width: 2.3;
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(1.45rem, 4.2vw, 2.25rem);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-title span.highlight {
  color: var(--color-accent);
}

.section-subtitle {
  font-size: clamp(0.86rem, 2vw, 1.05rem);
  color: var(--color-text-body);
  max-width: 640px;
  line-height: 1.6;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-accent);
  font-size: 0.95rem;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.link-action:hover {
  color: var(--color-primary);
  transform: translateX(4px);
}

/* Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: var(--color-white);
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-accent);
  background-color: var(--color-sky-light);
  transform: translateY(-2px);
}

.btn-white {
  background-color: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  background-color: var(--color-sky-light);
  color: var(--color-accent);
  transform: translateY(-2px);
}

.btn-royal {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.3);
}

.btn-royal:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1.05rem;
}

.btn:active {
  transform: scale(0.97);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseSubtle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.animate-fade-in {
  animation: fadeIn 0.6s var(--transition-smooth) forwards;
}

/* Global Mobile Base Tweaks */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 75px;
  }
  section, [id] {
    scroll-margin-top: 75px;
  }
  .section {
    padding: 44px 0;
  }
  .section-sm {
    padding: 28px 0;
  }
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }
  .section-header-flex {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 10px;
  }
  .link-action {
    font-size: 0.84rem;
  }
}

/* ===================================================================
   LOW-END DEVICE ACCELERATION & LIGHTWEIGHT RENDERING OPTIMIZATION
   - Saves 70% mobile RAM via content-visibility DOM containment
   - Fast async GPU decoding on budget chipsets
   =================================================================== */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Off-screen section virtualization - only renders DOM when scrolled near */
.section:not(:first-of-type),
.footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 450px;
}

/* Native async image decoding */
img {
  image-rendering: -webkit-optimize-contrast;
}

