/* Base AsciiDoc structure + HB fonts */
@import "https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&family=Noto+Serif:ital,wght@0,400;0,700;1,400&display=swap";
@import "https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor@2.0/data/stylesheets/asciidoctor-default.css";
@import "https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap";

/* Hellbender design tokens */
:root {
  --hb-teal:       #215b6d;
  --hb-teal-dark:  #164454;
  --hb-teal-light: #d4e8ee;
  --hb-bg:         #f4f6f2;
  --hb-surface:    #ffffff;
  --hb-ink:        #1a2822;
  --hb-muted:      #4e6158;
  --hb-line:       #d0d9d4;
  --hb-accent:     #ba3925;
  --hb-topbar-h:   60px;
}

*, *::before, *::after { box-sizing: border-box; }
/* Reserve space for the sticky topbar so anchor jumps don't hide the heading behind it */
html { scroll-behavior: smooth; scroll-padding-top: var(--hb-topbar-h); }
body {
  margin: 0;
  color: var(--hb-ink);
  font-family: 'Barlow', sans-serif;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hb-teal);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  height: var(--hb-topbar-h);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
}
.brand:hover { color: var(--hb-teal-light); }
.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.brand-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.topbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
}
.component-title { font-weight: 600; }
.version-badge {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  color: #fff;
}
.version-switcher {
  position: relative;
}
.version-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 0.15rem 0.75rem;
  font-size: 0.8rem;
  color: #fff;
  cursor: pointer;
  line-height: 1.4;
}
.version-button:hover {
  background: rgba(255,255,255,0.26);
}
.version-button::after {
  content: "\25BE";
  font-size: 0.7rem;
}
.version-switcher.is-open .version-button::after {
  content: "\25B4";
}
.version-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  min-width: 8rem;
  background: #fff;
  border: 1px solid var(--hb-line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
  display: none;
  overflow: hidden;
  z-index: 200;
}
.version-item {
  display: block;
  padding: 0.45rem 0.7rem;
  color: var(--hb-teal-dark);
  text-decoration: none;
  font-size: 0.82rem;
  border-bottom: 1px solid #eef2f0;
}
.version-item:last-child {
  border-bottom: 0;
}
.version-item:hover {
  background: var(--hb-teal-light);
  color: var(--hb-teal-dark);
}
.version-switcher.is-open .version-menu {
  display: block;
}
.download-link {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  color: #fff;
  text-decoration: none;
  line-height: 1.4;
}
.download-link:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Page layout */
.page-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Content area */
.content-area {
  padding: 1.75rem 0 3rem;
}

/* Article - two-column grid: TOC sidebar | content */
.doc {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto;
  align-items: start;
  gap: 0 2rem;
  background: linear-gradient(to right, var(--hb-teal) 0, var(--hb-teal) 260px, var(--hb-surface) 260px, var(--hb-surface) 100%);
  /* Disable the border frame. Leaving it here, in case we decide to re-enable it later. */
  /* border: 1px solid var(--hb-line); */
  /* border-radius: 14px; */
  /* box-shadow: 0 8px 24px rgba(33,91,109,0.07); */
  padding: 0;
  max-width: 1100px;
}

/* TOC occupies left column and sticks while scrolling */
#toc {
  grid-column: 1;
  grid-row: 1 / 9999;
  margin: 0;
  padding: 1.5rem 1rem;
  align-self: start;
  position: sticky;
  top: var(--hb-topbar-h);
  max-height: calc(100vh - var(--hb-topbar-h));
  overflow-y: auto;
  background: var(--hb-teal);
}

/* All other article elements go in the right column */
#toc ~ * {
  grid-column: 2;
  padding-right: 2.25rem;
}

/* First element after TOC gets top padding */
#toc + * {
  padding-top: 2rem;
}

/* Last element gets bottom padding */
.doc > *:last-child {
  padding-bottom: 2rem;
}

