@import url("./shared.css");

body.manual-page {
  --bg: #f4f0e6;
  --panel: #fffdf7;
  --ink: #2c2418;
  --muted: #6b5b42;
  --line: #d8c9ab;
  --accent: #c78417;
  --accent-dark: #8d5a09;
  --shadow: 0 18px 40px rgba(44, 36, 24, 0.08);
  --max-width: 76rem;
  --toc-width: 18rem;
  margin: 0;
  background: linear-gradient(180deg, #f6f1e6 0%, #f2ecdf 40%, #efe7d7 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

body.manual-page * {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.manual-page main {
  counter-reset: section appendix-section;
}

body.manual-page h5 {
  margin-bottom: 10px;
}

body.manual-page p.list-intro,
body.manual-page div.list-intro {
  margin-bottom: 0;
}

body.manual-page .manual-section .list-intro + ul,
body.manual-page .manual-section .list-intro + ol,
body.manual-page .hero-block .list-intro + ul,
body.manual-page .hero-block .list-intro + ol {
  margin-top: 0;
}

body.manual-page .manual-section li > p.list-intro {
  margin: 0;
}

body.manual-page .manual-section li > p.list-intro + ul,
body.manual-page .manual-section li > p.list-intro + ol {
  margin-top: 0.35rem;
}

body.manual-page .manual-section li.list-intro > ul,
body.manual-page .manual-section li.list-intro > ol {
  margin-top: 0;
}

body.manual-page .manual-section:not(.appendix-section):not(.appendix):not([data-appendix="true"]) > h2::before {
  counter-increment: section;
  content: counter(section) ". ";
}

body.manual-page .appendix-section > h2::before,
body.manual-page .appendix > h2::before,
body.manual-page [data-appendix="true"] > h2::before {
  counter-increment: appendix-section;
  content: "A" counter(appendix-section) ". ";
}

body.manual-page .layout img {
  max-width: 100%;
  height: auto;
}

body.manual-page .layout a {
  color: var(--accent-dark);
}

body.manual-page code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  background: #f9f5eb;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8em;
}

.manual-header {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(199, 132, 23, 0.16), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 253, 247, 0.9));
}

.manual-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}

.manual-eyebrow {
  margin: 0 0 0.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.manual-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.1;
}

.manual-intro {
  max-width: 48rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
}

body.manual-page .layout {
  display: grid;
  grid-template-columns: minmax(0, var(--toc-width)) minmax(0, 1fr);
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

body.manual-page .toc__inner {
  position: sticky;
  top: 1rem;
  padding: 1rem 1rem 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 253, 247, 0.86);
  box-shadow: var(--shadow);
}

body.manual-page .toc h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

body.manual-page .toc ol {
  margin: 0;
  padding-left: 0;
  font-size: 0.94rem;
  list-style: none;
}

body.manual-page .toc li + li {
  margin-top: 0.35rem;
}

body.manual-page .toc a {
  text-decoration: none;
}

body.manual-page .content {
  min-width: 0;
}

body.manual-page .manual-section,
body.manual-page .hero-block {
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

body.manual-page .manual-section + .manual-section,
body.manual-page .hero-block + .manual-section {
  margin-top: 1.5rem;
}

body.manual-page .manual-footer {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 253, 247, 0.8);
  color: var(--muted);
  font-size: 0.9rem;
}

body.manual-page .manual-footer h2 {
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
  color: var(--ink);
}

body.manual-page .manual-footer p {
  margin: 0;
}

body.manual-page .hero-block {
  margin-bottom: 1.5rem;
}

body.manual-page .hero-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
  min-width: 0;
}

body.manual-page .hero-image img {
  display: block;
}

body.manual-page .hero-image .hero-logo {
  width: min(100%, 26rem) !important;
  height: auto !important;
  max-width: 100% !important;
  min-width: 0;
}

body.manual-page .hero-image .hero-radio {
  width: auto !important;
  height: clamp(8.5rem, 16vw, 11.5rem);
  max-width: min(32vw, 10rem) !important;
  justify-self: end;
}

body.manual-page .manual-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.15;
}

body.manual-page .manual-section h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.55rem;
  font-size: 1.16rem;
}

body.manual-page .manual-section p,
body.manual-page .manual-section ul,
body.manual-page .manual-section ol,
body.manual-page .hero-block p {
  margin-top: 0.7rem;
  margin-bottom: 0.7rem;
}

