/* ==========================================================================
   Medresa Tedmurijja — site styles
   Layered on top of a trimmed Bootstrap 5.3 build (grid, navbar, offcanvas,
   forms, utilities). Uses logical properties so one file serves LTR and RTL.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Manrope";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../assets/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Manrope";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../assets/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal; font-display: swap; font-weight: 400;
  src: url("../assets/fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal; font-display: swap; font-weight: 500 600;
  src: url("../assets/fonts/noto-naskh-arabic-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal; font-display: swap; font-weight: 700 800;
  src: url("../assets/fonts/noto-naskh-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Amiri Orn";   /* 2 KB subset: ﴾ ﴿ ﷺ only */
  font-style: normal; font-display: swap; font-weight: 400 800;
  src: url("../assets/fonts/amiri-ornaments.woff2") format("woff2");
  unicode-range: U+FD3E-FD3F, U+FDFA;
}

/* ---------- Tokens ---------- */
:root {
  --green: #123D32;
  --green-2: #1E5A49;
  --green-deep: #0D2E26;
  --gold: #C89B3C;
  --gold-ink: #86621F;      /* gold for small text on light surfaces (AA) */
  --gold-light: #D9B466;    /* gold for text on dark green (AA) */
  --ivory: #F7F4EC;
  --white: #FCFBF8;
  --charcoal: #202421;
  --muted: #5C6661;         /* brief: #66706B — darkened slightly for AA on ivory */
  --line: rgba(18, 61, 50, .14);
  --line-strong: rgba(18, 61, 50, .26);
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(18, 61, 50, .06), 0 12px 32px -12px rgba(18, 61, 50, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Amiri Orn", "Noto Naskh Arabic", "Manrope", "Geeza Pro", "Times New Roman", serif;
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --header-h: 76px;

  --bs-body-font-family: var(--font);
  --bs-body-color: var(--charcoal);
  --bs-body-bg: var(--white);
  --bs-link-color: var(--green);
  --bs-link-color-rgb: 18, 61, 50;
  --bs-link-hover-color: var(--green-2);
  --bs-link-hover-color-rgb: 30, 90, 73;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 1.0625rem;           /* 17px mobile */
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--white);
  font-feature-settings: "ss01" off;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
@media (min-width: 768px) { body { font-size: 1.125rem; } } /* 18px */

h1, h2, h3, h4 { color: var(--green); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--green); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-2); }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
strong { font-weight: 700; }
:lang(ar) { font-family: var(--font-ar); letter-spacing: 0 !important; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(200, 155, 60, .3); color: var(--charcoal); }

.container-xxl { --bs-gutter-x: clamp(2.5rem, 5vw, 4rem); max-width: 1320px; }
@media (min-width: 1400px) { .container-xxl { max-width: 1360px; } }
.g-xl-6 { }
@media (min-width: 1200px) { .g-xl-6 { --bs-gutter-x: 5rem; --bs-gutter-y: 4rem; } }

.saw { font-family: "Amiri Orn", var(--font-ar); font-size: 1.45em; line-height: 0; vertical-align: -.12em; font-weight: 400; }
.nowrap { white-space: nowrap; }
.i { width: 1em; height: 1em; vertical-align: -.125em; flex-shrink: 0; }
[dir="rtl"] .i-flip { transform: scaleX(-1); }

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 2000;
  background: var(--green); color: var(--ivory); padding: .7rem 1.1rem; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--ivory); }

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-ink); margin-bottom: 1.25rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); flex-shrink: 0; }
.eyebrow--light { color: var(--gold-light); }

.h-display { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 1.25rem; text-wrap: balance; }
.h-section { font-size: clamp(1.85rem, 3.4vw, 2.75rem); line-height: 1.15; letter-spacing: -.025em; margin-bottom: 1.25rem; text-wrap: balance; }
.section-intro { color: var(--muted); max-width: 40rem; }
.lead-text { font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--charcoal); }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-font-weight: 650;
  font-size: 1rem; padding: .9rem 1.55rem; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
  min-height: 48px;
}
.btn .i { transition: transform .25s var(--ease); }
.btn:hover .i-flip { transform: translateX(3px); }
[dir="rtl"] .btn:hover .i-flip { transform: scaleX(-1) translateX(3px); }
.btn-brand { background: var(--green); color: var(--ivory); border: 1px solid var(--green); }
.btn-brand:hover, .btn-brand:focus-visible { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.btn-brand:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--green); border: 1px solid var(--line-strong); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--gold); color: var(--green); background: rgba(200, 155, 60, .06); }

