/* ═══════════════════════════════════════════════════════════════════════════
   AllurePOS Website: guide.css (2026-10-05)
   The ESIR integration guide for ELV LPFR (lpfr-api.html, lpfr-api.en.html, generated by
   scripts/build-lpfr-guide.mjs). Linked after site.css and uses its tokens: a contents column beside
   the text from 1100px (folded above the text below that), tables that scroll sideways on a phone,
   code blocks with a copy key, notes, a task list, and the print / PDF layout (A4, light).
   ═══════════════════════════════════════════════════════════════════════════ */

.guide { padding-top: 24px; }

/* Lat / Ћир / EN are links here (EN is the other page): the same keys as the site's buttons. */
a.lang__btn { display: inline-flex; align-items: center; justify-content: center; }
.lang__btn[aria-current="true"] { background: rgba(255, 255, 255, 0.1); color: var(--ink); }

/* The other language and the PDF, above everything. */
.guide-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
}
.guide-banner a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent-text); font-weight: 700; }
.guide-banner .ti { font-size: 18px; }
@media (hover: hover) and (pointer: fine) { .guide-banner a:hover { color: var(--accent); } }

.guide__layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ── Contents ──────────────────────────────────────────────────────────── */

.guide-toc {
  position: sticky;
  top: calc(var(--head) + 24px);
  max-height: calc(100vh - var(--head) - 48px);
  margin-top: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  font-size: 14px;
}
.guide-toc > summary { display: none; }
.guide-toc__title {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--muted-2);
  font: 700 13px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.guide-toc ol { list-style: none; margin: 0; padding: 0; }
.guide-toc ol ol { margin: 2px 0 8px 12px; padding-left: 6px; border-left: 1px solid var(--line); }
.guide-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 600;
  line-height: 1.35;
}
.guide-toc ol ol a { color: var(--muted); font-weight: 500; }
.guide-toc a[aria-current] { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.guide-toc code { font: 500 0.92em/1 var(--font-mono); }
.guide-toc .src-tag { font-size: 0.82em; }
@media (hover: hover) and (pointer: fine) { .guide-toc a:hover { color: var(--accent); } }

@media (max-width: 1099px) {
  .guide__layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-toc {
    position: static;
    max-height: none;
    margin: 16px 0 0;
    overflow: visible;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--panel);
  }
  .guide-toc > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 16px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
  }
  .guide-toc > summary::-webkit-details-marker { display: none; }
  .guide-toc > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin: -4px 4px 0 0;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
  }
  .guide-toc[open] > summary { border-bottom: 1px solid var(--line); }
  .guide-toc[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
  .guide-toc__nav { max-height: 60vh; padding: 8px; overflow-y: auto; }
  .guide-toc__title { display: none; }
  .guide-toc a { display: flex; align-items: center; min-height: 44px; }
}

/* ── Text ──────────────────────────────────────────────────────────────── */

.guide__body { max-width: 840px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.guide__body .article__title { margin-top: 32px; }
.guide__lede { margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.guide__lede strong { color: var(--ink); }
.guide__web { display: none; }
.guide__body h2 { margin: 56px 0 14px; }
.guide__body h3 { margin: 36px 0 10px; font-size: 20px; line-height: 1.3; }
.guide__body hr { margin: 48px 0 0; border: 0; border-top: 1px solid var(--line); }
.guide__body ol { margin: 0 0 18px; padding-left: 24px; }
.guide__body li > p { margin: 0 0 10px; }
.guide__body li > ul, .guide__body li > ol { margin: 6px 0 10px; }
.guide__body a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .guide__body a:hover { color: var(--accent); } }
.guide__body code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: 500 0.86em/1.5 var(--font-mono);
  overflow-wrap: anywhere;
}

/* Heading anchors: a "#" after the heading, shown on hover (always faint on touch screens). */
.guide__body .anchor {
  margin-left: 0.35em;
  color: var(--muted-2);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.guide__body h2:hover .anchor, .guide__body h3:hover .anchor { opacity: 1; }
@media (hover: none) { .guide__body .anchor { opacity: 0.45; } }

/* [ELV] / [PURS]: where a rule comes from. */
.src-tag {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  color: var(--accent-text);
  font: 600 0.78em/1.6 var(--font-mono);
  vertical-align: 0.08em;
  white-space: nowrap;
}
.src-tag--purs { border-color: rgba(110, 219, 165, 0.4); color: var(--ok-text); }

/* Notes (the Markdown blockquotes): labels, glossary, warnings. */
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--accent-line);
  border-left-width: 4px;
  border-radius: 12px;
  background: var(--panel);
}
.callout > :last-child { margin-bottom: 0; }
.callout__title { margin: 0 0 10px; color: var(--ink); font-size: 17px; font-weight: 800; }
.callout .table-wrap { background: var(--bg); }

