/*
 * Chrome of the host page: side menu, content area and the usage block.
 *
 * Written in plain CSS on purpose. This page stands in for the GetNet portal, and the
 * portal will not import our SCSS or our design tokens — it loads `main.js` and nothing
 * else. Styling the chrome with the design system would make the page prove less than
 * it claims: we would be demonstrating the components inside our own theme instead of
 * inside a stranger's page.
 *
 * Everything here is namespaced under `.host-` so nothing collides with the tokens the
 * bundle's own `styles.css` puts on `:root` and on element selectors.
 */

:root {
  --host-brand: #ec0000;
  --host-ink: #1a1a1a;
  --host-muted: #666666;
  --host-line: #e0e0e0;
  --host-surface: #ffffff;
  --host-canvas: #f7f7f7;
  --host-code-bg: #1e1e1e;
  --host-code-ink: #e8e8e8;
  --host-menu-width: 232px;
}

body {
  margin: 0;
  background: var(--host-canvas);
  color: var(--host-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.host {
  display: grid;
  grid-template-columns: var(--host-menu-width) 1fr;
  min-height: 100vh;
}

/* Side menu */

.host-menu {
  background: var(--host-surface);
  border-right: 1px solid var(--host-line);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.host-menu__brand {
  padding: 0 24px;
}

.host-menu__logo {
  max-width: 120px;
  height: auto;
}

.host-menu__nav {
  display: flex;
  flex-direction: column;
}

.host-menu__item {
  appearance: none;
  background: none;
  border: 0;
  border-left: 4px solid transparent;
  color: var(--host-ink);
  cursor: pointer;
  font: inherit;
  padding: 12px 24px;
  text-align: left;
}

.host-menu__item:hover {
  background: var(--host-canvas);
}

.host-menu__item[aria-current="page"] {
  border-left-color: var(--host-brand);
  color: var(--host-brand);
  font-weight: 700;
}

.host-menu__footer {
  border-top: 1px solid var(--host-line);
  color: var(--host-muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: auto;
  padding: 16px 24px 0;
}

.host-menu__status {
  font-weight: 700;
}

.host-menu__status--ok { color: #167f3d; }
.host-menu__status--error { color: var(--host-brand); }

/* Content */

.host-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 32px 48px;
}

.host-content__header {
  border-bottom: 1px solid var(--host-line);
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.host-content__title {
  font-size: 24px;
  margin: 0 0 4px;
}

.host-content__tag {
  color: var(--host-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
}

/*
 * The mount point. `min-height` keeps the usage block from jumping up the page while
 * the component is still fetching — without it the block sits under the title on load
 * and slides down a second later.
 */
.host-mount {
  min-height: 320px;
}

/* Usage block */

.host-usage {
  border-top: 1px solid var(--host-line);
  margin-top: 48px;
  padding-top: 24px;
}

.host-usage__title {
  font-size: 16px;
  margin: 0 0 4px;
}

.host-usage__lead {
  color: var(--host-muted);
  font-size: 14px;
  margin: 0 0 16px;
  max-width: 80ch;
}

.host-usage__step {
  margin-bottom: 20px;
}

.host-usage__step-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
}

.host-usage__note {
  color: var(--host-muted);
  font-size: 13px;
  margin: 8px 0 0;
  max-width: 80ch;
}

/*
 * Simulation scaffolding. Visually set apart from the steps on purpose: it explains how
 * this page fakes a portal, and reading it as part of the integration is the confusion
 * this styling exists to prevent.
 */
.host-usage__simulation {
  background: var(--host-canvas);
  border-left: 4px solid var(--host-line);
  color: var(--host-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 24px 0 0;
  max-width: 80ch;
  padding: 12px 16px;
}

.host-usage__code {
  background: var(--host-code-bg);
  border-radius: 6px;
  color: var(--host-code-ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  overflow-x: auto;
  padding: 16px;
  white-space: pre;
}

@media (max-width: 900px) {
  .host {
    grid-template-columns: 1fr;
  }

  .host-menu {
    height: auto;
    position: static;
  }
}
