/* Voltrus article skin (JoyoFit-style). Needs /css/tokens.css loaded first.
   Shared by every blog post, BlogLayout page, blog index/category/archive and calculator page.
   Everything is scoped with :where(main) (zero specificity) so a page's own <style> after this file wins. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; }
:where(main) { display: block; padding: 56px 0 96px; }
:where(main) .container { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* Site header/footer container (BaseStyles is not loaded on these pages) */
:where(.container) { max-width: 1152px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
@media (max-width: 640px) { :where(.container) { padding: 0 16px; } :where(main) .container { padding: 0 20px; } }

/* Type */
:where(main) h1 { font-family: var(--font-sans); font-weight: 800; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; color: var(--text); margin: 0 0 28px; text-wrap: balance; }
:where(main) h2 { font-family: var(--font-sans); font-size: 1.5rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; text-transform: none; color: var(--text); margin: 52px 0 14px; padding: 0; border: 0; }
:where(main) h3 { font-family: var(--font-sans); font-size: 1.1875rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; color: var(--text); margin: 32px 0 10px; }
:where(main) p { font-size: 17px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 20px; }
:where(main) p strong, :where(main) li strong { color: var(--text); font-weight: 700; }
:where(main) a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(main) a:hover { color: var(--accent-bright); text-decoration-color: currentColor; }
:where(main) ul, :where(main) ol { margin: 20px 0 20px 1.4em; padding: 0; color: var(--text-secondary); font-size: 17px; line-height: 1.7; }
:where(main) li { margin-bottom: 10px; }
:where(main) li::marker { color: var(--text-muted); }
:where(main) hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
:where(main) img { max-width: 100%; height: auto; border-radius: var(--radius-lg); }

/* Code */
:where(main) code { font-family: var(--font-code); font-size: 0.88em; background: var(--bg-surface); color: var(--text); padding: 0.15em 0.45em; border-radius: 0.4rem; overflow-wrap: anywhere; }
:where(main) pre { font-family: var(--font-code); background: var(--bg-surface); border: 0; border-radius: var(--radius-lg); padding: 18px 22px; overflow-x: auto; margin: 24px 0; font-size: 13.5px; line-height: 1.65; color: var(--text-secondary); }
:where(main) pre code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }

/* Meta label */
:where(main) .post-meta, :where(main) .meta { display: inline-block; font-family: var(--font-sans); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--tint-green-ink); background: var(--tint-green); padding: 6px 12px; border-radius: 14px; margin: 0 0 20px; line-height: 1.4; }

/* Quote */
:where(main) blockquote { background: var(--bg-surface); border: 0; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; padding: 16px 22px; margin: 24px 0; color: var(--text-secondary); font-style: normal; }
:where(main) blockquote p:last-child { margin-bottom: 0; }

/* Callout */
:where(main) .highlight { background: var(--tint-green); border: 0; border-radius: var(--radius-lg); padding: 20px 24px; margin: 24px 0; font-size: 16px; line-height: 1.65; color: var(--text); }
:where(main) .highlight p { font-size: inherit; color: inherit; }
:where(main) .highlight p:last-child { margin-bottom: 0; }
:where(main) .highlight strong { color: var(--tint-green-ink); }
:where(main) .warning-box, :where(main) .warning { background: var(--amber-dim); border: 0; border-radius: var(--radius-lg); padding: 18px 22px; margin: 24px 0; font-size: 16px; color: var(--text-secondary); }
:where(main) .warning-box strong, :where(main) .warning strong { color: var(--amber); }

/* Buttons + CTA cards */
:where(main) .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 28px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-sans); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; text-decoration: none; border: 0; border-radius: 999px; cursor: pointer; transition: background-color 0.15s, transform 0.15s var(--ease-out); }
:where(main) .btn-primary:hover { text-decoration: none; background: var(--accent-bright); color: var(--accent-ink); }
:where(main) .btn-primary:active { transform: scale(0.97); }
:where(main) .cta-box, :where(main) .cta-upgrade { margin: 48px 0; padding: 36px 32px; border: 0; border-radius: var(--radius-card); background: var(--bg-raised); box-shadow: var(--shadow-float); }
:where(main) .cta-box { text-align: center; }
:where(main) .cta-box h3, :where(main) .cta-upgrade h3 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; text-transform: none; color: var(--text); margin: 0 0 12px; }
:where(main) .cta-box p { margin-bottom: 20px; }
:where(main) .cta-upgrade p { font-size: 16px; margin-bottom: 16px; }
:where(main) .cta-upgrade p:last-child { margin-bottom: 0; }
:where(main) .cta-upgrade a { font-weight: 700; }

