/* RunOps blog: index (blog.html) and posts (blog/*.html). Built by tools/blog.py. */

/* ---------- Light from above ---------- */
.blog-sky { position: absolute; inset: 0 0 auto; height: 1100px; z-index: -1; pointer-events: none; overflow: hidden; }
.blog-sky::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% -6%, #FFFFFF 0%, rgba(255, 255, 255, 0.7) 34%, rgba(255, 255, 255, 0) 70%); }
.blog-sky i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.blog-sky i:nth-child(1) { width: 560px; height: 560px; top: -180px; right: -80px; background: radial-gradient(circle, rgba(244, 165, 94, 0.55), rgba(244, 165, 94, 0) 70%); animation: sky-a 38s ease-in-out infinite; }
.blog-sky i:nth-child(2) { width: 640px; height: 640px; top: 120px; left: -260px; background: radial-gradient(circle, rgba(123, 140, 126, 0.42), rgba(123, 140, 126, 0) 70%); animation: sky-b 46s ease-in-out infinite; }
.blog-sky i:nth-child(3) { width: 420px; height: 420px; top: 380px; right: 22%; background: radial-gradient(circle, rgba(255, 253, 249, 0.95), rgba(255, 253, 249, 0) 70%); opacity: 0.8; }
@keyframes sky-a { 50% { transform: translate3d(-60px, 50px, 0) scale(1.08); } }
@keyframes sky-b { 50% { transform: translate3d(80px, -30px, 0) scale(1.06); } }
body.blog { position: relative; }

/* ---------- Index hero ---------- */
.blog-hero { text-align: center; padding-bottom: clamp(40px, 5vw, 64px); }
.blog-hero .h-xl { max-width: 12ch; margin-inline: auto; }
.blog-hero .lede { margin-inline: auto; }

/* ---------- Cards ---------- */
.post-card {
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    background: var(--paper); border: 1px solid var(--sage-line); border-radius: 28px; overflow: hidden;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 30px 80px -48px rgba(47, 62, 51, 0.38);
    transition: transform 500ms var(--ease-out), box-shadow 500ms var(--ease-out), border-color 300ms;
}
.post-card:hover { transform: translateY(-6px); border-color: rgba(201, 103, 24, 0.35); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 44px 90px -44px rgba(201, 103, 24, 0.38); }
.post-card[hidden] { display: none; }
.pc-art { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--sage-line); background: var(--cream-2); }
.pc-art svg { width: 100%; height: 100%; display: block; transition: transform 900ms var(--ease-out); }
.post-card:hover .pc-art svg { transform: scale(1.035); }
.pc-body { padding: 26px 28px 30px; display: flex; flex-direction: column; flex: 1; }
.pc-meta, .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-3); }
.pc-meta > * + *::before, .post-meta > * + *::before { content: '·'; margin-right: 10px; color: var(--sage-line); }
.pc-cat { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terracotta-deep); }
.pc-title { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.12; margin-top: 14px; font-variation-settings: 'opsz' 96, 'SOFT' 50; }
.pc-excerpt { margin-top: 12px; color: var(--ink-2); line-height: 1.6; font-size: 16px; }
.pc-more { margin-top: auto; padding-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--sage-deep); }
.pc-more svg { transition: transform 350ms var(--ease-out); }
.post-card:hover .pc-more { color: var(--terracotta-deep); }
.post-card:hover .pc-more svg { transform: translateX(4px); }

/* Featured: the newest post, laid out wide */
.blog-featured[hidden] { display: none; }
.post-card.featured { display: grid; grid-template-columns: 1.25fr 1fr; border-radius: 34px; }
.post-card.featured .pc-art { aspect-ratio: auto; min-height: 420px; border-bottom: 0; border-right: 1px solid var(--sage-line); }
.post-card.featured .pc-art svg { object-fit: cover; }
.post-card.featured .pc-body { padding: clamp(32px, 4vw, 56px); justify-content: center; }
.post-card.featured .pc-title { font-size: clamp(32px, 3.6vw, 50px); line-height: 1.04; letter-spacing: -0.025em; font-variation-settings: 'opsz' 144, 'SOFT' 50; }
.post-card.featured .pc-title.long { font-size: clamp(28px, 2.7vw, 38px); line-height: 1.1; }
.pc-title.long { font-size: clamp(21px, 1.8vw, 25px); }
.post-card.featured .pc-excerpt { font-size: 18px; }
.post-card.featured .pc-more { margin-top: 28px; padding-top: 0; }
.post-card.featured::after { display: none; } /* no glass sheen over the art */

