/*
 * Single Document Template — scoped styles
 * Source: dev/doc-return-policy.dc.html (Design Compiler mockup)
 *
 * All rules are scoped under `.ldoc` to override Elementor / theme typography
 * without leaking into the rest of the site. Non-coders editing per-site
 * accents change ONE place: the CSS variables in `.ldoc` below.
 *
 * Themable per site:
 *   --accent       brand accent color (button, icons, active TOC marker, list markers)
 *   --lh           body line-height (1.75 comfortable, 1.6 compact)
 *   --sec-gap      space between major sections (46px comfortable, 32px compact)
 *
 * The neutral palette (--ink, --head, --muted, --faint, --rule, --panel) is
 * fixed by the design system and not intended for per-site changes.
 */

/* ===== Scope reset ===== */
.ldoc, .ldoc * { box-sizing: border-box; }

.ldoc {
  --accent: #3A3A3A;
  --lh: 1.75;
  --sec-gap: 46px;
  --measure: 70ch;
  --base: 16px;
  --sticky-top: 28px;
  --anchor: 28px;

  --ink: #232323;
  --head: #141414;
  --muted: #6A6A6A;
  --faint: #8A8A8A;
  --rule: #E6E6E6;
  --rule-soft: #EFEFEF;
  --panel: #FAFAFA;

  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  color: var(--ink);
  background: var(--nu-canvas, #F6F5F1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  width: 100%;
}
.ldoc ::selection { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* ===== Reading progress ===== */
.ldoc-progress {
  position: sticky;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--rule-soft);
  z-index: 40;
  width: 100%;
}
.ldoc-progress [data-progress-bar] {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* ===== Three-column grid ===== */
.ldoc-grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
  width: 100%;
  max-width: var(--nu-wide-width, 1440px);
  margin: 0 auto;
  /* Match site header/footer gutters so content aligns with site chrome. */
  padding-inline: var(--nu-gutter, clamp(1.25rem, 4vw, 3rem));
}

.ldoc-main { min-width: 0; }

/* ===== Header chrome ===== */
.ldoc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--faint);
  margin: 0 0 18px;
}
.ldoc-breadcrumb a {
  color: var(--faint);
  text-decoration: none;
}
.ldoc-breadcrumb a:hover { color: var(--head); }

.ldoc-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  padding-bottom: 24px;
}
.ldoc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ldoc-meta i {
  font-size: 14px;
  width: 15px;
  text-align: center;
}
.ldoc-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

/* ===== Body content (element-level styling so non-designers just edit plain HTML) ===== */
.doc-body { max-width: var(--measure); }
.doc-body > *:first-child { margin-top: 0; }

.doc-body p { margin: 0 0 1.05em; font-size: var(--base); line-height: var(--lh); color: var(--ink); }
.doc-body strong, .doc-body b { color: var(--head); font-weight: 600; }
.doc-body em, .doc-body i { font-style: italic; }

.doc-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.doc-body a:hover { text-decoration-thickness: 2px; }

.doc-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--head);
  margin: var(--sec-gap) 0 0.7em;
  padding-top: var(--sec-gap);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--anchor);
}
.doc-body h2:first-of-type { margin-top: 22px; padding-top: 20px; }

.doc-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--head);
  margin: 1.8em 0 0.5em;
  scroll-margin-top: var(--anchor);
}
.doc-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--head);
  margin: 1.5em 0 0.4em;
}

.doc-body ul, .doc-body ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.doc-body li { font-size: var(--base); line-height: var(--lh); color: var(--ink); margin-bottom: 0.45em; padding-left: 0.2em; }
.doc-body li::marker { color: var(--accent); }
.doc-body li > ul, .doc-body li > ol { margin: 0.45em 0 0.2em; }

.doc-body blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: #4A4A4A;
}
.doc-body blockquote p { color: #4A4A4A; }

.doc-body hr { border: 0; border-top: 1px solid var(--rule); margin: var(--sec-gap) 0; }

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 0.875em;
}
.doc-body th, .doc-body td {
  border: 1px solid var(--rule);
  padding: 7px 11px;
  text-align: left;
  line-height: 1.45;
  vertical-align: top;
}
.doc-body th { background: var(--panel); font-weight: 600; color: var(--head); }

.doc-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #F2F2F2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.doc-body .doc-cta,
.doc-body a.doc-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 1.4em;
}
.doc-body .doc-cta:hover,
.doc-body a.doc-cta:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

