/* Spyronix blog: article and listing styles. Builds on pages.css tokens. */

/* ---------- Article hero ---------- */
.post-hero h1 { max-width: 22ch; font-size: clamp(36px, 5vw, 76px); line-height: 1.04; }
.post-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; font-size: 14px; font-weight: 500; color: var(--muted); }
.post-crumbs a:hover { color: var(--ink); }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 28px 0 0; font-size: 15px; color: var(--muted); }
.post-meta b { color: var(--ink); font-weight: 600; }
.post-meta span + span::before { content: "·"; margin-right: 12px; color: #f3752b; font-weight: 700; }
.post-meta { gap: 8px 12px; }

/* ---------- Cover banner and figures ---------- */
.post-banner { margin-top: clamp(-24px, -2vw, -8px); }
.post-banner img { display: block; width: 100%; max-width: 1100px; height: auto; margin: 0 auto; border-radius: clamp(18px, 2vw, 28px); box-shadow: 0 40px 70px -40px rgba(14,14,18,.55); }
.post-figure { margin: 2em 0; }
.post-figure img { display: block; width: 100%; height: auto; border-radius: 22px; }
.post-card--thumb { padding-top: 0; overflow: hidden; }
.post-card--thumb img { display: block; width: calc(100% + 2 * clamp(24px, 2.6vw, 36px)); max-width: none; height: auto; margin: 0 calc(-1 * clamp(24px, 2.6vw, 36px)) 6px; aspect-ratio: 1200 / 630; object-fit: cover; transition: scale var(--dur-3) var(--ease-out); }
.post-card--thumb:hover img { scale: 1.03; }

/* ---------- Layout ---------- */
.post-layout { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: clamp(32px, 6vw, 96px); padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(56px, 8vw, 96px); justify-content: center; }
.post-toc { position: sticky; top: 28px; align-self: start; }
.post-toc p { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); }
.post-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.post-toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 15px; line-height: 1.35; color: var(--muted); transition: color var(--dur-2), border-color var(--dur-2); }
.post-toc a:hover { color: var(--ink); border-left-color: #f3752b; }
@media (max-width: 960px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-toc { display: none; }
}

/* ---------- Article body ---------- */
.post-body { font-size: clamp(17px, 1.2vw, 19px); line-height: 1.72; color: var(--ink-2); }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { margin: 2.2em 0 .6em; font-size: clamp(26px, 2.4vw, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; color: var(--ink); scroll-margin-top: 24px; text-wrap: balance; }
.post-body h3 { margin: 1.6em 0 .4em; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.post-body p { margin: 0 0 1.1em; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body a { color: var(--brand-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body ul, .post-body ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.post-body li { margin: 0 0 .55em; padding-left: .2em; }
.post-body li::marker { color: #f3752b; font-weight: 600; }
.post-body code { padding: 2px 7px; border-radius: 6px; background: var(--pill); font-size: .88em; color: var(--ink); }

.post-answer { padding: clamp(22px, 2.6vw, 32px); border-radius: 22px; background: var(--warm); border: 1px solid #f6e6d8; font-size: clamp(18px, 1.35vw, 21px); line-height: 1.6; }
.post-answer strong { font-weight: 600; }

.post-steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.post-steps > li { counter-increment: step; position: relative; padding-left: 52px !important; margin-bottom: 1em; }
.post-steps > li::before { content: counter(step); position: absolute; left: 0; top: .1em; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad); color: #fff; font-size: 15px; font-weight: 700; line-height: 1; }

.post-table { margin: 0 0 1.5em; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.post-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.post-table th, .post-table td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post-table thead th { background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; }
.post-table tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.post-table tbody tr:last-child > * { border-bottom: 0; }
.post-table tbody tr:nth-child(even) { background: #fbfbfc; }

.post-code { margin: 0 0 1.5em; padding: 18px 20px; overflow-x: auto; border-radius: 16px; background: var(--ink); color: #f4f4f6; font-size: 14px; line-height: 1.6; }
.post-code code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: pre; }

.post-callout { margin: 1.6em 0; padding: 20px 24px; border-left: 4px solid #f3752b; border-radius: 0 16px 16px 0; background: var(--pill); }
.post-callout p { margin: 0; }

.post-takeaways { margin: 2.4em 0; padding: clamp(24px, 3vw, 40px); border-radius: 26px; color: rgba(255,255,255,.82); background: radial-gradient(80% 90% at 100% 0%, rgba(247,150,52,.45), rgba(240,80,35,0) 60%), var(--ink); }
.post-takeaways h2 { margin-top: 0; color: #fff; }
.post-takeaways ul { margin-bottom: 0; }
.post-takeaways li::marker { color: #ffb37a; }

.post-faq h3 { padding-top: 1.2em; border-top: 1px solid var(--line); }
.post-faq h3:first-child { margin-top: .4em; }

.post-sources { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; }
.post-sources h2 { margin-top: 0; font-size: 22px; }
.post-sources li { margin-bottom: .6em; }
.post-review { margin-top: 1.4em; color: var(--muted); }

/* ---------- Reactions and sharing ---------- */
.post-engage { margin: 2.6em 0 0; padding: clamp(22px, 2.6vw, 32px); border-radius: 24px; border: 1px solid var(--line); background: #fff; display: grid; gap: 22px; }
.post-engage h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.post-engage p { margin: 0; font-size: 15px; color: var(--muted); }
.reacts, .share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.react { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--pill); font: 600 15px/1 inherit; font-family: inherit; color: var(--ink); cursor: pointer; transition: background-color var(--dur-2), border-color var(--dur-2), translate var(--dur-2) var(--ease-out); }
.react:hover { border-color: #f3c9a8; translate: 0 -2px; }
.react[aria-pressed="true"] { background: var(--warm); border-color: #f3752b; color: var(--brand-ink); }
.react__emoji { font-size: 18px; line-height: 1; }
.react__n { min-width: 1ch; font-variant-numeric: tabular-nums; color: var(--muted); }
.react[aria-pressed="true"] .react__n { color: var(--brand-ink); }
.react.is-pop .react__emoji { animation: react-pop .45s var(--ease-out); }
@keyframes react-pop { 40% { scale: 1.45; rotate: -8deg; } 100% { scale: 1; rotate: 0deg; } }
.share__btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none !important; transition: background-color var(--dur-2), color var(--dur-2), border-color var(--dur-2), translate var(--dur-2) var(--ease-out); }
.post-body .share__btn { color: var(--ink); }
.share__btn:hover, .post-body .share__btn:hover { translate: 0 -2px; background: var(--ink); color: #fff; border-color: var(--ink); }
.share__btn svg { width: 19px; height: 19px; }
.share__btn--wide { width: auto; padding: 0 16px; gap: 8px; grid-auto-flow: column; font: 600 14px inherit; font-family: inherit; border-radius: 999px; }
.share__status { align-self: center; font-size: 14px; color: var(--brand-ink); min-height: 1em; }
@media (prefers-reduced-motion: reduce) { .react.is-pop .react__emoji { animation: none; } }

/* ---------- Cards (index + related) ---------- */
.post-related { background: linear-gradient(180deg, #fff 0%, #fbfbfc 100%); border-top: 1px solid var(--line); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); margin-top: clamp(28px, 4vw, 48px); }
.post-grid--index { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.post-card { display: flex; flex-direction: column; gap: 14px; padding: clamp(24px, 2.6vw, 36px); border-radius: 24px; background: #fff; border: 1px solid var(--line); transition: translate var(--dur-3) var(--ease-out), box-shadow var(--dur-3), border-color var(--dur-3); }
.post-card:hover { translate: 0 -6px; border-color: #f3c9a8; box-shadow: 0 28px 50px -30px rgba(240,80,35,.45); }
.post-card__kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); }
.post-card b { font-size: clamp(22px, 1.9vw, 28px); font-weight: 600; line-height: 1.18; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.post-card__desc { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.post-card__foot, .post-card__more { margin-top: auto; font-size: 14px; color: var(--muted); }
.post-card__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.post-card__more svg { width: 15px; height: 15px; transition: translate var(--dur-2) var(--ease-out); }
.post-card:hover .post-card__more svg { translate: 3px -3px; }
@media (max-width: 900px) { .post-grid, .post-grid--index { grid-template-columns: minmax(0, 1fr); } }
