/* =========================================================
   MartiFlow blog — post styles
   Loads AFTER /styles.css and reuses its tokens and components
   (.nav, .label, .btn, .steps, .case, .cta-box, footer).
   ========================================================= */

/* ===== POST HERO ===== */
.post-hero {
  position: relative;
  padding-block: 2.75rem 2.5rem;
  overflow: hidden;
}
.post-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 5% 0%, rgba(58, 127, 183, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 60% at 95% 10%, rgba(7, 105, 81, 0.07), transparent 50%);
  pointer-events: none;
}
.post-wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, 780px);
  margin-inline: auto;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  padding: 0.3rem 0.7rem 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.crumb:hover { color: var(--blue-dark); border-color: var(--blue); background: var(--blue-soft); }
.post-hero .label { margin-bottom: 0.9rem; }
.post-hero h1 {
  font-size: clamp(1.85rem, 4.6vw, 2.7rem);
  text-wrap: balance;
  margin-bottom: 1rem;
}
.post-lede {
  font-size: 1.13rem;
  line-height: 1.6;
  color: #475569;
  max-width: 62ch;
  margin-bottom: 1.5rem;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.post-author {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.post-author strong { display: block; color: var(--text); font-weight: 650; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--blue) 0%, var(--green) 100%);
  box-shadow: 0 3px 10px rgba(58, 127, 183, 0.3);
  flex-shrink: 0;
}
.post-hero .hero-meta { margin-top: 0.25rem; }

/* ===== STATS ===== */
.post-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}
.post-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.post-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(7, 105, 81, 0.3); }
.post-stat:first-child { background: var(--green-soft); border-color: transparent; }
.post-stat .metric-num { display: block; }
.post-stat .metric-label { display: block; margin-top: 0.3rem; color: var(--text-muted); font-weight: 550; line-height: 1.4; }
.post-stat:first-child .metric-label { color: var(--green-dark); }

/* ===== ARTICLE BODY ===== */
.post-body {
  width: min(100% - 2.5rem, 720px);
  margin-inline: auto;
  padding-block: 1rem 3rem;
  font-size: 1.07rem;
  line-height: 1.75;
  color: #1e293b;
}
.post-body > * + * { margin-top: 1.1rem; }
.post-body h2 {
  font-size: clamp(1.4rem, 3.2vw, 1.75rem);
  margin: 3.25rem 0 0;
  scroll-margin-top: 5.5rem;
}
.post-body h2 + * { margin-top: 0.85rem; }
.post-body strong { color: var(--text); font-weight: 650; }
.post-body p a, .post-body li a {
  color: var(--blue-dark);
  text-decoration: underline;
  text-decoration-color: rgba(58, 127, 183, 0.35);
  text-underline-offset: 3px;
  font-weight: 550;
}
.post-body p a:hover, .post-body li a:hover { color: var(--green); text-decoration-color: currentColor; }

/* Bulleted lists (site reset removes markers, so draw our own) */
.post-body ul.bullets { display: grid; gap: 0.55rem; }
.post-body ul.bullets li {
  position: relative;
  padding-left: 1.6rem;
}
.post-body ul.bullets li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(58, 127, 183, 0.15);
}
.post-body ul.bullets.check li::before {
  content: "✓";
  top: 0.12em;
  left: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: var(--green);
  box-shadow: none;
}

/* Client card */
.client-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem 1.3rem 1.6rem;
  box-shadow: var(--shadow-sm);
}
.client-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), var(--green));
}
.client-card .label { margin-bottom: 0.4rem; }
.client-card p { color: #334155; }

/* Problem panel */
.problem {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.problem > p:first-child { font-weight: 600; color: var(--text); margin-bottom: 0.75rem; }

/* Pull quote */
.pullquote {
  margin-block: 2rem;
  padding: 1.35rem 1.5rem 1.35rem 1.6rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 80% 100% at 0% 0%, rgba(58, 127, 183, 0.12), transparent 65%),
    var(--blue-soft);
  border-left: 4px solid var(--blue);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--blue-dark);
}

/* Solution steps — builds on .steps / .step from styles.css */
.post-body .steps { margin-top: 1.25rem; }
.post-body .step h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.post-body .step p { font-size: 0.97rem; line-height: 1.6; }
.post-body .step p + p { margin-top: 0.6rem; }
.post-body .step ul.bullets { margin-top: 0.6rem; font-size: 0.97rem; color: var(--text-muted); gap: 0.35rem; }

/* Result panel */
.result {
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(7, 105, 81, 0.1), transparent 60%),
    var(--green-soft);
  border: 1px solid rgba(7, 105, 81, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  color: #14352c;
}
.result .label { margin-bottom: 0.35rem; }
.result h2 { margin-top: 0 !important; color: var(--green-dark); }
.result > * + * { margin-top: 0.85rem; }
.result strong { color: var(--green-dark); }

