:root {
  color-scheme: light;
  --ink: #25322a;
  --muted: #69766e;
  --green: #176d49;
  --green-dark: #105238;
  --paper: #f5f6ef;
  --card: rgba(255, 255, 255, 0.84);
  --line: #dce2d9;
  --focus: #d49a32;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 15% 5%, #eef4e8 0, transparent 34rem), var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
img { max-width: 100%; }

.blog-header,
.blog-footer,
.blog-hero,
.blog-featured,
.blog-grid,
.blog-article {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.blog-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}
.blog-brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-weight: 850; text-decoration: none; }
.blog-brand img { border-radius: 12px; }
.blog-header nav { display: flex; align-items: center; gap: 26px; }
.blog-header nav a,
.blog-login { color: var(--muted); font-size: .9rem; font-weight: 720; text-decoration: none; }
.blog-header nav a[aria-current="page"],
.blog-header nav a:hover,
.blog-login:hover { color: var(--green); }
.blog-login { justify-self: end; }

.blog-hero {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(320px, 1fr);
  grid-template-areas: "title title" "image copy";
  align-items: center;
  gap: 0 48px;
  padding: 44px 0 36px;
}
.blog-hero-title { grid-area: title; margin-bottom: 10px; }
.blog-hero-title span,
.blog-comments-title span { color: var(--green); font-size: .73rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.blog-hero-title h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
.blog-hero-image { grid-area: image; display: flex; justify-content: center; height: 300px; min-width: 0; }
.blog-hero-image img { width: auto; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 26px rgba(31, 51, 38, .12)); }
.blog-hero > p { grid-area: copy; max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1.3rem, 2.2vw, 2.15rem); line-height: 1.42; letter-spacing: -.025em; text-wrap: balance; }

