:root {
  --maroon-950: #3e0711;
  --maroon-900: #58101c;
  --maroon-800: #701624;
  --maroon-700: #8d2030;
  --crimson: #bd1634;
  --gold: #f2ae2e;
  --gold-soft: #f7d37c;
  --ink: #1e1918;
  --ink-soft: #665d58;
  --ivory: #f5f0e7;
  --paper: #fffdf8;
  --white: #fff;
  --rule: #d8cec2;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --arabic: "Noto Naskh Arabic", "Amiri", serif;
  --measure: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
body { margin: 0; color: var(--ink); background: var(--ivory); font-family: var(--sans); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
body::selection { color: var(--white); background: var(--maroon-700); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.035em; }
h1 { max-width: 11ch; margin-bottom: 1.75rem; font-size: clamp(3.75rem, 7vw, 6.75rem); line-height: .92; }
h2 { margin-bottom: 0; font-size: clamp(2.75rem, 5vw, 4.75rem); line-height: .98; }
h3 { font-size: clamp(1.8rem, 2.5vw, 2.45rem); line-height: 1.02; }
.wrap { width: min(calc(100% - 3rem), var(--measure)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--maroon-700); outline-offset: 4px; }
.hero :focus-visible, .connect-section :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; padding: .7rem 1rem; color: var(--white); background: var(--maroon-950); text-decoration: none; }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 10; color: var(--ink); background: rgb(255 253 248 / 96%); border-bottom: 1px solid var(--rule); backdrop-filter: blur(14px); }
.header-inner { min-height: 6rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; }
.brand { width: max-content; display: flex; align-items: center; gap: .85rem; text-decoration: none; }
.brand img { width: 3.85rem; aspect-ratio: 1; object-fit: contain; }
.brand span { display: grid; }
.brand strong { font-size: .95rem; letter-spacing: .055em; }
.brand small { color: var(--ink-soft); font-size: .7rem; }
.main-nav { display: flex; align-items: center; gap: clamp(1.4rem, 3vw, 2.6rem); }
.main-nav a, .footer-links a, .header-link { text-decoration: none; }
.main-nav a { position: relative; padding-block: .4rem; font-size: .84rem; font-weight: 600; }
.main-nav a::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--crimson); content: ""; transform: scaleX(0); transform-origin: right; transition: transform 180ms ease; }
.main-nav a:hover::after, .main-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.header-link { justify-self: end; padding: .5rem 0 .35rem; border-bottom: 2px solid var(--gold); color: var(--maroon-800); font-size: .82rem; font-weight: 700; }

.button { min-height: 3.1rem; display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.1rem; border: 1px solid transparent; border-radius: .35rem; font-size: .82rem; font-weight: 700; line-height: 1.2; text-decoration: none; transition: background-color 180ms ease, color 180ms ease; }
.button-gold { color: var(--maroon-950); background: var(--gold); }
.button-gold:hover { background: var(--gold-soft); }
.text-link { display: inline-flex; align-items: center; padding-block: .3rem; border-bottom: 1px solid currentColor; color: var(--maroon-800); font-size: .84rem; font-weight: 700; text-decoration: none; }
.text-link:hover { color: var(--crimson); }
.light-link { color: var(--white); }
.light-link:hover { color: var(--gold-soft); }

.hero { color: var(--white); background: var(--maroon-900); }
.hero-grid { min-height: 43rem; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(19rem, .55fr); align-items: center; gap: clamp(3rem, 7vw, 7rem); padding-block: clamp(5rem, 9vw, 7rem); }
.hero-copy { position: relative; z-index: 1; }
.hero-lede { max-width: 42rem; margin-bottom: 0; color: rgb(255 255 255 / 78%); font-size: clamp(1.08rem, 1.8vw, 1.3rem); line-height: 1.75; }
.hero-card { min-height: 31rem; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(1.6rem, 3vw, 2.35rem); color: var(--ink); background: var(--paper); border-radius: 12rem 12rem .4rem .4rem; box-shadow: 0 1.5rem 3.5rem rgb(31 0 7 / 26%); }
.hero-card img { width: 74%; margin: 1rem auto 2rem; }
.arabic { margin-bottom: .55rem; color: var(--maroon-800); font-family: var(--arabic); font-size: 1.5rem; line-height: 1.5; }
.hero-card-copy { margin-bottom: 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.65; }
.hero-note { padding-block: 1.2rem; border-top: 1px solid rgb(255 255 255 / 18%); }
.hero-note p { margin-bottom: 0; color: rgb(255 255 255 / 67%); font-size: .78rem; }

