/* ============================================================
   BrokerageLoop — reusable components
   ============================================================ */

/* ---- Kicker / eyebrow ----
   Set in IBM Plex Mono: the monospace label is what makes a technical product
   page read as engineering-led rather than marketing-led. Arabic falls back to
   IBM Plex Sans Arabic (same superfamily) since Plex Mono has no Arabic. */
.kicker{
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-block-end: var(--space-5);
}
html[lang="ar"] .kicker,
body.lang-ar .kicker{
  font-family: var(--font-arabic);
  letter-spacing: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.kicker::before{
  content: "";
  width: 22px; height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}
.kicker.on-dark{ color: var(--brand-gold-lifted); }

.eyebrow-dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}

/* ---- Buttons ---- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              background-color var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard);
  border: 1.5px solid transparent;
}
.btn svg{ width: 18px; height: 18px; flex: none; }
.btn:active{ transform: translateY(1px) scale(0.99); }

.btn-primary{
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
}
.btn-primary:hover{ background: var(--color-primary-hover); }

.btn-secondary{
  background: var(--color-bg);
  color: var(--color-fg);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover{ border-color: var(--color-accent); color: var(--color-accent); }

.btn-ghost-on-dark{
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
}
.btn-ghost-on-dark:hover{ background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }

.btn-gold{
  background: var(--brand-gold-lifted);
  color: var(--brand-ink);
}
.btn-gold:hover{ background: #f2c766; }

.btn-lg{ padding: 1.05rem 1.9rem; font-size: var(--fs-md); }
.btn-block{ width: 100%; }

.icon-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--color-fg);
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.icon-btn:hover{ background: var(--color-bg-muted); }
.icon-btn svg{ width: 20px; height: 20px; }

/* ---- Mono metadata label ----
   Small uppercase monospace line used for counts, indices and status text. */
.mono-label{
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-fg-subtle);
}
html[lang="ar"] .mono-label,
body.lang-ar .mono-label{ font-family: var(--font-arabic); letter-spacing: 0; }

/* ---- Badge / pill ---- */
.badge{
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
}
html[lang="ar"] .badge,
body.lang-ar .badge{ font-family: var(--font-arabic); letter-spacing: 0; font-weight: 700; font-size: var(--fs-xs); }
.badge-verified{
  background: var(--color-success-bg);
  color: var(--color-success);
}
.badge-verified svg{ width: 13px; height: 13px; }
.badge-neutral{
  background: var(--color-bg-muted);
  color: var(--color-fg-muted);
}
.badge-gold{
  background: rgba(233,185,73,0.14);
  color: var(--brand-gold-lifted);
  border: 1px solid rgba(233,185,73,0.3);
}

/* ---- Cards ---- */
.card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card-hover:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-cerulean-100);
}

/* Solid ink chip rather than a pale tint — reads as a deliberate mark on the
   page instead of a washed-out background swatch. */
.icon-tile{
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-cerulean-900);
  color: #fff;
  margin-block-end: var(--space-5);
  flex: none;
}
.icon-tile svg{ width: 22px; height: 22px; }
.icon-tile.accent{ background: var(--brand-bronze); color: #fff; }

/* Inside already-dark surfaces (AI cards, dark bands) the solid chip would
   disappear — keep the translucent treatment there. */
.ai-feature-card .icon-tile,
.band-ink .icon-tile{
  background: rgba(233,185,73,0.12);
  color: var(--brand-gold-lifted);
}

/* ---- Glass surface (used sparingly: hero panel, AI panel) ---- */
.glass{
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow-lg);
}
.glass-dark{
  background: rgba(13,26,48,0.55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ---- Grid utilities ---- */
.grid{ display: grid; gap: var(--space-6); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-3, .grid-4{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; } }

/* ---- Reveal-on-scroll (respects reduced motion via base.css) ---- */
/* Only hide .reveal elements once we know JS (and therefore main.js's
   IntersectionObserver, which adds .is-visible) actually ran — see the
   documentElement.classList.add('js') script at the top of <body>. Without
   that guard, a no-JS visitor or a crawler that doesn't execute scripts
   would see every section permanently at opacity:0. */
.js .reveal{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.is-visible{ opacity: 1; transform: none; }

/* ---- Untranslated-page notice (guide pages, Arabic mode) ----
   Inserted inside the content-hero's own .container (see main.js), not as
   a bare first child of <main> — <main> itself has no top clearance for
   the fixed .site-header, so an element placed directly at main's top
   renders underneath the header and becomes unclickable. */
.untranslated-notice{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--brand-cerulean-50);
  border: 1px solid var(--brand-cerulean-100);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-block-end: var(--space-6);
}
.untranslated-notice-text{
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.untranslated-notice-ar{
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-cerulean-900);
  font-family: var(--font-arabic);
}
.untranslated-notice-en{
  font-size: var(--fs-xs);
  color: var(--color-fg-subtle);
}
.untranslated-notice-close{
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-cerulean-900);
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.untranslated-notice-close:hover{ background: rgba(3, 105, 161, 0.12); }
.untranslated-notice-close svg{ width: 16px; height: 16px; }

/* ---- Tooltip-free helper text ---- */
.eyebrow-line{
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--color-fg-subtle); font-size: var(--fs-sm);
}
