/*
 * 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;
  /* 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: #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: 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;
  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));
  padding-top: 30px;
  padding-bottom: 30px;
  border-top: none;
}

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

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

/* taxesdiaz port: Beto base.css normally hides the skip link; replicate here (visible on keyboard focus only). */
.ldoc .skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.ldoc .skip-link:focus{left:12px;top:12px;width:auto;height:auto;padding:8px 14px;background:#fff;color:#141414;z-index:100000;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.2)}

/* taxesdiaz (Tracy 2026-10-16): Elementor kit link color (#328635) was overriding the button label; force white. */
.ldoc .ldoc-contact-card a.ldoc-contact-card__btn,
.ldoc .ldoc-contact-card a.ldoc-contact-card__btn:visited,
.ldoc .ldoc-contact-card a.ldoc-contact-card__btn:hover,
.ldoc .ldoc-contact-card a.ldoc-contact-card__btn:focus { color: #FFFFFF; }

/* taxesdiaz (Tracy 2026-10-16): heading scale + hierarchy for Documents (px, because this site sets html font-size to 10px). Inter if installed locally, else system fonts (no web font loads). */
.ldoc { --doc-head-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.ldoc .ldoc-main h1.ldoc-title {
  font-family: var(--doc-head-font); font-size: clamp(30px, 22px + 1.2vw, 40px);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--head); margin: 0.25em 0 0.4em;
}
.ldoc .ldoc-main .doc-body h2 {
  font-family: var(--doc-head-font); font-size: clamp(21px, 18px + 0.4vw, 24px);
  font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--head); margin: 2em 0 0.6em;
}
.ldoc .ldoc-main .doc-body h3 {
  font-family: var(--doc-head-font); font-size: clamp(17px, 16px + 0.15vw, 19px);
  font-weight: 600; line-height: 1.4; text-transform: none; letter-spacing: 0; color: var(--head); margin: 1.5em 0 0.45em;
}
.ldoc .ldoc-main .doc-body h2 + p, .ldoc .ldoc-main .doc-body h3 + p, .ldoc .ldoc-main .doc-body h3 + ul { margin-top: 0; }

/* taxesdiaz QA 2026-10-16 (WCAG AA): contrast, readable eyebrow size, visible focus, roomier tap targets. */
.ldoc .ldoc-breadcrumb, .ldoc .ldoc-breadcrumb a, .ldoc .ldoc-breadcrumb span { color: #5E5E5E; }
.ldoc .eyebrow { font-size: 12px; color: #5E5E5E; }
.ldoc a:focus-visible, .ldoc summary:focus-visible, .ldoc button:focus-visible {
  outline: 2px solid #1F5F22; outline-offset: 2px; border-radius: 3px;
}
.ldoc .ldoc-contact-card a.ldoc-contact-card__btn:focus-visible { outline: 3px solid #1F5F22; outline-offset: 3px; }
.ldoc .toc-rail a, .ldoc [data-toc-mobile] a { display: inline-block; min-height: 24px; padding-block: 2px; }
.ldoc .toc-mobile summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.ldoc .skip-link:focus { min-height: 24px; }
.ldoc a.ldoc-doc-link, .ldoc .ldoc-doc-link { color: #24702A; }

/* taxesdiaz (Tracy 2026-10-16 3:51 PM): more breathing room between TOC links (desktop rail + mobile disclosure). */
.ldoc .toc-rail a[data-toc-link], .ldoc [data-toc-mobile] a {
  display: block; padding-top: 10px; padding-bottom: 10px; line-height: 1.35; min-height: 0;
}
/* taxesdiaz (Tracy 3:52 PM): sidebar 'Questions?' heading scaled to sidebar hierarchy (below doc H2). */
.ldoc .ldoc-aside-right h2.ldoc-contact-card__title { font-family: var(--doc-head-font); font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: 0; margin: 0 0 6px; }

/* 2026-10-16: align /docs/ container with site content + header (Elementor boxed 1250px + 20px gutters). */
.ldoc .ldoc-grid { max-width: 1290px; padding-inline: 20px; }

/* 2026-10-17: EN/ES language switch link under the document meta. */
.ldoc .ldoc-lang-switch { margin: 0 0 18px; font-size: 14px; line-height: 1.4; color: #5E5E5E; }
.ldoc .ldoc-lang-switch a { color: #24702A; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 4px 0; }
.ldoc .ldoc-lang-switch a:hover { color: #1F5F22; }
