:root {
  --ink: #14201c;
  --muted: #5d6965;
  --line: #dce5df;
  --paper: #fbfcf7;
  --surface: #ffffff;
  --mint: #dff5df;
  --green: #117c5f;
  --green-dark: #07523f;
  --gold: #f2c14e;
  --sky: #d9edf7;
  --coral: #f4a69a;
  --shadow: 0 20px 50px rgba(15, 43, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: rgba(251, 252, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--green-dark);
  border-radius: 8px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
}

nav a,
.footer-links a {
  text-decoration: none;
}

nav a:hover,
.footer-links a:hover,
.post-card a:hover,
.featured-post a:hover {
  color: var(--green);
}

main {
  overflow: hidden;
}

.blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: stretch;
  padding: clamp(30px, 7vw, 86px) clamp(18px, 5vw, 72px) 34px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
}

.eyebrow,
.tag,
.meta {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(2.55rem, 6vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-text {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.25rem);
}

.search-panel {
  max-width: 660px;
  margin-top: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-row {
  display: flex;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #f7faf5;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

button {
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: var(--green-dark);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: var(--green);
}

.featured-post {
  align-self: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.featured-post img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.featured-body {
  padding: clamp(18px, 3vw, 30px);
}

.featured-body h2 {
  margin-top: 10px;
  font-size: clamp(1.5rem, 3vw, 2.55rem);
}

.featured-body a,
.post-card a {
  text-decoration: none;
}

.topic-strip {
  display: flex;
  gap: 10px;
  padding: 10px clamp(18px, 5vw, 72px) 42px;
  overflow-x: auto;
}

.topic {
  flex: 0 0 auto;
  color: var(--green-dark);
  background: var(--surface);
  border: 1px solid var(--line);
}

.topic.active {
  color: #fff;
  background: var(--green-dark);
}

.content-section,
.popular-section,
.newsletter {
  padding: clamp(44px, 7vw, 84px) clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.post-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.post-card p,
.featured-body p,
.site-footer p {
  color: var(--muted);
}

.post-card .meta {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
}

.popular-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 1fr);
  gap: 28px;
  background: var(--green-dark);
  color: #fff;
}

.popular-section .eyebrow {
  color: var(--gold);
}

.cluster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cluster-grid a {
  min-height: 72px;
  padding: 18px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font-weight: 900;
}

.cluster-grid a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 0.7fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, var(--mint), var(--sky) 52%, #fff2e8);
}

.newsletter form {
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(17, 124, 95, 0.18);
  border-radius: 8px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(18px, 5vw, 72px);
  background: #eef5ee;
  border-top: 1px solid var(--line);
}

.ad-stack {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 22px clamp(18px, 5vw, 72px);
  background: #f4f8f2;
  border-top: 1px solid var(--line);
}

.ad-slot {
  display: grid;
  width: min(100%, 728px);
  min-height: 60px;
  place-items: center;
  overflow: hidden;
}

.ad-direct-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.ad-direct-link:hover {
  color: var(--green);
}

.article-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 70px) clamp(18px, 5vw, 48px);
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 0.65fr);
  gap: 34px;
  align-items: center;
  margin-bottom: 44px;
}

.article-hero img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article-content {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.06rem;
}

.article-content h2 {
  margin-top: 42px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.article-content ul,
.article-content ol {
  padding-left: 22px;
}

.article-content table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-content th,
.article-content td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-content th {
  color: #fff;
  background: var(--green-dark);
}

.article-content tr:last-child td {
  border-bottom: 0;
}

.article-content pre {
  overflow-x: auto;
  margin: 28px 0;
  padding: 20px;
  color: #dff5df;
  background: #14201c;
  border-radius: 8px;
}

.article-content code {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.94rem;
}

.article-content li {
  margin-bottom: 10px;
}

.callout {
  margin: 34px 0;
  padding: 22px;
  background: var(--mint);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  font-weight: 800;
}

.breadcrumb {
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 800;
}

.breadcrumb a {
  color: var(--green-dark);
  text-decoration: none;
}

@media (max-width: 980px) {
  .blog-hero,
  .popular-section,
  .newsletter,
  .article-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer,
  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    gap: 10px;
  }

  .post-grid,
  .cluster-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.35rem, 14vw, 3.7rem);
  }
}
