/* chertmap.com — only what the shared CHERT site system (shell.css, site.css) does not already provide.
 * Same family additions as cherterp.css (tables, note line, reveal and contrast fixes), with the cm- prefix,
 * plus the capability grid, the hero route card, the secondary-page band and right-to-left support for /ar/.
 * Tokens only — no colour is written here. */

/* ---- family fixes (same as cherterp.com / chertrepat.com) ------------------------------------------ */
/* the reveal animates position, never visibility */
.js .sx-reveal { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .sx-reveal, .js .sx-reveal { opacity: 1 !important; transform: none !important; }
}
/* orange cannot carry small text on cream */
.sx-nav.is-solid .sx-nav__brand b { color: var(--chert-ink); }
.sx-stage__count { color: var(--chert-ink); }

/* ---- capabilities ----------------------------------------------------------------------------------- */
.cm-caps { background: var(--chert-surface-alt); }
.cm-caps__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.cm-cap { position: relative; overflow: hidden; padding: 24px; border-radius: 20px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  transition: translate var(--dur-slow) var(--ease), box-shadow var(--dur-slow), border-color var(--dur-slow); }
.cm-cap::after { content: ""; position: absolute; inset-inline-end: -80px; bottom: -110px; width: 220px; height: 220px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--chert-orange) 20%, transparent), transparent 70%); transition: opacity var(--dur-slow); }
.cm-cap:hover { translate: 0 -4px; box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--chert-orange) 50%, var(--chert-border)); }
.cm-cap:hover::after { opacity: 1; }
.cm-cap .sx-pillar__icon { width: 46px; height: 46px; border-radius: 13px; }
.cm-cap h3 { margin: 16px 0 6px; font-size: 18px; line-height: 1.3; }
.cm-cap p { margin: 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--chert-muted); }
.cm-cap__n { position: absolute; top: 20px; inset-inline-end: 22px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--chert-muted); }

/* ---- hero: sample route card (re-uses .sx-tele) ----------------------------------------------------- */
.cm-route__map { display: block; width: 100%; height: 64px; margin: 8px 0 6px; border-radius: 10px;
  background: color-mix(in srgb, var(--chert-dark) 70%, transparent); }
