/* SideGig Data blog styles. Shared by /blog/index.html and every article.
   Tokens match the SideGig Data design system (light only). */

:root {
  --surface: #f9fafb;
  --surface-raised: #ffffff;
  --surface-sunken: #f3f4f6;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --ink: #111827;
  --ink-body: #374151;
  --ink-secondary: #4b5563;
  --ink-muted: #6b7280;
  --accent: #6366f1;
  --accent-text: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-muted: #c7d2fe;
  --button: #4f46e5;
  --button-hover: #4338ca;
  --on-button: #ffffff;
  --link: #4f46e5;
  --link-hover: #4338ca;
  --focus-ring: #6366f1;
  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #a16207;
  --warning-soft: #fefce8;
  --band: #030712;
  --font-sans: "Geist", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-nav: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

html { scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.wrap { max-width: 1152px; margin: 0 auto; padding-inline: clamp(16px, 5vw, 64px); box-sizing: content-box; }

/* Nav */
.site-header { position: sticky; top: 16px; z-index: 10; padding-inline: 16px; }
.md-nav { max-width: 1152px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 18px 28px; background: var(--nav-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-nav); }
.md-navlinks { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.navlink { color: var(--ink-body); text-decoration: none; }
.navlink:hover, .navlink[aria-current="page"] { color: var(--ink); }

/* Wordmark */
.md-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; text-decoration: none; white-space: nowrap; }
.md-brand:hover { color: var(--ink); }
.md-brand svg { width: 16.5px; height: 22px; fill: var(--accent); flex: none; margin-right: -1px; transform: translateY(-1px) rotate(8deg); }
.md-brand span { position: relative; top: -2px; }
.md-brand.sm { font-size: 17px; }
.md-brand.sm svg { width: 14.25px; height: 19px; }
.md-brand.sm span { top: -1px; }

/* Buttons */
.md-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 4px; background: var(--button); color: var(--on-button); font-size: 16px; font-weight: 500; letter-spacing: 0.4px; text-decoration: none; white-space: nowrap; }
.md-btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; font-weight: 600; letter-spacing: 0; box-shadow: var(--shadow-xs); }
.md-btn:hover { background: var(--button-hover); color: var(--on-button); }
@media (max-width: 560px) { .md-nav .md-btn { display: none; } .md-nav { padding: 14px 20px; } }

/* Shared type */
.md-eyebrow { margin: 0; font-size: 18px; line-height: 28px; font-weight: 600; letter-spacing: -0.45px; color: var(--accent-text); }
.md-eyebrow a { color: inherit; text-decoration: none; }
.md-eyebrow a:hover { text-decoration: underline; }
.md-intro { margin: 16px 0 0; max-width: 720px; font-size: 18px; line-height: 28px; color: var(--ink-body); text-wrap: pretty; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; line-height: 22px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.meta .dot { color: var(--line-strong); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 9999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; line-height: 18px; font-weight: 600; }

/* ---------- Blog index ---------- */
.blog-hero { padding: 96px 0 32px; }
.blog-hero h1 { margin: 8px 0 0; max-width: 780px; font-size: clamp(36px, 4.6vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -0.04em; text-wrap: balance; }
.post-list { padding: 0 0 clamp(64px, 8vw, 96px); }

.post-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-xs); color: inherit; text-decoration: none; }
.post-card:hover { border-color: var(--line-strong); color: inherit; }
.post-card:hover h2, .post-card:hover h3 { color: var(--accent-text); }
.post-card h2, .post-card h3 { margin: 0; color: var(--ink); text-wrap: balance; font-size: 18px; line-height: 28px; font-weight: 600; }
.post-card p { margin: 0; font-size: 16px; line-height: 26px; color: var(--ink-muted); text-wrap: pretty; }
.post-card .meta { margin-top: auto; padding-top: 4px; }

/* Photo frame clips the hover zoom. Overflow stays off the card so the focus outline can paint. */
.cover-frame { overflow: hidden; border-radius: 7px 7px 0 0; }
.post-card.has-media { padding: 0; gap: 0; }
.post-card.has-media .post-card-copy { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 20px 24px 24px; }
.post-card-copy .meta { margin-top: 0; }

