/*
 * Two products, one site: the pieces that tell Kloudfuse and Dexter apart.
 * Dexter pages otherwise use the Kloudfuse theme (the centred article that
 * every page shares is in layout-scroll.css).
 *
 * A page is a Dexter page when it belongs to the `dexter` docs component
 * (nav.hbs stamps data-component on .nav-container, a sibling of <main>), or
 * when it carries the `dexter` page role, which the bundle's default layout
 * adds to <body class="article dexter">. kf-docs sets that role for the whole
 * component in dexter/antora.yml.
 */

/* ── Changelog rows ([.dexter-release] sections) ──────────────────── */

/*
 * Each release on the Dexter release notes page is a row: the version and its
 * date in a narrow left column, the grouped changes on the right. The date is
 * the first paragraph of the section body ([.dexter-release-date]); it is
 * lifted out to sit under the version.
 */
@media screen and (min-width: 721px) {
  body.dexter .body .doc .sect1.dexter-release {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    column-gap: 32px;
    margin-top: 2.75rem;
    padding-top: 2.25rem;
    border-top: 1px solid #e5e8ef;
  }

  body.dexter .body .doc .sect1.dexter-release > .sectionbody {
    grid-column: 2;
    grid-row: 1;
  }

  body.dexter .body .doc .sect1.dexter-release > h2 {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  body.dexter .body .doc .sect1.dexter-release .dexter-release-date {
    position: absolute;
    top: calc(2.25rem + 2.1rem);
    left: 0;
    width: 150px;
    margin: 0;
  }

  body.dexter .body .doc .sect1.dexter-release > .sectionbody > .dexter-release-date + .sect2 > h3 {
    margin-top: 0;
  }
}

/* The version is a label in the left column, not a section banner: drop the
   accent rule and band that section-accents.css gives every h2. */
body.dexter .body .doc .sect1.dexter-release > h2 {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

body.dexter .body .doc .sect1.dexter-release .dexter-release-date p {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ── Search results: product label ────────────────────────────────── */

/* Each search result says which product it belongs to
   (partials/search-scripts.hbs): Kloudfuse in the orange accent, Dexter in
   the blue one. */
.pf-result__product {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(242, 80, 34, 0.1);
  color: #c2390f;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.6;
  vertical-align: 1px;
  white-space: nowrap;
}

.pf-result--dexter .pf-result__product {
  background: rgba(26, 86, 219, 0.1);
  color: #1a56db;
}

/* The whole result is one link, and the site underlines links on hover. The
   row already changes ground on hover, so no underline. !important: the
   bundle's a:hover rule is more specific in places. */
a.pf-result,
a.pf-result:hover,
a.pf-result:focus,
a.pf-result:hover * {
  text-decoration: none !important;
}

/* ── "Copy page" menu (js/page-actions.js) ────────────────────────── */

.doc .kf-page-actions {
  position: relative;
  float: right;
  margin: 6px 0 0 16px;
  font-size: 13.5px;
  line-height: 1.3;
}

.doc .kf-page-actions button {
  font: inherit;
  color: #161b24;
  background: none;
  border: 0;
  cursor: pointer;
}

.doc .kf-page-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.doc .kf-page-actions__group {
  display: flex;
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.doc .kf-page-actions__main {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-weight: 500;
}

.doc .kf-page-actions__toggle {
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-left: 1px solid #e5e8ef;
  color: #6b7280;
}

.doc .kf-page-actions__main:hover,
.doc .kf-page-actions__toggle:hover,
.doc .kf-page-actions__item:hover {
  background: #f6f7f9;
}

.doc .kf-page-actions button:focus-visible {
  outline: 2px solid var(--kf-accent, #F25022);
  outline-offset: -2px;
}

.doc .kf-page-actions__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 290px;
  padding: 6px;
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 27, 36, 0.1);
}

.doc .kf-page-actions__menu[hidden] {
  display: none;
}

.doc .kf-page-actions__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  text-align: left;
}

.doc .kf-page-actions__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #e5e8ef;
  border-radius: 8px;
  flex-shrink: 0;
}

.doc .kf-page-actions__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.doc .kf-page-actions__text b {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.doc .kf-page-actions__text b svg {
  width: 12px;
  height: 12px;
  color: #6b7280;
}

.doc .kf-page-actions__text > span {
  font-size: 12.5px;
  color: #6b7280;
}

@media screen and (max-width: 720px) {
  .doc .kf-page-actions {
    float: none;
    display: inline-block;
    margin: 0 0 12px;
  }

  .doc .kf-page-actions__menu {
    right: auto;
    left: 0;
  }
}

/* ── Header brand: Kloudfuse mark, product name, "Docs" ───────────── */

/* styles.css draws the Kloudfuse "documentation" logo as a background on the
   brand link and hides the link's text. header-content.hbs renders a real
   lockup instead, on Kloudfuse and Dexter pages alike: the mark, the product
   name ("Platform" or "Dexter"), a hairline, and "Docs" in a lighter weight. */
.navbar-brand > .navbar-item.kf-brand:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px 0 0;
  color: #14171f;
  text-decoration: none;
  user-select: auto;
}

.navbar-brand > .navbar-item.kf-brand:first-child::before {
  content: none;
}

/* !important: the bundle caps images inside .navbar-item. */
.navbar-brand .kf-brand__mark {
  width: 30px !important;
  height: 30px !important;
  max-height: none !important;
  object-fit: contain;
}

.kf-brand__name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.kf-brand__docs {
  margin-left: 2px;
  padding-left: 11px;
  border-left: 1px solid #d5d9e2;
  color: #6b7280;
  font-size: 17px;
  font-weight: 450;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.kf-brand:hover .kf-brand__docs {
  color: #14171f;
}


/* The bundle gives the title its top margin only when it is the article's
   first child; the menu is inserted before it, so restore the margin and
   start the menu at the same height. */
.doc > .kf-page-actions + h1.page {
  margin-top: 2.5rem;
}

.doc > .kf-page-actions {
  margin-top: calc(2.5rem + 6px);
}

/* ── Product switcher (partials/nav-menu.hbs) ─────────────────────── */

/* Replaces the component title at the top of the sidebar when the site
   publishes more than one product: a dropdown to move between the Kloudfuse
   and Dexter docs. */
.nav-panel-menu .nav-menu .kf-switcher {
  position: relative;
  margin: 0 0 0.75rem;
}

.nav-panel-menu .nav-menu .kf-switcher__current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 1.5px solid var(--kf-accent, #F25022);
  border-radius: 8px;
  background: #fff;
  color: var(--kf-nav-strong, #14171f);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-panel-menu .nav-menu .kf-switcher__current::-webkit-details-marker {
  display: none;
}

.nav-panel-menu .nav-menu .kf-switcher__current::after {
  content: "";
  margin-left: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--kf-nav-muted, #6b7280);
  border-bottom: 1.5px solid var(--kf-nav-muted, #6b7280);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.nav-panel-menu .nav-menu .kf-switcher[open] > .kf-switcher__current::after {
  transform: translateY(2px) rotate(-135deg);
}

.nav-panel-menu .nav-menu .kf-switcher__current:focus-visible {
  outline: 2px solid var(--kf-accent, #F25022);
  outline-offset: 2px;
}

.nav-panel-menu .nav-menu .kf-switcher__menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--kf-rule, #e7e9ee);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.nav-panel-menu .nav-menu .kf-switcher__mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.nav-panel-menu .nav-menu .kf-switcher__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--kf-nav-strong, #14171f);
}

.nav-panel-menu .nav-menu .kf-switcher__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-panel-menu .nav-menu .kf-switcher__text b {
  font-weight: 600;
}

.nav-panel-menu .nav-menu .kf-switcher__text span {
  font-size: 12px;
  color: var(--kf-nav-muted, #6b7280);
}

.nav-panel-menu .nav-menu .kf-switcher__item:hover {
  background: var(--kf-nav-hover, rgba(242, 80, 34, 0.06));
}

.nav-panel-menu .nav-menu .kf-switcher__item.is-current {
  background: var(--kf-nav-tint, rgba(242, 80, 34, 0.09));
}

.nav-panel-menu .nav-menu .kf-switcher__item.is-current b {
  color: var(--kf-accent-deep, #C2390F);
}

/* ── Dexter overview tiles ────────────────────────────────────────── */

/* The Dexter overview uses the home page's tiles. Its lists are short, so
   the tiles are as tall as their content, not the home page's 430px. */
body.dexter .box-tiles > div {
  height: auto;
  min-height: 0;
  padding-bottom: 20px;
}

/* Four tiles in a row when they fit, otherwise two by two, so the last tile
   is never left on a row of its own. */
body.dexter .box-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

body.dexter .box-tiles > div {
  width: auto;
  max-width: none;
}

@media screen and (min-width: 1600px) {
  body.dexter .box-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media screen and (max-width: 640px) {
  body.dexter .box-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* styles.css pins every home-page link to 90px wide (for the tile icons);
   the next-page link is not a tile. */
body.index-page .doc nav.pagination a {
  width: auto !important;
}

/* ── Header: even spacing with the theme button ───────────────────── */

/* The theme button follows the Kloudfuse wordmark, so the wordmark must not
   keep the 24px margin of a middle item on top of the empty space inside its
   own image: that left a gap twice as wide as the others. */
.navbar-brand .navbar-item.search > a.navbar-brand__website-link {
  margin-right: 0;
}

/* 7px puts the sun or moon glyph 28px from the wordmark, the same as the
   gaps between the search field and the two buttons. */
.navbar .kf-theme-toggle {
  margin-left: 7px;
}

/* Every page: the wordmark sat 23px after Free Download while the search
   field and the buttons are 28px apart. */
.navbar-brand .navbar-item.search > a.navbar-brand__website-link--text.navbar-brand__website-link--text-free-download {
  margin-right: 15px !important;
}

/* The home page fills the window with eleven tiles. The Dexter overview has
   four, so on a wide window they sat at the left with empty space beside
   them: cap the page at the width of four tiles and centre it. */
@media screen and (min-width: 1024px) {
  body.dexter.index-page main > .content article.doc {
    max-width: 72rem !important;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Search shortcut hint (js/page-actions.js appends the <kbd>) ──── */

.navbar #search-field {
  position: relative;
}

.navbar .kf-search-hint {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: 2px 6px;
  border: 1px solid #dfe3ea;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  pointer-events: none;
}

.navbar #search-input:focus ~ .kf-search-hint {
  display: none;
}

@media screen and (max-width: 768.5px) {
  .navbar .kf-search-hint {
    display: none;
  }
}

/* ── Quieter page chrome (every page, both products) ──────────────── */

/* The colours, type and article styling are the Kloudfuse theme's. What
   changes is the furniture around the article, so the centred page reads as
   one surface instead of three boxed panels: the sidebar shares the page's
   white ground, the rules under the header and the breadcrumb bar go (on a
   wide window they started and stopped at different places), and the contents
   list is plain links instead of filled, coloured rows. */
@media screen and (min-width: 1024px) {
  .body .nav-container {
    background: #fff;
    box-shadow: none;
    border-right: 0;
  }
}

body.article .navbar-brand {
  box-shadow: none;
}

body.article .body .toolbar {
  border-bottom: 0;
  box-shadow: none;
}

/* Contents list: plain links, no filled rows, bars or dots. */
body.article .body aside.toc.sidebar {
  border-left: 0;
  box-shadow: none;
}

body.article .body aside.toc.sidebar .toc-menu ul {
  border-left: 0;
}

body.article aside.toc.sidebar .toc-menu > h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #161b24;
}

body.article aside.toc.sidebar .toc-menu ul > li {
  border-left: 0;
  border-radius: 0;
  background: none;
  margin-bottom: 0;
}

body.article aside.toc.sidebar .toc-menu ul > li[data-level] > a {
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.45;
  color: #5b6472;
  background: none;
}

body.article aside.toc.sidebar .toc-menu ul > li[data-level] > a::before {
  display: none;
}

body.article aside.toc.sidebar .toc-menu ul > li[data-level] > a:hover {
  color: #161b24;
  background: none;
}

body.article aside.toc.sidebar .toc-menu ul > li[data-level] > a.is-active {
  color: var(--kf-accent-deep, #c2390f);
  font-weight: 500;
  background: none;
}

/* ── Version bar (partials/nav-explore.hbs) ───────────────────────── */

/* Replaces the bundle's "explore" panel at the foot of the sidebar, which
   listed every product with every version. Shown only when the product has
   more than one version; pinned to the bottom of the sidebar. */

/* On desktop .nav-container is the fixed, scrolling box (layout-scroll.css)
   and aside.nav is height:auto, so let aside.nav grow to fill the container;
   .panels (a flex column) then has room to push the bar down, and sticky
   keeps it in view on a long nav tree. */
@media screen and (min-width: 1024px) {
  .nav-container {
    display: flex;
    flex-direction: column;
  }

  .nav-container .nav {
    flex: 1 0 auto;
  }
}

.nav .panels {
  display: flex;
  flex-direction: column;
}

.nav .panels .kf-version-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-top: 1px solid var(--kf-rule, #e7e9ee);
  background: #fff;
  font-family: var(--kf-nav-font, inherit);
  font-size: 13px;
  line-height: 1.4;
  color: var(--kf-nav-muted, #6b7280);
}

.nav .panels .kf-version-bar__product {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav .panels .kf-version-bar__version,
.nav .panels .kf-version-picker {
  margin-left: auto;
  flex-shrink: 0;
}

.nav .panels .kf-version-bar__version,
.nav .panels .kf-version-picker__current {
  color: var(--kf-nav-text, #3b414c);
  font-weight: 500;
}

.nav .panels .kf-version-picker {
  position: relative;
}

.nav .panels .kf-version-picker__current {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav .panels .kf-version-picker__current::-webkit-details-marker {
  display: none;
}

.nav .panels .kf-version-picker__current:hover,
.nav .panels .kf-version-picker[open] > .kf-version-picker__current {
  background: var(--kf-nav-hover, rgba(242, 80, 34, 0.06));
}

.nav .panels .kf-version-picker__current:focus-visible {
  outline: 2px solid var(--kf-accent, #F25022);
  outline-offset: 1px;
}

.nav .panels .kf-version-picker__current::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

/* Opens upward: the bar sits at the bottom of the sidebar. */
.nav .panels .kf-version-picker__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 11rem;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--kf-rule, #e7e9ee);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.nav .panels .kf-version-picker__item {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--kf-nav-strong, #14171f);
  text-decoration: none;
  white-space: nowrap;
}

.nav .panels .kf-version-picker__item:hover {
  background: var(--kf-nav-hover, rgba(242, 80, 34, 0.06));
}

.nav .panels .kf-version-picker__item.is-current {
  background: var(--kf-nav-tint, rgba(242, 80, 34, 0.09));
  color: var(--kf-accent-deep, #C2390F);
  font-weight: 600;
}

/* This page does not exist in that version; the link goes to its start page. */
.nav .panels .kf-version-picker__item.is-missing {
  color: var(--kf-nav-muted, #6b7280);
}
