/* ============================================================
   ThinkMDCL — blog.css
   Minimalist reading experience for Resources (Blog + Toolkit).
   Light by default; [data-theme="dark"] flips the palette.
   Deliberately lightweight: no animation libraries load on
   these templates.
   ============================================================ */

.blog-scope {
  --b-bg: var(--white);
  --b-fg: #1a2b33;
  --b-muted: #5b6f78;
  --b-card: #ffffff;
  --b-line: var(--ice-blue);
  --b-accent: var(--orange);
  --b-accent-2: #5d7a1f; /* accessible green for small text on light */
  background: var(--b-bg);
  color: var(--b-fg);
  transition: background 0.35s ease, color 0.35s ease;
}
.blog-scope[data-theme="dark"] {
  --b-bg: #112b36;
  --b-fg: #eef4f7;
  --b-muted: #9fb6c0;
  --b-card: #163947;
  --b-line: rgba(255,255,255,0.14);
  --b-accent: var(--lime);
  --b-accent-2: var(--lime);
}

.blog-scope a { color: inherit; }
.blog-scope img { border-radius: var(--radius); }

/* ---------- Page chrome ---------- */
.blog-main { padding: calc(var(--nav-height) + 50px) 0 100px; }
.blog-hero { max-width: 820px; margin-bottom: clamp(40px, 6vw, 70px); }
.blog-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--b-accent);
  margin-bottom: 14px;
}
.blog-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 1.02;
}
.blog-sub { margin-top: 16px; color: var(--b-muted); max-width: 56ch; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding: 10px 18px;
  border: 1px solid var(--b-line);
  border-radius: 100px;
  background: var(--b-card);
  color: var(--b-fg);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.3s, background 0.35s ease, color 0.35s ease;
}
.theme-toggle:hover { border-color: var(--b-accent); }
.theme-toggle .sun { display: none; }
.blog-scope[data-theme="dark"] .theme-toggle .sun { display: inline; }
.blog-scope[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px);
}
.post-card { display: flex; flex-direction: column; }
.post-card a { display: block; }
.post-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 18px;
  background: var(--b-line);
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.post-card:hover .post-thumb img { transform: scale(1.05); }
.post-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--b-accent-2);
}
.post-card h2, .post-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 10px 0 10px;
}
.post-card:hover h2, .post-card:hover h3 { text-decoration: underline; text-decoration-color: var(--b-accent); text-underline-offset: 4px; }
.post-excerpt { color: var(--b-muted); font-size: 0.95rem; }
.post-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--b-muted);
  display: flex;
  gap: 14px;
}

/* Featured (first) post */
.post-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(26px, 4vw, 56px);
  align-items: center;
  padding-bottom: clamp(30px, 4vw, 50px);
  border-bottom: 1px solid var(--b-line);
}
.post-featured .post-thumb { aspect-ratio: 16 / 10; margin: 0; }
.post-featured h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }

