/* ==========================================================================
   JP Management - Blog Styles (blog.css) v18
   Rewritten from scratch 2026-07 for the redesign. Companion to
   css/jp-site.css (loads after it, uses its --jp-* tokens). Styles the
   blog index (card grid) and the article pages (hero, TOC, rich text,
   CTA boxes, related-article cards). System font stack, no webfonts.
   ========================================================================== */

/* --- Page canvas ------------------------------------------------------- */
body[data-page="blog"],
body[data-page="blog-article"] {
  background:
    radial-gradient(1200px 500px at 85% -80px, rgba(168, 211, 249, 0.28), transparent 60%),
    radial-gradient(1000px 460px at 8% 60px, rgba(255, 170, 207, 0.24), transparent 55%),
    var(--jp-bg);
}

/* Clears the fixed pill nav; article column stays readable. */
.jp-article {
  max-width: 860px;
  padding-top: calc(var(--jp-nav-h) + 44px);
  padding-bottom: 40px;
}

/* Blog index needs the same nav clearance on its hero. */
body[data-page="blog"] .jp-main > .jp-container {
  padding-top: calc(var(--jp-nav-h) + 24px);
}

/* --- Breadcrumb -------------------------------------------------------- */
.breadcrumb { margin: 0 0 14px; }
.breadcrumb-inner {
  font-size: 0.82rem;
  color: var(--jp-muted);
}
.breadcrumb a {
  color: var(--jp-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--jp-ink); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.45; }
.breadcrumb .current { color: var(--jp-ink); }

/* --- Article hero (both markup generations) ---------------------------- */
.article-hero,
.blog-hero-inner { padding: 4px 0 10px; }

.article-category,
.blog-category,
.blog-card-category,
.blog-related-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--jp-ink);
  background: var(--jp-grad-soft);
  border: 1px solid var(--jp-line);
  border-radius: 999px;
  padding: 0.3em 1em;
  margin-bottom: 14px;
}

.article-title,
.blog-title,
.article-hero h1,
.blog-hero-inner h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--jp-ink);
}

.article-meta,
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.86rem;
  color: var(--jp-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--jp-line);
}
.article-meta .meta-sep,
.blog-meta .blog-meta-sep { opacity: 0.45; }

/* --- Article rich text -------------------------------------------------- */
.article-body,
.article-content,
.blog-content { padding: 26px 0 8px; }
.blog-content-inner { max-width: 100%; }

.article-body h2,
.article-content h2,
.blog-content h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 46px 0 14px;
  padding-left: 14px;
  border-left: 4px solid transparent;
  border-image: var(--jp-grad) 1;
  color: var(--jp-ink);
}
.article-body h2:first-child,
.article-content h2:first-child,
.blog-content h2:first-child { margin-top: 0; }

.article-body h3,
.article-content h3,
.blog-content h3 {
  font-size: 1.16rem;
  margin: 30px 0 10px;
  color: var(--jp-ink);
}

.article-body p,
.article-content p,
.blog-content p {
  font-size: 1rem;
  line-height: 1.85;
  color: #33363e;
  margin: 0 0 18px;
}

.article-body ul, .article-body ol,
.article-content ul, .article-content ol,
.blog-content ul, .blog-content ol {
  line-height: 1.85;
  color: #33363e;
  margin: 0 0 22px;
  padding-left: 22px;
}
.article-body li, .article-content li, .blog-content li { margin-bottom: 8px; }
.article-body li::marker, .article-content li::marker, .blog-content li::marker { color: #d4608a; }

.article-body strong, .article-content strong, .blog-content strong {
  color: var(--jp-ink);
  font-weight: 600;
}

.article-body a, .article-content a, .blog-content a {
  color: #b04f7f;
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 79, 127, 0.3);
  transition: color 0.2s, border-color 0.2s;
}
.article-body a:hover, .article-content a:hover, .blog-content a:hover {
  color: var(--jp-ink);
  border-bottom-color: var(--jp-ink);
}

.article-body img, .article-content img, .blog-content img { border-radius: var(--jp-radius); }

.article-body blockquote,
.article-content blockquote,
.blog-content blockquote {
  margin: 28px 0;
  padding: 18px 24px;
  background: var(--jp-surface);
  border-left: 4px solid transparent;
  border-image: var(--jp-grad) 1;
  border-radius: 0 var(--jp-radius) var(--jp-radius) 0;
}
.article-body blockquote p,
.article-content blockquote p,
.blog-content blockquote p { margin: 0; font-style: italic; color: var(--jp-muted); }

/* --- Tables ------------------------------------------------------------- */
.table-responsive { overflow-x: auto; margin: 26px 0; }
.table-responsive table { margin: 0; }

.article-body table, .article-content table, .blog-content table,
table.comparison-table, table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 26px 0;
  font-size: 0.92rem;
  background: #ffffff;
  border: 1px solid var(--jp-line);
  border-radius: var(--jp-radius);
  overflow: hidden;
}
.article-body th, .article-body td,
.article-content th, .article-content td,
.blog-content th, .blog-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--jp-line);
  color: #33363e;
}
.article-body th, .article-content th, .blog-content th {
  color: var(--jp-ink);
  font-weight: 600;
  background: linear-gradient(135deg, rgba(255, 170, 207, 0.16), rgba(168, 211, 249, 0.16));
}
.article-body tr:last-child td,
.article-content tr:last-child td,
.blog-content tr:last-child td { border-bottom: none; }