/* ---------- Header / navbar ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: var(--ivory);
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(252, 251, 248, .86);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled { background: var(--white); }
}
.site-header .navbar { padding-block: .7rem; min-height: var(--header-h); }
.site-header .navbar > .container-xxl { flex-wrap: nowrap; gap: 1.5rem; }

.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--green); flex-shrink: 0; }
.brand:hover { color: var(--green); }
.brand-logo { width: 52px; height: 52px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 750; font-size: 1.06rem; letter-spacing: -.01em; }
.brand-sub { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: .2rem; }

.nav-desktop { list-style: none; margin: 0 auto; padding: 0; gap: clamp(1rem, 1.6vw, 1.75rem); }
.nav-link-u {
  position: relative; display: inline-block; padding: .4rem 0;
  font-size: .94rem; font-weight: 600; color: var(--charcoal); text-decoration: none;
}
.nav-link-u::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .15rem; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: var(--origin, left);
  transition: transform .35s var(--ease);
}
[dir="rtl"] .nav-link-u::after { --origin: right; }
.nav-link-u:hover, .nav-link-u.is-active { color: var(--green); }
.nav-link-u:hover::after, .nav-link-u.is-active::after { transform: scaleX(1); }

.lang-switch {
  display: flex; align-items: center; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(252, 251, 248, .6);
}
.lang-switch a {
  font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-decoration: none;
  color: var(--muted); padding: .38rem .62rem; border-radius: 999px; line-height: 1;
  transition: background-color .2s, color .2s; font-family: var(--font);
}
.lang-switch a:hover { color: var(--green); background: rgba(18, 61, 50, .06); }
.lang-switch a.active { background: var(--green); color: var(--ivory); }

.menu-toggle, .menu-close {
  width: 46px; height: 46px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: transparent;
  color: var(--green); font-size: 1.4rem; padding: 0;
}
.menu-toggle:hover, .menu-close:hover { border-color: var(--gold); }

/* Offcanvas (mobile) */
.mobile-nav { --bs-offcanvas-width: min(88vw, 400px); --bs-offcanvas-bg: var(--ivory); --bs-offcanvas-padding-x: 1.6rem; }
.mobile-nav .offcanvas-header { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.mobile-nav .offcanvas-title { display: flex; align-items: center; gap: .7rem; margin: 0; font-weight: 750; color: var(--green); }
.mobile-nav .offcanvas-title img { width: 44px; height: 44px; object-fit: contain; }
.mobile-links { list-style: none; padding: 0; margin: 0 0 2rem; }
.mobile-links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: .95rem 0; border-bottom: 1px solid var(--line);
  font-size: 1.3rem; font-weight: 650; color: var(--green); text-decoration: none; letter-spacing: -.01em;
}
.mobile-links a::after { content: ""; width: 7px; height: 7px; border-top: 1.5px solid var(--gold); border-inline-end: 1.5px solid var(--gold); transform: rotate(45deg); }
[dir="rtl"] .mobile-links a::after { transform: rotate(-45deg); }
.lang-switch--lg { width: 100%; justify-content: space-between; }
.lang-switch--lg a { flex: 1; text-align: center; font-size: .9rem; padding: .7rem .4rem; letter-spacing: .02em; }
.mobile-mail { margin-top: 1.5rem; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); position: relative; }
.section--white { background: var(--white); }
.section--ivory { background: var(--ivory); }
.section--green { background: var(--green); color: rgba(247, 244, 236, .86); }
.section--green h2 { color: var(--ivory); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* faint 8-point-star pattern */
.section--pattern { isolation: isolate; }
.section--pattern::before,
.binding::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23123D32' stroke-width='1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h16M56 36h16M36 0v16M36 56v16'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
  opacity: .035;
}

