/* ==========================================================================
   Masjid website stylesheet (PRD v1.1, section 10)
   Matches the ICN Facility Rental site: a community-centre directory board.
   Condensed Big Shoulders Display reads like building signage and a
   scoreboard; Inter carries the body copy. Flat hairline structure on a
   warm paper background, navy bands, one amber accent.
   Fonts are hosted on this site (assets/fonts/), not loaded from Google,
   so the security policy can stay strict.
   ========================================================================== */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/assets/fonts/big-shoulders-display-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("/assets/fonts/noto-naskh-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- Tokens ---------- */

:root {
  /* From the facility rental site */
  --ink: #1e2a38;
  --ink-soft: #3a4757;
  --paper: #eef0ea;
  --paper-raised: #ffffff;
  --line: #d3d6c9;
  --amber: #c1872f;
  --maroon: #8c3a2b;
  --maroon-bg: #f6e9e6;
  --green: #3f6b4c;
  --green-bg: #e7efe6;
  --gold-bg: #f7edda;
  --board: #26333f;          /* scoreboard cells on navy */
  --on-dark: #d6dbe1;        /* body text on navy */
  --on-dark-soft: #b7c0c9;   /* secondary text on navy */
  --nav-text: #cfd6de;
  --footer-faint: #98a3ae;   /* copyright line; the original #6b7684 is too faint on navy */

  /* Adjusted so text meets WCAG AA contrast */
  --ink-faint: #5f6a77;      /* 4.6:1 on paper (the original #6b7684 is 4.0:1) */
  --amber-text: #7f5818;     /* amber-coloured text on light backgrounds, 5.5:1 */
  --amber-light: #d9a24a;    /* small amber text on navy, and button hover, 5.7:1 or more */
  --board-next: #33465a;     /* the next-prayer row */

  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif-condensed, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif;

  --max-width: 1120px;
  --radius: 3px;

  --focus: #96691f;          /* on light backgrounds */
  --focus-on-dark: var(--amber-light);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0.2px;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1rem; max-width: 62ch; }

a { color: var(--ink); text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible,
.hero :focus-visible,
.page-hero :focus-visible,
.site-footer :focus-visible { outline-color: var(--focus-on-dark); }
main:focus { outline: none; }

[lang="ar"] { font-family: var(--font-arabic); font-size: 1.25em; line-height: 1.8; }

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}
@media (max-width: 30rem) {
  .wrap { padding-inline: 16px; }
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  z-index: 100;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

.icon { flex: none; }
.ext-link { display: inline-flex; align-items: center; gap: 0.3em; }
.ext-link .icon-ext { opacity: 0.75; }
.ext-link.is-unset { cursor: not-allowed; }

.todo {
  background: var(--gold-bg);
  border: 1px dashed var(--amber-text);
  border-radius: var(--radius);
  padding: 0 0.3em;
  color: var(--ink);
  font-size: 0.95em;
}

/* ---------- Buttons ---------- */

.button, .donate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.button-primary, .donate-button { background: var(--amber); color: var(--ink); }
.button-primary:hover, .donate-button:hover { background: var(--amber-light); color: var(--ink); }
.button-quiet { background: var(--ink); color: #fff; }
.button-quiet:hover { background: var(--ink-soft); color: #fff; }

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--ink);
  color: #fff;
  border-bottom: 4px solid var(--amber);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 5rem;
  padding-block: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
  color: #fff;
  text-decoration: none;
}
.brand-logo { height: 56px; width: auto; }
/* The logo carries the masjid's name. The text name is shown beside it only
   on tablets, where the collapsed menu leaves room; elsewhere it is kept
   for screen readers. */
.brand-name {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.3px;
}
@media (min-width: 37.5rem) and (max-width: 69.99rem) {
  .brand-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
.header-actions { display: flex; align-items: center; gap: 10px; }

.menu, .submenu { list-style: none; margin: 0; padding: 0; }

.menu-button, .menu-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  padding: 8px 12px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--nav-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.menu-button:hover, .menu-link:hover { color: #fff; }
.menu-button.is-current { color: #fff; border-bottom-color: var(--amber); }
.menu-button .icon-caret { transition: transform 150ms ease; }
.menu-button[aria-expanded="true"] .icon-caret { transform: rotate(180deg); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
  border: 2px solid rgb(255 255 255 / 0.5);
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle:hover { border-color: #fff; }

/* Desktop: dropdown panels, flat with an amber top rule */
@media (min-width: 70rem) {
  .menu { display: flex; align-items: center; gap: 2px; }
  .menu-item { position: relative; }
  .submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 15rem;
    padding: 6px 0;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-top: 4px solid var(--amber);
    display: none;
  }
  /* The button controls the menu; hover also opens it. (no-js.css covers visitors without JavaScript.) */
  .menu-button[aria-expanded="true"] + .submenu { display: block; }
  .menu-item:hover > .menu-button[aria-expanded="false"] + .submenu { display: block; }
  .submenu a {
    display: block;
    padding: 9px 16px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
  }
  .submenu a:hover { background: var(--paper); text-decoration: underline; }
  .submenu a[aria-current="page"] {
    background: var(--gold-bg);
    box-shadow: inset 4px 0 0 var(--amber);
    font-weight: 700;
  }
}

/* Mobile: the menu opens inside the navy header */
@media (max-width: 69.99rem) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    order: 3;
    width: 100%;
    border-top: 1px solid rgb(255 255 255 / 0.15);
    padding-block: 8px 12px;
  }
  .site-nav:not(.is-open) { display: none; }
  .menu-button, .menu-link {
    width: 100%;
    justify-content: space-between;
    padding-inline: 0;
    font-size: 1.0625rem;
  }
  .menu-button.is-current { border-bottom-color: transparent; color: var(--amber-light); }
  .submenu {
    margin: 0 0 8px;
    padding-left: 14px;
    border-left: 3px solid rgb(255 255 255 / 0.2);
  }
  .menu-button[aria-expanded="false"] + .submenu { display: none; }
  .submenu a {
    display: block;
    padding: 9px 0;
    color: var(--on-dark);
    text-decoration: none;
  }
  .submenu a:hover { color: #fff; text-decoration: underline; }
  .submenu a[aria-current="page"] { color: var(--amber-light); font-weight: 700; }
}
@media (max-width: 30rem) {
  .brand { gap: 10px; }
  .brand-logo { height: 44px; }
  .header-actions { gap: 8px; }
  .donate-button { padding-inline: 16px; }
  .nav-toggle { padding-inline: 11px; }
  .nav-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- Announcement bar ---------- */

.announce {
  background: var(--gold-bg);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}
.announce-inner { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; }
.announce a { color: var(--ink); }
.announce :focus-visible { outline-color: var(--ink); }
.announce-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  contain: paint; /* clip the scrolling text to this box */
}
.announce-list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.announce-item { white-space: nowrap; padding-block: 0.55rem; }
.announce-item + .announce-item::before,
.is-scrolling .announce-item::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline: 1.5rem;
  vertical-align: middle;
  background: var(--amber);
}
.announce-track {
  display: flex;
  width: max-content;
  animation: announce-scroll var(--announce-duration, 30s) linear infinite;
}
.is-static .announce-track { animation: none; }
.announce.is-paused .announce-track,
.announce:hover .announce-track,
.announce:focus-within .announce-track { animation-play-state: paused; }
@keyframes announce-scroll { to { transform: translateX(-50%); } }
.is-stepped .announce-item { white-space: normal; }
.is-stepped .announce-item::before { display: none; }

.announce-toggle, .announce-step {
  display: inline-grid;
  place-items: center;
  position: relative;
  z-index: 1; /* keep the buttons above the scrolling text */
  width: 44px;
  height: 44px;
  flex: none;
  background: var(--gold-bg);
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
}
.announce-toggle:hover, .announce-step:hover { background: #efdfc0; }

.play-toggle[data-state="playing"] .icon-play,
.play-toggle[data-state="paused"] .icon-pause { display: none; }

/* ---------- Navy bands: homepage hero and page titles ---------- */

.hero, .page-hero { background: var(--ink); color: #fff; }
.hero { padding: 40px 0 56px; }
.page-hero { padding: 48px 0 52px; }
.page-hero h1 { margin-bottom: 0.25em; }
.page-section {
  margin: 0 0 10px;
  color: var(--amber-light);
  font-weight: 600;
}
.page-hero .lede, .hero .lede {
  color: var(--on-dark);
  font-size: 1.15rem;
  line-height: 1.5;
  max-width: 50ch;
  margin-bottom: 0;
}
.hero a, .page-hero a { color: #fff; }

/* ---------- Homepage: prayer board, slider, welcome ---------- */

.home-top {
  display: grid;
  gap: 40px;
  align-items: start;
}
@media (min-width: 60rem) {
  .home-top { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* The prayer panel is a scoreboard: navy cells, amber times. */
.prayer-panel {
  background: var(--ink);
  border: 2px solid var(--board);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 18px 20px 14px;
  background: var(--board);
  border-bottom: 4px solid var(--amber);
}
.panel-title { font-size: 2.6rem; margin: 0; color: #fff; }
.panel-date { margin: 0; color: var(--on-dark-soft); font-size: 0.95rem; font-weight: 600; }
.panel-subhead {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.prayer-panel .sample-notice { margin: 14px 16px 0; }
.prayer-day { padding: 2px 0 0; }

.prayer-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
  font-variant-numeric: tabular-nums;
}
.prayer-table thead th {
  padding: 10px 20px 6px;
  color: var(--on-dark-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}
.prayer-table thead th:first-child { text-align: left; }
.prayer-table thead th.iqamah { color: #fff; }
.prayer-table tbody th,
.prayer-table td { background: var(--board); }
.prayer-table tbody th {
  padding: 12px 10px 12px 20px;
  text-align: left;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.prayer-table tbody th > * { vertical-align: middle; }
.prayer-table td {
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
  color: var(--on-dark-soft);
  font-size: 1rem;
}
.prayer-table td.iqamah {
  padding-right: 20px;
  color: var(--amber-light);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.prayer-table td.khutba-cell {
  padding-right: 20px;
  color: var(--amber-light);
  font-weight: 700;
  white-space: normal;
}
.khutba-line { display: block; }

.prayer-table tr.is-next th,
.prayer-table tr.is-next td { background: var(--board-next); }
.prayer-table tr.is-next th { box-shadow: inset 5px 0 0 var(--amber); }
.prayer-table tr.is-next .khutba-line { color: #e8b866; } /* 5.1:1 on the next-prayer row */

.next-tag, .today-tag {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 9px;
  background: var(--amber);
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
}
.prayer-tomorrow {
  margin: 2px 0 0;
  max-width: none;
  padding: 12px 20px;
  background: var(--board-next);
  box-shadow: inset 5px 0 0 var(--amber);
  color: var(--on-dark);
  font-size: 0.95rem;
}
.prayer-tomorrow .next-tag { margin: 0 8px 0 0; }

.prayer-status {
  max-width: none;
  padding: 16px 18px;
  border-left: 4px solid var(--maroon);
  background: var(--maroon-bg);
  color: var(--ink);
  font-weight: 500;
}
.prayer-panel .prayer-status { margin: 14px 16px; }
.prayer-panel .prayer-status a { color: var(--ink); }

/* Narrow screens: one row per prayer, both labels kept */
@media (max-width: 26rem) {
  .prayer-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prayer-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: end;
    gap: 0 14px;
    margin-bottom: 2px;
    padding: 12px 16px;
    background: var(--board);
  }
  .prayer-table tbody tr.is-next { background: var(--board-next); box-shadow: inset 5px 0 0 var(--amber); }
  .prayer-table tbody th, .prayer-table td { padding: 0; background: none; }
  .prayer-table tr.is-next th { box-shadow: none; }
  .prayer-table tbody th { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; }
  .prayer-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--on-dark-soft);
  }
  .prayer-table td.iqamah { padding-right: 0; }
  .prayer-table tbody tr.is-jumuah { grid-template-columns: auto 1fr; align-items: center; }
  .prayer-table td.khutba-cell { padding-right: 0; text-align: right; font-size: 0.95rem; }
}

.prayer-panel .jumuah, .prayer-panel .special-prayers {
  margin: 2px 0 0;
  padding: 16px 20px;
  background: var(--board);
  color: #fff;
}
.jumuah-list { list-style: none; margin: 0; padding: 0; }
.jumuah-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 16px;
  padding-block: 4px;
}
.jumuah-label, .jumuah-time, .khutba-line { white-space: nowrap; }
.jumuah-time strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.prayer-panel .jumuah-time { color: var(--on-dark-soft); }
.prayer-panel .jumuah-time strong { color: var(--amber-light); }

.special-list { list-style: none; margin: 0; padding: 0; }
.special-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 16px;
  padding-block: 6px;
  border-bottom: 1px solid var(--line);
}
.special-list li:last-child { border-bottom: 0; }
.special-name { font-weight: 700; }
.special-time { font-weight: 700; text-align: right; }
.special-meta { grid-column: 1 / -1; color: var(--ink-faint); font-size: 0.95rem; }
.prayer-panel .special-list li { border-color: rgb(255 255 255 / 0.12); }
.prayer-panel .special-time { color: var(--amber-light); }
.prayer-panel .special-meta { color: var(--on-dark-soft); }

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  max-width: none;
  margin: 0;
  padding: 14px 20px 16px;
  font-size: 0.92rem;
}
.panel-foot a { font-weight: 700; }
.panel-updated { color: var(--on-dark-soft); }

/* Slider */
.home-side { display: grid; gap: 36px; }
.slider { position: relative; }
.slides { list-style: none; margin: 0; padding: 0; }
.slide:not(.is-active) { display: none; }
.slide figure { margin: 0; }
.slide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--board);
}
.slide figcaption {
  min-height: 2.75rem;
  margin-top: 12px;
  padding-right: 11rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}
.slide figcaption a { color: #fff; text-decoration: none; }
.slide figcaption a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .is-enhanced .slide.is-active { animation: slide-in 400ms ease-out; }
}
@keyframes slide-in { from { opacity: 0.4; } to { opacity: 1; } }

.slider-controls { position: absolute; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; }
.slider-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 2px solid rgb(255 255 255 / 0.5);
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
}
.slider-btn:hover { border-color: #fff; }
.slider-counter {
  min-width: 2.75rem;
  text-align: right;
  font-size: 0.92rem;
  color: var(--on-dark-soft);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 30rem) {
  .slide figcaption { padding-right: 0; margin-bottom: 3.5rem; }
}

.welcome > * { max-width: 40rem; }
.welcome h2 { font-size: clamp(2rem, 4vw, 3rem); color: #fff; }
.welcome p:last-child { margin-bottom: 0; }
.greeting { margin-bottom: 0.25rem; color: var(--amber-light); text-align: left; }

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

.home-band {
  padding-block: 56px;
  border-bottom: 1px solid var(--line);
}
.link-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 20px;
}
.link-grid a {
  display: block;
  height: 100%;
  padding: 20px 22px 22px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 6px solid var(--amber);
  color: var(--ink);
  text-decoration: none;
}
.link-grid a:hover { border-color: var(--ink); border-top-color: var(--amber); }
.link-grid a:hover .link-title { text-decoration: underline; text-decoration-thickness: 2px; }
.link-title {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
}
.link-desc { display: block; color: var(--ink-faint); font-size: 0.95rem; }

.support {
  padding-block: 56px;
}
.support-inner {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 28px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 6px solid var(--amber);
}
@media (min-width: 48rem) {
  .support-inner { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); padding: 32px 36px; }
}
.support-text h2 { margin-bottom: 0.3em; }
.support-text p { margin: 0; color: var(--ink-soft); }
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 48rem) {
  .support-actions { justify-content: flex-end; }
}

/* ---------- Content pages ---------- */

.page { padding-block: 48px 72px; }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }

/* Numbered steps, for content that really is a sequence */
.prose ol {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  counter-reset: step;
}
.prose ol > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 14px 0 14px 54px;
  border-top: 1px solid var(--line);
}
.prose ol > li:first-child { border-top: 0; }
.prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--amber-text);
}

/* ---------- History page ---------- */

.history .prose { max-width: 64rem; }
.history-columns { display: grid; gap: 8px 48px; }
@media (min-width: 48rem) {
  .history-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.prose .history-columns h2:first-child { margin-top: 1.4em; }

/* Timeline panel, after the sample: years on the left, an icon square for
   each year, a vertical line, and a short connector to each entry. */
.history-band { margin-bottom: 72px; }
.history-panel {
  --year-w: 6rem;
  --icon: 52px;
  --gap: 20px;
  --line-x: calc(var(--year-w) + var(--gap) + var(--icon) + var(--gap) + 18px);
  padding: 40px 32px 32px;
  background: var(--ink);
  border-top: 4px solid var(--amber);
  color: #fff;
}
.history-panel-title { margin: 0 0 28px; color: #fff; }
.history-timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--line-x);
  width: 2px;
  background: rgb(255 255 255 / 0.4);
}
.history-item {
  display: grid;
  grid-template-columns: var(--year-w) var(--icon) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: start;
  padding-bottom: 32px;
}
.history-item:last-child { padding-bottom: 0; }
.history-year {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: var(--icon);
  text-align: right;
  color: var(--amber-light);
  font-variant-numeric: tabular-nums;
}
.history-icon {
  display: grid;
  place-items: center;
  width: var(--icon);
  height: var(--icon);
  background: #fff;
  border-radius: 8px;
  color: var(--ink);
}
.history-item.is-milestone .history-icon { background: var(--amber); }
.history-body {
  position: relative;
  padding-left: 66px;
}
.history-body::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 18px;
  width: 36px;
  height: 2px;
  background: rgb(255 255 255 / 0.4);
}
.history-title {
  margin: 4px 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}
