:root {
  --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;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  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;
}

main {
  counter-reset: section appendix-section;
}

h5 {
  margin-bottom: 10px;
}

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

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

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

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

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

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

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

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-dark);
}

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

.site-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));
}

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

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

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

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

.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;
}

.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);
}

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

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

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

.toc a {
  text-decoration: none;
}

.content {
  min-width: 0;
}

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

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

.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;
}

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

.manual-footer p {
  margin: 0;
}

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

.hero-image {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: nowrap;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.hero-image img {
  display: block;
}

.hero-image .hero-logo,
.hero-image .hero-radio {
  height: clamp(8.5rem, 16vw, 11.5rem);
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto;
}

.hero-image .hero-radio {
  margin-left: auto;
}

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

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

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

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

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

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

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

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

.product-name {
  font-family: "Avenir Next Rounded", "Nunito", "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 500;
  color: #b27615;
  white-space: nowrap;
}

.term {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.83rem;
  color: #a26605;
}

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

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

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

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

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

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

kbd {
  display: inline-block;
  padding: 0.08em 0.25em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background: #222;
  border: 1px solid #555;
  border-radius: 0.15em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 0 rgba(0,0,0,0.25);
  white-space: nowrap;
}

.menu-item {
  display: inline-block;
  padding: 0.0em 0.1em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.8em;
  font-weight: 400;
  color: #000000;
/*  background: #ffebcc;*/
  border: 1px solid #d8b46a;
  border-radius: 0.2em;
  white-space: nowrap;
}

.menu-value {
  display: inline-block;
  padding: 0.0em 0.1em;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.8em;
  font-weight: 400;
  color: #000000;
/*  background: #fff5e6;*/
  border: 1px dashed #d8b46a;
  border-radius: 0.2em;
  white-space: nowrap;
}

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

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

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

.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);
}

.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);
}

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

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

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

.label-table--equal {
  table-layout: fixed;
}

.label-table th {

}

.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;
}

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


/* Clickable image thumbnail wrapper.
 * - Keeps the zoom badge anchored to the image.
 * - Uses line-height: 0 to remove extra inline spacing around image links. */
.clickable-image {
  position: relative;
  display: inline-block;
  line-height: 0;
}

/* Thumbnail image baseline behavior for linked images. */
.clickable-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Zoom affordance badge shown over clickable thumbnails. */
.clickable-image::after {
  content: "🔍";
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 2;

  width: 2rem;
  height: 2rem;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.05rem;
  line-height: 1;
  color: #2c2418;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(44, 36, 24, 0.38);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(1px);

  transition:
    transform 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Hover state for zoom badge to signal interactivity. */
.clickable-image:hover::after {
  color: #1f1910;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(44, 36, 24, 0.55);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  transform: scale(1.08);
}

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

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

/* Full-screen lightbox overlay backdrop.
 * Hidden by default; toggled visible by adding .is-open in JS. */
.image-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(30, 30,30, 0.7);
  z-index: 2000;
}

/* Active/open state for lightbox overlay. */
.image-lightbox.is-open {
  display: flex;
}

/* Structural lightbox container for sizing/positioning only.
 * Visual card styling is on .image-lightbox__img. */
.image-lightbox__dialog {
  position: relative;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
}

/* Enlarged image constraints:
 * fit viewport while preserving aspect ratio. */
.image-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 0.4rem;
  background: rgba(150,150,150, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Circular close button ("X") positioned at pane corner. */
.image-lightbox__close {
  position: absolute;
  top: -0.8rem;
  right: -0.8rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(44, 36, 24, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #2c2418;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

/* Hover/focus states for close button, including keyboard-visible focus ring. */
.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
  background: #fff;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Container: list on the left, images on the right */
.list-with-images {
  display: flex;
  align-items: flex-start;   /* top-align list and images */
  gap: 1rem;                 /* space between list and image column */
}

/* Ensure list formatting looks normal */
.list-with-images ul {
  margin: 0;
  padding-left: 1.5rem;      /* standard bullet indentation */
}

/* Image column (stacked vertically) */
.image-stack {
  display: flex;
  flex-direction: column;    /* stack images vertically */
  gap: 0.5rem;              /* space between images */
  flex-shrink: 0;           /* prevent images from shrinking */
}

/* Make images behave nicely */
.image-stack img {
  display: block;           /* removes inline spacing quirks */
  max-width: 100%;          /* ensures responsiveness if width not fixed */
  height: auto;             /* maintain aspect ratio */
}

/* Optional: clickable image wrapper */
.image-stack a {
  display: inline-block;
}

/* Responsive: stack everything vertically on small screens */
@media (max-width: 600px) {
  .list-with-images {
    flex-direction: column;
  }

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

  .image-stack {
    flex-direction: row;    /* optional: images side-by-side on mobile */
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

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

  .toc__inner {
    position: static;
  }
}

@media print {
  body {
    background: #fff;
  }

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

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

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

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

  /* Never print interactive lightbox overlay. */
  .image-lightbox {
    display: none !important;
  }
}
