/* ==========================================================================
   Forex Strategy Studio: one-to-one comparison pages
   (compare/<competitor>.html, built by tools/build-competitor.js).

   Loaded after site.css and legal.css, which provide the three-column
   document layout, the cards and the section list (toc.js). From 992px the
   sticky section list and "at a glance" sit beside the text; below that the
   page opens with the competitor pills, and the table turns into one block
   per capability with a chip per app under a sticky app header.
   ========================================================================== */

/* ---------- Page top ---------- */

.cmpx-top {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#0E0D0A, var(--bg));
}

.cmpx-top__inner {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmpx-top__title {
  font-size: clamp(30px, 7vw, 36px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.cmpx-top__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 13px;
  color: var(--text-5);
}

.cmpx-top__meta .cmpx-top__legacy {
  color: var(--gold);
  font-weight: 600;
}

@media (min-width: 768px) {
  .cmpx-top__inner {
    padding-top: 28px;
    padding-bottom: 28px;
  }
}

/* ---------- Layout ---------- */

/* Phones: no section bar; the competitor pills and the table's own sticky
   header do that job. */
@media (max-width: 991px) {
  .cmpx__toc {
    display: none;
  }
}

@media (min-width: 1200px) {
  .doc.cmpx {
    grid-template-columns: 180px minmax(0, 720px) 224px;
    column-gap: 38px;
  }
}

.cmpx__main {
  min-width: 0;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .cmpx__main {
    margin-top: 0;
  }
}

.cmpx__side {
  gap: 16px;
}

/* ---------- Competitor pills (below 992px) ---------- */

.cmpx-switch {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmpx-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cmpx-pill {
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  border-radius: 17px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.cmpx-pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.cmpx-pill[aria-current="page"] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
}

.cmpx-switch__all {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
}

@media (min-width: 992px) {
  .cmpx-switch {
    display: none;
  }
}

/* ---------- Intro and short answer ---------- */

.cmpx-intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
}

.cmpx-verdict {
  margin-top: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  border-inline-start: 3px solid var(--gold);
  border-radius: 14px;
  background: rgba(var(--gold-rgb), 0.05);
}

.cmpx-label--gold {
  color: var(--gold);
}

.cmpx-verdict p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-3);
}

.cmpx-verdict .cmpx-verdict__fss {
  color: var(--text);
}

@media (min-width: 768px) {
  .cmpx-intro {
    font-size: 18px;
  }

  .cmpx-verdict {
    margin-top: 28px;
    padding: 24px 26px;
  }

  .cmpx-verdict p {
    font-size: 16px;
  }
}

/* ---------- Sections ---------- */

.cmpx-sec {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cmpx-sec h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.cmpx-link {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .cmpx-sec {
    margin-top: 52px;
  }

  .cmpx-sec h2 {
    font-size: 24px;
  }
}

/* ---------- Side by side ---------- */

.cmpx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cmpx-table thead th {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.22);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  color: var(--text-2);
}

.cmpx-table thead th:first-child {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-6);
}

.cmpx-table thead th.cmpx-fss {
  background: rgba(var(--gold-rgb), 0.1);
  color: var(--gold-hi);
}

.cmpx-table tbody .cmpx-group td {
  padding: 20px 18px 8px;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.18);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.cmpx-table tbody th,
.cmpx-table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.08);
  line-height: 1.5;
  text-align: start;
  vertical-align: top;
}

.cmpx-table tbody th {
  width: 230px;
  font-weight: 500;
  color: var(--text);
}

.cmpx-table tbody td {
  color: var(--text-5);
}

.cmpx-table tbody td.cmpx-fss {
  background: rgba(var(--gold-rgb), 0.06);
  color: var(--text-2);
}

.cmpx-table tbody td.is-stronger {
  color: var(--text);
}

.cmpx-tick {
  width: 18px;
  height: 18px;
  margin-inline-end: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -3px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
}

.cmpx-legend {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-6);
}

/* Phones: one block per capability, a chip per app; the stronger side's chip
   is brighter. The app names stick under the site header. */
