/* Athkar — the app's "Four Lights" look: a dusk sky over the header,
   brass as the one accent, cream type on the dark. On a light-mode phone
   the page turns to warm paper with indigo ink, so both stay readable. */
:root {
  --indigo:     #1a1a2e;
  --plum:       #4a2c4f;
  --amber:      #c8794a;
  --brass:      #f0cf95;
  --cream:      #f7efe1;
  --cream-dim:  #d9cfbf;

  /* Light mode (default): paper ground, indigo ink. */
  --bg:         #f8f2e7;
  --surface:    #fffaf1;
  --line:       #e6dac6;
  --ink:        #1a1a2e;
  --text:       #3a3550;
  --muted:      #6d6679;
  --link:       #8a5a1f;
  --mark:       rgba(240, 207, 149, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #14142a;
    --surface:  #1f1d38;
    --line:     #34304f;
    --ink:      #f7efe1;
    --text:     #e4dacb;
    --muted:    #a79fb3;
    --link:     #f0cf95;
    --mark:     rgba(240, 207, 149, 0.22);
  }
}

* { box-sizing: border-box; }

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

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

[lang="ar"] {
  font-family: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, serif;
  line-height: 1.95;
}

/* The header is always the dusk sky, whatever the phone's appearance. */
header.cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(170deg, var(--indigo) 0%, #2b2347 38%, var(--plum) 66%, #9a5a4e 86%, var(--amber) 100%);
  color: var(--cream);
  padding: 3rem 1.5rem 2.6rem;
}

/* A low sun sitting on the horizon, drawn in CSS. */
header.cover::after {
  content: "";
  position: absolute;
  width: 15rem;
  height: 15rem;
  inset-inline-end: -4rem;
  bottom: -9.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 207, 149, 0.9) 0%, rgba(240, 207, 149, 0.35) 40%, rgba(240, 207, 149, 0) 70%);
  pointer-events: none;
}

header.cover .inner,
main,
footer .inner {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
}

header.cover h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cream);
}

header.cover h1 .en {
  display: block;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--brass);
  margin-top: 0.2rem;
}

header.cover p {
  text-align: right;
  margin: 0.6rem 0 0;
  color: var(--cream-dim);
  font-size: 1rem;
}

.langs {
  display: flex;
  gap: 0.5rem;
  margin: 1.4rem 0 0;
  flex-wrap: wrap;
}

.langs a {
  display: inline-block;
  border: 1px solid rgba(240, 207, 149, 0.55);
  border-radius: 999px;
  padding: 0.25rem 1rem;
  color: var(--brass);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.langs a:hover, .langs a:focus-visible { background: rgba(240, 207, 149, 0.14); }

main {
  padding: 2.6rem 1.5rem 3rem;
}

section.lang + section.lang {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 2.6rem;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

h2 {
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 700;
  margin: 2.6rem 0 0.7rem;
}

h2:first-child, .section-label + h2 { margin-top: 0; }

h3 {
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 600;
  margin: 1.8rem 0 0.4rem;
}

p, li { margin: 0.7rem 0; }

ul { padding-inline-start: 1.4rem; }

a { color: var(--link); text-underline-offset: 0.18em; }

strong { color: var(--ink); }

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

.marked {
  background: linear-gradient(var(--mark), var(--mark)) no-repeat;
  background-size: 100% 0.6em;
  background-position: 0 0.75em;
  padding: 0 0.12em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brass);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  margin: 1.4rem 0;
}

.card p { margin: 0; }
.card p + p { margin-top: 0.5rem; font-size: 0.94rem; }

.updated {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.2rem 0;
}

/* Email addresses and URLs stay left-to-right inside Arabic text. */
.ltr { direction: ltr; unicode-bidi: isolate; }

footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1.5rem 2.6rem;
  font-size: 0.92rem;
  color: var(--muted);
}

footer p { margin: 0.4rem 0; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  header.cover { padding: 2.4rem 1rem 2.1rem; }
  header.cover h1 { font-size: 1.9rem; }
  main { padding: 2rem 1rem 2.4rem; }
  footer { padding: 1.4rem 1rem 2.4rem; }
}