.history-body p { margin: 0 0 6px; max-width: 60ch; color: var(--on-dark); font-size: 0.95rem; line-height: 1.5; }
.history-body p:last-child { margin-bottom: 0; }

/* Narrow screens: the line runs through the icons, the year sits above the title. */
@media (max-width: 40rem) {
  .history-panel { --icon: 44px; padding: 28px 18px 24px; }
  .history-timeline::before { left: calc(var(--icon) / 2 - 1px); }
  .history-item {
    grid-template-columns: var(--icon) minmax(0, 1fr);
    grid-template-areas: "icon year" "icon body";
    column-gap: 16px;
    padding-bottom: 26px;
  }
  .history-icon { grid-area: icon; position: relative; z-index: 1; }
  .history-year { grid-area: year; text-align: left; font-size: 1.9rem; line-height: 1; }
  .history-body { grid-area: body; padding-left: 0; }
  .history-body::before { content: none; }
  .history-title { margin-top: 2px; }
}

.statement {
  max-width: 40rem;
  padding-left: 18px;
  border-left: 4px solid var(--amber);
  font-size: 1.2rem;
  line-height: 1.5;
}
.prose ul.values { list-style: none; padding-left: 0; }
.prose ul.values li { padding: 10px 0; margin: 0; border-top: 1px solid var(--line); }
.prose ul.values li:first-child { border-top: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--line);
}
.prose thead th { color: var(--ink-faint); font-size: 0.85rem; font-weight: 700; }
.prose table:has(thead th:empty) thead { display: none; }
.prose tbody td:first-child { font-weight: 600; width: 34%; }
.prose .button { margin-block: 0.25rem 1rem; }
.prose .jumuah {
  max-width: 28rem;
  margin: 0 0 1.5rem;
  padding: 18px 20px;
  background: var(--ink);
  border-top: 4px solid var(--amber);
  color: #fff;
}
.prose .jumuah-time { color: var(--on-dark-soft); }
.prose .jumuah-time strong { color: var(--amber-light); }
.prose code, .checker-hint code, .checker-file code {
  font-size: 0.9em;
  padding: 0.05em 0.35em;
  background: #e2e5dc;
  border-radius: var(--radius);
  color: var(--ink);
}

