/* TWP Builder sections (theme/legalsgram/twp-sections/*.json). Loaded on builder pages, 404, search and in the editor canvas (inc/sections.php). Tokens come from style.css. */

/* Links: underline at rest in text; primary links draw their underline in */
.tlink { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: 600; }
.tlink:hover { text-decoration-thickness: 2px; }
.draw { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; padding-bottom: 2px; transition: background-size var(--lg-t-base) var(--lg-ease); }
a:hover .draw, a:focus-visible .draw { background-size: 100% 1.5px; }
.btn-quiet { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-quiet:hover, .dark .btn-quiet:hover { background: var(--lg-ink); color: var(--lg-paper); box-shadow: inset 0 0 0 1.5px var(--lg-ink); }
.dark .btn-quiet:hover { background: var(--lg-on-black); color: var(--lg-black); }
.btn svg { width: 18px; height: 18px; transition: transform var(--lg-t-fast) var(--lg-ease); }
.btn:hover svg { transform: translateX(3px); }
.small { font-size: var(--lg-text-sm); }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.search-row { display: flex; flex-direction: column; gap: 10px; margin: 0; }
@media (min-width: 480px) { .search-row { flex-direction: row; } .search-row input { flex: 1; } }

/* Section shell */
.sec { padding-block: 64px; }
.sec + .sec { padding-top: 0; }
@media (min-width: 1024px) { .sec { padding-block: 96px; } .sec + .sec { padding-top: 0; } }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 32px; }
.sec-head p { max-width: 52ch; margin-top: 10px; }