/* Tech stack table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap th {
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.table-wrap td:first-child { font-weight: 650; color: var(--text); white-space: nowrap; }
.table-wrap td { color: #475569; }

/* Lessons */
.lessons {
  list-style: none;
  counter-reset: lesson;
  display: grid;
  gap: 0.75rem;
  margin-top: 1.1rem;
}
@media (min-width: 680px) { .lessons { grid-template-columns: 1fr 1fr; } }
.lessons li {
  counter-increment: lesson;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.lessons li:hover { border-color: rgba(58, 127, 183, 0.35); box-shadow: var(--shadow); transform: translateY(-2px); }
.lessons li::before {
  content: counter(lesson, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--blue);
  margin-bottom: 0.35rem;
}
.lessons li strong { display: block; font-size: 1rem; margin-bottom: 0.2rem; line-height: 1.35; }

/* ===== RELATED CASE STUDIES ===== */
.related {
  border-top: 1px solid var(--border);
  padding-block: 3.5rem 1rem;
}
.related-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.related-head h2 { margin-bottom: 0; }
.related-head a { font-size: 0.9rem; font-weight: 650; }
.related .cases { margin-top: 1.4rem; }
@media (min-width: 900px) { .related .cases { grid-template-columns: repeat(3, 1fr); } }
a.case { display: flex; flex-direction: column; color: inherit; }
a.case:hover { color: inherit; }
a.case h3 { font-size: 1.05rem; line-height: 1.35; }
a.case .metric-num { font-size: clamp(1.25rem, 3vw, 1.45rem); }
a.case .read {
  margin-top: auto;
  padding-top: 0.9rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--blue);
}
a.case:hover .read { color: var(--green); }

/* ===== POST CTA ===== */
.post-cta { padding-block: 2.5rem 4rem; }
.post-cta .cta-box p { max-width: 46ch; }

@media (max-width: 640px) {
  .post-hero { padding-block: 2rem 2rem; }
  .pullquote { padding: 1.1rem 1.15rem 1.1rem 1.25rem; }
  .step { padding: 1.1rem 1.1rem; gap: 0.9rem; }
  .table-wrap td:first-child { white-space: normal; width: 38%; }
  .table-wrap th, .table-wrap td { padding: 0.75rem 0.85rem; }
}

/* ===== ROOMIER LAYOUT (v2) ===== */
.post-hero { padding-block: 3.5rem 3rem; }
.post-wrap { width: min(100% - 2.5rem, 920px); }
.post-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); max-width: 22ch; margin-bottom: 1.25rem; }
.post-lede { font-size: 1.2rem; max-width: 68ch; margin-bottom: 1.75rem; }
.post-meta { margin-bottom: 1.5rem; }
.post-stats { gap: 1rem; margin-top: 2.5rem; }
.post-stat { padding: 1.4rem 1.5rem 1.5rem; }

.post-body { width: min(100% - 2.5rem, 860px); padding-block: 1.5rem 4.5rem; font-size: 1.1rem; line-height: 1.8; }
.post-body > * + * { margin-top: 1.5rem; }
.post-body h2 { margin-top: 4.25rem; font-size: clamp(1.5rem, 3.2vw, 1.95rem); }
.post-body h2 + * { margin-top: 1.1rem; }
.post-body ul.bullets { gap: 0.8rem; }

.client-card { padding: 1.75rem 2rem 1.85rem 2.25rem; }
.problem { padding: 1.75rem 2rem; }
.problem > p:first-child { margin-bottom: 1rem; }
.pullquote { margin-block: 2.75rem; padding: 1.85rem 2.1rem; font-size: clamp(1.15rem, 2.6vw, 1.45rem); }

.post-body .steps { margin-top: 1.75rem; }
.post-body .step { padding: 1.75rem 2rem; gap: 1.35rem; }
.post-body .step h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.post-body .step p { font-size: 1.02rem; line-height: 1.75; }
.post-body .step p + p { margin-top: 0.9rem; }
.post-body .step ul.bullets { margin-block: 0.9rem; font-size: 1.02rem; gap: 0.55rem; }

.result { padding: 2rem 2.25rem; margin-top: 3rem; }
.result > * + * { margin-top: 1.1rem; }
.table-wrap th, .table-wrap td { padding: 1rem 1.35rem; }
.table-wrap table { font-size: 1rem; }

.lessons { gap: 1rem; margin-top: 1.5rem; }
.lessons li { padding: 1.5rem 1.6rem; font-size: 1rem; line-height: 1.7; }
.lessons li strong { font-size: 1.05rem; margin-bottom: 0.4rem; }

.related { padding-block: 4.5rem 1.5rem; }
.post-cta { padding-block: 3rem 5rem; }

@media (max-width: 640px) {
  .post-hero { padding-block: 2.25rem 2.25rem; }
  .post-body { font-size: 1.05rem; }
  .post-body h2 { margin-top: 3.25rem; }
  .client-card, .problem, .result { padding: 1.35rem 1.25rem; }
  .client-card { padding-left: 1.5rem; }
  .pullquote { padding: 1.35rem 1.35rem; }
  .post-body .step { padding: 1.35rem 1.2rem; gap: 1rem; }
  .lessons li { padding: 1.25rem 1.3rem; }
  .table-wrap th, .table-wrap td { padding: 0.75rem 0.85rem; }
}