.contact-grid { display: grid; gap: 0 32px; }
@media (min-width: 48rem) {
  .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 64rem; }
  .prose:has(.contact-grid) { max-width: 64rem; }
}
.contact-grid h2 { font-size: 1.6rem; margin-top: 0; }

/* Messages */
.callout, .sample-notice {
  max-width: none;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-left: 4px solid var(--ink);
  background: var(--paper-raised);
  font-weight: 500;
}
.callout p:last-child { margin-bottom: 0; }
.callout-urgent { border-color: var(--maroon); background: var(--maroon-bg); }
.sample-notice { border-color: var(--amber); background: var(--gold-bg); color: var(--ink); font-size: 0.95rem; }

/* ---------- Monthly timetable ---------- */

.timetable-head { margin-bottom: 32px; }
.timetable-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
}
.timetable-meta .jumuah {
  min-width: min(100%, 22rem);
  padding: 16px 20px;
  background: var(--ink);
  border-top: 4px solid var(--amber);
  color: #fff;
}
.timetable-meta .jumuah-time { color: var(--on-dark-soft); }
.timetable-meta .jumuah-time strong { color: var(--amber-light); }
.timetable-tools { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 0.95rem; }
.timetable-tools a { font-weight: 700; }
.timetable-tools .panel-updated { color: var(--ink-faint); }
.month-nav ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 24px 0 0; padding: 0; }
.month-nav a {
  display: inline-block;
  padding: 8px 14px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.month-nav a:hover { border-color: var(--ink); }
.month { margin-bottom: 48px; scroll-margin-top: 1rem; }
.table-scroll {
  overflow-x: auto;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
}
.month-table {
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.month-table th, .month-table td {
  padding: 7px 10px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.month-table thead th { background: var(--paper-raised); }
.month-table thead tr:first-child th {
  padding-top: 12px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}
.month-table thead .sub { color: var(--ink-faint); font-size: 0.78rem; font-weight: 700; }
.month-table thead .sub.iqamah { color: var(--ink); }
.month-table .col-date {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--paper-raised);
  border-right: 1px solid var(--line);
  font-weight: 700;
}
.month-table thead tr:first-child th.col-date { font-family: var(--font-body); font-size: 0.85rem; color: var(--ink-faint); vertical-align: bottom; }
.month-table .col-date abbr { text-decoration: none; }
.month-table td { color: var(--ink-soft); }
.month-table td.iqamah { color: var(--ink); font-weight: 700; }
.month-table td.iqamah, .month-table td.friday-cell { border-right: 1px solid var(--line); }
.month-table tr.is-friday td.friday-cell {
  text-align: center;
  background: var(--green-bg);
  color: var(--green);
  font-weight: 700;
}
.month-table tr.is-today th, .month-table tr.is-today td { background: var(--gold-bg); }
.month-table tr.is-today th { box-shadow: inset 4px 0 0 var(--amber); }
.month-table .today-tag { font-size: 0.68rem; }

/* ---------- File check page ---------- */

.checker-form {
  margin: 20px 0;
  padding: 24px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 6px solid var(--amber);
}
.checker-label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 0.95rem; }
.checker-form input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 0.95rem;
}
.checker-submit { margin-top: 16px; }
.checker-hint, .checker-meta, .checker-file { color: var(--ink-faint); font-size: 0.95rem; }
.checker-result {
  margin-bottom: 48px;
  padding: 24px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 6px solid var(--ink);
  scroll-margin-top: 1rem;
}
.checker-verdict {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
}
.checker-verdict:focus { outline: none; }
.checker-verdict.is-good { color: var(--green); }
.checker-verdict.is-bad { color: var(--maroon); }
.checker-summary { color: var(--ink-soft); }
.checker-rename { padding: 14px 16px; border-left: 4px solid var(--amber); background: var(--gold-bg); max-width: none; }
.checker-group { margin-top: 20px; padding-left: 16px; border-left: 4px solid var(--line); }
.checker-group.is-bad { border-color: var(--maroon); }
.checker-group.is-warn { border-color: var(--amber); }
.checker-subhead { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }

