/* isaif.om — الأساسيات المشتركة بين كل الصفحات */

:root {
  --paper: #F7F4EF;
  --ink: #1A1814;
  --muted: #6E6759;
  --line: #DDD6C6;
  --gold: #C9A84C;
  --gold-deep: #7C5F14;
  --alert: #A33A2E;
  --r-lg: 28px;
  --r-md: 16px;
  --font: "Tajawal", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button, input { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  padding: 24px 20px 56px;
}

/* ---------- الخط والعناوين ---------- */

.display {
  font-size: clamp(2.9rem, 13vw, 4.8rem);
  font-weight: 900;
  line-height: 1.08;
}
.display--sm { font-size: clamp(2.4rem, 10vw, 3.6rem); }

.display, .lede, .h2 { text-wrap: balance; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 32ch; }
.h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.hint { color: var(--muted); font-size: 1rem; }

.brand {
  display: inline-block;
  justify-self: start;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  direction: ltr;
}

/* ---------- الأزرار ---------- */

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  min-height: 54px;
  padding: 0 24px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active:not([disabled]) { transform: scale(.98); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--block { width: 100%; }
.btn--text {
  background: none;
  color: var(--muted);
  min-height: 44px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- حقول الإدخال ---------- */

.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 1rem; }
.input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  font-size: 1.15rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: #fff;
}
.input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.input--code { text-align: center; letter-spacing: .3em; font-weight: 800; direction: ltr; }

/* ---------- وسوم صغيرة ---------- */

.tag {
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.6;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}
.tag--gold { background: var(--gold); color: var(--ink); }
.tag--soft { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.tag--alert { background: var(--alert); color: #fff; }

/* ---------- الصفحة الرئيسية ---------- */

.hub-head { display: grid; gap: 18px; padding-top: 12vh; padding-bottom: 7vh; }

.index { list-style: none; padding: 0; border-bottom: 1.5px solid var(--ink); }
.index li { border-top: 1.5px solid var(--ink); }

.entry {
  display: grid;
  gap: 4px;
  padding: 22px 4px;
  text-decoration: none;
  transition: background-color .15s ease, padding .15s ease;
}
.entry-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entry-title { font-size: 2.3rem; font-weight: 900; line-height: 1.15; }
.entry-desc { color: var(--muted); font-size: 1.05rem; }
a.entry:active { background: var(--gold); }
a.entry:active .entry-desc { color: var(--ink); }
@media (hover: hover) {
  a.entry:hover { background: var(--gold); padding-inline: 16px; }
  a.entry:hover .entry-desc { color: var(--ink); }
}
.entry--soon { opacity: .6; }

/* ---------- احترام تفضيل تقليل الحركة ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
