/**
 * Deck Reader authoring manual — page extras only.
 * Shared L&F: Addavento-Website/css/styles.css (policy-* / nav / footer).
 * Lives next to styles.css in the portal css/ folder.
 */

/* ── Contain wide tables / code on small screens ──
   Site sets overflow-x: hidden on html/body, so content that
   expands a CSS grid column past the viewport gets clipped
   with no way to pan. Keep everything inside the viewport and
   scroll inside tables / pre blocks instead. */
.policy-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.policy-toc,
.policy-content {
  min-width: 0;
  max-width: 100%;
}

.policy-hero {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.policy-hero__title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 640px) {
  .policy-hero__title {
    font-size: clamp(28px, 9vw, 40px);
  }
}

.policy-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.policy-content a[href^="#"],
.policy-content a[href^="http"],
.policy-content a[href^="mailto:"] {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-content h4 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 22px 0 8px;
  color: var(--ink);
}

.policy-content p,
.policy-content li,
.policy-content h2,
.policy-content h3,
.policy-content h4,
.policy-content .callout {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.policy-content code {
  font-family: var(--f-mono);
  font-size: 0.86em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: color-mix(in oklab, var(--paper-2) 70%, var(--paper-0));
  padding: 0.12em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: break-spaces;
}

.policy-content pre.manual-code {
  margin: 0 0 24px;
  padding: 16px 18px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.policy-content pre.manual-code code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

/* Scroll wide tables inside the content column (not the page). */
.policy-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.policy-content table thead th {
  white-space: nowrap;
}

.policy-content table tbody td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.policy-toc ol ol {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.policy-toc ol ol li a {
  font-size: 12px;
}

.policy-content h3[id],
.policy-content h2[id] {
  scroll-margin-top: 120px;
}

/* Manual pages only: if anything still overflows, allow panning
   (site-wide styles set overflow-x: hidden, which clips with no scroll). */
html:has(body.page-manual),
body.page-manual {
  overflow-x: auto;
}
