@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import url("https://fonts.cdnfonts.com/css/gt-super-text");

/* Ekoterra's existing serif headings, green identity, and quiet card layout.
   Standalone styles for server-rendered pages; no Tailwind or JavaScript needed. */
:root {
  color-scheme: light;
  --blog-primary: hsl(141 39% 37%);
  --blog-primary-dark: hsl(141 39% 28%);
  --blog-ink: hsl(210 11% 15%);
  --blog-muted: #526158;
  --blog-background: #fafbf8;
  --blog-surface: #fefefd;
  --blog-neutral: #f2f5ef;
  --blog-border: #dce4d9;
  --blog-footer: #1c2c1c;
  --blog-heading: "GT Super Text", Georgia, serif;
  --blog-body: "Inter", system-ui, sans-serif;
  --blog-width: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--blog-background);
  color: var(--blog-ink);
  font-family: var(--blog-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #dcebd9;
  color: #203b29;
}

a {
  color: var(--blog-primary-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blog-primary);
  outline-offset: 4px;
  border-radius: 3px;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--blog-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding: 1.15rem max(1.25rem, calc((100% - var(--blog-width)) / 2));
  background: var(--blog-surface);
  border-bottom: 1px solid var(--blog-border);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: var(--blog-primary);
  font-family: var(--blog-heading);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.site-header .brand img,
.site-header > a > img {
  width: 180px;
  max-width: 100%;
  max-height: 76px;
  object-fit: contain;
}

.site-header nav,
.site-header nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
}

.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blog-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--blog-primary-dark);
  text-decoration: underline;
  text-underline-offset: 0.45em;
}

.blog-main {
  width: min(var(--blog-width), calc(100% - 2.5rem));
  flex: 1;
  margin: 0 auto;
  padding: clamp(2.75rem, 6vw, 5rem) 0 clamp(3.5rem, 7vw, 6rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--blog-primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-main > h1,
.intro h1 {
  max-width: 850px;
  margin: 0 0 1.25rem;
  font-size: clamp(2.15rem, 4.3vw, 3.25rem);
}

.intro {
  max-width: 780px;
  margin: 0 0 clamp(2.5rem, 5vw, 4rem);
  color: var(--blog-muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.8;
}

.intro h1 {
  color: var(--blog-ink);
}

.intro p {
  margin: 0;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 1.5rem 1.5rem;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-surface);
  box-shadow: 0 2px 8px rgb(28 44 28 / 4%);
  transition: transform 180ms ease;
}

.article-card > img,
.article-card > a:first-child:has(img) {
  width: calc(100% + 3rem);
  max-width: none;
  margin: 0 -1.5rem 1.35rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--blog-neutral);
}

.article-card > a:first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .category {
  align-self: flex-start;
  width: fit-content;
  margin: 0 0 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--blog-primary);
  color: #fefefd;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
}

.article-card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.3rem;
  line-height: 1.4;
}

.article-card h2 a {
  color: inherit;
  text-decoration: none;
}

.article-card h2 a:hover {
  color: var(--blog-primary-dark);
  text-decoration: underline;
}

.article-card p {
  margin: 0 0 1.25rem;
  color: var(--blog-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
}

.article-card > a:not(:first-child) {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.3rem 0;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}

.article-card > a:not(:first-child):hover {
  text-decoration: underline;
}

.article-detail {
  max-width: 960px;
  margin: 0 auto;
}

.article-detail h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 1.2;
}

.article-detail .subtitle {
  max-width: 780px;
  margin: 0 0 1.5rem;
  color: var(--blog-muted);
  font-size: clamp(1.125rem, 1.8vw, 1.3rem);
  line-height: 1.75;
}

.byline {
  margin: 0 0 2rem;
  color: var(--blog-muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.article-detail .hero-image {
  width: 100%;
  height: auto;
  max-height: 560px;
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  object-fit: cover;
  border-radius: 8px;
  background: var(--blog-neutral);
}

.article-content {
  max-width: 740px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin: 0 0 1.5rem;
}

.article-content h2 {
  margin: 2.75rem 0 1rem;
  font-size: clamp(1.5rem, 2.7vw, 2rem);
}

.article-content h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
}

.article-content h4 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.125rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
}

.article-content li {
  padding-left: 0.25rem;
  margin-bottom: 0.6rem;
}

.article-content li::marker {
  color: var(--blog-primary-dark);
  font-weight: 600;
}

.article-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--blog-primary);
  background: var(--blog-neutral);
  color: #304836;
}

.article-content blockquote > :last-child {
  margin-bottom: 0;
}

.article-content img {
  margin: 1.5rem auto;
  border-radius: 6px;
}

.article-content figure {
  margin: 2rem 0;
}

.article-content figcaption {
  color: var(--blog-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.article-content hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--blog-border);
}

.article-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

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

.article-content th {
  background: var(--blog-neutral);
}

.site-footer {
  margin-top: auto;
  padding: 2.5rem max(1.25rem, calc((100% - var(--blog-width)) / 2));
  background: var(--blog-footer);
  color: #dce5d8;
  font-size: 0.875rem;
  line-height: 1.8;
}

.site-footer p {
  margin: 0 0 0.75rem;
}

.site-footer a {
  display: inline-block;
  padding: 0.35rem 0;
  color: #f5f8f1;
}

.site-footer a:focus-visible {
  outline-color: #ffc72c;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

@media (min-width: 768px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .article-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .article-card:hover {
    transform: translateY(-4px);
  }
}

@media (max-width: 480px) {
  .site-header {
    align-items: flex-start;
  }

  .site-header nav {
    width: 100%;
    gap: 0.25rem 1.1rem;
  }

  .blog-main {
    width: calc(100% - 2rem);
  }

  .article-detail h1 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    display: block;
    background: none;
    color: #202820;
    font-size: 11pt;
  }

  .site-header,
  .site-footer {
    display: none;
  }

  .blog-main,
  .article-detail,
  .article-content {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .article-grid {
    display: block;
  }

  .article-card {
    margin-bottom: 1.5rem;
    break-inside: avoid;
    box-shadow: none;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }
}