/* CSS placeholder. A later <img class="blog-cover"> keeps the 16:9 frame and does not show the icon or label. */
.blog-cover { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; aspect-ratio: 16 / 9; background: #E5E7EB; color: #6B7280; border-radius: 8px; border: 1px solid var(--line); }
.blog-cover::before { content: ""; width: 44px; height: 34px; flex: none; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 34' fill='none'%3E%3Crect x='1.25' y='1.25' width='41.5' height='31.5' rx='4' stroke='%236B7280' stroke-width='1.75'/%3E%3Ccircle cx='14' cy='12' r='3.25' stroke='%236B7280' stroke-width='1.75'/%3E%3Cpath d='M6.5 26.5 15 18l6 5.5 4.5-4L37.5 27' stroke='%236B7280' stroke-width='1.75' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }
.blog-cover::after { content: "Image"; font-size: 14px; line-height: 20px; font-weight: 500; }
img.blog-cover { display: block; height: auto; object-fit: cover; }
img.blog-cover::before,
img.blog-cover::after { content: none; }
picture:has(> img.blog-cover) { display: block; width: 100%; }
.post-card .blog-cover { border: 0; border-radius: 0; }

.card-read { align-self: flex-start; margin-top: auto; color: var(--accent-text); font-size: 16px; line-height: 24px; font-weight: 600; text-decoration: none; }
.card-read:hover { color: var(--accent-text); }
.card-read::after { content: ""; position: absolute; inset: 0; }
.card-read-arrow { display: inline-block; }
.post-card:has(.card-read):focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.post-card .card-read:focus-visible { outline: none; }

.post-card.featured { padding: clamp(24px, 4vw, 40px); background: var(--accent-soft); border-color: var(--accent-muted); box-shadow: none; border-radius: 12px; }
.post-card.featured h2 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; max-width: 760px; }
.post-card.featured p { max-width: 720px; font-size: 18px; line-height: 28px; color: var(--ink-body); }
.post-card.featured:hover { border-color: var(--accent); }
.post-card.featured .pill { background: var(--surface-raised); }

/* One live article: <article class="post-card featured has-media"> outside .post-grid.
   Image left, text right; stacks under 720px. With more than one card, drop "featured"
   and put every card in .post-grid. */
.post-card.featured.has-media { display: grid; grid-template-columns: minmax(240px, 42%) 1fr; padding: 0; align-items: stretch; }
.post-card.featured.has-media .cover-frame { position: relative; min-height: 100%; border-radius: 11px 0 0 11px; }
.post-card.featured.has-media .blog-cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.post-card.featured.has-media .post-card-copy { padding: clamp(24px, 4vw, 40px); justify-content: center; }
@media (max-width: 720px) {
  .post-card.featured.has-media { grid-template-columns: 1fr; }
  .post-card.featured.has-media .cover-frame { aspect-ratio: 16 / 9; min-height: 0; border-radius: 11px 11px 0 0; }
  .post-card.featured.has-media .blog-cover { position: static; height: auto; aspect-ratio: 16 / 9; }
}

.post-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .card-read-arrow { transition: transform 160ms ease; }
  .post-card:hover .card-read-arrow,
  .post-card:focus-within .card-read-arrow { transform: translateX(4px); }
  .post-card.has-media .blog-cover { transition: transform 280ms ease; }
  .post-card.has-media:hover .blog-cover,
  .post-card.has-media:focus-within .blog-cover { transform: scale(1.03); }
}

/* ---------- Article ---------- */
.article { padding: 96px 0 clamp(64px, 8vw, 96px); }
.article-col { max-width: 880px; margin: 0 auto; }
.crumbs { margin: 0 0 24px; font-size: 14px; color: var(--ink-muted); }
.crumbs a { color: var(--ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.article h1 { margin: 8px 0 0; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.06; font-weight: 700; letter-spacing: -0.04em; text-wrap: balance; }
.dek { margin: 16px 0 0; font-size: 20px; line-height: 30px; color: var(--ink-body); text-wrap: pretty; }
.byline { margin-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; background: var(--surface-sunken); border: 2px solid var(--surface-raised); box-shadow: var(--shadow-xs); flex: none; }
.byline-name { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }

/* Cover, header, and body share the 880px column. On a narrow screen they fill it. */
.article-hero { margin: 32px 0 0; }
.article-hero .blog-cover { width: 100%; border-radius: 8px; border: 1px solid var(--line); }

.takeaways { margin: 32px 0 0; padding: 20px 24px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px; }
.takeaways h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.takeaways ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.takeaways li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 15px; line-height: 22px; color: var(--ink-secondary); }
.takeaways svg { width: 20px; height: 20px; color: var(--success); margin-top: 1px; }

/* Article body prose */
.prose { margin-top: 32px; font-size: 18px; line-height: 30px; color: var(--ink-body); }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 20px; }
.prose p { text-wrap: pretty; }
.prose h2 { margin-top: 48px; font-size: clamp(24px, 2.4vw, 28px); line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); text-wrap: balance; }
.prose h3 { margin-top: 32px; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--ink-muted); }
.prose code { font-family: var(--font-mono); font-size: 0.85em; padding: 2px 6px; background: var(--surface-sunken); border-radius: 4px; color: var(--ink); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent-muted); font-size: 20px; line-height: 32px; color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 12px; }
.prose figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.prose figcaption { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-top: 40px; margin-bottom: 40px; }

.callout { padding: 16px 20px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent-muted); font-size: 16px; line-height: 26px; color: var(--ink-body); }
.callout strong { display: block; margin-bottom: 2px; color: var(--ink); }
.callout.caution { background: var(--warning-soft); border-color: #fde68a; }

.sources { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.sources h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ink); }
.sources ol { margin: 12px 0 0; padding-left: 20px; font-size: 14px; line-height: 22px; color: var(--ink-secondary); }
.sources li + li { margin-top: 6px; }

/* Article CTA */
.article-cta { margin-top: 48px; padding: clamp(24px, 4vw, 32px); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); }
.article-cta h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.article-cta p { margin: 8px 0 0; font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.cta-row { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.cta-note { font-size: 14px; color: var(--ink-muted); }

/* Related */
.related { padding: clamp(64px, 8vw, 96px) 0; background: var(--surface-raised); border-top: 1px solid var(--line); }
.related .post-card { background: var(--surface); }

/* Footer */
.md-footer { padding: 32px 0; border-top: 1px solid var(--line); }
.md-footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; font-size: 14px; color: var(--ink-secondary); }
.md-footer a:not(.md-brand) { color: inherit; }
.md-footer a:not(.md-brand):hover { color: var(--ink); }
