/* Ukkometa.fi blog: the hub (/blog/, /en/blog/) and every post.
   One file, loaded after subpage.css. Until 2026-11-01 each post carried its
   own 80-line inline <style> in four drifting variants; those are gone, so a
   change here lands on every post. The header and footer are in chrome.css.
   Tokens match site.css (the contrast-corrected values). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --black:   #fafaf8;
  --off:     #f3f2ec;
  --surface: #ffffff;
  --border:  #e3e1da;
  --muted:   #706d66;
  --subtle:  #5a5955;
  --body:    #3d3c38;
  --white:   #1a1a1a;
  --accent:  #7f6628;
  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;
  --max: 1280px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --post-max: 800px;   /* 720 px of text at desktop padding: about 80 characters a line */
  --post-bleed: 80px;  /* tables and code blocks widen past the text column on wide screens */
}
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { opacity: .8; }
.container { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.post-container { max-width: var(--post-max); }

/* ── Post header ─────────────────────────────────────────────────────── */
.post-header { padding-block: 3.5rem 2rem; border-bottom: 1px solid var(--border); }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.25rem;
}
.post-meta__sep { color: var(--border); }
.post-tags-header { display: flex; gap: .4rem; flex-wrap: wrap; }
.post-tag {
  font-size: .7rem; padding: .25em .65em; border: 1px solid rgba(127,102,40,.3);
  border-radius: 999px; color: var(--accent); letter-spacing: .04em; text-transform: none;
}
.post-title-main {
  font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 700;
  color: var(--white); line-height: 1.1; letter-spacing: -.01em; margin-bottom: 1.25rem;
  text-wrap: balance;
}
.post-description { font-size: 1.2rem; line-height: 1.6; color: var(--subtle); max-width: 640px; }
.post-byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin-top: 1.75rem; font-size: .9rem; color: var(--subtle);
}
.post-byline strong { color: var(--white); font-weight: 600; }
.post-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--white); color: var(--black);
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.post-lang-link { margin-left: auto; font-size: .85rem; color: var(--accent); text-decoration: none; }
.post-lang-link:hover { text-decoration: underline; opacity: 1; }

/* ── Post body ───────────────────────────────────────────────────────── */
.post-body { padding-block: 2.5rem 3rem; font-size: 1.0625rem; line-height: 1.75; }
.post-body p { margin-bottom: 1.5rem; }
.post-body p.lead { font-size: 1.25rem; line-height: 1.6; color: var(--white); margin-bottom: 1.75rem; }
.post-body h2 {
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; color: var(--white);
  line-height: 1.2; letter-spacing: -.01em; margin: 3.25rem 0 1rem;
}
.post-body h2::before {
  content: ""; display: block; width: 2.5rem; height: 3px; border-radius: 2px;
  background: var(--accent); margin-bottom: 1rem;
}
.post-body h3 {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--white);
  line-height: 1.3; margin: 2.25rem 0 .6rem;
}
.post-body h4 {
  font-size: .9rem; font-weight: 600; color: var(--subtle); margin: 2rem 0 .5rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.post-body ul, .post-body ol { margin: 0 0 1.5rem 1.4rem; }
.post-body li { margin-bottom: .5rem; padding-left: .2rem; }
.post-body li::marker { color: var(--accent); }
.post-body strong { color: var(--white); font-weight: 600; }
.post-body em { color: var(--subtle); }
.post-body a { color: var(--accent); text-decoration-thickness: 1px; }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }
.post-body img { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin: 1.75rem 0; }

.post-body code {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: .88em;
  background: var(--off); border: 1px solid var(--border); border-radius: 4px;
  padding: .1em .4em; color: var(--accent);
}
.post-body pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.25rem; overflow-x: auto; margin: 1.75rem 0; font-size: .9rem; line-height: 1.6;
}
.post-body pre code { background: none; border: 0; padding: 0; color: var(--body); font-size: inherit; }

.post-body table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.75rem 0;
  font-size: .95rem; line-height: 1.5; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.post-body th {
  background: var(--off); text-align: left; font-weight: 600; color: var(--white);
  font-size: .85rem; letter-spacing: .02em; padding: .75rem .9rem; border-bottom: 1px solid var(--border);
}
.post-body th:first-child { border-top-left-radius: 8px; }
.post-body th:last-child { border-top-right-radius: 8px; }
.post-body td { padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.post-body tr:last-child td { border-bottom: 0; }

/* Ordinary quotes stay quiet; a pull quote is loud on purpose. */
.post-body blockquote {
  border-left: 3px solid rgba(127,102,40,.35); padding-left: 1.25rem; margin: 1.75rem 0;
  color: var(--subtle); font-style: italic;
}
.post-body blockquote.pull {
  position: relative; border: 0; margin: 2.5rem 0; padding: .25rem 0 .25rem 1.5rem;
  font-family: var(--font-display); font-style: normal; font-size: 1.45rem; line-height: 1.35;
  color: var(--white); text-wrap: balance;
}
.post-body blockquote.pull::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px;
  background: var(--accent);
}
.post-body blockquote.pull p { margin: 0; }

/* The three-line summary after the intro. */
.takeaways {
  background: var(--off); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 1.5rem 1.75rem; margin: 2.25rem 0 2.5rem;
}
.takeaways__label {
  font-family: var(--font-display); font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}
