/* base.css — Dark Mode Foundation */

html {
  direction: rtl;
  scroll-behavior: smooth;
  height: auto;
  color-scheme: dark;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-ar);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  line-height: 1.75;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  /* Subtle Islamic diamond lattice */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 3 L57 30 L30 57 L3 30 Z' stroke='%23C9963A' stroke-width='0.55' stroke-opacity='0.07' fill='none'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px 60px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-ar);
}

a {
  color: var(--color-primary);
  font-family: var(--font-family-ar);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out);
}

a:hover { color: var(--color-accent); }

.hidden { display: none !important; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  padding-right: var(--space-16);
  padding-left: var(--space-16);
  margin-right: auto;
  margin-left: auto;
}

/* ── Section ── */
.section {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
}

/* ── Section headings ── */
.section-title {
  margin: 0;
  color: var(--color-accent);
  font-family: var(--font-family-ar);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  text-shadow: var(--glow-gold-sm);
  line-height: 1.25;
}

.section-subtitle {
  margin-top: var(--space-8);
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-family: var(--font-family-ar);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  line-height: 1.7;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--grad-divider);
  width: 100%;
  border: none;
}

/* ── Grids ── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  background-color: rgba(201, 150, 58, 0.12);
  color: var(--color-accent);
  border: 1px solid rgba(201, 150, 58, 0.30);
  border-radius: var(--radius-full);
  padding: var(--space-6) var(--space-12);
  font-family: var(--font-family-ar);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

/* ── Muted ── */
.muted {
  color: var(--color-text-muted);
  font-family: var(--font-family-ar);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}

/* ── Animations ── */
@keyframes glow-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════
   TABLET  (≤ 840px)
   ══════════════════════════════ */
@media (max-width: 840px) {
  .section {
    padding-top: var(--space-48);
    padding-bottom: var(--space-48);
  }
}

/* ══════════════════════════════
   MOBILE  (≤ 640px)
   ══════════════════════════════ */
@media (max-width: 640px) {
  .container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .section {
    padding-top: var(--space-32);
    padding-bottom: var(--space-32);
  }

  .section-title {
    font-size: var(--font-size-xl);
  }

  .section-subtitle {
    font-size: 15px;
  }

  .badge {
    font-size: 13px;
    padding: 5px 10px;
  }
}

/* ══════════════════════════════
   SMALL PHONE  (≤ 400px)
   ══════════════════════════════ */
@media (max-width: 400px) {
  .container {
    padding-right: 12px;
    padding-left: 12px;
  }

  .section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }
}