/* Comparison grid */
:where(main) .comparison-table { display: block; margin: 28px 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); overflow: hidden; }
:where(main) .comparison-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; align-items: center; background: var(--bg-raised); border-bottom: 1px solid var(--border); }
:where(main) .comparison-row:last-child { border-bottom: 0; }
:where(main) .comparison-row > div { padding: 15px 18px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; }
:where(main) .comparison-row.header { background: var(--bg-surface); }
:where(main) .comparison-row.header > div { font-family: var(--font-sans); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); padding: 13px 18px; }
:where(main) .comparison-row .factor { font-weight: 600; color: var(--text); }
:where(main) .comparison-row .col-good, :where(main) .comparison-row .col-ok, :where(main) .comparison-row .col-voltrus, :where(main) .comparison-row .pro { color: var(--accent); font-weight: 600; }
:where(main) .comparison-row .col-mid, :where(main) .comparison-row .col-market, :where(main) .comparison-row .col-warn { color: var(--amber); }
:where(main) .comparison-row .col-bad, :where(main) .comparison-row .con { color: var(--bad); }
@media (max-width: 640px) {
  .comparison-table .comparison-row.comparison-row { grid-template-columns: 1fr 1fr; }
  .comparison-table .comparison-row .factor { grid-column: 1 / -1; border-bottom: 1px solid var(--border); background: var(--bg-surface); }
  .comparison-table .comparison-row.header { display: none; }
  :where(main) table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  :where(main) th, :where(main) td { overflow-wrap: normal; min-width: 110px; }
}

/* Plain tables */
:where(main) table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 28px 0; font-size: 14px; line-height: 1.5; }
:where(main) th, :where(main) td { padding: 12px 14px; text-align: left; vertical-align: top; color: var(--text-secondary); border: 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
:where(main) th { background: var(--bg-surface); font-family: var(--font-sans); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); border-bottom: 0; }
:where(main) th:first-child { border-top-left-radius: 0.9rem; border-bottom-left-radius: 0.9rem; }
:where(main) th:last-child { border-top-right-radius: 0.9rem; border-bottom-right-radius: 0.9rem; }
:where(main) td:first-child { color: var(--text); font-weight: 600; }
:where(main) tr:last-child td { border-bottom: 0; }

/* Breadcrumbs / back links */
:where(main) .breadcrumbs, :where(main) .breadcrumb { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 0 0 12px; }
:where(main) .breadcrumbs a, :where(main) .breadcrumb a { color: var(--text-muted); text-decoration: none; }
:where(main) .breadcrumbs a:hover, :where(main) .breadcrumb a:hover { color: var(--accent); }

/* Floating back pill (sits under the sticky site header) */
.floating-back { position: fixed; top: 76px; left: 16px; z-index: 90; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-family: var(--font-sans); font-size: 13px; font-weight: 600; text-decoration: none; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s var(--ease-out), color 0.15s; box-shadow: var(--shadow-float); }
.floating-back.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.floating-back:hover { color: var(--text); }
@media (max-width: 640px) { .floating-back { top: 68px; left: 12px; padding: 0 14px; } }

/* Related posts (BlogLayout) */
:where(main) .related-posts { margin: 56px 0 0; padding-top: 32px; border-top: 1px solid var(--border); }
:where(main) .related-title { font-size: 1.25rem; margin: 0 0 18px; }
:where(main) .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
:where(main) .related-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--bg-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); text-decoration: none; color: inherit; transition: transform 0.2s var(--ease-out); }
:where(main) .related-card:hover { transform: translateY(-2px); color: inherit; }
:where(main) .related-cat { align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--tint-green-ink); background: var(--tint-green); padding: 4px 10px; border-radius: 999px; }
:where(main) .related-name { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--text); }
:where(main) .related-card:hover .related-name { color: var(--accent); }
:where(main) .related-meta { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* .comparison-table used as a wrapper around a real <table> */
:where(main) .comparison-table > table { margin: 0; }