/* ---------- Hero ---------- */
.hero { background: var(--ivory); padding-block: clamp(2rem, 5vw, 4.5rem) clamp(4rem, 8vw, 7rem); position: relative; }
.hero::after { /* thin manuscript-margin rule along the bottom */
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--line);
}
.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 5.2rem); line-height: 1; letter-spacing: -.04em; font-weight: 750;
  margin-bottom: 1.1rem;
}
.hero-slogan {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 500; color: var(--green-2);
  line-height: 1.35; margin-bottom: 1.6rem; letter-spacing: -.01em;
}
.hero-intro { color: #3D4541; max-width: 34rem; margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }

.hero-figure { position: relative; isolation: isolate; margin-inline-end: 1.25rem; margin-block-end: 1.25rem; }
.hero-figure::before {   /* offset gold hairline frame */
  content: ""; position: absolute; z-index: -1;
  inset-block-start: 1.25rem; inset-inline-start: 1.25rem; inset-block-end: -1.25rem; inset-inline-end: -1.25rem;
  border: 1px solid rgba(200, 155, 60, .7); border-radius: var(--radius-lg);
}
.hero-figure::after {    /* small gold corner accent */
  content: ""; position: absolute; width: 56px; height: 3px; background: var(--gold);
  inset-block-end: -1.25rem; inset-inline-end: 2rem; transform: translateY(1px);
}
.hero-figure img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 48% 55%;
  border-radius: var(--radius-lg); box-shadow: var(--shadow); background: #e9e5da;
}
@media (min-width: 576px) and (max-width: 991.98px) { .hero-figure img { aspect-ratio: 16 / 10; } }
@media (min-width: 992px) { .hero-figure img { aspect-ratio: 1.12; } }