/* ---------- List ---------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: 500 14px/1 var(--sans); padding: 10px 18px; border-radius: 999px; border: 1px solid var(--sage-line); background: var(--paper); color: var(--ink-2); cursor: pointer; transition: background 200ms, color 200ms, border-color 200ms; }
.pill:hover { border-color: var(--sage); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--sage-deep); border-color: var(--sage-deep); color: var(--on-dark); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.post-grid[data-count="1"] { grid-template-columns: minmax(0, 560px); }

/* ---------- Post ---------- */
.read-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 300; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--terracotta-soft), var(--terracotta)); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 12px rgba(230, 126, 34, 0.45); }

.post-hero { padding-top: clamp(140px, 14vw, 190px); text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 8px 16px 8px 12px; border-radius: 999px; border: 1px solid var(--sage-line); background: rgba(255, 253, 249, 0.7); transition: color 200ms, border-color 200ms; }
.back-link:hover { color: var(--terracotta-deep); border-color: var(--terracotta-soft); }
.post-meta { justify-content: center; margin-top: 30px; }
.post-title { font-size: clamp(40px, 6.2vw, 80px); line-height: 1.0; letter-spacing: -0.03em; max-width: 16ch; margin: 18px auto 0; font-variation-settings: 'opsz' 144, 'SOFT' 50; }
.post-title.long { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.04; max-width: 22ch; }
.byline { display: inline-flex; align-items: center; gap: 12px; margin-top: 30px; text-align: left; }
.byline strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.byline small { display: block; font-size: 13px; color: var(--ink-3); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 500 16px/1 var(--serif); color: var(--paper); background: radial-gradient(circle at 30% 25%, var(--terracotta-soft), var(--terracotta-deep)); box-shadow: 0 0 0 4px rgba(255, 253, 249, 0.9), 0 8px 24px -8px rgba(201, 103, 24, 0.6); }

.post-art { position: relative; max-width: 1080px; margin: clamp(44px, 5vw, 68px) auto 0; border-radius: 34px; overflow: hidden; border: 1px solid var(--sage-line); box-shadow: 0 60px 120px -60px rgba(47, 62, 51, 0.45); }
.post-art::before { content: ''; position: absolute; inset: -20% -10% auto; height: 60%; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5), transparent 70%); pointer-events: none; }
.post-art svg { display: block; width: 100%; height: auto; }

.prose { max-width: 700px; margin: clamp(56px, 7vw, 96px) auto 0; font-size: 19px; line-height: 1.75; color: #3B362F; }
.prose > * + * { margin-top: 1.15em; }
.prose > p:first-child { font-family: var(--serif); font-size: clamp(23px, 2.3vw, 28px); line-height: 1.42; color: var(--ink); letter-spacing: -0.01em; font-variation-settings: 'opsz' 48, 'SOFT' 50; }
.prose h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.12; color: var(--ink); margin-top: 2.2em; font-variation-settings: 'opsz' 96, 'SOFT' 50; scroll-margin-top: 120px; }
.prose h2 + * { margin-top: 0.7em; }
.prose h3 { font-size: 24px; margin-top: 1.8em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--terracotta-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 30px; }
.prose li + li { margin-top: 0.55em; }
.prose ul li::before { content: ''; position: absolute; left: 6px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--terracotta); box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.14); }
.prose ol { counter-reset: n; }
.prose ol li { counter-increment: n; }
.prose ol li::before { content: counter(n); position: absolute; left: 0; font: 500 13px/2.3 var(--mono); color: var(--terracotta-deep); }
.prose blockquote { border-left: 2px solid var(--terracotta); padding: 4px 0 4px 26px; font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.45; color: var(--ink); }