.section { padding-block: clamp(5.5rem, 9vw, 8rem); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, .72fr); align-items: end; gap: clamp(2rem, 7vw, 7rem); margin-bottom: clamp(3.5rem, 6vw, 5.5rem); }
.section-heading > p { max-width: 34rem; margin-bottom: .4rem; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.75; }

.programs-section { background: var(--ivory); }
.program-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 4.5rem); row-gap: clamp(4rem, 7vw, 6.5rem); }
.program-card { min-width: 0; }
.program-photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--maroon-900); border-radius: .35rem; }
.program-photo img { width: 100%; height: 100%; object-fit: cover; }
.program-card-body { max-width: 34rem; padding-top: 1.5rem; }
.program-card h3 { margin-bottom: .8rem; color: var(--maroon-900); }
.program-card p { margin-bottom: 0; color: var(--ink-soft); font-size: .94rem; line-height: 1.75; }
.photo-knk { object-position: center 62%; }
.photo-sweet-sunday { object-position: center 46%; }
.photo-dine { object-position: center 50%; }
.photo-hifz { object-position: center 58%; }
.photo-insights { object-position: center 48%; }

.events-section { background: var(--paper); }
.events-heading { margin-bottom: 3.5rem; padding-bottom: 2.25rem; border-bottom: 1px solid var(--rule); }
.events-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr); gap: clamp(2.5rem, 6vw, 6rem); }
.events-layout.single-event { grid-template-columns: 1fr; }
.next-event { min-height: 28rem; display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); overflow: hidden; background: var(--ivory); border-top: 1px solid var(--maroon-800); border-bottom: 1px solid var(--maroon-800); }
.event-loading { grid-column: 1 / -1; margin: auto; text-align: center; }
.event-loading p { margin-bottom: 0; color: var(--ink-soft); }
.loading-mark { width: 1.8rem; height: 1.8rem; display: block; margin: 0 auto 1rem; border: 2px solid var(--rule); border-top-color: var(--maroon-700); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.next-event-top { display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 2rem 1.6rem; color: var(--white); background: var(--maroon-800); }
.live-label { margin-bottom: 0; color: rgb(255 255 255 / 75%); font-size: .78rem; }
.event-date-block { display: grid; color: var(--gold-soft); }
.event-date-block strong { font-family: var(--serif); font-size: 5rem; font-weight: 600; letter-spacing: -.04em; line-height: .8; }
.event-date-block span { margin-top: .85rem; font-size: .72rem; font-weight: 600; line-height: 1.55; white-space: pre-line; }
.next-event-body { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4rem); }
.next-event h3 { max-width: 14ch; margin: 0 0 1.1rem; font-size: clamp(2.75rem, 5vw, 4.5rem); }
.event-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin-bottom: 1.25rem; color: var(--ink-soft); font-size: .87rem; }
.event-description { max-width: 39rem; margin-bottom: 1.6rem; color: var(--ink-soft); font-size: .92rem; }
.event-button { width: max-content; }
.event-empty { grid-column: 1 / -1; max-width: 38rem; align-self: center; padding: clamp(2rem, 5vw, 4rem); }
.event-empty h3 { margin-top: .75rem; }
.event-empty p { color: var(--ink-soft); }
.more-events { min-width: 0; }
.list-label { margin-bottom: 1.25rem; color: var(--maroon-800); font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.event-list { margin: 0; padding: 0; list-style: none; }
.event-list li { display: grid; grid-template-columns: 3.8rem 1fr auto; align-items: start; gap: 1.1rem; padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.event-list li:first-child { padding-top: 0; border-top: 0; }
.event-list time { color: var(--maroon-700); font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1; text-align: left; }
.event-list time span { display: block; margin-top: .2rem; font-family: var(--sans); font-size: .65rem; font-weight: 600; }
.event-list h3 { margin-bottom: .4rem; font-size: 1.4rem; line-height: 1.15; }
.event-list p { margin-bottom: 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.55; white-space: pre-line; }
.event-list a { padding-bottom: .15rem; border-bottom: 1px solid currentColor; color: var(--maroon-700); font-size: .76rem; font-weight: 700; text-decoration: none; }
.empty-list { color: var(--ink-soft); }

.connect-section { color: var(--white); background: var(--maroon-950); }
.connect-grid { display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: clamp(2.5rem, 7vw, 7rem); }
.connect-grid h2 { margin-bottom: 1rem; }
.connect-grid p { max-width: 34rem; margin-bottom: 0; color: rgb(255 255 255 / 70%); font-size: 1.05rem; }
.connect-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }

.site-footer { padding-top: 4.5rem; color: rgb(255 255 255 / 68%); background: #21191a; }
.footer-grid { display: grid; grid-template-columns: 1.25fr .85fr .7fr; gap: 3rem; padding-bottom: 4rem; }
.footer-brand { display: flex; align-items: flex-start; gap: 1.2rem; }
.footer-brand img { width: 5.25rem; object-fit: contain; }
.footer-brand strong { color: var(--white); font-size: .9rem; letter-spacing: .055em; }
.footer-brand p { margin: .5rem 0 0; font-size: .78rem; line-height: 1.7; }
.footer-label { margin-bottom: .85rem; color: var(--white); font-family: var(--serif); font-size: 1.05rem; }
.footer-date > p:last-child { margin-bottom: 0; font-size: .75rem; }
.hijri-arabic { margin-bottom: .2rem; color: var(--gold-soft); font-family: var(--arabic); font-size: 1.55rem; }
.footer-links { display: grid; justify-items: start; gap: .65rem; }
.footer-links a { color: rgb(255 255 255 / 78%); font-size: .78rem; }
.footer-links a:hover { color: var(--gold-soft); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.4rem; border-top: 1px solid rgb(255 255 255 / 12%); font-size: .68rem; }
.footer-bottom p { margin-bottom: 0; }
.footer-bottom a { color: var(--white); text-decoration: none; }

@media (max-width: 920px) {
  html { scroll-padding-top: 0; }
  .site-header { position: static; }
  .header-inner { grid-template-columns: 1fr auto; gap: .8rem 1.5rem; padding-block: .75rem; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; padding-top: .6rem; border-top: 1px solid var(--rule); }
  .hero-grid { min-height: auto; grid-template-columns: 1fr; }
  .hero-card { width: min(100%, 26rem); min-height: 28rem; justify-self: center; }
  .events-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .wrap { width: min(calc(100% - 1.5rem), var(--measure)); }
  .header-inner { min-height: 5rem; }
  .brand img { width: 3rem; }
  .brand small { display: none; }
  .header-link { font-size: .72rem; }
  .main-nav { justify-content: space-between; gap: 1rem; }
  .main-nav a { font-size: .74rem; }
  h1 { font-size: clamp(3.35rem, 16vw, 5rem); }
  .hero-grid { padding-block: 4.25rem; }
  .hero-card { min-height: 24rem; border-radius: 9rem 9rem .35rem .35rem; }
  .hero-card img { width: 65%; }
  .section-heading, .program-grid, .connect-grid, .footer-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; margin-bottom: 3rem; }
  .program-grid { row-gap: 3.75rem; }
  .program-card-body { padding-top: 1.2rem; }
  .next-event { min-height: 0; grid-template-columns: 1fr; }
  .next-event-top { min-height: 10rem; flex-direction: row; align-items: flex-end; padding: 1.5rem; }
  .event-date-block { text-align: right; }
  .event-date-block strong { font-size: 4.25rem; }
  .next-event-body { padding: 2rem 1.5rem 2.5rem; }
  .next-event h3 { font-size: clamp(2.55rem, 12vw, 3.75rem); }
  .event-list li { grid-template-columns: 3.2rem 1fr auto; gap: .8rem; }
  .connect-grid { align-items: start; }
  .footer-brand { grid-column: auto; }
  .footer-grid { gap: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