/* --- Table of contents (all markup generations) ------------------------- */
.toc,
.article-toc,
.blog-toc {
  background: var(--jp-surface);
  border: 1px solid var(--jp-line);
  border-radius: var(--jp-radius);
  padding: 22px 26px;
  margin: 0 0 34px;
}
.toc-title,
.article-toc h4,
.blog-toc-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--jp-muted);
  margin: 0 0 12px;
  padding: 0;
  border: none;
}
.toc-list,
.article-toc ol,
.blog-toc-list {
  margin: 0;
  padding-left: 20px;
  columns: 1;
}
.toc-list li,
.article-toc li,
.blog-toc-list li {
  font-size: 0.88rem;
  margin-bottom: 7px;
}
.toc-list a,
.article-toc a,
.blog-toc-list a {
  color: var(--jp-muted);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s;
}
.toc-list a:hover,
.article-toc a:hover,
.blog-toc-list a:hover { color: #b04f7f; }

/* Anchor targets scroll clear of the fixed nav */
.article-body [id], .article-content [id], .blog-content [id] {
  scroll-margin-top: calc(var(--jp-nav-h) + 24px);
}

/* --- CTA boxes ----------------------------------------------------------- */
.cta-box,
.article-cta,
.blog-cta-box,
.service-cta {
  position: relative;
  background: var(--jp-grad);
  border-radius: var(--jp-radius-lg);
  padding: 38px 32px;
  text-align: center;
  margin: 44px 0;
  overflow: hidden;
}
.cta-box::after,
.article-cta::after,
.blog-cta-box::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  pointer-events: none;
}
.cta-box-title,
.cta-box h3,
.article-cta h3,
.blog-cta-box h3 {
  position: relative;
  z-index: 1;
  font-size: 1.4rem;
  margin: 0 0 10px;
  padding: 0;
  border: none;
  color: var(--jp-ink);
}
.cta-box-text,
.cta-box p,
.article-cta p,
.blog-cta-box p {
  position: relative;
  z-index: 1;
  color: var(--jp-ink);
  opacity: 0.8;
  font-size: 0.95rem;
  margin: 0 0 6px;
}
.cta-box a, .article-cta a, .blog-cta-box a { border-bottom: none; }

/* Apply pill used inside articles (kept class name from the content) */
.jp-apply-btn,
.blog-cta-btn {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 15px 46px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--jp-ink) !important;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 22px rgba(20, 21, 25, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.jp-apply-btn:hover,
.blog-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(20, 21, 25, 0.22);
  color: var(--jp-ink) !important;
}

/* --- Blog index hero ----------------------------------------------------- */
.blog-hero {
  padding: 26px 0 10px;
  text-align: left;
}
.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.blog-hero h1::after {
  content: "";
  display: block;
  width: 74px;
  height: 5px;
  margin-top: 12px;
  border-radius: 3px;
  background: var(--jp-grad);
}
.blog-hero p,
.blog-hero .blog-hero-sub {
  font-size: 1.02rem;
  color: var(--jp-muted);
  max-width: 560px;
  margin: 0;
  line-height: 1.6;
}

/* --- Blog index grid ------------------------------------------------------ */
.blog-grid-section { padding: 30px 0 70px; }
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--jp-line);
  border-radius: var(--jp-radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--jp-shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--jp-shadow);
  border-color: var(--jp-pink);
}
.blog-card-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}
.blog-card-category { margin-bottom: 10px; align-self: flex-start; }
.blog-card-title {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px;
  color: var(--jp-ink);
}
.blog-card-excerpt {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--jp-muted);
  margin: 0 0 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  font-size: 0.78rem;
  color: var(--jp-muted);
  opacity: 0.8;
}

/* --- Related articles (both markup generations) --------------------------- */
.related-articles,
.blog-related {
  padding: 40px 0 20px;
  margin-top: 30px;
  border-top: 1px solid var(--jp-line);
}
.related-articles h2,
.blog-related-title {
  font-size: 1.35rem;
  text-align: left;
  margin: 0 0 22px;
  padding: 0;
  border: none;
}
.related-grid,
.blog-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .related-grid,
  .blog-related-grid { grid-template-columns: repeat(2, 1fr); }
}
.blog-related-card {
  display: block;
  background: #ffffff;
  border: 1px solid var(--jp-line);
  border-radius: var(--jp-radius);
  padding: 22px 24px;
  text-decoration: none;
  box-shadow: var(--jp-shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.blog-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--jp-shadow);
  border-color: var(--jp-blue);
}
.blog-related-card .blog-related-title {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--jp-ink);
}
.blog-related-category { margin-bottom: 10px; }

/* Narrow helper kept for legacy in-article wrappers */
.jp-container-narrow {
  max-width: 780px;
  margin-inline: auto;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 640px) {
  .jp-article { padding-top: calc(var(--jp-nav-h) + 30px); }
  .cta-box, .article-cta, .blog-cta-box { padding: 30px 20px; }
  .toc, .article-toc, .blog-toc { padding: 18px 20px; }
  .article-body h2, .article-content h2, .blog-content h2 { font-size: 1.32rem; }
}

/* third breadcrumb markup generation (leaks/promote articles) */
.blog-breadcrumb { font-size: 0.82rem; color: var(--jp-muted, #5c6270); margin: 0 0 18px; }
.blog-breadcrumb-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.blog-breadcrumb a { color: inherit; text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--jp-pink, #ffaacf); }
.breadcrumb-sep { opacity: 0.6; }
.breadcrumb-current { font-weight: 600; }

/* highlighted callout box (agency-vs-solo articles) */
.info-box {
  margin: 24px 0;
  padding: 20px 24px;
  border: 1px solid rgba(255, 170, 207, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 170, 207, 0.12) 0%, rgba(168, 211, 249, 0.12) 100%);
}
.info-box a { color: inherit; }