.status-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 0.95rem; }
.status-table th, .status-table td { text-align: left; vertical-align: top; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); }
.status-table thead th { color: var(--ink-faint); font-size: 0.85rem; font-weight: 700; }
.prose .status-table tbody td:first-child { font-weight: 400; width: auto; }
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status.is-good { background: var(--green-bg); color: var(--green); }
.status.is-bad { background: var(--maroon-bg); color: var(--maroon); }
.status-note { display: block; margin-top: 4px; color: var(--ink-faint); }
.status-file { font-family: var(--font-body); font-size: 1rem; margin-top: 24px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--on-dark-soft);
  font-size: 0.95rem;
}
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .todo { color: var(--ink); }
.footer-inner {
  display: grid;
  gap: 32px 48px;
  padding-block: 40px 30px;
}
@media (min-width: 60rem) {
  .footer-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}

/* Logo, name and description, as on the facility rental site */
.foot-brand-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-logo { display: inline-flex; flex: none; line-height: 0; }
.foot-logo img { height: 96px; width: auto; display: block; }
.foot-brand-text { flex: 1 1 16rem; }
.foot-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
}
.foot-about { margin: 6px 0 0; max-width: 46ch; color: var(--on-dark-soft); }

.footer-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
@media (min-width: 37.5rem) {
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
.footer-head {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.footer-address { display: grid; gap: 4px; font-style: normal; justify-items: start; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 30px; }
.social-link { gap: 10px; }
.social-icon { width: 20px; height: 20px; flex: none; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px 30px;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  color: var(--footer-faint);
  font-size: 0.85rem;
}
.footer-base p { margin: 0; }
.footer-policies { display: flex; gap: 20px; }
.footer-policies a { color: var(--footer-faint); text-decoration: underline; text-decoration-color: rgb(255 255 255 / 0.3); }

@media (max-width: 37.5rem) {
  .foot-logo img { height: 76px; }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .announce-track { animation: none !important; }
}

@media print {
  .site-header, .announce, .site-footer, .skip-link, .month-nav, .timetable-tools a, .slider, .page-hero { display: none !important; }
  body { background: #fff; font-size: 10pt; }
  .page { padding: 0; }
  .table-scroll { overflow: visible; border: 0; }
  .month-table { min-width: 0; font-size: 8.5pt; }
  .month-table th, .month-table td { padding: 2px 4px; }
  .month { break-before: page; margin: 0; }
  .month:first-of-type { break-before: auto; }
  .month-table tr.is-today th, .month-table tr.is-today td { background: none; box-shadow: none; }
  .today-tag { display: none; }
}