/* Hero: two paths. The ruled margin with line numbers borrows from pleading paper. */
.lg-hero { padding-block: 48px 56px; }
.hero-head { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0 10px; }
.margin { position: relative; margin: 0; padding: 0; list-style: none; font: 14px/1 var(--lg-font-body); color: var(--lg-muted); }
.margin::after { content: ""; position: absolute; inset: 0 0 0 auto; border-right: 3px double var(--lg-ink); }
.margin li { height: calc(clamp(42px, 7vw, 96px) * .98); display: flex; align-items: center; justify-content: flex-end; visibility: hidden; }
.display { font-size: clamp(42px, 7vw, 96px); line-height: .98; letter-spacing: -.035em; padding-left: 8px; }
.display span { display: block; }
.hero-sub { grid-column: 2; max-width: 56ch; font-size: 18px; line-height: 1.5; color: var(--lg-muted); margin-top: 22px; padding-left: 8px; }
@media (min-width: 900px) { .hero-head { grid-template-columns: 22px minmax(0, 1fr); gap: 0 16px; } .margin::after { right: -10px; } .margin li { visibility: visible; } .hero-sub { font-size: 19px; } }
@media (min-width: 1024px) { .hero-head { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 340px); } .hero-sub { grid-column: 3; grid-row: 1; align-self: end; margin: 0 0 .4em 24px; font-size: 18px; } }
@media (prefers-reduced-motion: no-preference) {
	.display span { animation: lg-settle 700ms var(--lg-ease) both; }
	.display span:nth-child(2) { animation-delay: 80ms; }
	.display span:nth-child(3) { animation-delay: 160ms; }
}
@keyframes lg-settle { from { opacity: 0; transform: translateY(.25em); } to { opacity: 1; transform: none; } }
.paths { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 900px) { .paths { grid-template-columns: 1.1fr 1fr; gap: 20px; } }
.path { border-radius: var(--lg-r-lg); padding: 28px 22px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 640px) { .path { padding: 40px; } }
.path-t { background: var(--lg-surface); box-shadow: inset 0 0 0 1.5px var(--lg-ink); }
.path h2 { font-size: clamp(30px, 3.8vw, 46px); }
.path .lead { margin: 0; font-size: 18px; max-width: 40ch; }
.dark .lead.muted { color: var(--lg-on-black-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--lg-line); border-radius: var(--lg-r-sm); text-decoration: none; font-size: 15px; transition: border-color var(--lg-t-fast), background-color var(--lg-t-fast); }
.chips a:hover { border-color: var(--lg-ink); background: var(--lg-paper); }
.path-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.topics { list-style: none; margin: 0; padding: 0; border-top: 1px solid #333; }
.topics li { border-bottom: 1px solid #333; }
.topics a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; text-decoration: none; font-size: 18px; }
.topics .n { color: var(--lg-on-black-muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Trust strip */
.trust { border-block: 1px solid var(--lg-line); }
.trust ul { list-style: none; margin: 0; padding: 0; display: grid; }
.trust li { padding: 20px 0; border-bottom: 1px solid var(--lg-line); }
.trust li:last-child { border-bottom: 0; }
.trust strong { display: block; font-family: var(--lg-font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.trust span { color: var(--lg-muted); font-size: 15px; }
@media (min-width: 640px) {
	.trust ul { grid-template-columns: 1fr 1fr; }
	.trust li:nth-child(odd) { padding-right: 24px; border-right: 1px solid var(--lg-line); }
	.trust li:nth-child(even) { padding-left: 24px; }
	.trust li:nth-child(3) { border-bottom: 0; }
}
@media (min-width: 1024px) {
	.trust ul { grid-template-columns: repeat(4, 1fr); }
	.trust li, .trust li:nth-child(n) { border-bottom: 0; padding: 24px; border-right: 1px solid var(--lg-line); }
	.trust li:first-child { padding-left: 0; }
	.trust li:last-child { border-right: 0; }
}

/* Template rows: an index, each row marked with a small document */
.tindex { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--lg-ink); }
.trow { border-bottom: 1px solid var(--lg-line); }
.trow a { display: grid; gap: 6px; padding: 20px 0; text-decoration: none; transition: background-color var(--lg-t-fast); }
.trow h3 { position: relative; padding-left: 36px; font-size: 22px; }
.trow h3::before { content: ""; position: absolute; left: 0; top: .1em; width: 22px; height: 28px; background: url(../img/doc.svg) no-repeat 0 0 / 100% 100%; }
.trow .sum, .trow .cat { padding-left: 36px; }
.trow .cat { font-size: var(--lg-text-sm); color: var(--lg-muted); }
.trow .go { display: none; font-weight: 600; color: var(--lg-accent); }
@media (min-width: 900px) {
	.trow a { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) minmax(0, .9fr) 130px; align-items: baseline; gap: 24px; padding: 22px 12px; }
	.trow a:hover { background: var(--lg-surface); }
	.trow .sum, .trow .cat { padding-left: 0; }
	.trow .go { display: block; text-align: right; }
}

/* Grouped lists on the hubs */
.hub-group + .hub-group { padding-top: 56px; }
.hub-group > h2 { font-size: clamp(26px, 3vw, 34px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.hub-group > h2 .n { font-family: var(--lg-font-body); font-size: 15px; font-weight: 600; color: var(--lg-muted); letter-spacing: 0; }
.hub-group > p.muted { margin: 8px 0 20px; max-width: 60ch; }
.see-all { margin-top: 16px; }

/* Guides: a lead article on a case sheet, the rest as a list */
.guides { display: grid; border-top: 1.5px solid var(--lg-ink); }
.g-lead a, .g-item a { display: block; text-decoration: none; }
.g-lead { padding: 28px 0; border-bottom: 1px solid var(--lg-line); }
.g-lead a::before { content: ""; display: block; max-width: 420px; aspect-ratio: 320 / 120; margin-bottom: 24px; background: url(../img/sheet.svg) no-repeat 0 0 / 100% auto; }
.g-lead h3 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -.02em; margin: 12px 0 14px; }
.g-lead p { font-size: 18px; max-width: 46ch; }
.g-list { list-style: none; margin: 0; padding: 0; }
.g-item { border-bottom: 1px solid var(--lg-line); }
.g-item a { padding: 20px 0; }
.g-item h3 { font-size: 21px; margin: 6px 0; }
.g-item p { font-size: 16px; }
.guides .go { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 15px; color: var(--lg-accent); }
@media (min-width: 900px) {
	.guides { grid-template-columns: 1.15fr 1fr; gap: 0 48px; }
	.g-lead { border-bottom: 0; padding: 32px 48px 32px 0; border-right: 1px solid var(--lg-line); }
}
@media (min-width: 1200px) {
	.guides { grid-template-columns: 1.1fr 2fr; }
	.g-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; align-content: start; }
}

/* Category lists */
.cats { display: grid; gap: 40px; }
@media (min-width: 900px) { .cats { grid-template-columns: 1fr 1fr; gap: 48px; } }
.cats h3 { font-size: 22px; padding-bottom: 12px; border-bottom: 1.5px solid var(--lg-ink); }
.cats ul { list-style: none; margin: 0; padding: 0; }
.cats-flat { display: block; border-top: 1.5px solid var(--lg-ink); }
@media (min-width: 900px) { .cats-flat ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; } }
.cats li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 0; border-bottom: 1px solid var(--lg-line); text-decoration: none; }
.cats b { font-weight: 600; font-size: 18px; justify-self: start; }
.cats .n { font-variant-numeric: tabular-nums; color: var(--lg-muted); font-size: 14px; align-self: center; }
.cats .d { grid-column: 1 / -1; color: var(--lg-muted); font-size: 15px; }

/* FAQ: heading beside the answers on wide screens */
.faq-grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .wrap.faq-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; } }
.faq details { border-bottom: 1px solid var(--lg-line); }
.faq details:first-of-type { border-top: 1.5px solid var(--lg-ink); }
.faq summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; font-size: 18px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 24px/1 var(--lg-font-display); transition: transform var(--lg-t-fast) var(--lg-ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; max-width: 68ch; }
.faq a, .prose a, .team a, .form-note a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Call-to-action strip */
.cta-sec { padding-bottom: 72px; }
.cta { display: grid; gap: 20px; padding: 28px 22px; border-radius: var(--lg-r-lg); background: var(--lg-surface); box-shadow: inset 0 0 0 1px var(--lg-line); }
.cta h2 { font-size: clamp(24px, 2.6vw, 30px); }
.cta p { margin-top: 8px; max-width: 60ch; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 900px) { .wrap .cta { grid-template-columns: 1fr auto; align-items: center; padding: 36px 40px; } }

