/* =========================================================================
   Hijri Calendar — style.css
   Single stylesheet, no framework, no build step.
   Palette and type scale live in :root as custom properties.
   ========================================================================= */

:root {
  /* --- Palette --------------------------------------------------------- */
  --night:        #1b2a4a;   /* deep night blue — primary ink / headers   */
  --night-2:      #26385f;   /* lighter night blue — panels               */
  --night-soft:   #35496f;   /* hover / borders on dark                   */
  --gold:         #c8a04a;   /* warm gold accent                          */
  --gold-soft:    #e2c987;   /* lighter gold for hovers                   */
  --paper:        #faf6ec;   /* off-white paper background                 */
  --paper-2:      #ffffff;   /* pure card surface                         */
  --paper-3:      #f1ead9;   /* subtle fill / muted cells                 */
  --green:        #1f7a52;   /* Hijri numerals                            */
  --green-soft:   #e4f1ea;   /* Hijri tint background                     */
  --ink:          #212636;   /* body text                                 */
  --ink-muted:    #6a7183;   /* secondary text                           */
  --line:         rgba(27, 42, 74, 0.14);
  --line-strong:  rgba(27, 42, 74, 0.28);
  --friday:       #b4451f;   /* Friday accent                             */
  --friday-soft:  #fbeee6;
  --danger:       #a23b2d;
  --danger-soft:  #f7e7e3;

  /* --- Type ------------------------------------------------------------ */
  --font-ui:    "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Amiri", "IBM Plex Sans Arabic", Georgia, serif;

  /* --- Shape / depth --------------------------------------------------- */
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(27, 42, 74, 0.06), 0 8px 24px rgba(27, 42, 74, 0.08);
  --shadow-sm: 0 1px 2px rgba(27, 42, 74, 0.08);
  --focus:     0 0 0 3px rgba(200, 160, 74, 0.55);

  --maxw: 960px;
}

/* Prevent a flash of wrong text before the i18n pass runs. Revealed by JS;
   there is a timed fallback in the inline head script, and non-JS users
   never hit this rule (the inline script that adds it never runs). */
html.i18n-loading body { visibility: hidden; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
  /* faint layered paper texture using two radial gradients */
  background-image:
    radial-gradient(circle at 12% 8%, rgba(200, 160, 74, 0.05), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(31, 122, 82, 0.05), transparent 42%);
  background-attachment: fixed;
}

/* Arabic mode uses the serif display face for headings and dates */
html[dir="rtl"] {
  --font-ui: "IBM Plex Sans Arabic", system-ui, sans-serif;
}
html[dir="rtl"] h1,
html[dir="rtl"] .today-hijri,
html[dir="rtl"] .cell-hijri,
html[dir="rtl"] .month-title {
  font-family: var(--font-serif);
}

img { max-width: 100%; height: auto; }

/* --- Layout -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

main { padding-bottom: 48px; }

/* --- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--night);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
}

/* --- Header / nav -------------------------------------------------------- */
.site-header {
  background: linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%);
  color: var(--paper);
  border-bottom: 3px solid var(--gold);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--paper);
  text-decoration: none;
  margin-inline-end: auto;
}
.brand .moon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex: none;
}
.brand:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--paper);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  opacity: 0.9;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.main-nav a[aria-current="page"] {
  background: rgba(200, 160, 74, 0.22);
  color: var(--gold-soft);
  opacity: 1;
}
.main-nav a:focus-visible { outline: none; box-shadow: var(--focus); }

.lang-toggle {
  font-family: var(--font-ui);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lang-toggle:hover { background: rgba(255, 255, 255, 0.18); }
.lang-toggle:focus-visible { outline: none; box-shadow: var(--focus); }

/* Language picker (menu of all supported pilgrim languages) */
.lang-select {
  font-family: var(--font-ui);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 7px 32px 7px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  /* custom caret so it reads as a menu, direction-aware */
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23faf6ec' stroke-width='1.6'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
html[dir="rtl"] .lang-select {
  padding: 7px 14px 7px 32px;
  background-position: left 12px center;
}
.lang-select:hover { background-color: rgba(255, 255, 255, 0.18); }
.lang-select:focus-visible { outline: none; box-shadow: var(--focus); }
/* Native option list renders on a light surface for readability */
.lang-select option { color: var(--ink); background: var(--paper-2); }

/* --- Section titles ------------------------------------------------------ */
.page-intro { margin: 26px 0 10px; }
.page-intro h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: var(--night);
  margin: 0 0 6px;
  line-height: 1.2;
}
.page-intro p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 60ch;
}

/* --- Today card ---------------------------------------------------------- */
.today-card {
  margin-top: 18px;
  background: linear-gradient(155deg, var(--night) 0%, var(--night-2) 100%);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.today-card::after {
  content: "";
  position: absolute;
  inset-inline-end: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(200, 160, 74, 0.22), transparent 70%);
  pointer-events: none;
}
.today-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--gold-soft);
  margin: 0 0 10px;
  font-weight: 600;
}
.today-weekday {
  font-size: 1.05rem;
  color: var(--gold-soft);
  margin: 0 0 4px;
  font-weight: 600;
}
.today-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 40px;
  align-items: baseline;
}
.today-block .k {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 2px;
}
.today-greg { font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 700; margin: 0; }
.today-hijri {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 700;
  margin: 0;
  color: var(--gold-soft);
}

