/* The changelog page's tabs. Tokens from foundations.css only, like the theme's own
   site.css and download.css. The tabs exist only once the script has run (the list is
   `hidden` in the markup); before that every section shows, under its own heading. */

.cl-tabs {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin: 1.6rem 0 1.8rem; padding: .3rem;
  background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: 999px;
  width: fit-content; max-width: 100%;
}
.cl-tabs[hidden] { display: none; }

.cl-tabs [role="tab"] {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--fg-2);
  background: transparent; border-radius: 999px; padding: .45rem 1rem;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.cl-tabs [role="tab"]:hover { color: var(--fg-1); }
.cl-tabs [role="tab"]:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.cl-tabs [role="tab"][aria-selected="true"] {
  background: var(--bg-elevated); color: var(--fg-1); box-shadow: var(--shadow-sm);
}

.cl-tab-version {
  font-size: .75rem; font-weight: 600; color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.cl-tabs [role="tab"][aria-selected="true"] .cl-tab-version { color: var(--synapsi-teal-700); }

.cl-panel { scroll-margin-top: 1rem; }
.cl-panel + .cl-panel { margin-top: 3rem; }
/* With tabs, the panel's own heading repeats the tab's name: it stays for screen
   readers and goes from the screen. */
.cl-tabbed .cl-panel + .cl-panel { margin-top: 0; }
.cl-tabbed .cl-panel > h2 {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}


.cl-meta { margin: -.4rem 0 .6rem; font-size: .85rem; color: var(--fg-3); }
.cl-beta {
  margin-left: .4rem; padding: .05rem .5rem; border: 1px solid var(--border-subtle);
  border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--fg-2);
}

/* ------------------------------------------------- the redesign's look
   Tabs as a pill with the version beside each name; every version a white card, its number
   and date in a column on the left and the notes beside it. The notes are the API's (or the
   files') markdown, rendered as the include has always rendered it: a `###` per version and
   the text after it, so the heading ids stay what they were. */
.cl-tabs { background: var(--tile); border-color: var(--line); padding: 5px; gap: 6px; }
.cl-tabs [role="tab"] { min-height: 44px; padding: 0 18px; color: var(--ink-2); }
.cl-tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); }
.cl-tab-version { color: var(--ink-3); }
.cl-tabs [role="tab"][aria-selected="true"] .cl-tab-version { color: var(--accent); }

.cl-panel h3 {
  margin: 20px 0 0; padding: 20px 28px 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.cl-panel .cl-meta {
  margin: 0; padding: 4px 28px 0; font-size: 14px; color: var(--ink-3);
  background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.cl-panel h3 + :not(.cl-meta), .cl-panel .cl-meta + * { margin-top: 0; }
.cl-panel h3 ~ :is(p, ul, ol, h4):not(.cl-meta) {
  margin: 0; padding-left: 28px; padding-right: 28px; background: var(--surface);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
/* As specific as the rule above, so the list keeps its indent; flow-root keeps the first and
   last item's margin inside the card instead of opening a seam of page colour. */
.cl-panel h3 ~ :is(ul, ol):not(.cl-meta) { padding-left: 48px; }
.cl-panel h3 ~ :is(p, ul, ol, h4):not(.cl-meta) { display: flow-root; }
.cl-panel .cl-meta { padding-bottom: 8px; }
.cl-panel h3 ~ :is(p, ul, ol, h4):not(.cl-meta):last-child,
.cl-panel h3 ~ :is(p, ul, ol, h4):not(.cl-meta):has(+ h3) { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius-xl) var(--radius-xl); padding-bottom: 24px; }
.cl-panel h4 { padding-top: 12px !important; font-size: 1rem; color: var(--ink); }
.cl-panel li { color: var(--ink-list); font-size: 16px; line-height: 1.6; margin: .4rem 0; }
.cl-beta { color: var(--ink-2); border-color: var(--line-2); }
.cl-panel#android > p:first-of-type { padding: 14px 18px; background: var(--cyan-soft); border: 1px solid var(--cyan-line); border-radius: var(--radius-lg); font-size: 15px; }
.cl-panel#android > p:first-of-type + p { margin-top: 12px; }

/* On a phone the three tabs with their versions wrap, and the pill turns into a blob: the
   version goes (the first card says it) and the three names fit on one line. */
@media (max-width: 480px) {
  .cl-tabs [role="tab"] { padding: 0 14px; }
  .cl-tab-version { display: none; }
}
