/*
  The Ratgeber: public help pages rendered by the server (docs/design/ratgeber.md). Loaded after bsft-ui.css,
  hauswerk.css and public.css, whose tokens, cards, bar and footer it uses; this file lays out the overview, the article
  with its sidebar and table of contents, and the screenshots in their phone frame.
*/

.hw-guide {
  --hw-guide-phone-bezel: #18211C;
  --hw-guide-phone-edge: rgba(255, 255, 255, 0.07);
  --hw-guide-phone-shadow: 0 22px 44px rgba(27, 38, 32, 0.20), 0 3px 8px rgba(27, 38, 32, 0.16);
  --hw-guide-phone-width: 232px;

  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  flex: 1;
  align-content: start;
  padding: 4px 16px 40px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bsft-theme="light"]) .hw-guide {
    --hw-guide-phone-bezel: #35423A;
    --hw-guide-phone-edge: rgba(255, 255, 255, 0.10);
    --hw-guide-phone-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.35);
  }
}

:root[data-bsft-theme="dark"] .hw-guide {
  --hw-guide-phone-bezel: #35423A;
  --hw-guide-phone-edge: rgba(255, 255, 255, 0.10);
  --hw-guide-phone-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.35);
}

@container hw-viewport (min-width: 960px) {
  .hw-guide {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    padding-top: 12px;
  }
}

@container hw-viewport (min-width: 1240px) {
  .hw-guide-with-toc {
    grid-template-columns: 240px minmax(0, 1fr) 210px;
  }
}

.hw-guide a:not([class]) {
  color: var(--bsft-color-primary);
  font-weight: 700;
  text-underline-offset: 2px;
}

/* --- sidebar -------------------------------------------------------------------- */

.hw-guide-nav {
  align-self: start;
}

.hw-guide-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
  background: var(--bsft-color-surface);
  font-family: var(--hw-font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.hw-guide-nav-toggle::-webkit-details-marker {
  display: none;
}

.hw-guide-nav-toggle::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s ease;
}

.hw-guide-nav[open] .hw-guide-nav-toggle::after {
  transform: rotate(225deg) translateY(-2px);
}

.hw-guide-nav-groups {
  margin-top: 8px;
  padding: 8px 8px 12px;
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
  background: var(--bsft-color-surface);
}

.hw-guide-nav-group + .hw-guide-nav-group {
  margin-top: 10px;
}

.hw-guide-nav-group-title {
  margin: 6px 10px 4px;
  color: var(--bsft-color-muted);
  font-family: var(--hw-font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hw-guide-nav-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hw-guide-nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--bsft-color-text);
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
}

.hw-guide-nav-link:hover {
  background: var(--hw-surface-2);
}

.hw-guide-nav-link[aria-current="page"] {
  background: var(--hw-accent-soft);
  color: var(--bsft-color-primary);
  font-weight: 700;
}

@container hw-viewport (min-width: 960px) {
  .hw-guide-nav {
    position: sticky;
    top: 16px;
    max-height: calc(100dvh / var(--hw-zoom) - 32px);
    overflow-y: auto;
  }

  .hw-guide-nav-toggle {
    display: none;
  }

  .hw-guide-nav-groups {
    margin-top: 0;
    border: 0;
    background: transparent;
    padding: 0;
  }
}

/* --- search ---------------------------------------------------------------------- */

.hw-guide-search {
  position: relative;
  margin-bottom: 12px;
}

.hw-guide-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--bsft-color-border);
  border-radius: 999px;
  background: var(--bsft-color-surface);
  color: var(--bsft-color-text);
  font: inherit;
  font-size: 16px;
}

.hw-guide-search input:focus-visible {
  outline: 2px solid var(--bsft-color-primary);
  outline-offset: 1px;
}

.hw-guide-search-results {
  margin: 8px 0 0;
  padding: 6px;
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
  background: var(--bsft-color-surface);
  list-style: none;
}

.hw-guide-search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--bsft-color-text);
  text-decoration: none;
}

.hw-guide-search-results a:hover,
.hw-guide-search-results a:focus-visible {
  background: var(--hw-surface-2);
}

.hw-guide-search-results small {
  display: block;
  color: var(--bsft-color-muted);
  font-size: 13px;
}

/* --- article ---------------------------------------------------------------------- */

.hw-guide-article {
  min-width: 0;
  padding: 20px 18px 28px;
}

@container hw-viewport (min-width: 720px) {
  .hw-guide-article {
    padding: 32px 40px 40px;
  }
}

.hw-guide-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px;
  padding: 0;
  color: var(--bsft-color-muted);
  font-size: 14px;
  list-style: none;
}

.hw-guide-breadcrumb li + li::before {
  content: "›";
  margin-right: 4px;
}

.hw-guide-breadcrumb a {
  color: inherit;
  text-underline-offset: 2px;
}