/* Page head, tools and policy layout */
.lg-page .page-head h1 { font-size: clamp(40px, 6vw, 80px); letter-spacing: -.03em; line-height: 1; }
.read.page-head h1 { font-size: clamp(38px, 5vw, 60px); }
.page-head .lead { max-width: 60ch; }
.page-head p:not(.lead):not(.updated) { max-width: 60ch; margin-top: 14px; color: var(--lg-muted); }
.updated { margin-top: 18px; font-size: var(--lg-text-sm); color: var(--lg-muted); }
.hub-tools { display: grid; gap: 18px; padding-block: 8px 32px; border-bottom: 1px solid var(--lg-line); }
@media (min-width: 900px) { .wrap .hub-tools { grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.filters a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--lg-ink); border-radius: var(--lg-r-sm); text-decoration: none; font-size: 15px; transition: background-color var(--lg-t-fast); }
.filters a:hover { background: var(--lg-ink); color: var(--lg-paper); }
.policy { display: grid; gap: 32px; }
@media (min-width: 1024px) { .policy { grid-template-columns: 240px minmax(0, var(--lg-read)); gap: 72px; } .policy-nav { position: sticky; top: 24px; align-self: start; } }
.policy-nav { padding-top: 28px; }
.policy-nav h2 { font-family: var(--lg-font-body); font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--lg-muted); margin-bottom: 8px; }
.policy-nav ul { list-style: none; margin: 0; padding: 0; border-left: 3px double var(--lg-ink); }
.policy-nav a { display: block; padding: 8px 0 8px 16px; text-decoration: none; font-weight: 600; }
.policy-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prose h2 { scroll-margin-top: 24px; }
.prose ol { counter-reset: step; list-style: none; padding-left: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 44px; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: -.1em; font: 600 24px/1.3 var(--lg-font-display); }
.summary, .notice { padding: 20px 22px; border-radius: var(--lg-r-md); background: var(--lg-surface); box-shadow: inset 0 0 0 1px var(--lg-line); }
.notice { border-left: 3px double var(--lg-ink); border-radius: 0 var(--lg-r-md) var(--lg-r-md) 0; }
.notice > h2 { margin-top: 0; font-size: 24px; }
.notice > * + * { margin-top: .8em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--lg-line); border-radius: var(--lg-r-md); background: var(--lg-surface); }
.table-wrap table { display: table; min-width: 640px; width: 100%; }
.linkish { border: 0; padding: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Team note */
.team-sec { padding-block: 24px 48px; }
.team-sec > div > h2 { font-size: clamp(26px, 3vw, 32px); }
.team-sec .lead { margin: 8px 0 24px; }
.team { display: grid; gap: 16px; }
.person { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 24px; border-radius: var(--lg-r-lg); background: var(--lg-surface); box-shadow: inset 0 0 0 1px var(--lg-line); }
.person .av { width: 56px; height: 56px; border-radius: 50%; background: var(--lg-ink); color: var(--lg-paper); display: grid; place-items: center; font: 600 24px var(--lg-font-display); }
.person h3 { font-size: 22px; }
.person .role { font-size: 15px; color: var(--lg-muted); margin: 2px 0 10px; }
.person p + p { margin-top: 8px; }
.person .links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; font-weight: 600; }

/* Forms (TWP Builder form widget) and the sign-up box */
.form-sec { padding-block: 16px 48px; }
.form-sec h2 { font-size: clamp(26px, 3vw, 32px); margin-bottom: 20px; }
.form-note { margin-top: 12px; }
.signup { border-radius: var(--lg-r-lg); padding: 32px 22px; display: grid; gap: 24px; }
@media (min-width: 900px) { .signup { grid-template-columns: 1fr 1fr; padding: 56px; gap: 56px; align-items: end; } }
.signup h2 { font-size: clamp(30px, 4vw, 48px); }
.signup p.muted { margin-top: 14px; }
.twpf .twpf-btn { min-height: 48px; border: 0; border-radius: var(--lg-r-md); background: var(--lg-accent); color: var(--lg-accent-text); font-weight: 600; }
.twpf .twpf-btn:hover { background: var(--lg-accent-hover); color: var(--lg-accent-text); }
.dark .twpf .twpf-btn:hover { background: var(--lg-accent-hover-dark); }

/* Text inside a wide page (404, no results) keeps the reading measure */
.wrap.prose > * { max-width: var(--lg-read); }
.policy .prose > :first-child { margin-top: 0; }
