/* ==========================================================================
   THE CURRENT — Base Styles
   Reset, typography, links, global elements.
   ========================================================================== */

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

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

/* ---- Body ---- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--line-height-body);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-heading);
  color: var(--text);
}

h1 {
  font-size: var(--heading-1);
  margin-bottom: var(--space-md);
}

h2 {
  font-size: var(--heading-2);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: var(--heading-3);
  color: var(--accent-structure);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

h4 {
  font-size: var(--heading-4);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

/* ---- Links ---- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ---- Footnote links (all superscripted) ---- */
a.hadith-fn,
a.quran-fn,
a.ref-fn {
  font-weight: var(--weight-semibold);
  font-size: 0.75em;
  text-decoration: none;
  vertical-align: super;
  line-height: 0;
  position: relative;
  top: -0.1em;
}

a.hadith-fn {
  color: var(--accent);
}

a.quran-fn {
  color: var(--gold);
}

a.ref-fn {
  color: var(--accent-structure);
}

a.hadith-fn:hover,
a.quran-fn:hover,
a.ref-fn:hover {
  text-decoration: underline;
}

/* ---- Lists ---- */
ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

li {
  margin-bottom: var(--space-xs);
}

li::marker {
  color: var(--text-light);
}

/* ---- Blockquote ---- */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-light);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
}

/* ---- Horizontal rule ---- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* ---- Strong / Emphasis ---- */
strong {
  font-weight: var(--weight-semibold);
}

em {
  font-style: italic;
}

/* ---- Small text ---- */
small,
.text-sm {
  font-size: var(--text-sm);
  color: var(--text-light);
}

.text-xs {
  font-size: var(--text-xs);
  color: var(--text-light);
}

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

/* ---- Selection ---- */
::selection {
  background-color: var(--accent-light);
  color: var(--text);
}

/* ---- Focus styles ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Utility: screen reader only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Page notice (dormant — kept for future use) ---- */
.page-notice {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: 1.65;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

/* ---- RTL support for Arabic text ---- */
.arabic-text {
  direction: rtl;
  text-align: right;
  font-size: 1.25em;
  line-height: 2;
}
