/* Inner pages: support, questions and answers, legal, sources, account
   deletion. Shared tokens, header, buttons and footer live in app.css. */

::selection { background: color-mix(in srgb, var(--gold-2) 40%, transparent); }

/* ── page hero ──────────────────────────────────────── */

.page { padding-bottom: clamp(3.5rem, 8vw, 7rem); }
.page__hero {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(2rem, 4vw, 3rem);
  margin-bottom: clamp(2.2rem, 5vw, 3.8rem);
  border-bottom: 1px solid var(--gold-line);
}
.page__hero .eyebrow { display: flex; align-items: center; gap: 0.6rem; color: var(--gold-text); }
.page__hero .eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: var(--gold); }
.page__title {
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4.4rem);
  line-height: 1.05;
  max-width: 20ch;
  text-wrap: balance;
}
.page__lead {
  margin-top: 1.2rem;
  font-size: var(--text-lead);
  color: var(--ink-2);
  max-width: 50ch;
  text-wrap: pretty;
}
.page__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.6rem; margin-top: 1.6rem; }
.page__meta p { margin: 0; font-size: 0.88rem; color: var(--ink-3-text); }
.page__meta strong { color: var(--ink-2); font-weight: 600; }

/* this page in the other languages */
.page__meta .langs ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.page__meta .langs a {
  display: inline-block;
  font-size: 0.84rem;
  padding: 0.28rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.page__meta .langs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.page__meta .langs a[href]:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }

/* ── long documents: contents rail + prose ──────────── */

.doc { display: grid; gap: clamp(2rem, 5vw, 4.5rem); grid-template-columns: minmax(0, 1fr); }
.doc--toc { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
.doc__toc {
  position: sticky;
  top: calc(var(--head-h) + 1.5rem);
  max-height: calc(100vh - var(--head-h) - 3rem);
  overflow: auto;
  padding-inline-end: 0.5rem;
}
.doc__toc > p {
  margin: 0 0 0.8rem;
  font-size: var(--text-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-text);
}
:root[dir="rtl"] .doc__toc > p { letter-spacing: 0.04em; }
.doc__toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--rule); }
.doc__toc a {
  display: block;
  padding: 0.4rem 0.9rem;
  margin-inline-start: -1px;
  border-inline-start: 1px solid transparent;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-3-text);
  text-decoration: none;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.doc__toc a:hover { color: var(--ink); border-inline-start-color: var(--gold); }
@media (max-width: 899px) {
  .doc--toc { grid-template-columns: minmax(0, 1fr); }
  .doc__toc {
    position: static;
    max-height: none;
    padding: 1.1rem 1.2rem;
    background: var(--card);
    border: 1px solid var(--rule-soft);
    border-radius: 14px;
    box-shadow: var(--e1);
  }
  .doc__toc ol { columns: 2 12rem; column-gap: 1.2rem; border: 0; }
  .doc__toc a { padding-inline: 0; break-inside: avoid; }
}

.prose { max-width: 70ch; color: var(--ink-2); }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  margin: clamp(2.4rem, 5vw, 3.2rem) 0 0.9rem;
  padding-top: clamp(1.2rem, 3vw, 1.6rem);
  border-top: 1px solid var(--rule);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