.cm-route__road { fill: none; stroke: color-mix(in srgb, var(--chert-dark-muted) 32%, transparent); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.cm-route__path { fill: none; stroke: var(--chert-orange); stroke-width: 3.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 6 5; animation: sx-dash 1.2s linear infinite; }
.cm-route__dot { fill: var(--chert-orange); filter: drop-shadow(0 0 5px var(--chert-orange)); }
.cm-route__end { fill: var(--chert-dark-text); stroke: var(--chert-orange); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* ---- tables that scroll rather than squash ---------------------------------------------------------- */
.cm-api { background: var(--chert-cream); }
.cm-table { overflow-x: auto; margin-block-start: 26px; border: 1px solid var(--chert-border); border-radius: 14px; background: var(--chert-surface); }
.cm-table table { inline-size: 100%; border-collapse: collapse; min-inline-size: 36rem; }
.cm-table th, .cm-table td { padding: 13px 16px; text-align: start; vertical-align: top; border-block-end: 1px solid var(--chert-border); font-size: .92rem; line-height: 1.6; }
.cm-table thead th { background: var(--chert-ink); color: var(--chert-cream); font-weight: 700; font-size: .84rem; letter-spacing: .02em; }
.cm-table tbody tr:nth-child(even) { background: var(--chert-surface-alt); }
.cm-table tbody tr:hover { background: var(--chert-orange-tint); }
.cm-table tbody tr:last-child th, .cm-table tbody tr:last-child td { border-block-end: 0; }
.cm-table tbody th { font-weight: 600; inline-size: 40%; }
.cm-table code { font-family: var(--font-mono); font-size: .86rem; font-weight: 600; color: var(--chert-ink); }

/* ---- note under a section --------------------------------------------------------------------------- */
.cm-note { margin-block-start: 22px; padding-inline-start: 10px; display: flex; align-items: flex-start; gap: 10px;
  color: var(--chert-muted); font-size: .92rem; line-height: 1.65; max-inline-size: 80ch; }
.cm-note svg { flex: 0 0 auto; margin-block-start: 3px; }

/* ---- footer legal line ------------------------------------------------------------------------------ */
.cm-foot__legal { padding-block-start: 14px; }
.cm-foot__legal small { font-size: var(--fs-xs); color: var(--chert-dark-muted); }

/* ---- secondary pages -------------------------------------------------------------------------------- */
.cm-page .sx-nav { position: sticky; top: 0; background: var(--chert-dark); color: var(--chert-dark-text); }
.cm-page .sx-nav.is-solid { background: color-mix(in srgb, var(--chert-cream) 88%, transparent); color: var(--chert-ink); }
.cm-band { position: relative; overflow: hidden; padding: var(--space-8) 0 var(--space-7); color: var(--chert-dark-text);
  background:
    radial-gradient(ellipse at 88% -20%, color-mix(in srgb, var(--chert-orange-deep) 28%, transparent), transparent 55%),
    linear-gradient(color-mix(in srgb, var(--chert-dark-border) 55%, transparent) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, color-mix(in srgb, var(--chert-dark-border) 55%, transparent) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--chert-dark); }
.cm-band .sx-eyebrow { color: var(--chert-orange); }
.cm-band h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
[lang="ar"] .cm-band h1 { letter-spacing: normal; line-height: 1.3; }
.cm-band__lead { max-width: 72ch; margin: 0; font-size: var(--fs-lg); color: var(--chert-dark-muted); }
.cm-doc h2 { margin: var(--space-7) 0 var(--space-3); font-size: var(--fs-h3); }
.cm-doc h2:first-child { margin-top: 0; }
.cm-doc p { max-width: 80ch; }
.cm-doc a:not(.btn) { color: var(--chert-ink); text-decoration: underline; text-decoration-color: var(--chert-orange-deep); text-underline-offset: 3px; }
.cm-doc__list { padding-inline-start: 1.2rem; display: grid; gap: 6px; }
.cm-doc .btn { margin-top: var(--space-6); }

/* ---- Arabic at /ar/: right-to-left ------------------------------------------------------------------ */
/* shell.css keeps family sites left-aligned; chertmap.com/ar/ is a full right-to-left page (design system §7). */
[dir="rtl"] .sx { text-align: right; }
[dir="rtl"] .sx-head, [dir="rtl"] .sx-final { text-align: center; }
[dir="rtl"] .sx-node { text-align: right; }
[dir="rtl"] .sx-tele { right: auto; left: 0; }
[dir="rtl"] .sx-hero__field { -webkit-mask-image: linear-gradient(260deg, transparent 0%, black 62%); mask-image: linear-gradient(260deg, transparent 0%, black 62%); }
@media (max-width: 999px) { [dir="rtl"] .sx-hero__field { -webkit-mask-image: linear-gradient(180deg, transparent 10%, black 70%); mask-image: linear-gradient(180deg, transparent 10%, black 70%); } }
/* directional icons mirror; the logo, the stack and the starburst never do */
[dir="rtl"] .sx-life__controls [data-sx-life-prev] svg, [dir="rtl"] .sx-life__controls [data-sx-life-next] svg,
[dir="rtl"] .sx-inspector__nav svg, [dir="rtl"] .sx-inspector__idle svg { transform: scaleX(-1); }
[lang="ar"] .sx-stats dt, [lang="ar"] .sx-eyebrow { letter-spacing: normal; text-transform: none; }
[lang="ar"] .sx-hero__lead, [lang="ar"] .sx-head p, [lang="ar"] .cm-cap p, [lang="ar"] .sx-pillar p { line-height: var(--lh-ar); }
/* shell.css hides the skip link at left:-9999px; in a right-to-left page that widens the scrollable area by
   10,000px and the page opens on empty space. Hide it on the inline-start side instead. */
[dir="rtl"] .skip-link { left: auto; right: -9999px; border-radius: 0 0 0 var(--radius-sm); }
[dir="rtl"] .skip-link:focus { right: 0; }
