/* Nidaa support and privacy pages.
   World: the night sky before Fajr (navy), lamplight (gold), a printed prayer timetable (paper).
   Gold marks links and focus only; the navy band is the one moment on each page. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f3f0e8;
  --text: #16232c;
  --text-2: #4c5a63;
  --text-3: #66737c;
  --line: rgb(22 35 44 / 0.10);
  --gold: #c99b45;
  --gold-ink: #7a5517;
  --gold-ink-hover: #4d350d;
  --band: #102634;
  --band-text: #f6f1e4;
  --band-text-2: #c9d3d8;
  --band-text-3: #93a5af;
  --shadow: 0 8px 24px rgb(22 35 44 / 0.10);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a151c;
    --surface: #102029;
    --surface-2: #132631;
    --text: #ece7dc;
    --text-2: #b3bdc3;
    --text-3: #8b98a0;
    --line: rgb(236 231 220 / 0.10);
    --gold-ink: #e0b96f;
    --gold-ink-hover: #f3d79f;
    --band: #102634;
    --shadow: 0 8px 24px rgb(0 0 0 / 0.40);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--gold-ink);
  text-underline-offset: 4px;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
a:hover { color: var(--gold-ink-hover); }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Header and footer */

header, footer {
  max-width: 1104px;
  margin: auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}
header { justify-content: space-between; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.brand:hover { color: var(--text); }
.brand img { border-radius: 10px; }
.brand small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.4;
}

nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
nav a { color: var(--text-2); text-decoration: none; }
nav a:hover { color: var(--text); }

/* The language link carries the other language's dir, so place its divider from the page's direction */
[dir=ltr] .language { border-left: 1px solid var(--line); padding-left: 20px; }
[dir=rtl] .language { border-right: 1px solid var(--line); padding-right: 20px; }

footer {
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-3);
}
footer span { margin-inline-end: auto; }
footer a { color: var(--text-3); }
footer a:hover { color: var(--text); }

/* Language menu */

.lang-menu {
  position: relative;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 20px;
}
.lang-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  transition: color 0.15s var(--ease);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { color: var(--text); }
.lang-menu .globe { flex: none; }

.lang-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 200px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.lang-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
}
.lang-list a:hover { background: var(--surface-2); color: var(--text); }
.lang-list a:focus-visible { outline-offset: -2px; }
.lang-list a[aria-current] { color: var(--gold-ink); font-weight: 500; }
.lang-list .check { flex: none; }

/* The navy band */

.hero {
  background: var(--band);
  color: var(--band-text);
  padding: 64px max(32px, calc((100vw - 1040px) / 2));
}
.hero .eyebrow {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--band-text-3);
}
.hero h1 {
  max-width: 768px;
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -1.2px;
}
.hero p { max-width: 704px; margin: 0; color: var(--band-text-2); }

/* Reading column */

article { max-width: 832px; margin: auto; padding: 48px 32px 80px; }

h2 {
  margin: 40px 0 12px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}
p { margin: 0 0 16px; color: var(--text-2); }
article ul { margin: 8px 0 16px; padding-inline-start: 20px; color: var(--text-2); }
article li { margin: 8px 0; }
.contact a, article a { overflow-wrap: anywhere; }

.updated { font-size: 14px; color: var(--text-3); }

.contact {
  padding: 24px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.contact h2 { margin-top: 0; }
.contact p:last-child { margin-bottom: 0; }

.platform-switch, .translation-note {
  padding: 12px 16px;
  font-size: 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.translation-note { background: transparent; }

.platform-choices { display: grid; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.platform-choices a {
  display: block;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}
.platform-choices a:hover { background: var(--surface-2); }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.links section {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.links h2 { margin: 0 0 16px; }

.button { display: inline-block; font-size: 15px; font-weight: 500; }
.button span { margin-inline-start: 8px; }

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

/* Arabic, Persian and Urdu scripts read badly with tightened letters */
[dir=rtl] .hero h1 { letter-spacing: 0; }

@media (max-width: 600px) {
  header { padding: 20px; gap: 12px; }
  .brand { font-size: 20px; }
  .brand img { width: 36px; height: 36px; border-radius: 8px; }
  .brand small { display: none; }
  nav { gap: 12px; font-size: 14px; }
  .lang-menu { padding-inline-start: 12px; }
  [dir=ltr] .language { padding-left: 12px; }
  [dir=rtl] .language { padding-right: 12px; }
  .hero { padding: 48px 24px; }
  .hero h1 { letter-spacing: -0.8px; }
  article { padding: 32px 24px 48px; }
  h2 { font-size: 20px; }
  .contact { padding: 20px; }
  .links { grid-template-columns: 1fr; }
  footer { padding: 24px; flex-wrap: wrap; gap: 16px; }
}

@media (max-width: 420px) {
  header { padding: 16px; }
  nav { gap: 12px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .lang-menu .lang-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
