/*
 * Design tokens from the Routific Website Figma file (variables on node 7166:92349).
 * Code components render inside Shadow DOM, so tokens are declared on :host as well as :root
 * (:root covers the local preview and Webflow's own page; :host covers the shadow tree).
 */
:host,
:host {
  /* Brand */
  --rt-indigo-100: #374cd2;
  --rt-indigo-200: #667afa;
  --rt-yellow-200: #ffad0a;
  --rt-yellow-border: #b97b01;
  --rt-turquoise: #45c4d7;
  --rt-primary-500: #326bfc;
  --rt-primary-600: #1750e3;
  --rt-hero-blue: #1f36a7;
  --rt-hero-lilac: #eceefb;

  /* Text */
  --rt-text-primary: #282828;
  --rt-text-secondary: #676d7e;
  --rt-text-tertiary: #9da1af;

  /* Route colours */
  --rt-route-violet: #7547bf;
  --rt-route-pink: #ff85a9;
  --rt-route-sky: #269ed1;
  --rt-route-lilac: #a770db;

  /* Type — Proxima Nova is expected to be loaded by the Webflow site (Adobe Fonts);
     Plus Jakarta Sans and Figtree are loaded from Google Fonts by useDocumentFonts(). */
  --rt-font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --rt-font-heading: "Figtree", system-ui, sans-serif;
  --rt-font-body: "proxima-nova", "Proxima Nova", "Figtree", system-ui, sans-serif;
  --rt-font-ui: "SF Pro Text", -apple-system, "Inter", system-ui, sans-serif;

  /* Radii */
  --rt-radius-md: 8px;
  --rt-radius-lg: 16px;

  /* Vector map (Hero/showcase/MapBase.tsx): Mapbox-light look of the current Routific UI */
  --map-land: #edeff3;
  --map-street: #fcfdfe;
  --map-park: #d3e9d1;
  --map-water: #b3caf3;
  --map-industrial: #f2e4c6;
  --map-highway: #aab3c7;
  --map-highway-edge: #fcfdfe;
}

/* ---------------------------------------------------------------------------
 * Blog post contents as a route (see BlogToc.tsx). Sits in the template's sticky sidebar column.
 * --rt-btoc-first / --rt-btoc-len: first stop and length of the route, --rt-btoc-fill: driven part
 * (all px, set from JS). Not in Figma: flag for design review.
 * ------------------------------------------------------------------------- */
:host {
  display: block;
}

.rt-btoc {
  --rt-btoc-blue: var(--rt-indigo-100);
  --rt-btoc-road: #c8cee2;
  --rt-btoc-first: 16px;
  --rt-btoc-len: 0px;
  --rt-btoc-fill: 0px;
  font-family: var(--rt-font-heading);
  -webkit-font-smoothing: antialiased;
}

.rt-btoc *,
.rt-btoc *::before,
.rt-btoc *::after {
  box-sizing: border-box;
}

.rt-btoc.is-empty {
  display: none;
}

.rt-btoc-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rt-btoc-blue);
}

.rt-btoc-heading {
  margin-bottom: 14px;
}

.rt-btoc-toggle {
  display: none;
}

/* ---- The route ---- */
.rt-btoc-body {
  position: relative;
}

.rt-btoc-road,
.rt-btoc-driven {
  position: absolute;
  left: 5px;
  top: var(--rt-btoc-first);
  width: 2px;
  pointer-events: none;
}

/* road ahead: dotted */
.rt-btoc-road {
  height: var(--rt-btoc-len);
  background: radial-gradient(circle, var(--rt-btoc-road) 1.1px, transparent 1.4px) center top / 2px 6px repeat-y;
}

/* driven: solid */
.rt-btoc-driven {
  height: var(--rt-btoc-fill);
  border-radius: 1px;
  background: var(--rt-btoc-blue);
  transition: height 120ms linear;
}

.rt-btoc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt-btoc-item {
  position: relative;
}

/* stop: a ring on the route, filled once passed */
.rt-btoc-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px; /* centred on the first text line: 6px padding + 20px line / 2 - 6px */
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid var(--rt-btoc-road);
  border-radius: 50%;
  background: #fff;
  transition:
    border-color 200ms,
    background-color 200ms,
    box-shadow 200ms;
  pointer-events: none;
}

.rt-btoc-item.is-past::before {
  border-color: var(--rt-btoc-blue);
  background: var(--rt-btoc-blue);
}

.rt-btoc-item.is-active::before {
  border-color: var(--rt-btoc-blue);
  box-shadow: 0 0 0 4px rgba(55, 76, 210, 0.16);
}

.rt-btoc-link {
  display: block;
  padding: 6px 0 6px 26px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  color: var(--rt-text-secondary);
  text-decoration: none;
  text-wrap: pretty;
  border-radius: 6px;
  transition: color 150ms;
}

.rt-btoc-link:hover {
  color: var(--rt-btoc-blue);
}

.rt-btoc-link:focus-visible {
  outline: 2px solid var(--rt-btoc-blue);
  outline-offset: 2px;
}

.is-active > .rt-btoc-link {
  font-weight: 600;
  color: var(--rt-text-primary);
}

/* ---- Tablets and phones: one card with an "On this page" toggle above the article ---- */
@media (max-width: 991px) {
  .rt-btoc {
    border: 1px solid #e5e9ff;
    border-radius: 12px;
    background: #f7f8ff;
  }

  .rt-btoc-heading {
    display: none;
  }

  .rt-btoc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
  }

  .rt-btoc-chev {
    color: var(--rt-btoc-blue);
    transition: transform 200ms;
  }

  .is-open .rt-btoc-chev {
    transform: rotate(180deg);
  }

  .rt-btoc-body {
    display: none;
    margin: 0 16px;
    padding: 2px 0 14px;
  }

  .is-open .rt-btoc-body {
    display: block;
  }

  .rt-btoc-item::before {
    background: #f7f8ff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rt-btoc *,
  .rt-btoc *::before {
    transition: none !important;
  }
}