/* Tables read as a card, with the bottom-line row lit */
.post-table { margin-block: 2em; border-radius: 22px; border: 1px solid var(--sage-line); background: var(--paper); overflow-x: auto; box-shadow: 0 30px 70px -50px rgba(47, 62, 51, 0.4); }
.post-table table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; min-width: 520px; }
.post-table th, .post-table td { padding: 16px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--sage-line); }
.post-table thead th { font: 500 12px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); background: var(--cream-2); }
.post-table tbody th { font-weight: 500; color: var(--ink-2); width: 42%; }
.post-table td { color: var(--ink); font-variant-numeric: tabular-nums; }
.post-table tbody tr:last-child th, .post-table tbody tr:last-child td { border-bottom: 0; background: rgba(244, 165, 94, 0.1); }
.post-table tbody tr:last-child td { font-family: var(--serif); font-size: 24px; color: var(--terracotta-deep); }

/* Sign-off */
.post-end { max-width: 700px; margin: clamp(56px, 6vw, 80px) auto 0; padding-top: 44px; border-top: 1px solid var(--sage-line); position: relative; }
.post-end::before { content: ''; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); box-shadow: 0 0 0 6px rgba(230, 126, 34, 0.15), 0 0 24px rgba(230, 126, 34, 0.6); }
.signoff-line { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; color: var(--sage-deep); letter-spacing: -0.01em; }
.post-end .byline { margin-top: 26px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.share .btn { min-height: 42px; padding: 10px 20px; font-size: 14px; }

.post-sources { max-width: 700px; margin: 56px auto 0; padding: 28px 30px; border-radius: 22px; background: rgba(245, 239, 230, 0.7); border: 1px solid var(--sage-line); font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.post-sources h2 { font: 500 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--sage); margin-bottom: 16px; }
.post-sources ol { list-style: none; padding: 0; counter-reset: s; }
.post-sources li { counter-increment: s; position: relative; padding-left: 28px; }
.post-sources li + li { margin-top: 10px; }
.post-sources li::before { content: counter(s); position: absolute; left: 0; font: 500 12px/1.9 var(--mono); color: var(--terracotta-deep); }
.post-sources a { color: var(--sage-deep); text-underline-offset: 3px; }
.post-sources a:hover { color: var(--terracotta-deep); }

.blog-more { margin-top: clamp(40px, 6vw, 80px); }

/* ---------- Photos ---------- */
.pc-art.is-photo picture, .post-art.is-photo picture { display: block; width: 100%; height: 100%; }
.pc-art.is-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1100ms var(--ease-out); }
.post-card:hover .pc-art.is-photo img { transform: scale(1.035); }
.post-art.is-photo { aspect-ratio: 16 / 9; background: var(--sage-night); }
.post-art.is-photo::before { display: none; }
.post-art.is-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prose .post-figure { margin: 2.6em -80px 2.2em; }
.post-figure img { display: block; width: 100%; height: auto; border-radius: 26px; box-shadow: 0 40px 90px -55px rgba(47, 62, 51, 0.45); }
.post-figure figcaption { margin-top: 14px; text-align: center; font-size: 14px; color: var(--ink-3); font-style: italic; font-family: var(--serif); }
.art-wash { width: 100%; height: 100%; min-height: 100%; aspect-ratio: 16 / 10; background: radial-gradient(ellipse at 78% 18%, rgba(244, 165, 94, 0.45), transparent 60%), radial-gradient(ellipse at 10% 95%, rgba(123, 140, 126, 0.3), transparent 60%), linear-gradient(180deg, var(--paper), var(--cream-2)); }
@media (max-width: 900px) { .prose .post-figure { margin-inline: 0; } }

@media (max-width: 900px) {
    .post-card.featured { grid-template-columns: 1fr; }
    .post-card.featured .pc-art { min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--sage-line); }
}
@media (max-width: 600px) {
    .prose { font-size: 17.5px; }
    .post-art { border-radius: 22px; }
    .pc-body { padding: 22px 22px 26px; }
    .post-table th, .post-table td { padding: 13px 14px; }
    .post-table tbody tr:last-child td { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .blog-sky i { animation: none; }
    .post-card, .pc-art svg { transition: none; }
}
