/* ============================================================
   blog-post.css — shared styling for long-form blog posts
   ------------------------------------------------------------
   Every long-form post is stored in the Google Sheet as a plain
   HTML fragment wrapped in <div class="gj-post"> … </div> with
   NO inline <style> of its own. The look lives here, so:

     - sheet rows stay small,
     - one edit restyles every post,
     - nothing leaks into the surrounding page.

   Loaded by: blog.html (modal), _worker.js (/blog/<slug> SSR),
              converter.html (live preview).
   Authoring template: /blog-post-template.html
   ============================================================ */

.gj-post {
  --gj-primary: #667eea;
  --gj-primary-dark: #764ba2;
  --gj-ink: #2c3e50;
  --gj-red: #e74c3c;
  --gj-green: #27ae60;
  --gj-blue: #3498db;
  --gj-amber: #ffc107;

  color: var(--gj-ink);
  line-height: 1.75;
  font-size: 1.02rem;
  word-wrap: break-word;
}

/* ---------- headings ---------- */
/* The page already renders the post title as <h1>, so posts start at <h2>. */
.gj-post h2 {
  font-size: 1.55em;
  color: var(--gj-primary);
  margin: 2.2rem 0 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--gj-primary);
  font-weight: 700;
  line-height: 1.35;
}

.gj-post > h2:first-child { margin-top: 0; }

.gj-post h3 {
  font-size: 1.2em;
  color: var(--gj-ink);
  margin: 1.6rem 0 .6rem;
  font-weight: 700;
}

.gj-post p { margin: 0 0 1.1rem; }
.gj-post ul,
.gj-post ol { margin: 0 0 1.2rem 1.4rem; }
.gj-post li { margin-bottom: .6rem; }
.gj-post strong { color: var(--gj-ink); font-weight: 600; }
.gj-post a { color: #2980b9; }

.gj-post img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.2rem 0;
}

/* ---------- lead / pull quote ---------- */
.gj-lead {
  background: #f8f9fa;
  border-left: 4px solid var(--gj-red);
  padding: 1.15rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-style: italic;
  color: #34495e;
}

.gj-post blockquote {
  border-left: 4px solid var(--gj-primary);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: #555;
  font-style: italic;
  font-weight: 500;
}

.gj-post blockquote cite {
  display: block;
  margin-top: .5rem;
  font-size: .9em;
  color: #777;
}

/* ---------- myth vs fact ---------- */
.gj-mf {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.6rem 0;
}

.gj-myth,
.gj-fact {
  padding: 1.15rem 1.25rem;
  border-radius: 8px;
  border-left: 4px solid;
}

.gj-myth { background: #ffe5e5; border-left-color: var(--gj-red); }
.gj-fact { background: #e5f5e8; border-left-color: var(--gj-green); }
.gj-myth > p:last-child,
.gj-fact > p:last-child { margin-bottom: 0; }

.gj-myth .gj-label { color: #c0392b; font-weight: 700; display: block; margin-bottom: .4rem; }
.gj-fact .gj-label { color: #1e8449; font-weight: 700; display: block; margin-bottom: .4rem; }

/* ---------- callout boxes ---------- */
.gj-note,
.gj-step,
.gj-warn {
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  border-left: 4px solid;
}

.gj-note {                                   /* key data / statistic */
  background: #fff8e1;
  border: 1px solid var(--gj-amber);
  border-left: 4px solid var(--gj-amber);
}

.gj-step {                                   /* actionable step */
  background: #ecf8ff;
  border-left-color: var(--gj-blue);
}

.gj-step > p:first-child strong,
.gj-step h3 { color: #2980b9; }

.gj-warn {                                   /* risk / red flag */
  background: #fef5f5;
  border-left-color: var(--gj-red);
}

.gj-warn h3 { color: #c0392b; font-size: 1.05em; margin-top: 0; }

.gj-note > *:last-child,
.gj-step > *:last-child,
.gj-warn > *:last-child { margin-bottom: 0; }

/* ---------- pathway / process line ---------- */
.gj-flow {
  text-align: center;
  color: var(--gj-primary);
  font-weight: 500;
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f7f8ff;
  border-radius: 8px;
}

/* ---------- tables ---------- */
/* Wrap wide tables in <div class="gj-table"> so they scroll instead of
   blowing out the page width on phones. */
.gj-table { overflow-x: auto; margin: 1.6rem 0; -webkit-overflow-scrolling: touch; }

.gj-post table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  border-radius: 4px;
  overflow: hidden;
}

.gj-post th,
.gj-post td {
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #ecf0f1;
}

.gj-post th { background: var(--gj-primary); color: #fff; font-weight: 600; }
.gj-post tbody tr:hover { background: #f8f9fa; }

/* ---------- FAQ (feeds FAQPage rich results — see _worker.js) ---------- */
.gj-faq { margin: 1.6rem 0; }

.gj-faq .gj-q {
  font-size: 1.08em;
  font-weight: 700;
  color: var(--gj-primary);
  margin: 1.2rem 0 .4rem;
}

.gj-faq .gj-a { margin: 0 0 1rem; }

/* ---------- takeaway / conclusion ---------- */
.gj-conclusion {
  background: linear-gradient(135deg, var(--gj-primary) 0%, var(--gj-primary-dark) 100%);
  color: #fff;
  padding: 1.8rem;
  border-radius: 8px;
  margin: 2.2rem 0;
}

.gj-conclusion h2 {
  color: #fff;
  border-left-color: #ffd700;
  margin-top: 0;
}

.gj-conclusion strong { color: #ffd700; }
.gj-conclusion > *:last-child { margin-bottom: 0; }

/* ---------- references, bio, disclaimer ---------- */
.gj-refs {
  background: #f8f9fa;
  padding: 1.4rem;
  border-radius: 8px;
  margin: 2rem 0;
  font-size: .92em;
}

.gj-refs h2,
.gj-refs h3 {
  font-size: 1.05em;
  color: var(--gj-ink);
  border: 0;
  padding: 0;
  margin: 0 0 .8rem;
}

.gj-refs ol { margin-left: 1.2rem; }
.gj-refs li { color: #555; margin-bottom: .5rem; }

.gj-bio {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 1.6rem;
  border-radius: 8px;
  margin: 2rem 0;
  text-align: center;
}

.gj-bio .gj-name {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--gj-primary);
  margin-bottom: .6rem;
}

.gj-bio .gj-title { font-size: .95em; color: #555; line-height: 1.75; margin-bottom: .8rem; }
.gj-bio .gj-contact { font-size: .9em; }
.gj-bio .gj-contact a { color: #2980b9; text-decoration: none; }

.gj-disclaimer {
  background: #fff8e1;
  border: 1px solid var(--gj-amber);
  padding: 1.1rem 1.25rem;
  border-radius: 6px;
  font-size: .9em;
  color: #856404;
  font-style: italic;
  margin: 1.5rem 0 0;
}

/* Machine-readable SEO block — never shown to readers. */
.gj-seo { display: none !important; }

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  .gj-post { font-size: 1rem; }
  .gj-post h2 { font-size: 1.3em; }
  .gj-mf { grid-template-columns: 1fr; }
  .gj-post th,
  .gj-post td { padding: .7rem; font-size: .92em; }
  .gj-conclusion { padding: 1.3rem; }
}