/* Checklist before going live. */
.guide__body .tasks { padding-left: 0; list-style: none; }
.tasks li { margin: 10px 0; }
.tasks label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.tasks input { flex: none; width: 20px; height: 20px; margin: 4px 0 0; accent-color: var(--accent); }

/* ── Tables: scroll sideways on a phone ────────────────────────────────── */

.table-wrap {
  margin: 8px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
/* Below these widths a table scrolls sideways instead of squeezing its columns (phones); all fit the 840px text column. */
.table-wrap .t-cols-3 { min-width: 480px; }
.table-wrap .t-cols-4 { min-width: 600px; }
.table-wrap .t-cols-5, .table-wrap .t-cols-6 { min-width: 720px; }
.table-wrap .t-cols-7 { min-width: 800px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { background: var(--bg-2); color: var(--ink); font-weight: 700; }
.table-wrap .t-cols-7 th, .table-wrap .t-cols-7 td { padding-inline: 9px; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { color: var(--ink); }
/* Paths and codes keep their width in a cell (break-word, not anywhere: "/attention" never splits). */
.guide__body .table-wrap code { font-size: 0.84em; overflow-wrap: break-word; }
@media (max-width: 599px) { .table-wrap table { font-size: 13px; } }

/* ── Code blocks with a copy key ───────────────────────────────────────── */

.code {
  margin: 8px 0 22px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-2);
}
.code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 4px 0 14px;
  border-bottom: 1px solid var(--line);
}
.code__lang { color: var(--muted-2); font: 500 13px/1 var(--font-mono); }
.code__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 700 13px/1 var(--font-sans);
}
.code__copy[hidden] { display: none; }
.code__copy .ti { font-size: 17px; }
.code__copy.is-done { color: var(--ok-text); }
@media (hover: hover) and (pointer: fine) { .code__copy:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); } }
.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--ink-2);
  font: 400 13.5px/1.6 var(--font-mono);
  tab-size: 2;
}
.guide__body .code pre code { padding: 0; border: 0; background: none; color: inherit; font: inherit; overflow-wrap: normal; }

/* A phone narrower than the header: the logo mark alone. */
@media (max-width: 374px) { .guide-page .brand__name { display: none; } }

/* ── Print and PDF (scripts/lpfr-guide-pdf.mjs) ────────────────────────── */

@media print {
  @page { size: A4; margin: 16mm 15mm 18mm; }
  html, body.site { background: #fff !important; color: #1a1a1a; }
  body.site { display: block; min-height: 0; font-size: 10pt; }
  .site-header, .site-footer, .guide-banner, .guide-toc, .code__bar, .guide__body .anchor, #guide-live { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .guide { padding: 0; }
  .guide__layout { display: block; }
  .guide__body { max-width: none; color: #1a1a1a; font-size: 10pt; line-height: 1.5; }
  .guide__body .article__title { margin: 0 0 8pt; color: #000; font-size: 22pt; }
  .guide__lede { margin: 0 0 6pt; color: #333; font-size: 9.5pt; }
  .guide__lede strong, .guide__body strong { color: #000; }
  .guide__web { display: block; margin: 0 0 12pt; color: #555; font-size: 9pt; }
  .guide__body h2 { margin: 18pt 0 6pt; padding-bottom: 3pt; border-bottom: 1px solid #ccc; color: #000; font-size: 15pt; break-after: avoid; page-break-after: avoid; }
  .guide__body h3 { margin: 12pt 0 4pt; color: #000; font-size: 12pt; break-after: avoid; page-break-after: avoid; }
  .guide__body p, .guide__body li { orphans: 3; widows: 3; }
  .guide__body hr { display: none; }
  .guide__body a { color: #1a1a1a; }
  /* Square corners and no outline on inline code in print: hundreds of rounded boxes made the PDF heavy. */
  .guide__body code { padding: 0 2px; border: 0; border-radius: 0; background: #eef0f3; color: #111; }
  .src-tag { border: 0; border-radius: 0; padding: 0; color: #6b4e0e; font-weight: 700; }
  .src-tag--purs { color: #1d6b45; }
  .callout, .code, .table-wrap { border-radius: 0; }
  .callout { border-color: #d9b45f; background: #faf7ef; }
  .callout__title { color: #000; }
  .callout .table-wrap { background: #fff; }
  .code { border-color: #d0d4da; background: #f6f7f9; break-inside: avoid; page-break-inside: avoid; }
  .code pre { overflow: visible; color: #111; font-size: 8.5pt; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
  .table-wrap { overflow: visible; border-color: #c8ccd2; }
  .table-wrap table { min-width: 0 !important; font-size: 8.5pt; line-height: 1.4; }
  .table-wrap th { background: #eef0f3; color: #000; white-space: normal; }
  .table-wrap th, .table-wrap td { padding: 4pt 6pt; border-bottom-color: #d6d9de; }
  .table-wrap td:first-child { color: #000; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  .tasks input { accent-color: #333; }
}
