/* planCoo blog — shared article + index system
   Brand tokens from src/styles/theme.js (primary #558392, wash #f4f8f8) */

:root {
  --pc-primary: #558392;
  --pc-primary-dark: #406b77;
  --pc-primary-light: #88a8b3;
  --pc-accent: #28a699;
  --pc-ink: #0f172a;
  --pc-body: #23434e;
  --pc-muted: #5f6b7a;
  --pc-faint: #90a4ae;
  --pc-line: #d7e3e4;
  --pc-paper: #ffffff;
  --pc-wash: #f4f8f8;
  --pc-chip: #eef5f5;
  --pc-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(64, 107, 119, 0.08);
  --pc-radius: 16px;
  --pc-radius-sm: 10px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body.blog-page,
body:has(.blog-shell),
body:has(.blog-index) {
  font-family: var(--font);
  color: var(--pc-ink);
  background:
    radial-gradient(ellipse 80% 60% at 12% 18%, rgba(40, 166, 153, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 8%, rgba(85, 131, 146, 0.12), transparent 50%),
    linear-gradient(165deg, #f4f8f8 0%, #e8f2f1 42%, #f7f5f1 100%);
  min-height: 100%;
  line-height: 1.7;
}

a {
  color: var(--pc-primary-dark);
  text-decoration: none;
}
a:hover { color: var(--pc-accent); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--pc-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Site bar ── */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(244, 248, 248, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(215, 227, 228, 0.85);
}
.site-logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--pc-primary);
  text-decoration: none;
}
.site-logo:hover { color: var(--pc-primary-dark); text-decoration: none; }
.site-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.92rem;
  font-weight: 600;
}
.site-links a { color: var(--pc-body); text-decoration: none; }
.site-links a:hover { color: var(--pc-primary-dark); }
.site-links a[aria-current="page"] { color: var(--pc-primary-dark); }

/* ── Shell ── */
.blog-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.blog-article,
.blog-wrap {
  max-width: 760px;
  margin: 0 auto;
  background: var(--pc-paper);
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  box-shadow: var(--pc-shadow);
  padding: 36px 40px 40px;
}

.blog-shell .blog-article,
.blog-shell .blog-wrap { margin: 0 auto; }

/* ── Breadcrumb ── */
.blog-nav,
nav.blog-nav,
.blog-article > nav:first-child,
.blog-wrap > nav:first-child {
  font-size: 0.84rem;
  color: var(--pc-muted);
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.blog-nav span,
.blog-wrap > nav span,
.blog-article > nav span {
  color: var(--pc-faint);
  margin: 0 8px;
}

/* ── Tags / chips ── */
.blog-tags,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.blog-tag,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: var(--pc-chip);
  color: var(--pc-primary-dark);
  border: 1px solid #d3e4e6;
}
.blog-tag.alt1, .blog-tag.tag-green { background: #ecf8f0; color: #1b6b3a; border-color: #cdebd6; }
.blog-tag.alt2, .blog-tag.tag-orange { background: #fff4e8; color: #b45309; border-color: #fde1c3; }
.blog-tag.alt3, .blog-tag.tag-purple { background: #f4eef8; color: #6d28d9; border-color: #e4d7f5; }
.blog-tag.tag-rose { background: #fdecef; color: #be123c; border-color: #f9cfd8; }
.blog-tag.tag-indigo { background: #eef0fa; color: #3730a3; border-color: #d8dcf3; }
.blog-tag.tag-amber { background: #fff8e1; color: #b45309; border-color: #f3e2a8; }

/* ── Type ── */
.blog-article h1,
.blog-wrap h1,
.hero h1 {
  margin: 0 0 10px;
  color: var(--pc-ink);
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

h1 + h2 {
  color: var(--pc-muted);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  line-height: 1.4;
}

.blog-byline,
.byline {
  margin: 0 0 28px;
  color: var(--pc-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.blog-lede,
.blog-byline + p,
.byline + p {
  font-size: 1.18rem;
  color: var(--pc-body);
  line-height: 1.75;
  margin: 0 0 1.2em;
}

.blog-article h2,
.blog-wrap h2,
.content h2 {
  margin: 2.2em 0 0.7em;
  color: var(--pc-ink);
  font-size: 1.38rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding: 0 0 10px;
  border-bottom: 0;
  box-shadow: inset 0 -3px 0 0 var(--pc-accent);
  display: table;
}

.blog-article h3,
.blog-wrap h3,
.content h3 {
  margin: 1.5em 0 0.5em;
  color: var(--pc-ink);
  font-size: 1.08rem;
  font-weight: 700;
}

.blog-article p,
.blog-wrap p,
.content p {
  color: var(--pc-body);
  margin: 0 0 1.05em;
  font-size: 1.02rem;
}

.blog-article ul,
.blog-wrap ul,
.blog-article ol,
.blog-wrap ol {
  color: var(--pc-body);
  margin: 0 0 1.3em;
  padding-left: 1.25em;
  line-height: 1.8;
}
.blog-article li,
.blog-wrap li { margin: 0.35em 0; }

.blog-article strong,
.blog-wrap strong { color: var(--pc-ink); font-weight: 700; }

blockquote {
  margin: 1.4em 0;
  padding: 16px 20px 16px 22px;
  border-left: 3px solid var(--pc-accent);
  background: #f3faf9;
  border-radius: 0 var(--pc-radius-sm) var(--pc-radius-sm) 0;
  color: var(--pc-body);
  font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

.highlight-box {
  background: #fff7eb;
  border-left: 3px solid #f59e0b;
  padding: 16px 20px;
  margin: 1.4em 0;
  border-radius: 0 var(--pc-radius-sm) var(--pc-radius-sm) 0;
  color: var(--pc-body);
}

/* ── Layout modules ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 1.5em;
}
.blog-stack { display: flex; flex-direction: column; gap: 14px; margin: 0 0 1.5em; }

.blog-card,
.blog-article .blog-grid > div,
.blog-wrap .blog-grid > div {
  background: #f7fbfb;
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius-sm);
  padding: 18px;
}
.blog-card > p:last-child,
.blog-card > h3:last-child { margin-bottom: 0; }
.blog-card h3 { margin-top: 0; }

.blog-callout,
.section {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--pc-line);
  border-left: 3px solid var(--pc-primary);
  border-radius: var(--pc-radius-sm);
  background: #f8fbfb;
}
.blog-callout.is-green { border-left-color: #2e7d32; background: #f4faf5; }
.blog-callout.is-teal { border-left-color: #0f766e; background: #f2faf8; }
.blog-callout.is-purple { border-left-color: #7c3aed; background: #f7f3fc; }
.blog-callout.is-orange { border-left-color: #ea580c; background: #fff8f1; }
.blog-callout p:last-child,
.section p:last-child { margin-bottom: 0; }

.blog-note {
  background: #f4faf8;
  border: 1px solid #cde8e4;
  border-radius: var(--pc-radius-sm);
  padding: 18px 20px;
  margin: 1.4em 0;
}
.blog-note p:last-child { margin-bottom: 0; }

.blog-steps { display: flex; flex-direction: column; gap: 14px; margin: 0 0 1.5em; }
.blog-step { display: flex; gap: 12px; align-items: flex-start; }
.blog-step-num {
  background: #e6f4f1;
  color: #0f766e;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.blog-level {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--pc-line);
}
.blog-level:last-child { border-bottom: 0; }
.blog-badge {
  display: inline-flex;
  background: var(--pc-primary);
  color: #fff;
  border-radius: 8px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.blog-table-wrap { overflow-x: auto; margin: 1.4em 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pc-line);
  color: var(--pc-body);
  vertical-align: top;
}
th {
  color: var(--pc-primary-dark);
  font-weight: 700;
  background: #f4f8f8;
}
thead th { border-bottom: 1px solid var(--pc-line); }

/* ── CTA / about / related ── */
.blog-cta {
  background: linear-gradient(135deg, #e8f4f2 0%, #eef5f8 100%);
  border: 1px solid #cde8e4;
  border-radius: var(--pc-radius);
  padding: 28px 24px;
  margin: 2.4em 0;
  text-align: center;
}
.blog-cta p:last-of-type { margin-bottom: 1em; }

.blog-about {
  background: #f3f8f8;
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  padding: 28px;
  margin: 40px 0 8px;
}
.blog-kicker,
.blog-about > p:first-child,
.blog-related > p:first-child {
  color: var(--pc-muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.blog-related,
.related-stories {
  background: #f7fbfb;
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  padding: 24px;
  margin: 40px 0 8px;
}
.blog-related h3,
.related-stories h3 { margin-top: 0; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { margin: 12px 0; }
.related-date { display: block; font-size: 0.82rem; color: var(--pc-faint); margin-top: 2px; }
.blog-related a { font-weight: 600; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pc-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn:hover { background: var(--pc-primary-dark); color: #fff; text-decoration: none; }
.btn-ghost,
a.btn-ghost {
  background: #fff;
  color: var(--pc-primary-dark);
  border: 1px solid var(--pc-primary);
}
.btn-ghost:hover { background: #f4f8f8; color: var(--pc-primary-dark); text-decoration: none; }
.btn-muted,
a.btn-muted {
  background: #fff;
  color: var(--pc-muted);
  border: 1px solid var(--pc-line);
}
.btn-muted:hover { color: var(--pc-ink); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 0.84rem; }

.social-share {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0;
  padding: 22px 0;
  border-top: 1px solid var(--pc-line);
  border-bottom: 1px solid var(--pc-line);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f4f8f8;
  border: 1px solid var(--pc-line);
  border-radius: 8px;
  color: var(--pc-body);
  font-size: 0.88rem;
  font-weight: 600;
}
.share-btn:hover { border-color: var(--pc-primary); color: var(--pc-primary-dark); text-decoration: none; }

.blog-footer,
footer.blog-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--pc-line);
  color: var(--pc-muted);
  font-size: 0.86rem;
}
.blog-footer p { margin: 0; color: var(--pc-muted); font-size: inherit; }

/* CEP leftover hero */
.hero {
  margin: -36px -40px 28px;
  padding: 32px 40px 22px;
  background: linear-gradient(135deg, #f7fbfb 0%, #eef6f5 100%);
  border-bottom: 1px solid var(--pc-line);
  border-radius: var(--pc-radius) var(--pc-radius) 0 0;
}
.content { padding: 0; }

/* ── Index ── */
.blog-index { max-width: 1080px; margin: 0 auto; padding: 12px 20px 72px; }

.blog-index-hero {
  padding: 28px 4px 36px;
  max-width: 720px;
}
.blog-index-hero .kicker {
  color: var(--pc-accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.blog-index-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--pc-ink);
}
.blog-index-hero .lead {
  margin: 0 0 22px;
  font-size: 1.18rem;
  color: var(--pc-body);
  line-height: 1.65;
}

.topic-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}
.topic {
  appearance: none;
  background: #fff;
  border: 1px solid var(--pc-line);
  color: var(--pc-body);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
}
.topic:hover { border-color: var(--pc-primary-light); }
.topic.is-on {
  background: var(--pc-primary);
  border-color: var(--pc-primary);
  color: #fff;
}

.blog-feed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.blog-post-card {
  display: flex;
  flex-direction: column;
  background: var(--pc-paper);
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  padding: 24px;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  min-height: 100%;
}
.blog-post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pc-shadow);
  border-color: #b9d0d3;
  text-decoration: none;
  color: inherit;
}
.blog-post-card.is-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(232, 244, 242, 0.9) 0%, #fff 55%);
}
.blog-post-card .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.blog-post-card time {
  color: var(--pc-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.blog-post-card h2 {
  margin: 0 0 10px;
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--pc-ink);
  border: 0;
  padding: 0;
  box-shadow: none;
  display: block;
}
.blog-post-card.is-featured h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
.blog-post-card p {
  margin: 0 0 16px;
  color: var(--pc-body);
  font-size: 0.98rem;
  flex: 1;
}
.blog-post-card .read {
  color: var(--pc-primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: auto;
}
.blog-post-card:hover .read { color: var(--pc-accent); }
.blog-post-card.is-hidden { display: none; }

.featured-aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}
.featured-aside .stat {
  background: #fff;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  padding: 14px 16px;
}
.featured-aside .stat strong {
  display: block;
  font-size: 0.82rem;
  color: var(--pc-primary-dark);
  margin-bottom: 4px;
}
.featured-aside .stat span {
  font-size: 0.88rem;
  color: var(--pc-body);
}

.blog-index-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--pc-line);
  color: var(--pc-muted);
  font-size: 0.86rem;
  text-align: center;
}

@media (max-width: 800px) {
  .site-bar { padding: 10px 16px; }
  .site-links a:not(.btn) { display: none; }
  .blog-article, .blog-wrap { padding: 24px 18px 32px; }
  .hero { margin: -24px -18px 22px; padding: 22px 18px 16px; }
  .blog-feed { grid-template-columns: 1fr; }
  .blog-post-card.is-featured {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .featured-aside { display: none; }
  .blog-index-hero { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-post-card { transition: none; }
  html { scroll-behavior: auto; }
}
