/* ============================================================
   GreenAlsoGreen Blog — Content Styles
   Loaded AFTER the shared site CSS (style.css / plugins.css).
   Handles: blog listing, post cards, article body, sidebar,
   archives, pagination. Nav + footer come from the shared theme.
   ============================================================ */

:root {
  --green-50:  #EDF5EE;
  --green-100: #D3E8D5;
  --green-600: #387A3C;
  --green-700: #2C6331;
  --green-800: #214C25;

  --neutral-0:   #FFFFFF;
  --neutral-50:  #FAFAFA;
  --neutral-100: #F5F5F5;
  --neutral-200: #E5E5E5;
  --neutral-300: #D4D4D4;
  --neutral-400: #A3A3A3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-800: #262626;
  --neutral-900: #171717;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --max-w-article: 680px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ── Base overrides for blog content ──────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--neutral-900);
}

/* Bring the main-content area below the sticky nav naturally */
.blog-listing,
.post-single,
.archive-page {
  padding-top: 48px;
  padding-bottom: 80px;
}

/* ── Hero / Featured Post ─────────────────────────────────── */
.hero-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  align-items: center;
}
.hero-post-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.hero-post-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-post-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--green-600);
  margin-bottom: 12px;
}
.hero-post-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--neutral-800);
  line-height: 1.15;
  margin: 0 0 16px;
}
.hero-post-title a { color: inherit; text-decoration: none; }
.hero-post-title a:hover { color: var(--green-600); }
.hero-post-excerpt {
  font-size: 17px;
  color: var(--neutral-600);
  line-height: 1.6;
  margin: 0 0 20px;
}
.hero-post-meta {
  font-size: 14px;
  color: var(--neutral-500);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-post-meta .sep { color: var(--neutral-300); }
.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-600);
  border: 2px solid var(--green-600);
  padding: 8px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 150ms, color 150ms;
}
.btn-read-more:hover { background: var(--green-600); color: var(--neutral-0); }

/* ── Blog listing layout ──────────────────────────────────── */
.listing-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
}
.listing-page-header {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--neutral-800);
  margin: 0 0 24px;
}

/* ── Post grid ────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}
.post-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ── Post card ────────────────────────────────────────────── */
.post-card {
  background: var(--neutral-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 250ms ease-out, box-shadow 250ms ease-out;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.post-card-image-link { display: block; }
.post-card-image { width: 100%; height: 200px; object-fit: cover; display: block; }
.post-card-body { padding: 20px; }
.post-card-cats { margin-bottom: 8px; }
.post-card-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-600);
  background: var(--green-50);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.post-card-cat:hover { background: var(--green-100); color: var(--green-700); }
.post-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--neutral-800);
  line-height: 1.3;
  margin: 0 0 10px;
}
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--green-600); }
.post-card-excerpt {
  font-size: 14px;
  color: var(--neutral-600);
  line-height: 1.55;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  font-size: 12px;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  gap: 5px;
}
.post-card-meta .sep { color: var(--neutral-300); }

/* ── Sidebar ──────────────────────────────────────────────── */
.listing-sidebar { padding-top: 0; }
.sidebar-widget {
  background: var(--neutral-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 24px;
}
.sidebar-widget-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-800);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-600);
  display: inline-block;
}
.sidebar-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-cat-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--neutral-100);
  font-size: 14px;
}
.sidebar-cat-list li:last-child { border-bottom: none; }
.sidebar-cat-list a { color: var(--neutral-700); text-decoration: none; }
.sidebar-cat-list a:hover { color: var(--green-600); }
.sidebar-cat-count {
  font-size: 12px;
  color: var(--neutral-400);
  background: var(--neutral-100);
  padding: 1px 6px;
  border-radius: 20px;
}
.sidebar-widget-desc {
  font-size: 14px;
  color: var(--neutral-600);
  margin: 0 0 14px;
}
.newsletter-form { display: flex; flex-direction: column; gap: 8px; }
.newsletter-input {
  padding: 10px 12px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 150ms;
}
.newsletter-input:focus { border-color: var(--green-600); }
.newsletter-btn {
  padding: 10px;
  background: var(--green-600);
  color: var(--neutral-0);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 150ms;
}
.newsletter-btn:hover { background: var(--green-700); }
.newsletter-success { margin: 0; font-size: 14px; color: var(--green-700); font-weight: 600; }

