/*
 * Edge One Media — Blog Post Styles
 * File: blog-post-style.css
 *
 * HOW TO USE:
 *   1. Place this file in your child theme directory (e.g., /wp-content/themes/edgeone-blockbasechild/)
 *   2. Enqueue it in your child theme's functions.php using the snippet in functions-snippet.php
 *
 * SCOPE:
 *   All rules are prefixed with `body.single-post` so they apply ONLY on
 *   single blog post pages and will not affect any other page type.
 *
 * BRAND TOKENS:
 *   --eo-green   : #93CC04  (brand accent / link / heading highlight)
 *   --eo-dark    : #1a1a1a  (near-black for body text)
 *   --eo-mid     : #444444  (secondary text / captions)
 *   --eo-light   : #f7f8f4  (light tinted background for callout blocks)
 *   --eo-border  : #e2e8d0  (subtle green-tinted border)
 *   --eo-white   : #ffffff
 */

/* ─────────────────────────────────────────────
   0. CSS CUSTOM PROPERTIES (scoped to single posts)
   ───────────────────────────────────────────── */
body.single-post {
  --eo-green:   #93CC04;
  --eo-green-dark: #6fa003;
  --eo-dark:    #1a1a1a;
  --eo-mid:     #555555;
  --eo-light:   #f7f8f4;
  --eo-border:  #dde8c0;
  --eo-white:   #ffffff;
  --eo-radius:  8px;
  --eo-max-w:   780px;
  --eo-font:    din-2014, "DIN 2014", "DIN Next", "Helvetica Neue", Arial, sans-serif;
}

/* ─────────────────────────────────────────────
   1. POST CONTENT WRAPPER
   ───────────────────────────────────────────── */
body.single-post article.entry-content {
  max-width: var(--eo-max-w);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px 64px;
  font-family: var(--eo-font);
  color: var(--eo-dark);
  line-height: 1.75;
  font-size: 1.0625rem; /* 17px */
}

/* ─────────────────────────────────────────────
   2. HERO IMAGE
   ───────────────────────────────────────────── */
body.single-post article.entry-content > figure:first-of-type img,
body.single-post article.entry-content > .wp-block-image:first-of-type img {
  width: 100%;
  height: auto;
  border-radius: var(--eo-radius);
  display: block;
  margin-bottom: 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

/* ─────────────────────────────────────────────
   3. HEADINGS
   ───────────────────────────────────────────── */

/* H1 — Post title */
body.single-post article.entry-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--eo-green);
  margin-top: 0;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* H2 — Section headings */
body.single-post article.entry-content h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--eo-dark);
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--eo-green);
}

/* H3 — Sub-section headings (non-stat) */
body.single-post article.entry-content h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 700;
  color: var(--eo-dark);
  margin-top: 36px;
  margin-bottom: 10px;
}

/* ─────────────────────────────────────────────
   4. STAT BLOCKS
   The current markup pattern is:
     <h3>19,842</h3>
     <p>Ad Impressions</p>
   We detect numeric-looking H3s and style them as stat cards.
   The .eo-stat-grid wrapper is injected via the companion JS snippet.
   ───────────────────────────────────────────── */

/* Stat grid container (added by JS) */
body.single-post .eo-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 32px 0 40px;
}

/* Individual stat card (added by JS) */
body.single-post .eo-stat-card {
  background: var(--eo-light);
  border: 1px solid var(--eo-border);
  border-top: 4px solid var(--eo-green);
  border-radius: var(--eo-radius);
  padding: 24px 20px 20px;
  text-align: center;
}

body.single-post .eo-stat-card .eo-stat-number {
  display: block;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--eo-green);
  line-height: 1;
  margin-bottom: 8px;
}

body.single-post .eo-stat-card .eo-stat-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--eo-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────
   5. PARAGRAPHS & BODY TEXT
   ───────────────────────────────────────────── */
body.single-post article.entry-content p {
  margin-bottom: 20px;
  color: var(--eo-dark);
  font-size: 1.0625rem;
  line-height: 1.8;
}

/* Lead paragraph (first <p> after h1) */
body.single-post article.entry-content h1 + p,
body.single-post article.entry-content h1 ~ p:first-of-type {
  font-size: 1.1875rem;
  color: var(--eo-mid);
  line-height: 1.7;
}

/* ─────────────────────────────────────────────
   6. LISTS
   ───────────────────────────────────────────── */
body.single-post article.entry-content ul,
body.single-post article.entry-content ol {
  padding-left: 1.5rem;
  margin-bottom: 20px;
}

body.single-post article.entry-content ul li,
body.single-post article.entry-content ol li {
  margin-bottom: 8px;
  line-height: 1.7;
}

body.single-post article.entry-content ul li::marker {
  color: var(--eo-green);
}

/* ─────────────────────────────────────────────
   7. HORIZONTAL RULES (section dividers)
   ───────────────────────────────────────────── */
