/* seli — long-read (/strategie) and legal pages. Readable measure, styled tables, sticky mini-TOC on desktop. */

.page-read { background: var(--paper); }
.read-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.read-tag { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }
.read-progress { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: var(--rec); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

.read { display: grid; gap: 0; padding-top: 20px; padding-bottom: 72px; }
@media (min-width: 1100px) {
  .read { grid-template-columns: 240px minmax(0, 720px); justify-content: center; gap: 72px; padding-top: 56px; padding-bottom: 120px; }
}

/* TOC */
.read__toc { position: sticky; top: 0; z-index: 10; margin: 0 calc(-1 * var(--gutter)) 8px; padding: 0 var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); }
.read__toc-btn { display: none; }
.read__toc-title { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc { list-style: none; counter-reset: none; display: grid; gap: 0; padding-bottom: 12px; }
.toc a { display: block; padding: 7px 0 7px 12px; border-left: 2px solid var(--line-2); text-decoration: none; color: var(--muted); font-size: .875rem; line-height: 1.35; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--rec); font-weight: 600; }
.js .read__toc-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 52px; border: 0; background: none; padding: 0; font-weight: 600; font-size: .9375rem; color: var(--ink); }
.read__toc-ico { margin-right: 6px; width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.read__toc-btn[aria-expanded="true"] .read__toc-ico { transform: rotate(-135deg) translateY(-3px); }
.js .read__toc-nav { display: none; max-height: 60vh; overflow: auto; }
.js .read__toc-btn[aria-expanded="true"] + .read__toc-nav { display: block; }
.js .read__toc-nav .read__toc-title { display: none; }
.read__toc-nav { padding-top: 12px; }
@media (min-width: 1100px) {
  .read__toc { top: 32px; align-self: start; margin: 0; padding: 0; border: 0; background: none; }
  .js .read__toc-btn { display: none; }
  .js .read__toc-nav, .read__toc-nav { display: block; max-height: calc(100vh - 64px); padding-top: 6px; }
  .js .read__toc-nav .read__toc-title { display: block; }
}

/* prose */
.prose { min-width: 0; font-size: 1.0625rem; line-height: 1.7; color: #22211F; }
@media (min-width: 900px) { .prose { font-size: 1.125rem; } }
.prose > * { max-width: 68ch; }
.prose > .table-wrap { max-width: none; }
.prose h1 { font-size: clamp(2.5rem, 11vw, 4.75rem); line-height: .96; letter-spacing: -0.045em; margin: 20px 0 18px; color: var(--ink); }
.prose h1 + p em:only-child, .prose h1 + p > em { display: inline-block; font-style: normal; font-size: .875rem; line-height: 1.5; color: var(--muted); padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.prose h2 { font-size: clamp(1.75rem, 7vw, 2.375rem); line-height: 1.05; letter-spacing: -0.035em; margin: 64px 0 18px; padding-top: 20px; border-top: 2px solid var(--ink); color: var(--ink); scroll-margin-top: 72px; }
.prose h3 { font-size: 1.375rem; letter-spacing: -0.025em; margin: 36px 0 12px; scroll-margin-top: 72px; }
@media (min-width: 1100px) { .prose h2, .prose h3 { scroll-margin-top: 32px; } }
.prose p { margin: 0 0 1.05em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 0; list-style: none; display: grid; gap: .45em; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before { content: ''; position: absolute; left: 2px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--rec); }
.prose ul ul > li::before { background: none; border: 1.5px solid var(--muted); width: 6px; height: 6px; }
.prose ul ul, .prose ol ul { margin: .45em 0 0; }
.prose ol { counter-reset: li; }
.prose ol > li { position: relative; padding-left: 34px; counter-increment: li; }
.prose ol > li::before { content: counter(li); position: absolute; left: 0; top: .15em; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .75rem; font-weight: 600; display: grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums; }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 48px 0; }
.prose blockquote { margin: 0 0 1.2em; padding: 4px 0 4px 18px; border-left: 3px solid var(--rec); color: var(--ink); }
.prose code { font-size: .875em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* tables */
.table-wrap { margin: 8px 0 28px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.prose thead th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 16px 10px; border-bottom: 1.5px solid var(--ink); background: var(--surface); white-space: nowrap; }
.prose td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: #FBFAF7; }
.prose td.num, .prose th.num { text-align: right; white-space: nowrap; }
.prose tr.is-total td { background: var(--ink); color: var(--paper); border-bottom: 0; }
.prose tr.is-total td strong { color: var(--paper); }
.prose table.is-wide { min-width: 620px; }
@media (max-width: 520px) {
  .prose table { font-size: .875rem; }
  .prose td, .prose thead th { padding-left: 12px; padding-right: 12px; }
  /* 2-column tables: long numeric cells ("490 lei cu TVA (≈ 405 lei fără TVA)") wrap instead of crushing the label column */
  .prose table:not(.is-wide) td.num { white-space: normal; }
  .prose table:not(.is-wide) td:first-child { min-width: 8em; }
}

/* ---------- legal pages ---------- */
.legal { padding-top: 24px; padding-bottom: 80px; }
.legal__in { max-width: 720px; margin: 0 auto; }
.legal__draft { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); }
.legal__draft .rec-dot { width: 7px; height: 7px; }
.legal .prose h1 { margin-top: 18px; }
.legal .prose h2 { font-size: clamp(1.375rem, 5.6vw, 1.75rem); margin-top: 44px; padding-top: 16px; border-top-width: 1.5px; }
.legal__updated { color: var(--muted); font-size: .9375rem; }

/* ---------- 404 ---------- */
.nf { min-height: calc(100vh - 92px); min-height: calc(100dvh - 92px); display: grid; align-content: center; padding-top: 40px; padding-bottom: 80px; }
.nf__code { display: inline-flex; align-items: center; gap: 10px; font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--on-ink-muted); }
.nf__title { margin-top: 16px; font-size: clamp(2.6rem, 12vw, 6rem); line-height: .95; letter-spacing: -0.045em; max-width: 12ch; }
.nf__p { margin-top: 16px; color: var(--on-ink-muted); font-size: 1.0625rem; max-width: 40ch; }
.nf__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* company data (legal pages, from COMPANY_* env) */
.prose .company-data { margin: 0 0 1.2em; display: grid; gap: 0; border-top: 1px solid var(--line); max-width: 68ch; }
.prose .company-data > div { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.prose .company-data dt { color: var(--muted); font-weight: 500; }
.prose .company-data dd { margin: 0; overflow-wrap: anywhere; }
