/* ============================================================
   Components - header, buttons, badges, cards, footer
   ============================================================ */

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px) saturate(1.2);
  background: linear-gradient(to bottom, var(--scrim), var(--scrim-soft));
  border-bottom: 1px solid var(--line-soft);
  transition: background .4s var(--ease), border-color .4s;
}
.site-header.is-scrolled { background: var(--scrim-strong); box-shadow: var(--sh-1); }

.nav { display: flex; align-items: center; gap: 28px; height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__mark { display:flex; align-items:center; }
.brand__mark-img { width:44px; height:44px; display:block; object-fit:contain; transition: transform .25s var(--ease, ease); }
.brand:hover .brand__mark-img { transform: rotate(-4deg) scale(1.04); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__ar { font-family: var(--f-display); font-weight: 700; font-size: 1.18rem; color: var(--text-strong); }
.brand__en { font-size: .56rem; letter-spacing: .22em; color: var(--muted); font-weight: 500; }
html[lang="en"] .brand__ar { display: none; }
html[lang="ar"] .brand__en { letter-spacing: .14em; }

.nav__links { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav__links a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px;
  font-size: .92rem; font-weight: 500; color: var(--sand-dim);
  transition: color .25s, background .25s;
  position: relative;
}
.nav__links a:hover { color: var(--text-strong); background: rgba(0,0,0,.05); }
.nav__links a.is-active { color: var(--text-strong); }
.nav__live { color: var(--crimson) !important; }
.livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); box-shadow: 0 0 0 0 rgba(216,27,96,.45); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(216,27,96,.45);} 70%{ box-shadow: 0 0 0 7px rgba(216,27,96,0);} 100%{ box-shadow:0 0 0 0 rgba(216,27,96,0);} }

.nav__actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--muted);
  transition: border-color .3s;
}
.lang-toggle:hover { border-color: var(--sand-dim); }
.lang-toggle__opt { transition: color .3s; }
.lang-toggle__opt.is-active { color: var(--text-strong); }
.lang-toggle__sep { width: 1px; height: 12px; background: var(--line); }

.nav__burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav__burger span { width: 22px; height: 2px; background: var(--sand); border-radius: 2px; transition: .3s; }

/* M-10: onboarding replay '?' help button */
.nav__help {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--muted); font-size: .9rem; font-weight: 700;
  display: grid; place-items: center; transition: .25s;
  flex-shrink: 0;
}
.nav__help:hover { border-color: var(--sand); color: var(--text-strong); }

/* ---------- Footer mega-nav sitemap ---------- */
.site-footer__sitemap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 28px 20px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
  margin-top: 24px;
}
.footer-col__heading {
  font-family: var(--f-display); font-weight: 600; font-size: .82rem;
  color: var(--sand); letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-col__links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col__links a { color: var(--muted); font-size: .84rem; transition: color .2s; }
.footer-col__links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: .96rem; letter-spacing: .01em;
  transition: transform .25s var(--ease-out), box-shadow .3s, background .3s, color .3s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%); color: #FFFFFF; box-shadow: var(--sh-gold); }
.btn--gold:hover { box-shadow: 0 14px 48px -10px rgba(236,138,46,.38); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--sand); background: rgba(0,0,0,.04); }
.btn--live { background: var(--crimson); color: var(--on-warm); box-shadow: 0 10px 36px -12px rgba(216,27,96,.45); }
.btn--live:hover { background: var(--crimson-deep); }
.btn .arrow { transition: transform .3s var(--ease-out); }
html[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
.btn:hover .arrow { transform: translateX(-3px) scaleX(var(--ax, 1)); }
html[dir="rtl"] .btn:hover .arrow { transform: translateX(3px) scaleX(-1); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .04em;
}
.badge--live { background: rgba(216,27,96,.10); color: var(--crimson); border: 1px solid rgba(216,27,96,.35); }
.badge--gold { background: rgba(236,138,46,.10); color: var(--gold); border: 1px solid rgba(236,138,46,.40); }
.badge--green { background: rgba(233,108,78,.10); color: var(--green-deep); border: 1px solid rgba(233,108,78,.40); }
.badge--ghost { border: 1px solid var(--line); color: var(--sand-dim); background: none; font-family: inherit; }
/* welfare conditional hue - amber is distinct from gold (no rgb(228,186,94) overlap) */
.badge--amber { background: rgba(181,115,10,.12); color: var(--amber); border: 1px solid rgba(181,115,10,.42); }
/* welfare traffic-light states */
.badge--red { background: rgba(216,27,96,.10); color: var(--crimson); border: 1px solid rgba(216,27,96,.35); }
.badge .livedot { width: 6px; height: 6px; }

/* ---------- Card ---------- */
.card {
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 26px;
  position: relative; overflow: hidden;
  transition: transform .4s var(--ease-out), border-color .4s, box-shadow .4s;
}
.card--hover:hover { transform: translateY(-5px); border-color: var(--sand-dim); box-shadow: var(--sh-2); }
.card__corner {
  position: absolute; inset-block-start: 0; inset-inline-end: 0;
  width: 64px; height: 64px;
  background: radial-gradient(circle at 100% 0, rgba(170,130,80,.20), transparent 70%);
  pointer-events: none;
}

/* divider with diamond */
.divider { display: flex; align-items: center; gap: 14px; color: var(--line); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider span { color: var(--sand-dim); font-size: .7rem; letter-spacing: .3em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding-block: 44px; margin-top: 40px; background: var(--overlay-1); }
.site-footer__grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: center; }
.site-footer__title { font-family: var(--f-display); font-weight: 600; font-size: 1.2rem; color: var(--text-strong); }
.site-footer__note { color: var(--muted); font-size: .86rem; max-width: 46ch; margin-top: 4px; }
.site-footer__meta { display: flex; gap: 12px; align-items: center; color: var(--sand-dim); font-size: .84rem; flex-wrap: wrap; }
.site-footer__meta .dot { color: var(--gold-deep); }

/* ---------- QR placeholder ---------- */
.qr-placeholder {
  width: 96px; height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 / 16px 16px;
}

/* ---------- Icon glyphs (text-glyph replacements for decorative SVGs) ---------- */
.ic { font-style: normal; line-height: 1; display: inline-block; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .nav__links {
    position: fixed; inset: 76px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--scrim-strong); border-bottom: 1px solid var(--line);
    padding: 16px var(--gutter); margin: 0;
    transform: translateY(-130%); transition: transform .4s var(--ease); z-index: 39;
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { padding: 14px; font-size: 1.05rem; }
  .nav__burger { display: flex; }
  .nav { gap: 14px; }
}

/* ---------- Spark baseline (replaces decorative flat-line SVG) ---------- */
.spark-baseline { height: 1px; width: 100%; background: var(--line); border-radius: 1px; }

/* ---------- Stable crest logo-mark image ---------- */
.stable-crest-img { width: 48px; height: 48px; object-fit: contain; display: block; }