/* ── Single Post ──────────────────────────────────────────── */
.post-article {
  max-width: var(--max-w-article);
  margin: 0 auto;
}

.post-header { margin-bottom: 32px; }
.post-cats { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.post-cat-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-600);
  background: var(--green-50);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.post-cat-tag:hover { background: var(--green-100); }
.post-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--neutral-800);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -.01em;
}
.post-subtitle {
  font-size: 20px;
  color: var(--neutral-600);
  line-height: 1.5;
  margin: 0 0 20px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--neutral-500);
}
.post-meta .post-meta-sep { color: var(--neutral-300); }
.post-author { font-weight: 500; color: var(--neutral-700); }

.post-hero-image {
  max-width: 860px;
  margin: 0 auto 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.post-hero-image img { width: 100%; height: auto; display: block; }

/* ── Article body typography ──────────────────────────────── */
.post-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--neutral-900);
}
.post-body p { margin: 0 0 1.4em; }
.post-body h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--neutral-800); margin: 2em 0 .6em; line-height: 1.2; }
.post-body h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--neutral-800); margin: 1.8em 0 .5em; }
.post-body h4 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--neutral-800); margin: 1.5em 0 .4em; }
.post-body a { color: var(--green-600); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 150ms; }
.post-body a:hover { color: var(--green-700); text-decoration-color: var(--green-700); }
.post-body blockquote {
  border-left: 3px solid var(--green-600);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--green-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 18px;
  color: var(--neutral-700);
  font-style: italic;
}
.post-body code {
  font-size: 14px;
  background: var(--neutral-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--neutral-800);
}
.post-body pre {
  background: var(--neutral-900);
  color: var(--neutral-0);
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  margin: 24px 0;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 0 0 1.4em; }
.post-body li { margin-bottom: .4em; }
.post-body img { border-radius: var(--radius-md); margin: 24px auto; max-width: 100%; }
.post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.post-body th { text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--neutral-200); }
.post-body td { padding: 10px 12px; border-bottom: 1px solid var(--neutral-100); }

/* ── Post tags ────────────────────────────────────────────── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--neutral-200);
}
.post-tag {
  font-size: 13px;
  color: var(--neutral-600);
  background: var(--neutral-100);
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 150ms;
}
.post-tag:hover { background: var(--neutral-200); color: var(--neutral-800); }

/* ── Related posts ────────────────────────────────────────── */
.related-posts {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--neutral-200);
}
.related-posts-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--neutral-800);
  margin: 0 0 24px;
}

/* ── Archive page ─────────────────────────────────────────── */
.archive-header { margin-bottom: 40px; }
.archive-featured-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  display: block;
}
.archive-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-600);
  margin-bottom: 8px;
}
.archive-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--neutral-800);
  margin: 0 0 10px;
}
.archive-description { font-size: 17px; color: var(--neutral-600); margin: 0; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--neutral-200);
}
.pagination-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-600);
  padding: 8px 16px;
  border: 1px solid var(--green-600);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.pagination-link:hover { background: var(--green-600); color: var(--neutral-0); }
.pagination-info { font-size: 14px; color: var(--neutral-500); }

/* ── Empty listing ────────────────────────────────────────── */
.empty-listing {
  text-align: center;
  padding: 80px 20px;
  color: var(--neutral-500);
  font-size: 17px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-post { grid-template-columns: 1fr; gap: 24px; }
  .hero-post-image { order: -1; }
  .hero-post-title { font-size: 26px; }
  .listing-layout { grid-template-columns: 1fr; }
  .listing-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .post-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .blog-listing, .post-single, .archive-page { padding-top: 32px; }
  .post-title { font-size: 28px; }
  .post-subtitle { font-size: 17px; }
  .post-body { font-size: 16px; }
  .post-grid--3 { grid-template-columns: 1fr; }
  .listing-sidebar { grid-template-columns: 1fr; }
  .hero-post-title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card:hover { transition: none; }
}