body.single-post article.entry-content hr {
  border: none;
  border-top: 2px solid var(--eo-border);
  margin: 48px auto;
  width: 80px;
}

/* ─────────────────────────────────────────────
   8. TABLES
   ───────────────────────────────────────────── */
body.single-post article.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 0.9375rem;
  border-radius: var(--eo-radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

body.single-post article.entry-content thead {
  background-color: var(--eo-green);
  color: var(--eo-white);
}

body.single-post article.entry-content thead th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.single-post article.entry-content tbody tr:nth-child(even) {
  background-color: var(--eo-light);
}

body.single-post article.entry-content tbody tr:hover {
  background-color: #edf5c5;
}

body.single-post article.entry-content tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--eo-border);
  color: var(--eo-dark);
}

/* Highlight growth column (last td) */
body.single-post article.entry-content tbody td:last-child {
  font-weight: 700;
  color: var(--eo-green-dark);
}

/* ─────────────────────────────────────────────
   9. BLOCKQUOTES / CALLOUT BOXES
   ───────────────────────────────────────────── */
body.single-post article.entry-content blockquote {
  border-left: 5px solid var(--eo-green);
  background: var(--eo-light);
  margin: 32px 0;
  padding: 20px 24px;
  border-radius: 0 var(--eo-radius) var(--eo-radius) 0;
  font-size: 1.0625rem;
  color: var(--eo-mid);
  font-style: italic;
}

body.single-post article.entry-content blockquote p {
  margin: 0;
}

/* ─────────────────────────────────────────────
   10. LINKS
   ───────────────────────────────────────────── */
body.single-post article.entry-content a {
  color: var(--eo-green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

body.single-post article.entry-content a:hover {
  color: var(--eo-green);
}

/* ─────────────────────────────────────────────
   11. STRONG / BOLD TEXT
   ───────────────────────────────────────────── */
body.single-post article.entry-content strong {
  font-weight: 700;
  color: var(--eo-dark);
}

/* ─────────────────────────────────────────────
   12. IMAGES (general)
   ───────────────────────────────────────────── */
body.single-post article.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--eo-radius);
  display: block;
  margin: 24px auto;
}

body.single-post article.entry-content figure figcaption {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--eo-mid);
  margin-top: 8px;
}

/* ─────────────────────────────────────────────
   13. VIDEO EMBEDS
   ───────────────────────────────────────────── */
body.single-post article.entry-content video,
body.single-post article.entry-content iframe,
body.single-post article.entry-content .wp-block-video {
  max-width: 100%;
  border-radius: var(--eo-radius);
  overflow: hidden;
  display: block;
  margin: 24px auto;
}

/* ─────────────────────────────────────────────
   14. POST META BAR (date, author, category)
   Scoped tightly to the post meta group directly
   inside .wp-site-blocks > article, not the header.
   ───────────────────────────────────────────── */
body.single-post article.entry-content > .wp-block-group.is-layout-constrained {
  max-width: var(--eo-max-w);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

/* ─────────────────────────────────────────────
   15. TABLE OF CONTENTS (injected by JS)
   ───────────────────────────────────────────── */
body.single-post .eo-toc {
  background: var(--eo-light);
  border: 1px solid var(--eo-border);
  border-radius: var(--eo-radius);
  padding: 24px 28px;
  margin: 32px 0 40px;
}

body.single-post .eo-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--eo-mid);
  margin: 0 0 12px;
}

body.single-post .eo-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  list-style: decimal;
}

body.single-post .eo-toc ol li {
  margin-bottom: 6px;
}

body.single-post .eo-toc ol li a {
  color: var(--eo-dark);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

body.single-post .eo-toc ol li a:hover {
  color: var(--eo-green);
  text-decoration: underline;
}

/* ─────────────────────────────────────────────
   16. CTA BLOCK (injected by JS at end of post)
   ───────────────────────────────────────────── */
body.single-post .eo-cta-block {
  background: var(--eo-green);
  color: var(--eo-white);
  border-radius: var(--eo-radius);
  padding: 40px 36px;
  text-align: center;
  margin: 56px 0 32px;
}

body.single-post .eo-cta-block h2 {
  color: var(--eo-white);
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: none;
  padding-bottom: 0;
}

body.single-post .eo-cta-block p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  margin-bottom: 24px;
}

body.single-post .eo-cta-block a.eo-cta-btn {
  display: inline-block;
  background: var(--eo-white);
  color: var(--eo-green-dark);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

body.single-post .eo-cta-block a.eo-cta-btn:hover {
  background: var(--eo-dark);
  color: var(--eo-white);
}

/* ─────────────────────────────────────────────
   17. RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
  body.single-post article.entry-content {
    padding: 0 16px 48px;
    font-size: 1rem;
  }

  body.single-post article.entry-content h2 {
    margin-top: 40px;
  }

  body.single-post .eo-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  body.single-post article.entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.single-post .eo-cta-block {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  body.single-post .eo-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