/* ===== Table of contents (left rail) ===== */
.ldoc-toc-nav .eyebrow { margin: 0 0 14px 16px; }
.toc-rail { display: flex; flex-direction: column; border-left: 1px solid var(--rule); }
.ldoc [data-toc-link] {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  color: #5A5A5A;
  text-decoration: none;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
}
.ldoc [data-toc-link]:hover { color: var(--head); }
.ldoc [data-toc-link][aria-current="true"] { color: var(--accent); font-weight: 600; border-left-color: var(--accent); }

/* ===== More documents sidebar ===== */
.ldoc-doc-list {
  display: flex;
  flex-direction: column;
}
.ldoc-doc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
  color: #333;
  font-size: 13.5px;
}
.ldoc-doc-link:hover { color: var(--accent); }
.ldoc-doc-link i {
  font-size: 14px;
  width: 16px;
  opacity: 0.55;
  flex-shrink: 0;
}

/* ===== Contact card (right sidebar) ===== */
.ldoc-contact-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px;
  background: var(--panel);
}
.ldoc-contact-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--head);
  margin: 0 0 8px;
}
.ldoc-contact-card__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 14px;
}
.ldoc-contact-card address {
  font-style: normal;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 16px;
}
.ldoc-contact-card address strong {
  display: block;
  color: var(--head);
  font-weight: 600;
  margin-bottom: 3px;
}
.ldoc-contact-card__phone {
  display: block;
  margin-top: 6px;
}
.ldoc-contact-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.ldoc-contact-card__btn:hover {
  filter: brightness(1.08);
  color: #fff;
  text-decoration: none;
}
.ldoc-contact-card__btn i { font-size: 15px; }

/* ===== Mobile TOC disclosure ===== */
.ldoc .toc-mobile {
  display: none;
  margin-top: 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 4px 16px;
}
.ldoc .toc-mobile summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}
.ldoc .toc-mobile [data-toc-mobile] { padding: 4px 0 14px; }

/* ===== Footer ===== */
.ldoc-footer {
  border-top: 1px solid var(--rule);
  max-width: var(--nu-wide-width, 1440px);
  margin: 24px auto 0;
  padding: 28px var(--nu-gutter, clamp(1.25rem, 4vw, 3rem)) 40px;
}
.ldoc-footer p {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
}

/* ===== Focus visibility ===== */
.ldoc a:focus-visible,
.ldoc button:focus-visible,
.ldoc [data-toc-link]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Skip link ===== */
.ldoc .skip-link {
  position: absolute;
  left: 12px;
  top: -200px;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
  transition: top 0.15s ease;
}
.ldoc .skip-link:focus { top: 12px; }

/* ===== Common bits ===== */
.ldoc .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #555555; }
.ldoc .eyebrow--more-docs { margin-bottom: 14px; }

/* Document title. Color rides the --head token so the palette changes in one
   place; the font stack inherits from .ldoc. */
.ldoc .ldoc-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--head);
  margin: 0 0 14px;
}
@media (max-width: 800px) {
  .ldoc .ldoc-title { font-size: 1.8rem; }
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .ldoc-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 44px; }
  .ldoc-aside-right { display: none; }
}
@media (max-width: 800px) {
  .ldoc-grid { grid-template-columns: 1fr; gap: 0; }
  .ldoc-aside-left { display: none; }
  .ldoc .toc-mobile { display: block; }
  .doc-body { max-width: 100%; }
}

/* Smooth anchor jumps unless the reader prefers reduced motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ===== Print ===== */
@media print {
  .ldoc-aside-left, .ldoc-aside-right, .ldoc-progress, .toc-mobile { display: none !important; }
  .ldoc-grid { display: block; }
  .doc-body { max-width: 100%; }
  .doc-body h2 { break-after: avoid; }
  .doc-body a { color: #000; text-decoration: underline; }
}

/* ---- Motion audit (2026-07-13): base-state transitions so no interaction snaps.
   Tint tier 0.2s / travel tier 0.45s, house curve. See AGENTS.md motion rules. ---- */
.ldoc-breadcrumb a,
.ldoc [data-toc-link],
.ldoc-doc-link { transition: color 0.2s cubic-bezier(0.33, 1, 0.68, 1); }
.doc-body a { transition: color 0.2s cubic-bezier(0.33, 1, 0.68, 1), text-decoration-thickness 0.2s cubic-bezier(0.33, 1, 0.68, 1), text-underline-offset 0.2s cubic-bezier(0.33, 1, 0.68, 1); }
.doc-body .doc-cta,
.doc-body a.doc-cta,
.ldoc-contact-card__btn { transition: filter 0.2s cubic-bezier(0.33, 1, 0.68, 1), color 0.2s cubic-bezier(0.33, 1, 0.68, 1), background 0.2s cubic-bezier(0.33, 1, 0.68, 1); }
.ldoc .skip-link { transition: top 0.2s cubic-bezier(0.33, 1, 0.68, 1); }
