/*
 * Haris page styles. Brand colour and type come from /brand.css — the names
 * below are local aliases onto those tokens, so this file never hard-codes a
 * brand value. To change a brand colour, edit brand/brand.css.
 */
:root {
  --red: var(--brand-primary);
  --red-dark: var(--brand-primary-hover);
  --ink: var(--brand-ink);
  --muted: var(--brand-muted);
  --line: var(--brand-line);
  --bg: var(--brand-bg);
  --panel: var(--brand-surface-2);
  --card: var(--brand-surface);
  --radius: var(--brand-radius);
  --shadow: var(--brand-shadow);
  --font: var(--brand-font);
  --font-en: var(--brand-font-en);

  /* Screening status colours — app semantics, not brand colours. */
  --iraq: #244a2a;
  --pep: #b26a00;
  --pep-bg: #fff4e0;
  --sanc-bg: #fde8e8;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
html[lang=en] body { font-family: var(--font-en); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 max(16px, 6vw);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #8a8a8a;
}
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
/* The real HARIS lockup (brand/public/logos/haris-logo.png), wordmark + shield. */
.brand-mark img { height: 34px; width: auto; display: block; }
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-size: .95rem; white-space: nowrap; overflow-x: auto; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a.active { font-weight: 700; }
.nav a:hover { color: var(--red); }
.nav .sep { color: #9a9a9a; }
.nav .soon { color: #a8a8a8; cursor: default; }
/*
 * Landing view: the hero wordmark is the brand, so the bar itself is not drawn
 * — no background, no rule, no small wordmark. Only the language switch stays,
 * floating over the globe. Everything keeps its space, so nothing shifts when
 * results arrive and the bar appears.
 */
body:not(.searched) .topbar { background: none; backdrop-filter: none; border-bottom: 0; }
body:not(.searched) .brand,
body:not(.searched) .nav { visibility: hidden; }
.lang {
  flex: none; font: inherit; font-size: .9rem; font-weight: 500; color: var(--ink); background: none;
  border: 1px solid #9a9a9a; border-radius: var(--radius); padding: 4px 12px; cursor: pointer;
}
.lang:lang(ar) { font-family: var(--font); }
.lang:lang(en) { font-family: var(--font-en); }
.lang:hover { border-color: var(--red); color: var(--red); }

/* ---------- globe ---------- */
.globe-wrap {
  position: fixed; inset: 64px 0 0 0; z-index: 0; pointer-events: none;
  transition: opacity .8s ease, transform 1s cubic-bezier(.2, .7, .2, 1);
}
#globe { width: 100%; height: 100%; display: block; }
body.searched .globe-wrap { opacity: .35; transform: scale(1.08); }

main { position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px 64px;
  transition: min-height .6s ease, padding .6s ease;
}
.hero-inner { width: min(560px, 100%); display: flex; flex-direction: column; align-items: flex-start; }
.hero-logo {
  margin: 0; display: flex; align-items: flex-end; gap: 10px;
  animation: rise .9s .5s both cubic-bezier(.2, .7, .2, 1);
}
.hero-logo .brand-mark img { height: clamp(76px, 17vw, 136px); }
.tagline {
  margin: 22px 0 28px; font-size: clamp(1.05rem, 2.6vw, 1.45rem); font-weight: 700; line-height: 1.75;
  animation: rise .9s .8s both cubic-bezier(.2, .7, .2, 1);
}
.quick {
  display: flex; width: 100%; box-shadow: var(--shadow); border-radius: var(--radius); background: #fff;
  animation: rise .9s 1.05s both cubic-bezier(.2, .7, .2, 1);
}
.quick input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-inline-end: 0; border-radius: 0;
  border-start-start-radius: var(--radius); border-end-start-radius: var(--radius);
  padding: 14px 16px; font: inherit; font-size: 1rem; background: transparent;
}
.quick input:focus { outline: 2px solid var(--red); outline-offset: -2px; }
.quick button {
  border: 0; background: var(--red); color: #fff; font: inherit; font-weight: 700; padding: 0 28px;
  border-radius: 0; border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); cursor: pointer;
}
.quick button:hover { background: var(--red-dark); }
.stats { margin: 14px 0 0; color: var(--muted); font-size: .9rem; animation: rise .9s 1.25s both ease; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

body.searched .hero { display: none; }

/* ---------- panels and cards ---------- */
.panel { width: min(1060px, 100% - 32px); margin: 28px auto 64px; }
.card {
  background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px;
}
.card h2 { margin: 0 0 6px; font-family: var(--brand-font-display); font-weight: 700; font-size: 1.3rem; }

.adv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 32px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .field legend { font-size: .82rem; color: var(--muted); padding: 0; }
.field input, .field select {
  font: inherit; font-size: 1rem; border: 0; border-bottom: 1px solid #9e9e9e; padding: 6px 2px; background: transparent;
  border-radius: 0; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-bottom: 2px solid var(--red); }
.field input[type=range] { border: 0; accent-color: var(--red); padding: 8px 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 4px; }
.checks .group { flex-basis: 100%; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; color: var(--ink); cursor: pointer; }
.checks input { accent-color: var(--ink); width: 17px; height: 17px; }
.actions { display: flex; gap: 12px; }
button.primary, button.ghost {
  font: inherit; font-weight: 700; border-radius: var(--radius); padding: 10px 26px; cursor: pointer;
}
button.primary { background: var(--red); color: #fff; border: 0; box-shadow: var(--shadow); }
button.primary:hover { background: var(--red-dark); }
button.ghost { background: #eee; color: var(--ink); border: 0; box-shadow: var(--shadow); }
button.ghost:hover { background: #e2e2e2; }
button.small { padding: 6px 14px; font-size: .85rem; }

/* ---------- results ---------- */
.results { padding: 0; overflow: hidden; }
.results-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: .92rem;
}
.hits { list-style: none; margin: 0; padding: 0; }
.hit { border-bottom: 1px solid #ececec; }
.hit:last-child { border-bottom: 0; }
.hit-head {
  display: grid; grid-template-columns: 44px 1fr auto 28px; gap: 16px; align-items: center;
  padding: 16px 20px; cursor: pointer; width: 100%; background: none; border: 0; font: inherit; text-align: inherit; color: inherit;
}
.hit-head:hover { background: #fcfcfc; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center;
}
.avatar svg { width: 22px; height: 22px; fill: currentColor; }
.hit-name { color: var(--red); font-weight: 700; font-size: 1.08rem; unicode-bidi: plaintext; }
.hit-sub { font-size: .85rem; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hit-sub .alias { unicode-bidi: plaintext; }
.badge { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 10px; font-weight: 500; }
.badge.sanctions { background: var(--sanc-bg); color: var(--red-dark); }
.badge.pep { background: var(--pep-bg); color: var(--pep); }
.score { text-align: center; font-weight: 700; min-width: 74px; }
.score b { display: block; font-size: 1.25rem; }
.score small { font-weight: 500; font-size: .72rem; color: var(--muted); }
.score.high b { color: var(--red); }
.score.mid b { color: #d27400; }
.score.low b { color: #777; }
.chev { transition: transform .2s; color: #777; }
.hit.open .chev { transform: rotate(180deg); }
.hit-body { display: none; padding: 4px 20px 22px; padding-inline-start: 80px; }
.hit.open .hit-body { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.details { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; font-size: .92rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details .ltr { direction: ltr; unicode-bidi: isolate; text-align: left; }
html[dir=rtl] .details .ltr { text-align: right; }
.details ul { margin: 0; padding-inline-start: 18px; }
.details a { color: var(--red-dark); }
.warn { color: #b05c00; font-size: .82rem; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.loading { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------- sources ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0; }
.sources-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sources-table th, .sources-table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
.sources-table th { font-size: .8rem; color: var(--muted); font-weight: 500; }
.sources-table td.num { font-variant-numeric: tabular-nums; }
.sources-table .err { color: var(--red-dark); font-size: .8rem; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .adv { grid-template-columns: 1fr 1fr; }
  .nav .soon, .nav .sep:nth-of-type(n+2) { display: none; }
}
@media (max-width: 560px) {
  .topbar { height: 56px; }
  .globe-wrap { inset: 56px 0 0 0; opacity: .55; }
  .hero { min-height: calc(100vh - 56px); }
  .adv { grid-template-columns: 1fr; }
  .hit-head { grid-template-columns: 36px 1fr auto; gap: 10px; padding: 14px 12px; }
  .hit-head .chev { display: none; }
  .avatar { width: 34px; height: 34px; }
  .hit-body { padding: 0 12px 18px; }
  .lang { padding: 3px 8px; font-size: .82rem; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 8px; }
  .card { padding: 18px; }
  .results { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