.hero-in { animation: heroIn .9s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- About ---------- */
.ayah { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.ayah blockquote { margin: 0; }
.ayah-ar { font-size: clamp(1.7rem, 3vw, 2.2rem); color: var(--green); line-height: 1.6; margin-bottom: .35rem; text-align: start; }
[dir="ltr"] .ayah-ar { text-align: left; }
.ayah-tr { font-style: italic; color: var(--muted); margin-bottom: .4rem; }
.ayah figcaption { font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }

/* ---------- Program (ruled grid) ---------- */
.disciplines {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
@media (min-width: 640px) { .disciplines { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .disciplines { grid-template-columns: repeat(3, 1fr); } }
.discipline {
  position: relative; background: var(--white); padding: clamp(1.6rem, 3vw, 2.25rem);
  transition: background-color .35s var(--ease);
}
.discipline::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0; height: 2px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: var(--origin, left);
  transition: transform .45s var(--ease);
}
[dir="rtl"] .discipline::before { --origin: right; }
.discipline:hover { background: #fff; }
.discipline:hover::before { transform: scaleX(1); }
.discipline-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.discipline-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(200, 155, 60, .55); color: var(--green); font-size: 1.1rem;
  transition: border-color .3s, background-color .3s;
}
.discipline:hover .discipline-icon { border-color: var(--gold); background: rgba(200, 155, 60, .08); }
.discipline-ar { font-size: 1.15rem; color: var(--gold-ink); line-height: 1.4; }
.discipline h3 { font-size: 1.3rem; margin-bottom: .55rem; }
.discipline p { color: var(--muted); font-size: 1rem; line-height: 1.65; margin: 0; }

/* ---------- Teaching / values ---------- */
.values { list-style: none; padding: 0; margin: 0; }
.value {
  position: relative; display: grid; grid-template-columns: 3.75rem 1fr; gap: 1rem;
  padding-block: 1.6rem; border-top: 1px solid var(--line);
}
.value:last-child { border-bottom: 1px solid var(--line); }
.value::before {
  content: ""; position: absolute; top: -1px; inset-inline-start: 0; width: 2.5rem; height: 1px; background: var(--gold);
  transition: width .5s var(--ease);
}
.value:hover::before { width: 6rem; }
.value-num { font-size: .95rem; font-weight: 700; letter-spacing: .1em; color: var(--gold-ink); font-variant-numeric: tabular-nums; padding-top: .3rem; font-family: var(--font); }
.value h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: .3rem; }
.value p { color: var(--muted); margin: 0; }
@media (min-width: 768px) {
  .value { grid-template-columns: 4.5rem 14rem 1fr; align-items: baseline; }
  .value > div { display: contents; }
  .value h3 { margin: 0; }
}

/* ---------- Photos ---------- */
.photo { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: #ddd8cc; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo--tall img { aspect-ratio: 4 / 5; object-position: 50% 35%; }
.photo--masjid img { aspect-ratio: 4 / 4.4; object-position: 50% 62%; }
@media (min-width: 992px) { .photo--masjid img { aspect-ratio: 5 / 5.6; } }

/* ---------- Teachers ---------- */
.section--teachers .photo { box-shadow: var(--shadow); }
.rule-text { border-inline-start: 2px solid var(--gold); padding-inline-start: clamp(1.1rem, 2.5vw, 1.75rem); margin-block: .5rem 2.25rem; }
.countries-label { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.countries ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 0; }
.countries li { font-weight: 650; color: var(--green); font-size: 1.05rem; }
.countries li + li::before { content: "·"; color: var(--gold); margin-inline: .75rem; font-weight: 700; }

/* ---------- Tedmurijja ---------- */
.binding {
  position: relative; isolation: isolate; max-width: 27rem; margin-inline: auto;
  background: var(--green); border-radius: var(--radius-lg); padding: clamp(.9rem, 2vw, 1.25rem);
  box-shadow: var(--shadow); overflow: hidden;
}
.binding::before { opacity: .09; filter: invert(1); z-index: 0; }
.binding-inner {
  position: relative; z-index: 1;
  aspect-ratio: 4 / 3.3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 1px solid rgba(200, 155, 60, .75); border-radius: 4px;
  box-shadow: inset 0 0 0 6px var(--green), inset 0 0 0 7px rgba(200, 155, 60, .4);
  padding: 2rem 1.25rem;
}
@media (min-width: 992px) { .binding-inner { aspect-ratio: 4 / 4.6; } }
.binding-word { font-family: var(--font-ar); font-weight: 700; color: var(--ivory); font-size: clamp(3.4rem, 9vw, 5.4rem); line-height: 1.4; margin: 0; }
.binding-rule { display: block; width: 56px; height: 1px; background: var(--gold); margin: 1.25rem auto 1rem; position: relative; }
.binding-rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); }
.binding-caption { color: rgba(247, 244, 236, .78); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; margin: 0; }
.full-title {
  font-size: clamp(1.2rem, 2vw, 1.45rem); color: var(--green); line-height: 1.8; font-weight: 600;
  border-block: 1px solid rgba(200, 155, 60, .55); padding-block: 1rem; margin-block: 1.25rem 1.5rem;
}
[dir="ltr"] .full-title { text-align: right; }

/* ---------- Library ---------- */
.library {
  display: grid; gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "text text" "main main" "a b";
}
.library-text { grid-area: text; padding-bottom: .5rem; }
.library-main { grid-area: main; }
.library-a { grid-area: a; }
.library-b { grid-area: b; }
.library-main img { aspect-ratio: 4 / 4.4; object-position: 50% 40%; }
.library-a img, .library-b img { aspect-ratio: 4 / 5; }
.library-b img { object-position: 30% 40%; }
.library-sub { font-size: clamp(1.2rem, 2vw, 1.45rem); color: var(--green-2); font-weight: 500; line-height: 1.4; margin-bottom: 1.25rem; max-width: 30rem; }
.library-text p:not(.library-sub):not(.eyebrow) { color: #3D4541; max-width: 34rem; }
@media (min-width: 992px) {
  .library {
    grid-template-columns: 1.2fr 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: "main text text" "main a b";
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
  }
  .library-text { align-self: end; padding: 0 0 1.25rem; }
  .library-main { position: relative; min-height: 100%; }
  .library-main picture, .library-main img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
}

/* ---------- Masjid ---------- */
.section--green .photo { background: var(--green-2); }
.section--green p { max-width: 32rem; }

/* ---------- Contact ---------- */
.contact-lead { font-size: clamp(1.1rem, 1.5vw, 1.22rem); color: #3D4541; max-width: 30rem; }

/* "letter" card — same binding motif as the Tedmurijja panel, in ivory */
.letter {
  position: relative; background: var(--white); border-radius: var(--radius-lg);
  padding: clamp(.7rem, 1.6vw, 1rem); box-shadow: var(--shadow);
}
.letter-inner {
  position: relative; border: 1px solid rgba(200, 155, 60, .6); border-radius: 4px;
  box-shadow: inset 0 0 0 5px var(--white), inset 0 0 0 6px rgba(200, 155, 60, .28);
  padding: clamp(1.75rem, 4.5vw, 3rem) clamp(1.35rem, 4.5vw, 3rem) clamp(1.5rem, 3.5vw, 2.25rem);
}
.letter-inner::before { /* small gold diamond on the top edge, like a clasp */
  content: ""; position: absolute; top: -5px; left: 50%; width: 9px; height: 9px;
  background: var(--gold); transform: translateX(-50%) rotate(45deg);
}
.letter-row + .letter-row { margin-top: 2rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.letter-label {
  display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.letter-label .i { color: var(--gold-ink); font-size: 1rem; }
.letter-mail {
  display: inline-block; font-size: clamp(1.35rem, 3.2vw, 2.05rem); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.25; color: var(--green); text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px;
  transition: background-size .45s var(--ease); padding-bottom: .15rem; font-family: var(--font);
}
.letter-mail:hover, .letter-mail:focus-visible { color: var(--green); background-size: 100% 1px; }
.letter-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.letter-actions .btn { flex: 1 1 auto; }
@media (min-width: 576px) { .letter-actions .btn { flex: 0 0 auto; } }
.js-copy.is-done { border-color: var(--gold); background: rgba(200, 155, 60, .08); }
.letter-place { font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 650; color: var(--green); margin: 0; }
.letter-seal {
  margin: 2.25rem 0 0; text-align: center; font-size: 1.3rem; color: var(--gold-ink); line-height: 1.6;
  display: flex; align-items: center; gap: 1rem;
}
.letter-seal::before, .letter-seal::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sr-only-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
[dir="rtl"] .letter-mail { font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
[dir="rtl"] .letter-label { letter-spacing: 0; text-transform: none; font-size: .95rem; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-deep); color: rgba(247, 244, 236, .78); padding-block: clamp(3.5rem, 7vw, 5.5rem) 2rem; font-size: 1rem; }
.site-footer a { color: rgba(247, 244, 236, .9); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); text-decoration: underline; }
.footer-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.footer-brand img { width: 72px; height: 72px; object-fit: contain; }
.footer-name { color: var(--ivory); font-weight: 750; font-size: 1.2rem; margin: 0; }
.footer-slogan { color: var(--gold-light); margin: .1rem 0 0; font-size: .98rem; }
.footer-tag { max-width: 22rem; font-size: .95rem; }
.footer-h { font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-links a[aria-current] { color: var(--gold-light); }
.footer-contact { line-height: 1.8; overflow-wrap: anywhere; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid rgba(247, 244, 236, .12); font-size: .9rem;
}
.footer-bottom p { margin: 0; }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-img img { clip-path: inset(5% 5% 5% 5% round 4px); transform: scale(1.04); transition: clip-path 1.1s var(--ease), transform 1.4s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal-img.is-visible img { clip-path: inset(0 0 0 0 round 0); transform: none; }

/* ---------- Arabic / RTL ---------- */
[dir="rtl"] body { font-family: var(--font-ar); font-size: 1.15rem; line-height: 1.95; }
@media (min-width: 768px) { [dir="rtl"] body { font-size: 1.22rem; } }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--font-ar); letter-spacing: 0; line-height: 1.45; font-weight: 700; }
[dir="rtl"] .hero-title { font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.35; letter-spacing: 0; }
[dir="rtl"] .hero-slogan { font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.6; letter-spacing: 0; }
[dir="rtl"] .h-display, [dir="rtl"] .h-section { letter-spacing: 0; line-height: 1.45; }
[dir="rtl"] .eyebrow, [dir="rtl"] .countries-label, [dir="rtl"] .footer-h,
[dir="rtl"] .binding-caption, [dir="rtl"] .ayah figcaption, [dir="rtl"] .brand-sub {
  letter-spacing: 0; text-transform: none; font-size: .95rem; font-weight: 600;
}
[dir="rtl"] .brand-name { font-family: var(--font-ar); font-size: 1.2rem; letter-spacing: 0; }
[dir="rtl"] .brand-sub { font-size: .8rem; margin-top: 0; }
[dir="rtl"] .nav-link-u { font-size: 1.05rem; font-weight: 600; }
[dir="rtl"] .mobile-links a { font-size: 1.4rem; letter-spacing: 0; }
[dir="rtl"] .btn { font-size: 1.08rem; padding-block: .75rem; }
[dir="rtl"] .lead-text { line-height: 1.9; }
[dir="rtl"] .discipline h3 { font-size: 1.45rem; }
[dir="rtl"] .discipline p, [dir="rtl"] .value p { line-height: 1.85; }
[dir="rtl"] .value { grid-template-columns: 3.25rem 1fr; }
@media (min-width: 768px) { [dir="rtl"] .value { grid-template-columns: 4rem 13rem 1fr; } }
[dir="rtl"] .value h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); }
[dir="rtl"] .full-title { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
[dir="rtl"] .footer-name { font-family: var(--font-ar); font-size: 1.35rem; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal-img img { clip-path: none; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .mobile-nav, .hero-actions, .letter-actions { display: none !important; }
  .js .reveal, .js .reveal-img img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
