/* =========================================================
   KetabGard — Base styles & global utilities
   ========================================================= */

/* ---------- Brand font (Vazirmatn, OFL, bundled locally) ---------- */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  direction: rtl;
  text-align: right;
}

h1, h2, h3, h4 { color: var(--text); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); font-weight: 700; }

p { color: var(--text-2); }

a {
  color: var(--link);
  text-decoration: none;
}

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

button {
  font-family: var(--font);
  cursor: pointer;
}

input,
select,
textarea {
  font-family: var(--font);
  font-size: var(--fs-base);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: 22px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stack-sm { display: grid; gap: var(--gap-sm); }
.stack { display: grid; gap: var(--gap); }
.stack-lg { display: grid; gap: var(--gap-lg); }

.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.sr-only { /* accessibility alias */ }

/* =========================================================
   Phase 3.5 — Liquid Glass base layer
   ========================================================= */
body {
  background-color: var(--kg-bg);
  background-image:
    radial-gradient(1100px 520px at 88% -8%, var(--kg-bg-glow-1), transparent 60%),
    radial-gradient(900px 480px at 0% 4%, var(--kg-bg-glow-2), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, var(--kg-bg-glow-3), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4, .brand, .section-title, .page-title,
.loan-title, .book-card-title, .user-card-name, .msg-info .name,
.notif-title, .chat-title, .stat-tile .stat-value, .tx-label {
  font-family: var(--kg-font-head);
  letter-spacing: -0.2px;
}
h1, h2, h3, h4 { font-weight: 800; }

a { text-decoration: none; }

::selection { background: var(--kg-primary-soft); color: var(--kg-primary-deep); }

/* Tidy scrollbars (WebKit) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--kg-sand); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Shise round focus ring everywhere */
:focus-visible { outline: 2px solid var(--kg-primary); outline-offset: 2px; box-shadow: none; }
