/* Chile US Tax library (guides, forms directory, updates). Builds on home.css tokens. */
.section-sm { padding-top: 72px; padding-bottom: 72px; }
.page-hero { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 22px; max-width: 1280px; }
.page-hero h1 { font-size: clamp(38px, 5.4vw, 72px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; max-width: 15em; text-wrap: balance; }
.page-hero h1 em { letter-spacing: -0.03em; }
.page-lede { max-width: 38em; font-size: 18px; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--slate); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-3); }
.crumbs a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.section-label { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); margin-bottom: 28px; }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--bg); color: var(--navy); }
.underline-light { color: var(--white); border-bottom-color: var(--white); }
.underline-light:hover { color: var(--on-navy-2); }

/* Cards */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 32px 28px; }
.resource-card { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--navy); padding-top: 18px; min-width: 0; }
.resource-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.resource-card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.resource-card h3 a:hover { color: var(--red); }
.resource-card > p:not(.resource-label) { font-size: 15px; line-height: 1.6; color: var(--ink-3); }
.resource-link { margin-top: auto; font-size: 14px; font-weight: 500; color: var(--navy); }

/* Library index */
.library-topics { display: flex; flex-direction: column; gap: 56px; }
.topic { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px 56px; align-items: start; scroll-margin-top: 24px; }
.topic-head { display: flex; flex-direction: column; gap: 10px; }
.topic-head h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.topic-head p { font-size: 15px; line-height: 1.6; color: var(--ink-3); max-width: 28em; }
.library-topics .guide-link { grid-template-columns: 120px 1fr 24px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 56px; align-items: start; }
.forms-teaser, .update-teaser { display: flex; flex-direction: column; gap: 16px; }
.forms-teaser h3, .update-teaser h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; }
.update-teaser h3 a { color: var(--white); }
.update-teaser h3 a:hover { color: var(--on-navy-2); }
.forms-teaser p:not(.label), .update-teaser p:not(.label) { font-size: 15px; line-height: 1.65; color: var(--on-navy); max-width: 32em; }
.forms-teaser .btn { align-self: flex-start; }

/* Guide pages */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; align-items: start; padding-bottom: 96px; }
.doc-body { min-width: 0; max-width: 46em; display: flex; flex-direction: column; gap: 40px; }
.doc-body section { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 24px; }
.doc-body h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; text-wrap: balance; }
.doc-body h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin-top: 8px; }
.doc-body p, .doc-body li { font-size: 17px; line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }
.doc-body ul, .doc-body ol { padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.doc-body a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--red); }
.doc-body a:hover { color: var(--red); }
.doc-body strong { font-weight: 600; color: var(--ink); }
.doc-body .table-scroll { margin: 4px 0; }
.in-short { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; }
.in-short ul { padding-left: 1.1em; gap: 10px; }
.in-short li { font-size: 16px; line-height: 1.6; }
.callout { border-top: 2px solid var(--navy); padding-top: 16px; }
.callout p { font-size: 16px; }
.doc-cta { background: var(--navy); color: var(--white); border-radius: 4px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.doc-cta-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--white) !important; }
.doc-cta p { color: var(--on-navy) !important; font-size: 15px !important; }
.doc-cta .btn { align-self: flex-start; text-decoration: none; color: var(--navy); }
.doc-cta .btn:hover { color: var(--navy); }
.doc-note { font-size: 13px !important; line-height: 1.6 !important; color: var(--slate) !important; }
.doc-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.toc ol { list-style: none; padding: 0; margin: 14px 0 0; border-left: 1px solid var(--line-2); }
.toc li a { display: block; padding: 7px 0 7px 14px; font-size: 14px; line-height: 1.4; color: var(--ink-3); margin-left: -1px; border-left: 2px solid transparent; }
.toc li a:hover { color: var(--navy); border-left-color: var(--red); }
.resource-sidebar { display: flex; flex-direction: column; gap: 10px; }
.side-note { font-size: 13px; line-height: 1.55; color: var(--slate); }
.resource-sidebar ul { list-style: none; padding: 0; margin: 4px 0 0; border-top: 1px solid var(--line-2); }
.resource-sidebar li { border-bottom: 1px solid var(--line-2); }
.resource-sidebar li a { display: block; padding: 12px 0; font-size: 14px; font-weight: 500; line-height: 1.45; }
.resource-sidebar li a span { color: var(--red); }
.related .resource-grid { margin-top: 8px; }
.related-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); margin-bottom: 20px; }

