/*
 * Wejoo public website — one stylesheet, no framework, no web fonts.
 * Colours: the locked brand palette (docs/DESIGN-SYSTEM.md) — green #106730,
 * cream #FEF3E0, yellow #FFA300 (decorative only, never text on cream),
 * black #000000 — and the app's "Anthracite" dark mode for
 * prefers-color-scheme: dark. Layout uses logical properties only (start/end,
 * never left/right) so the Arabic pages mirror under dir="rtl".
 */

:root {
  --bg: #fef3e0;
  --surface: #fffaf3;
  --fill: #fee9c5;
  --text: #000000;
  --text-secondary: rgb(0 0 0 / 60%);
  --brand: #106730;
  --brand-surface: #106730;
  --on-brand: #fef3e0;
  --accent: #ffa300;
  --on-accent: #000000;
  --separator: rgb(0 0 0 / 8%);
  --border: rgb(0 0 0 / 12%);
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-arabic:
    'SF Arabic', 'Geeza Pro', 'Noto Sans Arabic', 'Noto Naskh Arabic', Tahoma, system-ui, sans-serif;
  --radius: 14px;
  --gutter: 16px;
  --measure: 46rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2f2d29;
    --surface: #393732;
    --fill: #43403b;
    --text: #fef3e0;
    --text-secondary: rgb(254 243 224 / 60%);
    --brand: #87ad88;
    --separator: rgb(254 243 224 / 10%);
    --border: rgb(254 243 224 / 12%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

body:lang(ar) {
  font-family: var(--font-arabic);
  line-height: 1.8;
}

.wrap {
  inline-size: 100%;
  max-inline-size: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--gutter);
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  inset-block-start: 8px;
}

/* ---- Draft banner + placeholders ---------------------------------------- */

.draft-banner {
  margin: 0;
  padding: 8px var(--gutter);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

mark.ph {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 4px;
  padding-inline: 0.2em;
  font-size: 0.92em;
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
  border-block-end: 1px solid var(--separator);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: var(--brand);
}

.wordmark {
  display: block;
  inline-size: 112px;
  block-size: 35px;
  /* The artwork has ~15 % transparent padding: align the letters with the gutter. */
  margin-inline-start: -16px;
  background-color: currentColor;
  -webkit-mask: url('wordmark.png') center / contain no-repeat;
  mask: url('wordmark.png') center / contain no-repeat;
}

@media (forced-colors: active) {
  .wordmark {
    background-color: CanvasText;
  }
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  margin-inline-start: -10px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-radius: 10px;
}

.main-nav a:hover {
  background: var(--fill);
}

.main-nav a[aria-current='page'] {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.main-nav .lang-switch {
  margin-inline-start: 6px;
  padding-inline: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-switch:lang(ar) {
  font-family: var(--font-arabic);
}

.lang-switch:lang(en) {
  font-family: var(--font-body);
}

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

main {
  padding-block: 28px 48px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
}

:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3 {
  font-family: var(--font-arabic);
  line-height: 1.45;
}

h1 {
  margin-block: 0 16px;
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.6rem);
}

h2 {
  margin-block: 2.2em 0.6em;
  font-size: 1.5rem;
  scroll-margin-block-start: 16px;
}

h3 {
  margin-block: 1.6em 0.4em;
  font-size: 1.15rem;
  scroll-margin-block-start: 16px;
}

p,
ul,
ol {
  margin-block: 0 1em;
}

ul,
ol {
  padding-inline-start: 1.4em;
}

li + li {
  margin-block-start: 0.35em;
}

code {
  /* Phone numbers and other Latin snippets keep their order inside Arabic text. */
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--fill);
  border-radius: 6px;
}

.note {
  margin-block: 0 24px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
}

.note p:last-child {
  margin-block-end: 0;
}

.toc {
  margin-block: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toc-title {
  margin-block-end: 6px;
  font-weight: 700;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 16rem;
  column-gap: 24px;
}

.toc li {
  margin: 0;
  break-inside: avoid;
}

.toc a {
  display: inline-block;
  padding-block: 4px;
}

.table-wrap {
  margin-block: 0 1.2em;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Wide tables scroll inside .table-wrap on phones; two columns always fit. */
table.cols-3,
table.cols-4 {
  min-inline-size: 34rem;
}

th,
td {
  padding: 10px 14px;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid var(--separator);
}

th {
  background: var(--fill);
  font-weight: 700;
}

tbody tr:last-child td {
  border-block-end: 0;
}

/* ---- Home --------------------------------------------------------------- */

.hero {
  padding-block: 12px 8px;
  text-align: center;
}

.hero-art {
  display: block;
  inline-size: 152px;
  block-size: auto;
  margin: 0 auto 12px;
}

.hero h1 {
  max-inline-size: 18em;
  margin-inline: auto;
}

.lead {
  max-inline-size: 34em;
  margin-inline: auto;
  color: var(--text-secondary);
  font-size: 1.15rem;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-block: 24px 8px;
}

.store {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-inline-size: 168px;
  min-block-size: 56px;
  padding: 8px 18px;
  border-radius: var(--radius);
  background: var(--brand-surface);
  color: var(--on-brand);
  text-decoration: none;
  line-height: 1.25;
}

.store.is-soon {
  background: var(--surface);
  color: var(--text);
  border: 1px dashed var(--border);
}

.store-name {
  font-weight: 700;
}

.store-soon {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.page-index ol {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.page-index ol li {
  position: relative;
  margin: 0;
  padding: 16px 18px;
  padding-inline-start: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}

.page-index ol li::before {
  content: counter(step);
  position: absolute;
  inset-block-start: 16px;
  inset-inline-start: 18px;
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 50%;
  background: var(--brand-surface);
  color: var(--on-brand);
  font-weight: 700;
}

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

.site-footer {
  border-block-start: 1px solid var(--separator);
  padding-block: 20px 32px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  margin-block-end: 8px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
}

.site-footer p {
  margin-block: 0 6px;
}

.publisher mark.ph {
  font-size: 0.85em;
}

@media print {
  .skip,
  .main-nav,
  .footer-nav {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
