/* ==========================================================================
   مكتبة الفوز — Storefront typography & design tokens
   Heritage–Modern / جنگلی سبز + سونا + کاغذی کریم
   --------------------------------------------------------------------------
   One family for the three languages in body text: Noto Sans Arabic
   (Arabic + Urdu + Latin subsets). Display headings may differ:
     • Urdu headings  → Mehr Nastaliq
     • Arabic headings → Noto Sans Arabic (bold weight)
     • English headings → Noto Sans Arabic Latin subset (bold weight)
   All fonts are self-hosted; no external font requests.
   ========================================================================== */

/* --- Arabic / Urdu subset ------------------------------------------------ */
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891,
                 U+0898-08E1, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFC,
                 U+1EE00-1EEFF;
}

/* --- Latin subset (English UI + numbers + SKU) --------------------------- */
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
                 U+FFFD;
}

/* --- Urdu display face --------------------------------------------------- */
@font-face {
  font-family: "Mehr Nastaliq";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/mehr-nastaliq.woff") format("woff");
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC;
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  --paper: #FBF8F0;
  --ink: #1B331C;
  --ink-soft: #264423;
  --brass: #B08D3F;
  --brass-light: #E8CF84;
  --clay: #8A3B2E;
  --line: rgba(27, 51, 28, .12);

  --font-ui: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-heading-ur: "Mehr Nastaliq", "Noto Sans Arabic", serif;
  --font-heading-ar: "Noto Sans Arabic", sans-serif;
  --font-heading-en: "Noto Sans Arabic", sans-serif;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* --- Base: same face for ur / ar / en ------------------------------------ */
html, body {
  font-family: var(--font-ui);
}

html .font-num,
html .tabular-nums {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Nastaliq needs more breathing room than the UI face. */
html .font-urdu {
  font-family: var(--font-heading-ur);
  font-weight: 400;
  line-height: 1.9;
}

/* --- Headings per language ------------------------------------------------ */
/* Urdu: display face for major headings; smaller headings stay in the UI
   face so Arabic book titles remain crisp at card size. */
html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] .font-heading {
  font-family: var(--font-heading-ur);
  font-weight: 400;
  line-height: 1.45;
}

/* Arabic: same family, heavier weight — no second face needed. */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .font-heading {
  font-family: var(--font-heading-ar);
  font-weight: 700;
  line-height: 1.4;
}

/* English: Latin subset of the very same family. */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] .font-heading {
  font-family: var(--font-heading-en);
  font-weight: 700;
  line-height: 1.25;
}

/* --- Brand mark (logo) ----------------------------------------------------
   The source PNG is a transparent mark. Monochrome variants use CSS masks,
   so the original artwork stays untouched.                                */
.brand-mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background-color: var(--ink);
  -webkit-mask: url("../images/logo-mark.png") center / contain no-repeat;
  mask: url("../images/logo-mark.png") center / contain no-repeat;
}

.brand-mark--gold {
  background-color: var(--brass-light);
}

.brand-mark--color {
  background: transparent;
  -webkit-mask: none;
  mask: none;
}

.brand-mark--color img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Accessibility foundation ------------------------------------------- */
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: top .2s ease;
}

.skip-link:focus {
  top: 12px;
  color: var(--paper);
}

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

/* Sticky header: hide on scroll down, reveal on scroll up. */
.site-header {
  transition: transform .3s ease, box-shadow .3s ease;
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-header:not(.is-hidden) {
  box-shadow: 0 8px 30px -22px rgba(27, 51, 28, .45);
}

/* --- Book visual ---------------------------------------------------------
   A real cover fills the frame. Until a cover is supplied, the frame shows a
   catalogue slip: typeset title, one hairline rule, one brass edge. No drawn
   spine, gradient or imitation jacket.
   ------------------------------------------------------------------------ */
.book-frame {
  position: relative;
  overflow: hidden;
  background: #f6f1e6;
}

.book-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-slip {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 2.6vw, 32px);
  color: var(--ink);
  background: #f6f1e6;
}

.book-slip::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(27, 51, 28, .14);
  pointer-events: none;
}

.book-slip::after {
  content: "";
  position: absolute;
  inset-block: 12px;
  inset-inline-start: 12px;
  width: 3px;
  background: var(--brass);
  opacity: .8;
}

.book-slip__inner {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.book-slip__eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #795a21;
}

.book-slip__title {
  margin-top: 12px;
  font-family: var(--font-heading-ar);
  font-weight: 700;
  font-size: clamp(16px, 1.7vw, 23px);
  line-height: 1.55;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.book-slip__rule {
  width: 34px;
  height: 2px;
  margin: 14px 0;
  background: var(--brass);
}

.book-slip__meta {
  font-size: 12px;
  line-height: 1.75;
  color: rgba(27, 51, 28, .66);
}

.book-frame--large .book-slip__title {
  font-size: clamp(22px, 3vw, 36px);
}

.book-frame--large .book-slip__meta {
  font-size: 14px;
}

/* Editorial page details shared by author / publisher hubs */
.page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #795a21;
}

.hairline-gold {
  height: 2px;
  width: 44px;
  background: var(--brass);
}