/* AsciiDoc headings */
h1, h2, h3, h4, h5, h6,
.sidebarblock > .content > .title {
  color: var(--hb-accent);
  font-family: 'Barlow', sans-serif;
  font-weight: 500;  
}
a { color: var(--hb-teal); }
a:hover { color: var(--hb-teal-dark); }

/* TOC sidebar styling */
#toctitle {
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}
.toc-doc-identity {
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.85rem;
  margin-bottom: 0.9rem;
}
.toc-doc-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}
.toc-doc-meta {
  margin-top: 0.35rem;
  color: rgba(255,255,255,0.78);
  font-size: 0.75rem;
  line-height: 1.3;
}
#toc a { color: rgba(255,255,255,0.85); text-decoration: none; }
#toc a:hover { color: #fff; text-decoration: underline; }
#toc ul { list-style: none; padding-left: 0.75rem; margin: 0; }
#toc > ul { padding-left: 0; }
#toc li { margin: 0.25rem 0; font-size: 0.875rem; line-height: 1.4; }

/* Sub-levels start collapsed; JS toggles .is-expanded on click (see default.hbs) */
#toc li ul {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.1s ease, opacity 0.2s ease, visibility 0s linear 0.1s;}
#toc li.is-expanded > ul {
  /* Copilot suggested removing the max-height property, but the expand/collapse animation
     doesn't work without it. The max-height is set to a large value to accommodate the largest possible TOC. */
  max-height: 1000px;
  opacity: 1;
  visibility: visible;
}

/* Arrow indicator for entries that have a nested level, rotates open on expand.
   Reserved on every item (hidden when unused) so labels stay aligned. */
#toc li > a::before {
  content: "›";
  color: #fff;
  width: 0.7em;
  margin-right: 0.4em;
  font-size: 0.85em;
  display: inline-block;
  visibility: hidden;
  transition: transform 0.2s ease;
}
#toc li:has(> ul) > a::before {
  visibility: visible;
}
#toc li.is-expanded > a::before {
  transform: rotate(90deg);
}

.bordered-image img {
  border: 1px solid #DDDDDD;
  border-radius: 4px;
}

/* Code */
pre, pre.highlight, .listingblock pre {
  background: #f7f7f8;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
}
code {
  background: #f7f7f8;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}
pre code { background: none; padding: 0; }

/* Tables */
table.tableblock { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; }
table.tableblock th {
  background: var(--hb-teal);
  color: #fff;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
table.tableblock td { padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--hb-line); }

/* Admonitions */
.admonitionblock {
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
/* Admonition icons use the PNGs in resources/icons (bundled to assets/img/icons); the
   FA glyph markup asciidoctor emits is repurposed as an image swap, not a font. */
.admonitionblock td.icon [class^="fa icon-"]::before {
  content: none;
}
.admonitionblock td.icon [class^="fa icon-"] {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  background: no-repeat center / contain;
}
.admonitionblock td.icon .icon-note { background-image: url(../img/icons/note.png); }
.admonitionblock td.icon .icon-tip { background-image: url(../img/icons/tip.png); }
.admonitionblock td.icon .icon-warning { background-image: url(../img/icons/warning.png); }
.admonitionblock td.icon .icon-caution { background-image: url(../img/icons/caution.png); }
.admonitionblock td.icon .icon-important { background-image: url(../img/icons/important.png); }
.admonitionblock td.content { color: var(--hb-teal-dark); }

/* Images */
.doc img { max-width: 100%; height: auto; border-radius: 6px; }

/* Responsive */
@media (max-width: 768px) {
  .page-layout { padding: 0 0.75rem; }
  .content-area { padding: 1rem 0; }
  .brand-name { display: none; }
  .doc {
    grid-template-columns: 1fr;
    background: var(--hb-surface);
  }
  #toc {
    grid-row: auto;
    position: static;
    max-height: none;
  }
  #toc ~ * {
    grid-column: 1;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }
}