/* Tables (forms directory and in-guide tables) */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.forms-wrap { display: flex; flex-direction: column; gap: 64px; padding-top: 0; }
.forms-group { display: flex; flex-direction: column; gap: 18px; }
.forms-group h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -0.03em; }
.forms-table, .doc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; min-width: 720px; }
.doc-table { min-width: 560px; }
.forms-table th, .forms-table td, .doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line-2); }
.forms-table thead th, .doc-table thead th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); border-bottom: 2px solid var(--navy); padding-top: 0; }
.forms-table td, .doc-table td { color: var(--ink-3); }
.forms-table tbody th { width: 22%; }
.forms-table tr { scroll-margin-top: 24px; }
.form-code { display: block; font-weight: 600; font-size: 15px; color: var(--ink); }
.form-name { display: block; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.form-guide { display: inline-block; margin-top: 8px; font-weight: 500; color: var(--navy); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.form-soon { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--slate); }
.doc-table td:first-child { font-weight: 600; color: var(--ink); }
.doc-table.kv { min-width: 0; }
.doc-table.kv td:first-child { width: 38%; }
.forms-table { table-layout: fixed; }
.forms-table thead th:nth-child(1) { width: 22%; }
.forms-table thead th:nth-child(2) { width: 27%; }
.forms-table thead th:nth-child(3) { width: 27%; }
.forms-table thead th:nth-child(4) { width: 24%; }

/* Updates */
.updates-list { display: flex; flex-direction: column; gap: 0; padding-top: 0; max-width: 52em; }
.update-item { display: flex; flex-direction: column; gap: 10px; padding: 32px 0; border-top: 1px solid var(--line-2); }
.update-item h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; }
.update-item p:not(.step-when) { font-size: 16px; line-height: 1.65; color: var(--ink-3); }
.update-item .underline-link { padding-top: 6px; }

@media (max-width: 980px) {
  .doc-layout { grid-template-columns: 1fr; gap: 48px; }
  .doc-side { position: static; order: -1; }
  .toc { display: none; }
}
@media (max-width: 800px) {
  .section-sm { padding-top: 56px; padding-bottom: 56px; }
  .page-hero { padding-top: 16px; padding-bottom: 44px; }
  .page-lede { font-size: 17px; }
  .doc-body p, .doc-body li { font-size: 16px; }
  .in-short { padding: 22px 20px; }
  .doc-cta { padding: 24px 22px; }
  .library-topics .guide-link { grid-template-columns: 1fr 24px; }
  .doc-side { order: 0; }
}

/* Standalone pages (how we work) */
.page-section { display: flex; flex-direction: column; gap: 40px; }
.page-section > h2 { max-width: 14em; }
.page-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px 64px; align-items: start; }
.page-split > p, .page-intro { font-size: 16px; line-height: 1.7; color: var(--ink-2); max-width: 32em; }
.check-list { list-style: none; padding: 0; display: flex; flex-direction: column; border-top: 2px solid var(--navy); }
.check-list li { padding: 18px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.check-list strong { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.check-list span { font-size: 15px; line-height: 1.6; color: var(--ink-3); }
.band-navy .check-list { border-top-color: var(--white); }
.band-navy .check-list li { border-bottom-color: var(--navy-line-2); }
.band-navy .check-list strong { color: var(--white); }
.band-navy .check-list span, .band-navy .page-split > p { color: var(--on-navy); }
.page-cta { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.page-cta p { font-size: 16px; line-height: 1.65; color: var(--on-navy); max-width: 36em; }
