/* ------------------------------------------------------------------
   Two-column layout utility
   Usage: wrap content in a container with class "cols cols--2".
   The first child becomes the left column, the second the right.
   On narrow viewports the layout stacks vertically.
   ------------------------------------------------------------------ */

.cols {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.cols--2 > :first-child {
  flex: 1 1 55%;
  min-width: 0;
}

.cols--2 > :last-child {
  flex: 1 1 40%;
  min-width: 0;
}

.cols--2 > :last-child img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Stack on narrow viewports */
@media (max-width: 680px) {
  .cols {
    flex-direction: column;
  }

  .cols--2 > :first-child,
  .cols--2 > :last-child {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------------
   API reference link styling
   Applied by the apilinks extension via .api-ref and .api-<platform>
   classes on <code> elements inside <a> tags.
   ------------------------------------------------------------------ */

a .api-ref {
  border-bottom: 1px dotted currentColor;
  padding: 0.1em 0.2em;
}

a:hover .api-ref {
  border-bottom-style: solid;
}

/* Per-platform accent colors (subtle left border) */
a .api-android { border-left: 2px solid #3ddc84; }
a .api-apple   { border-left: 2px solid #147efb; }
a .api-web     { border-left: 2px solid #f7b731; }
a .api-react   { border-left: 2px solid #61dafb; }

/* ------------------------------------------------------------------
   Sidebar child pages
   The sidebar renders the full page tree (collapse=false in
   theme/include/sidenav.html). Only the branch of the current page is
   expanded; entries with child pages show a chevron.
   ------------------------------------------------------------------ */

.cl-sphinx-sidenav li:not(.current) > ul {
  display: none;
}

.cl-sphinx-sidenav li > a:not(:last-child) {
  padding-right: 2rem;
}

/* ::before, since the theme uses a.current::after for the current page bar */
.cl-sphinx-sidenav li > a:not(:last-child)::before {
  content: "\f054"; /* chevron-right */
  float: right;
  margin-right: -1.25rem;
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.75rem;
  color: #6d5e5e;
}

.cl-sphinx-sidenav li.current > a:not(:last-child)::before {
  content: "\f078"; /* chevron-down */
}
