/*
 * 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 green (progress, list markers, TOC border, selection)
 *   --accent-ink   brand navy (TOC active text, Contact button — AA contrast)
 *   --lh           body line-height (1.75 comfortable, 1.6 compact)
 *   --sec-gap      space between major sections (46px comfortable, 32px compact)
 *
 * Neutrals follow the site brand kit (FutureBridge: ink/head/muted/rules/panel).
 */

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

.ldoc {
  /* FutureBridge Memphis brand */
  --accent: #86BF40;       /* green — progress, markers, TOC rail, selection */
  --accent-ink: #174273;   /* navy — TOC active text + Contact button (AA) */
  --lh: 1.75;
  --sec-gap: 46px;
  --measure: 100%; /* fill .ldoc-main — was 70ch, left ~215px empty on the right */
  --base: 16px;
  /* Fallback until document.js measures the sticky site header. */
  --sticky-header: calc(var(--wp-admin--admin-bar--height, 0px) + 64px);
  --sticky-top: calc(var(--sticky-header) + 16px);
  --anchor: var(--sticky-top);

  --ink: #364153;
  --head: #101828;
  --muted: #4A5565;
  --faint: #6A7282;
  --rule: #E5E7EB;
  --rule-soft: #F3F4F6;
  --panel: #FFFFFF;

  position: relative;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  color: var(--ink);
  background: var(--nu-canvas, #F9FAFB);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  width: 100%;
  /*
   * Match sticky header chrome (aa9500e) without changing the header:
   * outer pad 30px + .e-con-inner max 1440 / pad 32px (logo at 62px mid-width).
   * Same dual-shell model as Contact (.ct-body 30 + .ct-wrap 32).
   */
  padding-inline: 30px;
  box-sizing: border-box;
}
.ldoc ::selection { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* ===== Reading progress ===== */
.ldoc-progress {
  position: sticky;
  top: var(--sticky-header);
  left: 0;
  height: 3px;
  /* Transparent track — filled bar only, so it doesn't read as a page border. */
  background: transparent;
  z-index: 40;
  /* Break out of .ldoc outer gutters so the bar stays full-bleed. */
  width: calc(100% + 60px);
  margin-inline: -30px;
}
.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;
  box-sizing: border-box;
  /* Match aa9500e > .e-con-inner content inset (keep at all desktop widths). */
  padding-inline: 32px;
  padding-top: 30px;
  padding-bottom: 30px;
  border-top: none;
}
@media (max-width: 767px) {
  .ldoc {
    padding-inline: 20px; /* match aa9500e mobile outer */
  }
  .ldoc-progress {
    width: calc(100% + 40px);
    margin-inline: -20px;
  }
  .ldoc-grid {
    padding-inline: 20px; /* match aa9500e > .e-con-inner mobile */
  }
}

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

/* Sticky rails — pin within .ldoc-grid while the document scrolls. */
.ldoc-aside-left,
.ldoc-aside-right {
  position: sticky;
  top: var(--sticky-top);
  align-self: start;
  max-height: calc(100vh - var(--sticky-top) - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ===== 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;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ldoc [data-toc-link]:hover { color: var(--head); }
.ldoc [data-toc-link][aria-current="true"] { color: var(--accent-ink); font-weight: 600; border-left-color: var(--accent); }

/* ===== More documents sidebar ===== */
/* Slight inset under the eyebrow; card below keeps its own padding. */
.ldoc-doc-list {
  display: flex;
  flex-direction: column;
  padding-inline: 8px;
}
.ldoc-doc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
}
.ldoc-doc-link:hover { color: var(--accent); }
.ldoc-doc-link i,
.ldoc-doc-link svg {
  flex-shrink: 0;
  opacity: 0.55;
  color: inherit;
}
.ldoc-doc-link i {
  font-size: 14px;
  width: 16px;
}
.ldoc-doc-link svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ===== Contact card (right sidebar) ===== */
.ldoc-contact-card {
  margin-top: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.125rem 1.125rem 1.25rem;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* Beat Elementor kit `.elementor-kit-3701 h2` (36px global) — card is only ~260px wide. */
.ldoc-contact-card h2.ldoc-contact-card__title {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1.0625rem; /* 17px */
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--accent-ink);
  margin: 0 0 0.4rem;
}
/* Beat kit `p { margin-block-end: 0 }` so body → button spacing holds. */
.ldoc-contact-card p.ldoc-contact-card__text {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1rem;
  margin-block-end: 1rem;
}
.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;
  margin-top: 0;
  border-radius: 6px;
  background: var(--accent-ink);
  color: #fff;
  font-size: 0.8125rem; /* 13px */
  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: 14px; }

/* ===== 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; }

/* ===== 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: 0 0 14px 8px; } /* align with .ldoc-doc-list padding-inline */

/* 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; }
}


/* RWD: mobile type floor */
@media (max-width: 767px) {
  .ldoc { --base: 16px; }
  .ldoc .doc-body p,
  .ldoc .doc-body li,
  .ldoc-meta,
  .ldoc-breadcrumb,
  .ldoc-doc-link,
  .ldoc-contact-card p.ldoc-contact-card__text { font-size: 0.9375rem; } /* 15px — keep card balanced on mobile */
  .ldoc [data-toc-link] { font-size: 15px; }
  .ldoc-title { text-wrap: balance; }
  .ldoc .doc-body p { text-wrap: pretty; }
}


/* RWD: toc + breadcrumb tap targets */
@media (max-width: 1024px) {
  .ldoc-breadcrumb a,
  .ldoc-doc-link,
  .ldoc [data-toc-link],
  .ldoc-toc a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-block: 10px;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.35;
  }
  .ldoc-title,
  .ldoc h2,
  .ldoc h3 { text-wrap: balance; }
  .ldoc .doc-body p,
  .ldoc .doc-body li { text-wrap: pretty; }
}