.hw-guide-article h1 {
  margin: 0;
  font-size: clamp(30px, 7cqi, 42px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hw-guide-lead {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--bsft-color-muted);
  font-size: 18px;
  line-height: 1.5;
}

.hw-guide-updated {
  margin: 10px 0 0;
  color: var(--bsft-color-muted);
  font-size: 14px;
}

.hw-guide-body {
  display: flow-root;
  max-width: 74ch;
  margin-top: 24px;
  font-size: 17px;
  line-height: 1.6;
}

.hw-guide-body > :first-child {
  margin-top: 0;
}

.hw-guide-body h2 {
  clear: both;
  margin: 36px 0 10px;
  font-size: 25px;
  line-height: 1.2;
  scroll-margin-top: 16px;
}

.hw-guide-body h3 {
  margin: 24px 0 6px;
  font-size: 19px;
  line-height: 1.25;
  scroll-margin-top: 16px;
}

.hw-guide-body p {
  margin: 0 0 14px;
}

/* A list beside a screenshot keeps its markers next to the text instead of under the picture. */
.hw-guide-body ul,
.hw-guide-body ol {
  display: flow-root;
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.hw-guide-body li + li {
  margin-top: 6px;
}

.hw-guide-body li::marker {
  color: var(--bsft-color-primary);
  font-weight: 700;
}

.hw-guide-body code,
.hw-guide-body kbd {
  padding: 1px 6px;
  border: 1px solid var(--bsft-color-border);
  border-radius: 6px;
  background: var(--hw-surface-2);
  font-family: var(--hw-font-mono);
  font-size: 0.88em;
}

.hw-guide-body blockquote {
  display: flow-root;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--bsft-color-primary);
  border-radius: 0 12px 12px 0;
  background: var(--hw-accent-soft);
}

.hw-guide-body blockquote > :last-child {
  margin-bottom: 0;
}

.hw-guide-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 15px;
}

.hw-guide-body th,
.hw-guide-body td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bsft-color-border);
  text-align: left;
  vertical-align: top;
}

.hw-guide-body th {
  font-family: var(--hw-font-display);
}

/* --- screenshots in a phone frame --------------------------------------------------- */

.hw-shot {
  width: min(76%, 290px);
  margin: 8px auto 24px;
}

@container hw-viewport (min-width: 720px) {
  .hw-shot {
    width: var(--hw-guide-phone-width);
  }

  .hw-shot-right {
    float: right;
    margin: 6px 0 20px 32px;
  }

  .hw-shot-left {
    float: left;
    margin: 6px 32px 20px 0;
  }
}

.hw-phone {
  position: relative;
  padding: 8px;
  border-radius: 36px;
  background: var(--hw-guide-phone-bezel);
  box-shadow: inset 0 0 0 1px var(--hw-guide-phone-edge), var(--hw-guide-phone-shadow);
}

/* The punch-hole camera. */
.hw-phone::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 50%;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #080C0A;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
  transform: translateX(-50%);
}

/* The side buttons. */
.hw-phone::after {
  content: "";
  position: absolute;
  top: 22%;
  right: -3px;
  width: 3px;
  height: 11%;
  border-radius: 0 3px 3px 0;
  background: var(--hw-guide-phone-bezel);
}

.hw-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  background: var(--hw-ground);
}

.hw-shot figcaption {
  margin-top: 12px;
  color: var(--bsft-color-muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}

/* --- table of contents ------------------------------------------------------------- */

.hw-guide-toc {
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
  background: var(--hw-surface-2);
}

.hw-guide-toc summary {
  font-family: var(--hw-font-display);
  font-weight: 700;
  cursor: pointer;
}

.hw-guide-toc ol {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.hw-guide-toc li {
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.3;
}

.hw-guide-toc .hw-guide-toc-sub {
  padding-left: 14px;
  font-size: 14px;
}

.hw-guide-toc a {
  color: var(--bsft-color-text);
  text-decoration: none;
}

.hw-guide-toc a:hover {
  color: var(--bsft-color-primary);
  text-decoration: underline;
}

.hw-guide-aside {
  display: none;
}

@container hw-viewport (min-width: 1240px) {
  .hw-guide-toc-inline {
    display: none;
  }

  .hw-guide-aside {
    display: block;
    align-self: start;
    position: sticky;
    top: 16px;
  }

  .hw-guide-aside .hw-guide-toc {
    margin: 0;
    border: 0;
    background: transparent;
  }

  .hw-guide-aside-title {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--bsft-color-muted);
    font-family: var(--hw-font-body);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

/* --- related pages and overview ------------------------------------------------------ */

.hw-guide-related {
  clear: both;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--bsft-color-border);
}

.hw-guide-related h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.hw-guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hw-guide-card {
  display: block;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
  background: var(--bsft-color-surface);
  color: var(--bsft-color-text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hw-guide-card:hover {
  border-color: var(--bsft-color-primary);
  transform: translateY(-1px);
}

.hw-guide-card strong {
  display: block;
  font-family: var(--hw-font-display);
  font-size: 17px;
  line-height: 1.25;
}

.hw-guide-card span {
  display: block;
  margin-top: 4px;
  color: var(--bsft-color-muted);
  font-size: 14px;
  line-height: 1.4;
}

.hw-guide-overview {
  min-width: 0;
}

.hw-guide-overview-head {
  padding: 16px 0 8px;
}

.hw-guide-overview-head h1 {
  margin: 0;
  font-size: clamp(36px, 9cqi, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--bsft-color-primary);
}

.hw-guide-overview-section {
  margin-top: 28px;
}

.hw-guide-overview-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

/* --- not found ---------------------------------------------------------------------- */

.hw-guide-missing {
  max-width: 640px;
  margin: 24px auto;
  padding: 28px 24px;
  text-align: center;
}

.hw-guide-missing h1 {
  margin: 0 0 10px;
  font-size: 32px;
}

.hw-guide-missing p {
  margin: 0 0 18px;
  color: var(--bsft-color-muted);
}

.hw-guide-missing .hw-public-actions {
  justify-content: center;
}

/* --- bar and footer ------------------------------------------------------------------ */

/* The Ratgeber is wider than the other public pages; the bar and the footer line up with its sidebar. */
.hw-public:has(.hw-guide) .hw-public-bar,
.hw-public:has(.hw-guide) .hw-public-footer {
  max-width: 1180px;
}
