/* ==================================================================
   PLATFORMS — homepage "One Platform. Multiple Markets." MT5 grid.
   Markup lives inline in index.html (single consumer).

   Ported from update/ui/platform.html plus the .mt5-* rules it depends
   on in the mockup's index.html export. Deviations, and why:

   1. CLASS NAMES. The prototype uses bare .section, .container, .device
      and Bootstrap's own .btn / .btn-outline-dark. Restyling .btn here
      would reach every button on the page, so the section's furniture is
      namespaced .rz-plat__* / .rz-plat-card__*.

   2. FONTS. Marcellus + Inter are replaced by the site's self-hosted
      'Ping AR + LT' — neither Google font covers Arabic (NFR-10).

   3. NO SECTION BACKGROUND. The prototype ships this section .on-light
      between two .on-dark ones, and that alternation is the point. Here
      the section inherits the page background so the same rhythm holds in
      both themes: accounts (page) → markets (navy) → platforms (page) →
      funding (navy). Cards use --section-box-color / --footer-border, the
      same theme-aware tokens as .compare-card in the accounts section
      directly above, so the two read as one system.

   4. BUTTONS ARE THEME-AWARE. .btn-outline-dark is black-on-transparent,
      invisible on the dark theme. These use --text-primary, which flips
      with data-bs-theme, and fill gold on hover per BRD §9.1 (gold is for
      primary actions and hover states).

   Third file to mirror the same section furniture — when a fourth lands,
   extract .rz-*__container / __head / __eyebrow into css/sections.css
   instead of copying it again.
   ================================================================== */

/* #region ------- ( 1- Scoped tokens + reset ) ---------- */
.rz-plat {
  --plat-max-w: 1240px;
}
.rz-plat,
.rz-plat *,
.rz-plat *::before,
.rz-plat *::after {
  box-sizing: border-box;
}
/* #endregion */

/* #region ------- ( 2- Section shell ) ---------- */
.rz-plat {
  position: relative;
  padding: 96px 0;
  font-family: 'Ping AR + LT', -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.rz-plat__container {
  max-width: var(--plat-max-w);
  margin: 0 auto;
  padding: 0 40px;
}

/* On the homepage this section has no head of its own — #metatrader-5 sits
   directly above and carries the heading for the whole MetaTrader 5 block,
   so the card row must not open a second 96px gap. See css/mt5.css §2. */
.rz-plat--headless {
  padding-top: 0;
}
/* #endregion */

/* #region ------- ( 3- Section head ) ---------- */
.rz-plat__head {
  max-width: 660px;
  margin: 0 auto 56px;
  text-align: center;
}
.rz-plat__eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--royce-gold);
  margin-bottom: 16px;
}
.rtl .rz-plat__eyebrow {
  letter-spacing: normal;
}
.rz-plat__head h2 {
  font-weight: 400;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  color: var(--text-primary);
}
.rtl .rz-plat__head h2 {
  letter-spacing: normal;
}
.rz-plat__head p {
  font-size: 0.98rem;
  margin: 0;
  color: var(--paragraph-color);
}
/* #endregion */

/* #region ------- ( 4- Card grid ) ---------- */
.rz-plat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.rz-plat-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 42px 34px;
  background: var(--section-box-color);
  border: 1px solid var(--footer-border);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.rz-plat-card:hover {
  border-color: var(--brand-gold);
  transform: translateY(-3px);
}

.rz-plat-card__device {
  width: 56px;
  height: 44px;
  margin: 0 auto 22px;
  color: var(--text-primary);
}
.rz-plat-card__device svg {
  width: 100%;
  height: 100%;
  display: block;
}
.rz-plat-card h3 {
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.rtl .rz-plat-card h3 {
  letter-spacing: normal;
}
/* flex-grow keeps every CTA on the same baseline whatever the copy length */
.rz-plat-card p {
  font-size: 0.89rem;
  color: var(--paragraph-color);
  margin: 0 0 28px;
  flex-grow: 1;
}

/* Colour, motion, and the gap between stacked actions in a card. The box —
   including the full width, which css/buttons.css keeps for the card actions —
   and the RTL tracking reset are shared. */
.rz-plat-card__btn {
  margin-bottom: 12px;
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.rz-plat-card__btn:last-child {
  margin-bottom: 0;
}
.rz-plat-card__btn:hover,
.rz-plat-card__btn:focus-visible {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--royce-black);
}
.rz-plat-card__btn:focus-visible {
  outline: 2px solid var(--royce-gold);
  outline-offset: 3px;
}

.rz-plat__note {
  margin: 32px auto 0;
  max-width: 760px;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--paragraph-color);
}
/* #endregion */

/* #region ------- ( 5- Responsive ) ---------- */
@media (max-width: 1100px) {
  .rz-plat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .rz-plat {
    padding: 68px 0;
  }
  .rz-plat__container {
    padding: 0 24px;
  }
  .rz-plat__head {
    margin-bottom: 40px;
  }
}
@media (max-width: 600px) {
  .rz-plat-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .rz-plat-card {
    padding: 32px 24px;
  }
}
/* #endregion */

/* #region ------- ( 6- Reduced motion ) ---------- */
@media (prefers-reduced-motion: reduce) {
  .rz-plat-card:hover {
    transform: none;
  }
  .rz-plat *,
  .rz-plat *::before,
  .rz-plat *::after {
    transition: none !important;
  }
}
/* #endregion */