@media (max-width: 767px) {
  .cmpx-table,
  .cmpx-table thead,
  .cmpx-table tbody {
    display: block;
  }

  .cmpx-table thead {
    position: sticky;
    top: var(--header-h);
    z-index: 5;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
  }

  .cmpx-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cmpx-table thead th {
    padding: 10px 0;
    border: 0;
    background: none;
    font-size: 12px;
  }

  .cmpx-table thead th:first-child {
    display: none;
  }

  .cmpx-table thead th.cmpx-fss {
    background: none;
    color: var(--gold);
  }

  .cmpx-group {
    display: block !important;
  }

  .cmpx-table tbody .cmpx-group td {
    display: block;
    padding: 16px 0 6px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--gold);
    font-size: 10px;
  }

  .cmpx-table tbody tr:not(.cmpx-group) {
    padding: 12px 0;
    border-top: 1px solid rgba(var(--gold-rgb), 0.08);
    row-gap: 6px;
  }

  .cmpx-table tbody th {
    grid-column: 1 / -1;
    width: auto;
    padding: 0;
    border: 0;
    font-size: 14px;
    font-weight: 600;
  }

  .cmpx-table tbody td,
  .cmpx-table tbody td.cmpx-fss {
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(242, 238, 227, 0.03);
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-5);
  }

  .cmpx-table tbody td.cmpx-fss {
    background: rgba(var(--gold-rgb), 0.05);
    color: var(--text);
  }

  .cmpx-table tbody td.is-stronger {
    background: rgba(var(--gold-rgb), 0.12);
    color: var(--text);
  }

  .cmpx-tick {
    width: 16px;
    height: 16px;
    margin-inline-end: 6px;
    font-size: 9px;
  }
}

/* ---------- Where it stands out ---------- */

.cmpx-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cmpx-card--fss {
  border-color: rgba(var(--gold-rgb), 0.4);
}

.cmpx-sec .cmpx-card h2 {
  font-size: 18px;
  line-height: 1.35;
}

.cmpx-ticks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cmpx-ticks li {
  position: relative;
  padding-inline-start: 24px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-3);
}

.cmpx-ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 5px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(var(--gold-rgb), 0.6);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0 2.5px, transparent 3px);
}

@media (min-width: 768px) {
  .cmpx-card {
    padding: 24px 26px;
  }

  .cmpx-sec .cmpx-card h2 {
    font-size: 20px;
  }
}

/* ---------- Questions ---------- */

.cmpx-qa {
  scroll-margin-top: 20px;
  transition: border-color 0.2s ease;
}

.cmpx-qa + .cmpx-qa {
  margin-top: -6px;
}

.cmpx-qa[open] {
  border-color: rgba(var(--gold-rgb), 0.55);
}

.cmpx-qa summary {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.cmpx-qa summary::-webkit-details-marker {
  display: none;
}

.cmpx-qa summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 12px;
}

.cmpx-qa h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.cmpx-qa__pm {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(var(--gold-rgb), 0.4);
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.cmpx-qa__pm::before,
.cmpx-qa__pm::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.5px;
  margin: -0.75px 0 0 -5.5px;
  background: var(--gold);
}

.cmpx-qa__pm::after {
  transform: rotate(90deg);
}

.cmpx-qa[open] .cmpx-qa__pm {
  transform: rotate(45deg);
}

.cmpx-qa p {
  padding: 0 20px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-3);
}

/* ---------- Trademark note ---------- */

.cmpx-trademark {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-6);
}

/* ---------- At a glance, other comparisons ---------- */

.cmpx-glance {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmpx-glance > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--text-2);
}

.cmpx-glance__n {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-2);
}

.cmpx-glance__n--fss {
  color: var(--gold);
}

.cmpx-glance__n--even {
  color: var(--text-5);
}

.cmpx-others {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmpx-others a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--text-2);
}

.cmpx-others a:hover {
  color: var(--gold);
}

.cmpx-others a span {
  color: var(--gold);
}

/* The phone pills already list the other comparisons. */
@media (max-width: 991px) {
  .cmpx-others {
    display: none;
  }
}

/* Arabic: the small capitals labels need a size step up. */
:lang(ar) .cmpx-table thead th:first-child,
:lang(ar) .cmpx-table tbody .cmpx-group td {
  font-size: 12px;
}
