/* ==========================================================================
   Madrasa Noor-ul-Quran for the Blind — stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Jost:wght@400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;600;700&display=swap');

:root {
  --ink: #26221b;
  --ink-soft: #5b5344;
  --cream: #faf6ec;
  --cream-deep: #f1e6d3;
  --card: #ffffff;
  --teal: #3a6b35;
  --teal-deep: #1f4720;
  --gold: #a97c50;
  --gold-soft: #e3c9a3;
  --line: #e6d9bf;
  --shadow: 0 18px 40px -20px rgba(31, 71, 32, 0.35);
  --radius: 18px;
  --font-en: 'Jost', 'Segoe UI', sans-serif;
  --font-head: 'Cormorant Garamond', 'Georgia', serif;
  --font-ar: 'Noto Nastaliq Urdu', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-en);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
}

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

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 92%;
  max-width: 1160px;
  margin: 0 auto;
}

/* ---------- language switching ---------- */

.ar { display: none; }

body.lang-ar {
  font-family: var(--font-ar);
}

body.lang-ar .en { display: none !important; }
body.lang-ar .ar { display: inline; }
body.lang-ar p.ar,
body.lang-ar div.ar,
body.lang-ar li.ar,
body.lang-ar span.block.ar { display: block; }

body.lang-ar { direction: rtl; }
body.lang-ar .site-header .container,
body.lang-ar .stat-card,
body.lang-ar .value-card,
body.lang-ar .dept-card,
body.lang-ar .unique-item,
body.lang-ar .media-card,
body.lang-ar .footer-grid { direction: rtl; text-align: right; }

body.lang-ar h1, body.lang-ar h2, body.lang-ar h3, body.lang-ar .eyebrow {
  font-family: var(--font-ar);
}

body.lang-ar .lead::first-letter { all: unset; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 42px;
  width: 42px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-head);
  line-height: 1.15;
}

.brand-text strong {
  display: block;
  font-size: 1.15rem;
  color: var(--teal-deep);
  letter-spacing: 0.02em;
}

