/* graphics.css — graphic components for generated blog + /stocks/ pages.
   Extends styles.css (design tokens). Loaded only on generated pages so the
   hand-built pages are untouched. */

/* ---- article hero (two-column, matches .hero-grid rhythm) ---- */
.pg-hero { position: relative; overflow: hidden; }
.pg-hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.pg-hero-visual {
  position: relative; border-radius: var(--radius-lg);
  background: var(--glass); box-shadow: var(--glass-edge), var(--shadow);
  border: 1px solid var(--line); overflow: hidden; aspect-ratio: 19 / 16;
  display: grid; place-items: center;
}
.pg-hero-visual svg { width: 100%; height: 100%; }
.pg-hero-visual.pg-hero-img { aspect-ratio: 19 / 16; }
.pg-hero-visual.pg-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-3);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: .32rem .7rem; border-radius: var(--radius-pill); margin-bottom: 1.1rem;
}
@media (max-width: 820px) {
  .pg-hero-grid { grid-template-columns: 1fr; }
  .pg-hero-visual { order: -1; max-width: 460px; }
}

/* ---- figures / charts ---- */
.pg-figure {
  margin: 2rem 0; padding: clamp(1rem, 3vw, 1.6rem);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.pg-figure svg { width: 100%; height: auto; display: block; }
.pg-cap {
  margin-top: .8rem; color: var(--muted); font-size: .82rem;
  font-family: var(--font-mono); text-align: center;
}
.pg-chart { background: linear-gradient(180deg, var(--surface), var(--bg-2)); }

/* ---- stat grid tweaks for article context ---- */
.pg-stats { margin: 2rem 0; box-shadow: var(--shadow); }
.pg-stats .stat .num { background: var(--flame); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pg-stats .stat .sub { color: var(--up); }

/* ---- 8-condition grid ---- */
.pg-cond-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; margin: 2rem 0;
}
.pg-cond { background: var(--surface); padding: 1.1rem 1rem; position: relative; transition: background var(--dur) var(--ease); }
.pg-cond:hover { background: var(--surface-2); }
.pg-cond-ic {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent-3); display: grid; place-items: center; margin-bottom: .7rem;
}
.pg-cond-n { position: absolute; top: .8rem; right: 1rem; font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.pg-cond-l { font-size: .92rem; color: var(--text-soft); font-weight: 600; }
@media (max-width: 720px) { .pg-cond-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- callouts ---- */
.pg-callout {
  display: flex; gap: .9rem; align-items: flex-start; margin: 1.8rem 0;
  padding: 1.1rem 1.3rem; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent); color: var(--text-soft);
}
.pg-callout p { margin: 0; }
.pg-callout-ic { flex: none; color: var(--accent); margin-top: .1rem; }
.pg-callout-risk { border-left-color: var(--down); } .pg-callout-risk .pg-callout-ic { color: var(--down); }
.pg-callout-win  { border-left-color: var(--up); }   .pg-callout-win .pg-callout-ic { color: var(--up); }

/* ---- key takeaways card ---- */
.pg-takeaways {
  margin: 2rem 0; padding: 1.4rem 1.6rem; border-radius: var(--radius-lg);
  background: var(--flame-soft); border: 1px solid var(--accent-line);
}
.pg-takeaways-h {
  display: flex; align-items: center; gap: .55rem; color: var(--accent-3);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: .9rem;
}
.pg-takeaways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.pg-takeaways li { display: flex; gap: .7rem; align-items: flex-start; color: var(--text-soft); }
.pg-takeaways li svg { flex: none; color: var(--up); margin-top: .15rem; }

/* ---- h2 with icon ---- */
.pg-body h2 { display: flex; align-items: center; gap: .7rem; }
.pg-h2ic {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-3);
  display: inline-grid; place-items: center;
}
/* first paragraph lead-in */
.pg-body > p:first-of-type { font-size: 1.12rem; color: var(--text); }