.takeaways ul { margin: 0 0 0 1.2rem; }
.takeaways li { margin-bottom: .5rem; color: var(--white); }
.takeaways li:last-child { margin-bottom: 0; }

/* A dated note ("Päivitys 4.4.2026: …") set apart from the argument. */
.callout {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.1rem 1.4rem 1.1rem 1.35rem; margin: 0 0 1.75rem;
  font-size: .95rem; line-height: 1.65; color: var(--subtle);
}
.callout::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px;
  background: var(--accent);
}
.callout p { margin: 0; }
.callout p + p { margin-top: .75rem; }

.post-loading { color: var(--muted); font-size: .9rem; padding: 2rem 0; }

/* ── After the article: author, pilot, next post ─────────────────────── */
.post-end { border-top: 1px solid var(--border); padding-block: 2.5rem 4rem; display: grid; gap: 2rem; }

.author-card { display: flex; gap: 1.25rem; align-items: flex-start; }
.author-card .post-avatar { width: 56px; height: 56px; font-size: 1.4rem; }
.author-card__name { font-family: var(--font-display); font-weight: 700; color: var(--white); font-size: 1.05rem; }
.author-card__role { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.author-card__bio { font-size: .95rem; color: var(--subtle); line-height: 1.6; }

.post-cta {
  background: var(--white); color: var(--black); border-radius: 12px; padding: 2.25rem;
  display: grid; gap: 1rem;
}
.post-cta__label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(250,250,248,.6); }
.post-cta__title {
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 700;
  line-height: 1.15; color: var(--black); text-wrap: balance;
}
.post-cta__text { color: rgba(250,250,248,.78); max-width: 560px; font-size: 1rem; line-height: 1.6; }
.post-cta__actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-top: .25rem; }
.post-cta__btn {
  display: inline-block; background: var(--black); color: var(--white); font-weight: 600; font-size: .95rem;
  padding: .8em 1.5em; border-radius: 999px; text-decoration: none;
}
.post-cta__btn:hover { opacity: .9; }
.post-cta__link { color: rgba(250,250,248,.8); font-size: .9rem; }

.post-next { display: grid; gap: .5rem; }
.post-next__label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.post-next__card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.25rem 1.5rem; text-decoration: none; color: inherit; transition: border-color .2s;
}
.post-next__card:hover { border-color: var(--subtle); opacity: 1; }
.post-next__title { display: block; font-family: var(--font-display); font-weight: 600; color: var(--white); font-size: 1.1rem; line-height: 1.3; margin-bottom: .35rem; }
.post-next__excerpt { display: block; font-size: .9rem; color: var(--subtle); line-height: 1.55; }

/* ── Hub ─────────────────────────────────────────────────────────────── */
.blog-header { padding-block: 4rem 3rem; border-bottom: 1px solid var(--border); }
.blog-header-label { font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.blog-header-title { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; color: var(--white); line-height: 1.1; margin-bottom: 1rem; }
.blog-header-desc { color: var(--body); max-width: 540px; }
.blog-lang-toggle { margin-top: 1.5rem; display: flex; gap: .5rem; }
.blog-lang-btn { font-size: .78rem; padding: .3em .8em; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--subtle); transition: all .2s; }
.blog-lang-btn.active, .blog-lang-btn:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

.blog-listing { padding-block: 3rem; }
.blog-listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.blog-post-card {
  background: var(--off); border: 1px solid var(--border); border-radius: 8px; padding: 1.75rem;
  display: flex; flex-direction: column; gap: .8rem; text-decoration: none; color: inherit;
  transition: border-color .2s, background .2s;
}
.blog-post-card:hover { background: var(--surface); border-color: var(--subtle); opacity: 1; }
.blog-post-card .post-meta { margin-bottom: 0; }
.post-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--white); line-height: 1.3; }
.post-excerpt { font-size: .9rem; color: var(--body); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.post-read-more { font-size: .82rem; color: var(--accent); }

/* The newest post, and a lone post, take the full row instead of one tile. */
.blog-post-card--featured { grid-column: 1 / -1; padding: 2.5rem; background: var(--surface); }
.blog-post-card--featured .post-title { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.15; max-width: 720px; }
.blog-post-card--featured .post-excerpt { display: block; -webkit-line-clamp: unset; font-size: 1.05rem; max-width: 640px; }

.blog-empty { grid-column: 1 / -1; text-align: center; padding: 4rem 1rem; color: var(--muted); }
.blog-empty-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--subtle); margin-bottom: .5rem; }

/* ── Phones ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .post-body { font-size: 1rem; }
  .post-body p.lead { font-size: 1.125rem; }
  .post-body blockquote.pull { font-size: 1.25rem; }
  .post-lang-link { margin-left: 0; flex-basis: 100%; }
  .post-cta { padding: 1.5rem; }
  .author-card { gap: 1rem; }
  .blog-listing-grid { grid-template-columns: 1fr; }
  .blog-post-card--featured { padding: 1.75rem; }
  /* A table wider than the phone scrolls sideways instead of clipping its last column. */
  .post-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Wide screens: data gets room the prose does not need ───────────── */
@media (min-width: 1000px) {
  .post-body table, .post-body pre {
    width: calc(100% + 2 * var(--post-bleed));
    margin-inline: calc(-1 * var(--post-bleed));
  }
}