.blog-featured { margin-bottom: 24px; }
.blog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.blog-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.blog-card {
  min-width: 0;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: clamp(25px, 3.2vw, 38px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  color: inherit;
  background: var(--card);
  box-shadow: 0 18px 48px rgba(37, 50, 42, .055);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.blog-card-featured { min-height: 370px; background: rgba(225, 238, 222, .9); }
.blog-card-image { width: 100%; aspect-ratio: 16 / 9; margin: calc(clamp(25px, 3.2vw, 38px) * -1) calc(clamp(25px, 3.2vw, 38px) * -1) 28px; max-width: none; width: calc(100% + clamp(50px, 6.4vw, 76px)); object-fit: cover; }
.blog-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: .8rem; }
.blog-card h2 { margin: 38px 0 0; font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.08; letter-spacing: -.04em; overflow-wrap: anywhere; text-wrap: balance; }
.blog-card-featured h2 { max-width: 900px; font-size: clamp(2rem, 4.2vw, 3.65rem); }
.blog-card > p {
  max-width: 780px;
  display: -webkit-box;
  margin: 18px 0 24px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
}
.blog-engagement { margin-top: auto; color: var(--muted); font-weight: 690; }
.blog-read { margin-top: 18px; color: var(--green); font-weight: 850; }
.blog-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.blog-card:active { transform: translateY(1px) scale(.995); }
@media (hover: hover) and (pointer: fine) {
  .blog-card:hover { transform: translateY(-3px); border-color: #acc5b4; background: #fff; box-shadow: 0 24px 60px rgba(37, 50, 42, .1); }
  .blog-card:hover .blog-read { color: var(--green-dark); }
}

.blog-empty,
.blog-not-found { padding: 64px 28px; text-align: center; }
.blog-empty { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 24px; }
.blog-empty p,
.blog-not-found p { color: var(--muted); }
.blog-not-found { max-width: 680px; margin: 12vh auto; }
.blog-not-found > strong { color: var(--green); font-size: 1rem; letter-spacing: .12em; }
.blog-not-found h1 { font-size: clamp(2.2rem, 7vw, 4.6rem); margin: 14px 0; }
.blog-not-found a { display: inline-flex; margin-top: 18px; color: var(--green); font-weight: 800; }

.blog-article { max-width: 900px; margin-top: 64px; }
.blog-article > header { padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.blog-back { color: var(--green); font-weight: 800; text-decoration: none; }
.blog-article h1 { max-width: 880px; margin: 30px 0 20px; font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: .98; letter-spacing: -.055em; overflow-wrap: anywhere; text-wrap: balance; }
.blog-article > header > p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.16rem; line-height: 1.7; }
.blog-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: 28px; color: var(--muted); font-size: .84rem; }
.blog-article-meta strong { color: var(--ink); }
.blog-article-preview { width: 100%; aspect-ratio: 16 / 9; margin-top: 38px; border-radius: 24px; object-fit: cover; }
.blog-markdown { padding: 54px 0; font-size: 1.06rem; line-height: 1.82; overflow-wrap: anywhere; }
.blog-markdown h1,
.blog-markdown h2,
.blog-markdown h3 { margin: 1.6em 0 .55em; line-height: 1.16; letter-spacing: -.032em; text-wrap: balance; }
.blog-markdown h1 { font-size: 2.3rem; }
.blog-markdown h2 { font-size: 1.9rem; }
.blog-markdown h3 { font-size: 1.45rem; }
.blog-markdown p,
.blog-markdown ul,
.blog-markdown ol,
.blog-markdown blockquote,
.blog-markdown figure { margin: 0 0 1.25em; }
.blog-markdown blockquote { padding: 18px 22px; border-left: 4px solid var(--focus); border-radius: 0 14px 14px 0; background: #f5ecd9; }
.blog-markdown code { padding: 2px 6px; border-radius: 6px; background: #e9ede6; }
.blog-markdown a { color: var(--green); }
.blog-markdown figure { width: 75%; margin: 30px auto; }
.blog-image-button { width: 100%; display: block; padding: 0; border: 0; border-radius: 18px; cursor: zoom-in; background: transparent; }
.blog-image-button img { width: 100%; height: auto; display: block; border-radius: inherit; }
.blog-image-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.blog-markdown figcaption { margin-top: 8px; color: var(--muted); font-size: .8rem; text-align: center; }
.blog-inline-image { max-width: 75%; height: auto; vertical-align: middle; }
.blog-table-wrap { max-width: 100%; margin: 32px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .72); -webkit-overflow-scrolling: touch; }
.blog-table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.blog-markdown table { width: 100%; min-width: 560px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.blog-markdown th,
.blog-markdown td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.blog-markdown th { color: var(--ink); background: #edf2e9; font-size: .86rem; line-height: 1.4; }
.blog-markdown tbody tr:last-child td { border-bottom: 0; }
.blog-markdown .align-left { text-align: left; }
.blog-markdown .align-center { text-align: center; }
.blog-markdown .align-right { text-align: right; }

.blog-reactions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.blog-reactions button { min-height: 46px; display: inline-flex; align-items: center; gap: 10px; padding: 0 17px; border: 1px solid #b9cbbc; border-radius: 999px; color: var(--green); background: #eef5ef; font: inherit; font-weight: 800; cursor: pointer; }
.blog-reactions button[aria-pressed="true"] { color: #9d3340; border-color: #e0b5bb; background: #f9e8eb; }
.blog-reactions button:focus-visible,
.blog-comment-form button:focus-visible,
.blog-cta a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.blog-comments { padding: 48px 0; }
.blog-comments-title { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.blog-comments-title h2 { margin: 8px 0 0; font-size: 2.2rem; }
.blog-comments-title > strong { color: var(--muted); font-size: .86rem; }
.blog-comment-gate,
.blog-comment-form { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.blog-comment-gate[hidden],
.blog-comment-form[hidden] { display: none; }
.blog-comment-gate { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.blog-comment-gate p { margin: 0; color: var(--muted); }
.blog-comment-gate a { color: var(--green); font-weight: 800; }
.blog-comment-form label { display: block; margin-bottom: 9px; font-weight: 800; }
.blog-comment-form textarea { width: 100%; min-height: 120px; padding: 14px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fbfcf8; font: inherit; line-height: 1.55; }
.blog-comment-form textarea:focus { border-color: var(--green); outline: 2px solid rgba(23, 109, 73, .15); }
.blog-comment-form > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; }
.blog-comment-form small { color: var(--muted); }
.blog-comment-form button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; color: #fff; background: var(--green); font: inherit; font-weight: 800; cursor: pointer; }
.blog-interaction-error { margin: 20px 0 0; padding: 12px 14px; border-radius: 12px; color: #8c2f28; background: #f8e4df; }
.blog-comment-list { display: grid; gap: 14px; margin-top: 24px; }
.blog-comment { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .7); }
.blog-comment header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.blog-comment time { color: var(--muted); font-size: .78rem; }
.blog-comment p { margin: 10px 0 0; white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }
.blog-comment p[hidden],
.blog-comment-editor[hidden] { display: none; }
.blog-comment-actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.blog-comment-actions button,
.blog-comment-editor button { padding: 0; border: 0; color: var(--green); background: transparent; font: inherit; font-size: .78rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.blog-comment-actions button:last-child { color: #963b35; }
.blog-comment-actions button:disabled,
.blog-comment-editor button:disabled { cursor: default; opacity: .55; }
.blog-comment-editor { margin-top: 14px; }
.blog-comment-editor textarea { width: 100%; min-height: 110px; padding: 13px 14px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; font: inherit; line-height: 1.55; }
.blog-comment-editor textarea:focus { border-color: var(--green); outline: 2px solid rgba(23, 109, 73, .14); }
.blog-comment-editor > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.blog-comment-editor small { color: var(--muted); }
.blog-comment-editor span { display: inline-flex; gap: 14px; }
.blog-comment-editor span button:last-child { color: #fff; padding: 8px 14px; border-radius: 999px; background: var(--green); text-decoration: none; }
.blog-comments-empty { color: var(--muted); }
.blog-cta { margin: 18px 0 76px; padding: clamp(28px, 5vw, 48px); border-radius: 26px; background: #e4efe1; }
.blog-cta > strong { font-size: clamp(1.65rem, 4vw, 2.6rem); letter-spacing: -.035em; }
.blog-cta p { max-width: 650px; color: var(--muted); line-height: 1.65; }
.blog-cta a { min-height: 46px; display: inline-flex; align-items: center; padding: 0 20px; border-radius: 999px; color: #fff; background: var(--green); font-weight: 850; text-decoration: none; }

.blog-footer { display: flex; align-items: center; gap: 24px; padding: 30px 0 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.blog-footer span { margin-right: auto; }
.blog-footer a { text-decoration: none; }
.blog-footer a:hover { color: var(--green); }

.blog-lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 34px; background: rgba(10, 16, 12, .86); }
.blog-lightbox[hidden] { display: none; }
.blog-lightbox img { max-width: min(94vw, 1440px); max-height: 90vh; border-radius: 10px; object-fit: contain; }
.blog-lightbox button { position: fixed; top: 18px; right: 22px; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; color: #fff; background: rgba(0,0,0,.35); font-size: 2rem; cursor: pointer; }

@media (max-width: 768px) {
  .blog-header { grid-template-columns: 1fr auto; }
  .blog-header nav { display: none; }
  .blog-hero { grid-template-columns: 1fr; grid-template-areas: "title" "image" "copy"; gap: 10px; padding: 34px 0 28px; }
  .blog-hero-title { text-align: center; }
  .blog-hero-image { height: min(58vw, 240px); }
  .blog-hero > p { margin: 0 auto; font-size: 1.13rem; text-align: center; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-grid > :last-child:nth-child(odd) { grid-column: auto; }
  .blog-card,
  .blog-card-featured { min-height: 0; }
  .blog-card h2 { margin-top: 28px; }
}

@media (max-width: 560px) {
  .blog-header,
  .blog-footer,
  .blog-hero,
  .blog-featured,
  .blog-grid,
  .blog-article { width: min(100% - 28px, 1180px); }
  .blog-header { min-height: 68px; }
  .blog-card { padding: 22px; border-radius: 22px; }
  .blog-card-image { margin: -22px -22px 24px; width: calc(100% + 44px); }
  .blog-card-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .blog-card h2,
  .blog-card-featured h2 { font-size: 1.75rem; }
  .blog-article { margin-top: 42px; }
  .blog-article h1 { font-size: clamp(2.35rem, 12.5vw, 3.4rem); }
  .blog-markdown { padding: 40px 0; font-size: 1rem; }
  .blog-markdown figure { width: 75%; }
  .blog-reactions,
  .blog-comments-title,
  .blog-comment-gate,
  .blog-comment header,
  .blog-comment-form > div { align-items: stretch; flex-direction: column; }
  .blog-comment-actions { margin-left: 0; }
  .blog-comment-editor > div { align-items: flex-start; flex-direction: column; }
  .blog-footer { flex-wrap: wrap; }
  .blog-footer span { flex-basis: 100%; }
  .blog-lightbox { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blog-card { transition: none; }
}