/* --- Ad slots ------------------------------------------------------------ */
.ad-slot {
  margin: 22px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-3);
  color: var(--ink-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}

/* --- Calendar controls --------------------------------------------------- */
.cal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.month-title {
  font-size: 1.25rem;
  color: var(--night);
  font-weight: 700;
  margin: 0;
  flex: 1 1 auto;
  min-width: 180px;
}
.month-title .hijri-span { color: var(--green); font-weight: 600; }

.nav-btn {
  font-family: var(--font-ui);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  color: var(--night);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-btn:hover { background: var(--paper-3); border-color: var(--gold); }
.nav-btn:focus-visible { outline: none; box-shadow: var(--focus); }
/* Arrows are direction-aware: flip the glyph in RTL */
html[dir="rtl"] .nav-btn .chev { transform: scaleX(-1); }

.today-btn {
  font-family: var(--font-ui);
  background: var(--gold);
  border: 1px solid var(--gold);
  color: var(--night);
  font-weight: 600;
  padding: 0 16px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.today-btn:hover { background: var(--gold-soft); }
.today-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.jump {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.jump select {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}
.jump select:focus-visible { outline: none; box-shadow: var(--focus); }

/* --- Notices ------------------------------------------------------------- */
.notice {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: none;
}
.notice.show { display: block; }
.notice.approx {
  background: var(--paper-3);
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
}
.notice.error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* --- Calendar table ------------------------------------------------------ */
.cal-shell {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.cal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.cal-table caption { display: none; }
.cal-table thead th {
  background: var(--night);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 10px 4px;
  text-align: center;
  letter-spacing: 0.02em;
}
.cal-table thead th.is-friday-h { color: var(--gold-soft); }

.cal-table td {
  border: 1px solid var(--line);
  vertical-align: top;
  height: 74px;
  padding: 6px 7px;
  position: relative;
}
.cal-table td.empty { background: var(--paper-3); }

.cell-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 60px;
}
.cell-greg {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--night);
  line-height: 1;
}
.cell-hijri {
  margin-top: auto;
  align-self: flex-end;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.cell-month-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border-radius: 4px;
  padding: 2px 5px;
  margin-top: 4px;
  line-height: 1.2;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Friday column tint */
.cal-table td.friday { background: var(--friday-soft); }
.cal-table td.friday .cell-greg { color: var(--friday); }

/* Today */
.cal-table td.today {
  background: var(--green-soft);
  box-shadow: inset 0 0 0 3px var(--green);
}
.cal-table td.today .cell-greg { color: var(--green); }

/* Loading shimmer overlay */
.cal-shell.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(250, 246, 236, 0.6);
  backdrop-filter: blur(1px);
  z-index: 2;
}
.cal-shell.loading .spinner { display: block; }
.spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  z-index: 3;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Holiday / official occasion */
.cal-table td.holiday { background: var(--friday-soft); }
.cal-table td.holiday.friday { background: #fbe9df; }
.cal-table td.holiday.today { background: var(--green-soft); }
.cell-holiday-dot {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--paper-2);
}
.cal-table td.today .cell-holiday-dot { box-shadow: 0 0 0 2px var(--green-soft); }

/* --- Holidays list ------------------------------------------------------- */
.holidays-box {
  margin-top: 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.holidays-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--night);
}
html[dir="rtl"] .holidays-title { font-family: var(--font-serif); font-size: 1.2rem; }
.holidays-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.holiday-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.holiday-badge {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--night);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}
.holiday-body { display: flex; flex-direction: column; min-width: 0; }
.holiday-name { font-weight: 700; color: var(--night); }
html[dir="rtl"] .holiday-name { font-family: var(--font-serif); }
.holiday-date { font-size: 0.82rem; color: var(--ink-muted); }
.holiday-none { color: var(--ink-muted); font-size: 0.9rem; }

/* --- Legend -------------------------------------------------------------- */
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 2px 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.swatch.today { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); }
.swatch.friday { background: var(--friday-soft); box-shadow: inset 0 0 0 1px var(--friday); }
.swatch.holiday { background: var(--gold); }
.swatch.hijri { background: var(--green); }

/* --- Age calculator ------------------------------------------------------ */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-top: 18px;
}
.age-form fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 18px;
  margin: 0 0 18px;
}
.age-form legend {
  font-weight: 600;
  color: var(--night);
  padding: 0 6px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.seg label {
  padding: 8px 18px;
  cursor: pointer;
  font-size: 0.92rem;
  background: var(--paper-2);
  color: var(--ink);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span,
.seg label.active { background: var(--night); color: var(--paper); }
.seg label span { display: block; padding: 8px 18px; margin: -8px -18px; }
.seg input:focus-visible + span { box-shadow: var(--focus); border-radius: 999px; }

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 120px;
  min-width: 100px;
}
.field label { font-size: 0.82rem; color: var(--ink-muted); font-weight: 600; }
.field input,
.field select {
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  width: 100%;
}
.field input:focus-visible,
.field select:focus-visible { outline: none; box-shadow: var(--focus); }

.btn-primary {
  font-family: var(--font-ui);
  background: var(--gold);
  border: 1px solid var(--gold);
  color: var(--night);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--gold-soft); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--focus); }