/* ---------- Article ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--orange), var(--lime));
  z-index: 200;
}
.article-header { max-width: 860px; margin: 0 auto clamp(34px, 5vw, 56px); }
.article-title {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 14px 0 20px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--b-muted);
  align-items: center;
}
.article-hero-img { max-width: 1060px; margin: 0 auto clamp(34px, 5vw, 56px); }
.article-hero-img img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }

.article-body { max-width: 720px; margin: 0 auto; font-size: 1.06rem; line-height: 1.85; }
.article-body p { margin-bottom: 1.3rem; }
.article-body h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  margin: 2.4rem 0 0.9rem;
  letter-spacing: -0.01em;
}
.article-body h3 { font-size: 1.2rem; font-weight: 800; margin: 1.8rem 0 0.7rem; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem 1.2rem; }
.article-body li { margin-bottom: 0.55rem; }
.article-body li::marker { color: var(--b-accent); font-weight: 700; }
.article-body img { margin: 1.6rem 0; }
.article-body blockquote {
  margin: 2rem 0;
  padding: 22px 28px;
  background: var(--peach);
  border-left: 5px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #163947;
  font-weight: 600;
  font-style: italic;
}
.blog-scope[data-theme="dark"] .article-body blockquote { background: rgba(244, 118, 33, 0.14); color: var(--b-fg); }

/* Stat strip inside articles */
.article-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 2rem 0;
}
.article-stat {
  border: 1px solid var(--b-line);
  border-top: 4px solid var(--b-accent);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.article-stat strong { display: block; font-size: 1.6rem; font-weight: 900; }
.article-stat span { font-size: 0.8rem; color: var(--b-muted); }

/* Interactive poll */
.poll {
  margin: 2.4rem 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--b-line);
  border-radius: var(--radius);
  background: var(--b-card);
  box-shadow: 0 10px 36px rgba(22, 57, 71, 0.07);
}
.poll h3 { margin: 0 0 6px; font-weight: 800; }
.poll-sub { font-size: 0.85rem; color: var(--b-muted); margin-bottom: 16px; }
.poll-option {
  display: block;
  width: 100%;
  position: relative;
  margin-bottom: 10px;
  padding: 13px 16px;
  border: 1px solid var(--b-line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.3s;
}
.poll-option:hover { border-color: var(--b-accent); }
.poll-option .fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--pale-lime);
  transition: width 0.8s var(--ease-out);
  z-index: 0;
}
.blog-scope[data-theme="dark"] .poll-option .fill { background: rgba(200, 220, 96, 0.18); }
.poll-option .label, .poll-option .pct { position: relative; z-index: 1; }
.poll-option .pct { float: right; font-weight: 800; opacity: 0; transition: opacity 0.4s; }
.poll.voted .poll-option { cursor: default; }
.poll.voted .poll-option .pct { opacity: 1; }
.poll-note { font-size: 0.78rem; color: var(--b-muted); margin-top: 8px; }

/* Share row */
.article-share {
  max-width: 720px;
  margin: 3rem auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--b-line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.share-btn {
  padding: 9px 18px;
  border: 1px solid var(--b-line);
  border-radius: 100px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
.share-btn:hover { border-color: var(--b-accent); color: var(--b-accent); }

/* ---------- Toolkit ---------- */
.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 32px);
}
.tool-card {
  border: 1px solid var(--b-line);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--b-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.35s, border-color 0.35s;
}
.tool-card:hover { box-shadow: 0 18px 50px rgba(22,57,71,0.12); border-color: var(--b-accent); }
.tool-type {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #163947;
  background: var(--pale-lime);
  padding: 5px 12px;
  border-radius: 100px;
}
.blog-scope[data-theme="dark"] .tool-type { background: rgba(200,220,96,0.2); color: var(--lime); }
.tool-card h3 { font-size: 1.2rem; font-weight: 800; }
.tool-card p { font-size: 0.92rem; color: var(--b-muted); flex: 1; }
.tool-link { font-weight: 700; font-size: 0.9rem; color: var(--b-accent-2); }
.tool-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .post-grid, .toolkit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .post-grid, .toolkit-grid { grid-template-columns: 1fr; }
  .post-featured { grid-template-columns: 1fr; }
  .article-stats { grid-template-columns: 1fr; }
}

/* ---------- Embedded toolkit app ---------- */
.toolkit-frame {
  display: block;
  width: 100%;
  min-height: 600px;   /* until the app reports its height */
  border: none;
  border-top: 1px solid var(--b-line);
  border-bottom: 1px solid var(--b-line);
  overflow: hidden;
}

/* Author / publisher box on articles (E-E-A-T attribution) */
.author-box { display: flex; gap: 18px; align-items: flex-start; margin: 40px 0 10px; padding: 24px; border: 1px solid var(--b-line); border-radius: 12px; background: var(--b-card, rgba(0,0,0,0.02)); }
.author-box-logo { flex: 0 0 auto; width: 64px; height: 64px; object-fit: contain; }
.author-box-name { font-weight: 700; margin: 0 0 6px; }
.author-box-bio { margin: 0 0 8px; font-size: 0.95rem; line-height: 1.55; }
.author-box-link { margin: 0; font-size: 0.9rem; }
.author-box-link a { text-decoration: underline; text-underline-offset: 3px; }