.brand-text span {
  font-family: var(--font-en);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-nav ul {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.main-nav a {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover { color: var(--teal); border-color: var(--gold); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--teal);
  color: var(--teal-deep);
  background: transparent;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.lang-toggle:hover { background: var(--teal); color: #fff; }

.nav-toggle {
  display: none;
  position: relative;
  z-index: 210;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--teal-deep);
  cursor: pointer;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background-image:
    linear-gradient(180deg, rgba(20,45,20,0.55) 0%, rgba(20,45,20,0.72) 55%, rgba(20,40,20,0.92) 100%),
    url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center 30%;
  background-attachment: fixed;
  padding: 140px 20px 90px;
}

@media (max-width: 800px) {
  .hero { background-attachment: scroll; }
}

.hero-logo {
  width: min(190px, 42vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto 26px;
  padding: 12px;
  background: #fff;
  border-radius: 50%;
  border: 3px solid var(--gold-soft);
  box-shadow: 0 14px 34px -10px rgba(0,0,0,0.55);
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.footer-brand img,
.brand img {
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  border: 1px solid var(--line);
}

.hero .eyebrow {
  color: var(--gold-soft);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 700;
  margin: 0 0 10px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.hero .location {
  font-size: 1rem;
  color: #f2ead2;
  margin-bottom: 6px;
}

.hero .trust-line {
  font-size: 0.88rem;
  color: #d8cfae;
  margin-bottom: 30px;
}

.motto-strip {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding: 14px 0;
  margin-bottom: 34px;
}

.motto-strip span {
  padding: 0 18px;
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  position: relative;
}

.motto-strip span:not(:last-child)::after {
  content: '•';
  position: absolute;
  inset-inline-end: -4px;
  color: var(--gold);
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn-gold {
  background: var(--gold);
  color: var(--teal-deep);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(189,148,64,0.6); }

.btn-outline {
  border: 1.5px solid rgba(255,255,255,0.7);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }

/* ---------- sections ---------- */

section { padding: 78px 0; }
section.alt { background: var(--cream-deep); }

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 46px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  color: var(--teal-deep);
  margin: 0 0 12px;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.rule {
  width: 64px;
  height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
  border-radius: 3px;
}

.prose {
  max-width: 820px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.prose p { margin: 0 0 18px; }

.prose .lead {
  font-size: 1.12rem;
  color: var(--ink);
}

.prose-columns {
  columns: 1;
}

.signoff {
  text-align: center;
  margin-top: 28px;
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--teal);
}

/* card grids */

.grid {
  display: grid;
  gap: 24px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.value-card, .dept-card, .media-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.value-card:hover, .dept-card:hover {
  transform: translateY(-5px);
}

.card-num {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}

.value-card h3, .dept-card h3 {
  font-family: var(--font-head);
  font-size: 1.22rem;
  color: var(--teal-deep);
  margin: 0 0 8px;
}

.value-card p, .dept-card p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin: 0;
}

.unique-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 720px) { .unique-list { grid-template-columns: 1fr; } }

.unique-item {
  display: flex;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--line);
}

.unique-item .num {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
}

.unique-item h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--teal-deep);
  margin: 0 0 6px;
}

.unique-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 30px;
  align-items: stretch;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 780px) { .resource-grid { grid-template-columns: 1fr; } }

.resource-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
@media (max-width: 780px) { .resource-image { height: 300px; } }
.resource-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-stack {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.resource-card {
  background: var(--teal-deep);
  color: #f2ead2;
  border-radius: var(--radius);
  padding: 38px 42px;
  flex: 1;
}
.resource-card h3 {
  font-family: var(--font-head);
  color: var(--gold-soft);
  font-size: 1.45rem;
  margin: 0 0 12px;
}
.resource-card p { margin: 0; color: #d8cfae; font-size: 1.02rem; }
.resource-card .resource-buy {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 0.9rem;
}
.resource-card .resource-buy a {
  color: var(--gold-soft);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.resource-card .resource-buy a:hover { color: #fff; }
.resource-buy-cta {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 22px;
  font-size: 0.84rem;
  vertical-align: middle;
}
.resource-buy-or {
  display: inline-block;
  margin: 14px 10px 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold-soft);
  vertical-align: middle;
}

/* application form */

.apply-form {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

.apply-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--teal-deep);
  min-width: 0;
}

.form-full { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; font-size: 0.86rem; font-weight: 600; color: var(--teal-deep); min-width: 0; }

.apply-form input,
.apply-form select,
.apply-form textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-en);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  resize: vertical;
}

body.lang-ar .apply-form input,
body.lang-ar .apply-form select,
body.lang-ar .apply-form textarea {
  font-family: var(--font-ar);
}

.apply-form input:focus,
.apply-form select:focus,
.apply-form textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.apply-form button[type="submit"] {
  border: none;
  cursor: pointer;
  font-family: var(--font-en);
}
body.lang-ar .apply-form button[type="submit"] { font-family: var(--font-ar); }

.apply-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin: 16px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.form-status.success { color: var(--teal); }
.form-status.error { color: #b34438; }

/* stats */

.stats-band {
  background: var(--teal-deep);
  color: #fff;
  position: relative;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  text-align: center;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr 1fr; } }

.stat-card .num {
  font-family: var(--font-head);
  font-size: 2.5rem;
  color: var(--gold-soft);
  font-weight: 700;
  line-height: 1;
}
.stat-card .label {
  margin-top: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #cfd8d3;
}
.stats-note {
  text-align: center;
  margin-top: 34px;
  font-size: 0.86rem;
  color: #b9c4bd;
}

/* media / social */

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .media-grid { grid-template-columns: 1fr; } }

.media-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.media-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.media-icon.yt { background: #d9302f; }
.media-icon.ig { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }

.media-card h3 { font-family: var(--font-head); font-size: 1.15rem; margin: 0; color: var(--teal-deep); }
.media-card p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }

.video-embed {
  margin-top: 10px;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.video-embed iframe { width: 100%; height: 100%; border: 0; }

/* location */

.location-wrap {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 30px;
  align-items: stretch;
}
@media (max-width: 860px) { .location-wrap { grid-template-columns: 1fr; } }

.location-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.location-card h3 {
  font-family: var(--font-head);
  color: var(--teal-deep);
  font-size: 1.3rem;
  margin: 0 0 14px;
}
.location-card address {
  font-style: normal;
  color: var(--ink-soft);
  margin-bottom: 20px;
  line-height: 1.8;
}

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 340px;
  box-shadow: var(--shadow);
}
.map-frame iframe { width: 100%; height: 100%; min-height: 340px; border: 0; }

/* footer */

.site-footer {
  background: var(--ink);
  color: #cfcabb;
  padding: 56px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.footer-brand img { height: 40px; width: 40px; object-fit: contain; }
.footer-brand strong {
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: #fff;
}

.site-footer h4 {
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.05rem;
  margin: 0 0 14px;
}

.site-footer ul li { margin-bottom: 10px; font-size: 0.9rem; }
.site-footer a:hover { color: var(--gold-soft); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #8f8b7d;
}
.footer-bottom a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-bottom a:hover { color: #fff; }

/* mobile nav */

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(78vw, 320px);
    height: 100vh;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    padding: 90px 26px 26px;
    clip-path: inset(0 0 0 100%);
    transition: clip-path 0.3s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
  }
  /* NOTE: this panel's box stays anchored fully inside the viewport at all
     times (right:0, width <= 320px) and is revealed/hidden with `clip-path`
     instead of moving the box off-screen via `transform` or a negative
     `right`/`left` offset. Chromium counts a `position: fixed` element in
     the page's scrollable width whenever its box extends past the viewport
     — via transform OR plain offsets — which caused real horizontal
     scroll/overflow on mobile. Never letting the box leave the viewport
     avoids that at the source. */
  body.lang-ar .main-nav {
    right: auto;
    left: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    clip-path: inset(0 100% 0 0);
  }
  .main-nav.open { clip-path: inset(0 0 0 0); }
  .main-nav ul { flex-direction: column; gap: 16px; width: 100%; }
  .lang-toggle { margin-top: 10px; }
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}