.age-results { margin-top: 22px; display: none; }
.age-results.show { display: block; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background: var(--paper);
}
.result-card.hijri { background: var(--green-soft); border-color: rgba(31, 122, 82, 0.3); }
.result-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--night);
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-card.hijri h3 { color: var(--green); }
.result-big { font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 0 0 6px; line-height: 1.25; }
.result-card.hijri .result-big { color: var(--green); }
.result-sub { font-size: 0.9rem; color: var(--ink-muted); margin: 0; }
.result-sub strong { color: var(--ink); font-weight: 600; }

.stat-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.stat {
  flex: 1 1 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--paper-2);
}
.stat .k { font-size: 0.78rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 4px; }
.stat .v { font-size: 1.3rem; font-weight: 700; color: var(--night); margin: 0; }

/* --- Prayer times --------------------------------------------------------- */
.pr-place-head { margin: 0 0 4px; }
.pr-place-head #pr-place { font-size: 1.2rem; font-weight: 700; color: var(--night); }
#pr-hijri { color: var(--green); font-weight: 600; margin: 0 0 10px; }
#pr-next {
  display: inline-block;
  background: var(--night);
  color: var(--gold-soft);
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 4px 0 16px;
}
.prayer-list { list-style: none; margin: 0; padding: 0; }
.prayer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--paper-2);
}
.prayer-row.sunrise { background: var(--paper-3); }
.prayer-row.is-next {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--green);
}
.prayer-name { font-weight: 600; color: var(--night); font-size: 1.05rem; }
html[dir="rtl"] .prayer-name { font-family: var(--font-serif); font-size: 1.15rem; }
.prayer-time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.prayer-row.is-next .prayer-name,
.prayer-row.is-next .prayer-time { color: var(--green); }
.btn-secondary {
  font-family: var(--font-ui);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  color: var(--night);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-secondary:hover { background: var(--paper-3); border-color: var(--gold); }
.btn-secondary:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.field-hint { margin: 12px 0 4px; color: var(--ink-muted); font-size: 0.85rem; }

/* --- Currency ------------------------------------------------------------ */
.cur-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}
.cur-swap-btn {
  font-family: var(--font-ui);
  background: var(--night);
  color: var(--paper);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  align-self: end;
  margin-bottom: 1px;
}
.cur-swap-btn:hover { background: var(--night-2); }
.cur-swap-btn:focus-visible { outline: none; box-shadow: var(--focus); }
#cur-result-big { font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 700; color: var(--green); margin: 0 0 6px; }
#cur-rate { color: var(--ink-muted); margin: 0 0 4px; }
#cur-updated { color: var(--ink-muted); font-size: 0.82rem; margin: 0; }
@media (max-width: 460px) {
  .cur-row { grid-template-columns: 1fr; }
  .cur-swap-btn { justify-self: center; transform: rotate(90deg); }
}

/* --- Visually hidden (labels for screen readers) ------------------------- */
.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;
}

/* --- Prose (privacy) ----------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { color: var(--night); margin-top: 28px; font-size: 1.25rem; }
.prose h3 { color: var(--night); margin-top: 20px; font-size: 1.05rem; }
.prose p, .prose li { color: var(--ink); }
.prose a { color: var(--green); }
.prose ul { padding-inline-start: 20px; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  margin-top: 40px;
}
.site-footer .wrap {
  padding-top: 22px;
  padding-bottom: 26px;
  display: flex;
  gap: 14px 26px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.site-footer a { color: var(--night); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer a:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.site-footer .spacer { margin-inline-start: auto; }

/* --- Responsive: phones -------------------------------------------------- */
@media (max-width: 560px) {
  .cal-table td { height: 58px; padding: 4px 4px; }
  .cell-greg { font-size: 0.98rem; }
  .cell-hijri { font-size: 0.86rem; }
  .cell-month-label { font-size: 0.55rem; padding: 1px 4px; }
  .cal-table thead th { font-size: 0.68rem; padding: 8px 2px; }
  .today-card { padding: 18px; }
  .site-header .wrap { gap: 10px; }
  .brand { font-size: 1.05rem; }
  .main-nav a { padding: 6px 9px; font-size: 0.88rem; }
}

@media (max-width: 380px) {
  .cal-table td { height: 52px; }
  .cell-greg { font-size: 0.9rem; }
  .cell-hijri { font-size: 0.8rem; }
  .cal-table thead th { font-size: 0.6rem; }
  body { font-size: 15px; }
}

/* --- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .spinner { animation: none; border-top-color: var(--gold); }
}