body.manual-page .manual-section p.list-intro,
body.manual-page .hero-block p.list-intro {
  margin-bottom: 0;
}

body.manual-page .manual-section ul,
body.manual-page .manual-section ol {
  padding-left: 1.35rem;
}

body.manual-page .manual-section li + li {
  margin-top: 0.25rem;
}

body.manual-page .indented-list {
  margin-left: 2em;
}

body.manual-page .placeholder {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px dashed #c8a76b;
  border-radius: 0.8rem;
  background: #fff7e6;
  color: var(--muted);
  font-style: italic;
}

body.manual-page .smallhead {
  font-weight: bold;
  font-size: 0.83em;
}

body.manual-page .heading-aside {
  font-size: 0.9em;
}

body.manual-page .issue-ref {
  text-decoration: none;
  display: inline-block;
  line-height: 1;
}

body.manual-page .issue-ref:hover,
body.manual-page .issue-ref:focus-visible {
  text-decoration: none;
  color: red;
}

body.manual-page .circled-item {
  position: relative;
  padding-left: 2.1em;
  margin: 0.4rem 0;
}

body.manual-page .marker {
  position: absolute;
  left: 0;
  top: 0.30em;
  display: inline-block;
  line-height: 1.2;
}

body.manual-page .menu-items-list {
  list-style: none;
  margin: 0.7rem 0;
  padding-left: 0;
  counter-reset: menu-item-number;
}

body.manual-page .menu-items-group {
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
  font-weight: 700;
  color: var(--muted);
}

body.manual-page .menu-items-entry {
  position: relative;
  margin: 0.15rem 0;
  padding-left: 2.2rem;
}

body.manual-page .menu-items-entry::before {
  counter-increment: menu-item-number;
  content: counter(menu-item-number) ".";
  position: absolute;
  left: 0;
  width: 1.8rem;
  text-align: right;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--muted);
}

body.manual-page .table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  border: 1px solid var(--line);
}

body.manual-page .table th,
body.manual-page .table td {
  border: 1px solid var(--line);
  padding: 0.1rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

body.manual-page .table th {
  background: #f3ebda;
  font-weight: 700;
}

body.manual-page .label-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

body.manual-page .label-table--equal {
  table-layout: fixed;
}

body.manual-page .label-table td {
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #d0d0d0;
}

body.manual-page .label-table th {
  background: #f3f3f3;
  font-weight: 600;
}

body.manual-page .inline-figure-right {
  float: right;
  width: min(18%, 9rem);
  margin: 0.15rem 0 0.65rem 1rem;
}

body.manual-page .inline-figure-right img {
  display: block;
  width: 100%;
  height: auto;
}

body.manual-page .receiver-label-figure {
  width: min(28%, 14rem);
}

body.manual-page .list-with-images {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

body.manual-page .list-with-images ul {
  margin: 0;
  padding-left: 1.5rem;
}

body.manual-page .image-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

body.manual-page .image-stack img {
  display: block;
  max-width: 100%;
  height: auto;
}

body.manual-page .image-stack a {
  display: inline-block;
}

@media (max-width: 600px) {
  body.manual-page .hero-image {
    grid-template-columns: 1fr;
  }

  body.manual-page .hero-image .hero-logo,
  body.manual-page .hero-image .hero-radio {
    justify-self: start;
  }

  body.manual-page .list-with-images {
    flex-direction: column;
  }

  body.manual-page .inline-figure-right {
    float: none;
    width: min(45%, 10rem);
    margin: 0.4rem 0 0.8rem;
  }

  body.manual-page .receiver-label-figure {
    width: min(70%, 14rem);
  }

  body.manual-page .image-stack {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 960px) {
  body.manual-page .layout {
    grid-template-columns: 1fr;
  }

  body.manual-page .toc__inner {
    position: static;
  }
}

@media print {
  body.manual-page {
    background: #fff;
  }

  body.manual-page .manual-header,
  body.manual-page .manual-section,
  body.manual-page .hero-block,
  body.manual-page .toc__inner {
    box-shadow: none;
    background: #fff;
  }

  body.manual-page .layout {
    display: block;
    max-width: none;
    padding: 0;
  }

  body.manual-page .toc {
    page-break-after: always;
  }

  body.manual-page .manual-section,
  body.manual-page .hero-block {
    border: none;
    padding: 0;
  }

  body.manual-page .image-lightbox {
    display: none !important;
  }
}