.prose h3 { margin: 1.8rem 0 0.6rem; font-size: 1.12rem; color: var(--ink); }
.prose p, .prose li { font-size: 1.02rem; line-height: 1.8; }
.prose p { margin: 0.9rem 0 0; }
.prose ul, .prose ol { margin: 0.9rem 0 0; padding-inline-start: 1.4rem; }
.prose li { margin-top: 0.45rem; }
.prose li::marker { color: var(--gold); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose a:hover { color: var(--gold-text); }
.prose code { font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.4em; border-radius: 4px; overflow-wrap: anywhere; }
.prose table {
  width: 100%;
  margin-top: 1.2rem;
  border-collapse: collapse;
  font-size: 0.94rem;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--e1);
}
.prose caption { caption-side: top; text-align: start; padding: 0 0 0.5rem; font-weight: 600; color: var(--ink); }
.prose th, .prose td { padding: 0.7rem 0.9rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
.prose th { color: var(--ink); font-weight: 600; background: var(--paper-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--gold-line); margin: clamp(2.6rem, 6vw, 4rem) 0; }

/* callouts the pages already carry */
.prose .notgov, .prose .app-name {
  margin-top: 1.4rem;
  padding: 1.1rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  box-shadow: var(--e1), var(--edge);
  color: var(--ink);
  line-height: 1.75;
}
.prose .note { font-size: 0.92rem; color: var(--ink-3-text); }
.prose .lang-switch a { font-weight: 600; }

/* official sources list */
.prose ol:has(.agency) { list-style: none; padding: 0; counter-reset: src; }
.prose ol:has(.agency) > li {
  counter-increment: src;
  position: relative;
  margin: 0;
  padding: 1rem 0 1rem 2.6rem;
  border-top: 1px solid var(--rule-soft);
  line-height: 1.55;
}
:root[dir="rtl"] .prose ol:has(.agency) > li { padding: 1rem 2.6rem 1rem 0; }
.prose ol:has(.agency) > li::before {
  content: counter(src);
  position: absolute;
  inset-inline-start: 0;
  top: 1rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.prose .agency { display: inline-block; margin-top: 0.2rem; font-size: 0.84rem; font-weight: 600; color: var(--gold-text); }
.prose .url { font-size: 0.86rem; color: var(--ink-3-text); direction: ltr; unicode-bidi: isolate; }

/* ── support ────────────────────────────────────────── */

.help {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  margin-bottom: clamp(2.4rem, 5vw, 3.6rem);
}
.help__card {
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--e2), var(--edge);
  padding: clamp(1.4rem, 2.6vw, 2.1rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.help__card h2 { font-family: var(--font-display); font-size: var(--text-h3); margin: 0; }
.help__card p { margin: 0; color: var(--ink-2); }
.help__note { font-size: 0.9rem; color: var(--ink-3-text); }
.help__links { list-style: none; margin: 0; padding: 0; display: grid; }
.help__links li { border-top: 1px solid var(--rule-soft); }
.help__links li:last-child { border-bottom: 1px solid var(--rule-soft); }
.help__links a {
  display: block;
  padding-block: 0.75rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}
.help__links a:hover { color: var(--ink); transform: translateX(3px); }
:root[dir="rtl"] .help__links a:hover { transform: translateX(-3px); }

/* the questions-and-answers teaser sits on the navy ground, like the home page's threads */
.faq {
  padding: clamp(1.8rem, 4vw, 3rem);
  background: var(--night);
  color: var(--on-night);
  border-radius: var(--radius-card);
  box-shadow: var(--e3);
}
.faq__title { font-family: var(--font-display); font-size: var(--text-h2); color: var(--on-night); margin: 0; }
.faq .page__lead { color: var(--on-night-2); margin-top: 0.8rem; }
.faq .btn--ghost { color: var(--on-night); border-color: rgba(245, 241, 232, 0.35); margin-top: 1.4rem; }
.faq .btn--ghost:hover { color: var(--gold-2); border-color: var(--gold-2); }
.faq :focus-visible { outline-color: var(--gold-2); }

.help__emergency {
  margin-top: clamp(2rem, 4vw, 3rem);
  font-size: 0.9rem;
  color: var(--ink-3-text);
}

/* ── questions and answers ──────────────────────────── */

.qa__nav { margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.qa__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qa__nav a {
  display: inline-block;
  padding: 0.38rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}
.qa__nav a:hover { border-color: var(--gold); color: var(--ink); background: color-mix(in srgb, var(--gold) 8%, transparent); }

.qa__group {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1rem clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--gold-line);
}
.qa__group-title {
  position: sticky;
  top: calc(var(--head-h) + 1.5rem);
  align-self: start;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}
.qa__group > .qa { grid-column: 2; }
@media (max-width: 899px) {
  .qa__group { grid-template-columns: minmax(0, 1fr); }
  .qa__group-title { position: static; }
  .qa__group > .qa { grid-column: 1; }
}

.qa {
  padding-block: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--rule-soft);
}
.qa:last-child { border-bottom: 0; }
.qa__q { font-family: var(--font-sans); font-size: 1.08rem; font-weight: 600; line-height: 1.45; margin: 0 0 0.5rem; }
.qa__q a { text-decoration: none; }
.qa__q a:hover { color: var(--gold-text); }
.qa:target .qa__q { color: var(--gold-text); }
.qa__a { margin: 0; color: var(--ink-2); max-width: var(--measure); }
.qa__a a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.qa__a a:hover { color: var(--gold-text); }
.qa__a code { font-size: 0.92em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  .help__links a:hover { transform: none; }
}

/* the account page repeats itself in Arabic under its own title */
.prose h1, .prose .prose__title { margin: 0 0 0.6rem; padding-top: 0; border-top: 0; font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem); line-height: 1.1; color: var(--ink); }
.prose .updated { font-size: 0.88rem; color: var(--ink-3-text); }

/* ── 404 ────────────────────────────────────────────── */

.lost .eyebrow { font-variant-numeric: tabular-nums; }
.lost__alt { font-size: 1rem; color: var(--ink-3-text); margin-top: 0.5rem; }
.lost__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.lost__links a {
  display: grid;
  gap: 0.2rem;
  height: 100%;
  padding: 1.1rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  box-shadow: var(--e1), var(--edge);
  text-decoration: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.lost__links b { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.lost__links span { font-size: 0.88rem; color: var(--ink-3-text); }
@media (hover: hover) and (pointer: fine) {
  .lost__links a:hover { transform: translateY(-2px); box-shadow: var(--e2), var(--edge); }
}

/* ── /get ───────────────────────────────────────────── */

.getapp { text-align: center; border-bottom: 0; }
.getapp__icon { width: 88px; height: 88px; margin: 0 auto 0.6rem; border-radius: 22px; border: 1px solid var(--gold-line); box-shadow: var(--e2); }
.getapp .page__title, .getapp .page__lead { margin-inline: auto; }
.getapp__stores .stores { justify-content: center; margin-top: 2rem; }
.getapp__more { margin-top: 1.6rem; font-weight: 600; }
.getapp__more a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 4px; }
