/* Blog content-area styles only.
   Header / footer / nav / breakpoints come from site/css/styles.css unchanged. */

.blog-body { overflow-x: clip; }
.blog-main {
  padding-top: var(--nav-offset, 110px);
  padding-bottom: 48px;
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.blog-evo {
  position: absolute;
  width: 220px; height: 220px;
  color: var(--ink-2, #2c466c);
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
}
.blog-evo-tl { top: -40px; left: -36px; transform: rotate(-18deg); }
.blog-evo-br { right: -48px; bottom: -64px; transform: rotate(22deg); width: 260px; height: 260px; }
.blog-evo-tr { top: -36px; right: -28px; transform: rotate(12deg); }

/* Hero: badge + headline + lede + featured card only */
.blog-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0 36px;
  background: transparent;
}
.blog-hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.blog-hero-copy { max-width: 36rem; }
.blog-hero-copy .eyebrow { margin-bottom: 18px; }
.blog-hero-copy h1 {
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  max-width: 16ch;
  margin: 0 0 18px;
  color: var(--ink);
}
.blog-hero-copy .lede {
  margin: 0;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-2);
  max-width: 48ch;
  line-height: 1.55;
}

/* Search: separate section; match staging .lib-search language */
.blog-search-section {
  padding: 10px 0 6px;
  background: transparent;
}
.blog-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 12px 10px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
.blog-search-icon { color: var(--muted); flex: 0 0 auto; }
.blog-search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  font-family: 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  padding: 8px 0;
}
.blog-search-bar input::placeholder { color: var(--muted); }
.blog-search-bar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 100px;
  padding: 11px 20px;
}

/* Four balanced category buttons — staging card language */
.blog-cats-section {
  padding: 18px 0 4px;
  background: transparent;
}
.blog-cat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.blog-cat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  min-height: 56px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 22px);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Segoe UI', Roboto, sans-serif;
  box-shadow: var(--shadow-sm);
  transition: .35s;
}
.blog-cat-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: var(--red);
  border-color: rgba(244,5,28,.22);
}
.blog-cat-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.blog-feature {
  position: relative; overflow: hidden; border-radius: var(--r-xl, 28px);
  text-decoration: none; color: #fff; min-height: 380px;
  box-shadow: var(--shadow); display: block;
  background: linear-gradient(150deg, #0B1B3E, #123B7A);
}
.blog-feature img {
  width: 100%; height: 100%; object-fit: cover; min-height: 380px;
  filter: brightness(0.72);
}
.blog-feature-body {
  position: absolute; inset: auto 0 0 0;
  padding: 24px;
  background: linear-gradient(transparent, rgba(11,27,62,0.92));
}
.blog-feature-body h2 {
  margin: 8px 0; color: #fff;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-feature-excerpt {
  margin: 0 0 10px; color: rgba(255,255,255,0.88); font-size: 0.9rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.blog-section { padding-top: 10px; padding-bottom: 18px; overflow: hidden; }
.blog-sec-head {
  display: flex; align-items: end; justify-content: space-between; gap: 12px;
  margin: 36px 0 18px;
}
.blog-sec-head .tag { margin-bottom: 10px; display: inline-flex; }
.blog-sec-head h2 {
  margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 800; color: var(--ink);
}
.blog-sec-actions { display: flex; align-items: center; gap: 8px; }
.blog-see-all {
  color: var(--red); font-weight: 700; text-decoration: none; font-size: 0.92rem;
}
.blog-see-all:hover { text-decoration: underline; }
.blog-nav-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 1.2rem; cursor: pointer; line-height: 1;
}
.blog-nav-btn:hover { border-color: rgba(244,5,28,0.35); color: var(--red); }
.blog-nav-btn:focus-visible,
.blog-card:focus-visible,
.blog-cat-btn:focus-visible,
.blog-doc-action:focus-visible {
  outline: 3px solid rgba(244,5,28,0.35); outline-offset: 2px;
}

.blog-carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px);
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 10px; scrollbar-width: thin;
}
.blog-carousel .blog-card { scroll-snap-align: start; }
.blog-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.blog-grid-wrap { padding-bottom: 40px; }

.blog-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg, 22px);
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm); min-height: 100%;
  transition: .35s;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.blog-card-media { aspect-ratio: 16 / 10; background: var(--panel-2, #eef3fb); overflow: hidden; }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; }
.blog-placeholder {
  display: grid; place-items: center; color: var(--ink-2); font-weight: 700;
  background: linear-gradient(135deg, rgba(244,5,28,0.08), rgba(45,154,140,0.12)), var(--panel, #f5f8fd);
}
.blog-placeholder.tall { min-height: 380px; }
.blog-card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card-title {
  margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.blog-card-excerpt {
  margin: 0; color: var(--ink-2); font-size: 0.88rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  color: var(--muted); font-size: 0.82rem;
  margin-top: auto;
}
.blog-card-meta.light { color: rgba(255,255,255,0.9); }

.blog-chip {
  display: inline-flex; align-items: center; width: fit-content;
  background: rgba(244,5,28,.06); border: 1px solid rgba(244,5,28,.18);
  border-radius: 999px; padding: 4px 10px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--red); text-decoration: none;
}
.blog-chip.light {
  background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.28); color: #fff;
  letter-spacing: .06em;
}
.blog-chip.muted {
  font-weight: 500; letter-spacing: 0; text-transform: none;
  background: var(--panel); color: var(--muted); border-color: var(--line);
}

.blog-page-hero { position: relative; overflow: hidden; padding: 18px 24px 8px; }
.blog-page-hero h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.blog-crumb { color: var(--red); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.blog-crumb a { color: inherit; text-decoration: none; }
.blog-empty { color: var(--muted); }

.blog-article-hero { max-width: 820px; }
.blog-article-hero h1 {
  margin: 0 0 14px; font-size: clamp(1.85rem, 3.2vw, 2.55rem); line-height: 1.15;
}
.blog-byline {
  display: flex; flex-wrap: wrap; gap: 12px;
  color: var(--muted); margin-bottom: 20px; font-size: 0.95rem;
}
.blog-article-feature {
  margin: 0 0 8px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
}
.blog-article-feature img { width: 100%; max-height: 480px; object-fit: cover; }
.blog-article-feature figcaption {
  padding: 10px 14px; color: var(--muted); font-size: 0.86rem; background: var(--panel);
}
.blog-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) minmax(0, 280px);
  gap: 32px; justify-content: space-between;
  padding-top: 18px; padding-bottom: 24px;
}
.blog-article-layout > * { min-width: 0; }
.blog-article-main { max-width: 740px; }
.blog-content {
  font-size: 1.05rem; color: var(--ink);
  overflow-wrap: anywhere; word-break: break-word;
}
.blog-content > *:first-child { margin-top: 0; }
.blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4 {
  margin: 1.4em 0 0.55em; line-height: 1.25; color: var(--ink);
}
.blog-content p, .blog-content ul, .blog-content ol, .blog-content pre, .blog-content table {
  margin: 0 0 1em;
}
.blog-content img, .blog-content video, .blog-content iframe {
  border-radius: 12px; border: 1px solid var(--line); margin: 12px 0;
  max-width: 100%; height: auto;
}
.blog-content a { color: var(--red); font-weight: 600; }
.blog-content table {
  width: 100%; max-width: 100%; border-collapse: collapse;
  display: block; overflow-x: auto;
}
.blog-content th, .blog-content td { border: 1px solid var(--line); padding: 8px 10px; }

/* Live-style code block: box styles ONLY on <pre>.
   Do NOT put border/padding/radius on inner <code> — that is inline and
   fragments into broken line-boxes (missing text + blue patches). */
.blog-content pre {
  background: #f6f8fa !important;
  background-image: none !important;
  color: #24292e !important;
  border: 1px solid #d0d7de !important;
  border-radius: 8px !important;
  padding: 18px 20px !important;
  overflow-x: auto;
  max-width: 100%;
  font-family: Consolas, Menlo, 'Courier New', ui-monospace, monospace !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  white-space: pre !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  margin: 14px 0 22px !important;
  box-decoration-break: clone;
}
.blog-content pre code {
  display: block;
  background: transparent !important;
  background-image: none !important;
  color: #24292e !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  white-space: inherit !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
.blog-content code {
  font-family: Consolas, Menlo, 'Courier New', ui-monospace, monospace;
  font-size: 0.92em;
}
.blog-content :not(pre) > code {
  background: #f6f8fa;
  color: #24292e;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}
.blog-content *[width],
.blog-content [style*="width"] { max-width: 100% !important; }
/* Do not force max-width on code blocks via loose style*=width matching */
.blog-content pre,
.blog-content pre * {
  max-width: none;
}

.blog-docs {
  margin-top: 28px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); padding: 16px;
}
.blog-docs h2 { margin: 0 0 12px; font-size: 1rem; }
.blog-doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.blog-doc-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.blog-doc-icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(244,5,28,0.08); color: var(--red);
  font-size: 0.68rem; font-weight: 800;
}
.blog-doc-name { margin: 0; font-weight: 700; font-size: 0.92rem; }
.blog-doc-kind { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; }
.blog-doc-action { white-space: nowrap; padding: 10px 14px; font-size: 13px; }

.blog-aside-card {
  position: sticky; top: calc(var(--nav-offset, 110px) + 12px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.blog-aside-card h2, .blog-aside-sub { margin: 0 0 10px; font-size: 0.95rem; }
.blog-aside-sub { margin-top: 16px; }
.blog-aside-author { margin: 0 0 8px; font-weight: 700; }
.blog-chips { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 1100px) {
  .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .blog-hero-grid, .blog-article-layout { grid-template-columns: 1fr; }
  .blog-hero { padding: 24px 0 18px; }
  .blog-hero-copy h1 { max-width: none; }
  .blog-cat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-aside-card { position: static; }
  .blog-doc-item { grid-template-columns: auto 1fr; }
  .blog-doc-action { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 560px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-cat-row { grid-template-columns: 1fr; gap: 12px; }
  .blog-search-bar {
    flex-wrap: wrap;
    border-radius: 18px;
    padding: 12px 14px;
  }
  .blog-search-bar .btn { width: 100%; border-radius: 12px; }
  .blog-carousel { grid-auto-columns: minmax(240px, 82vw); }
  .blog-evo { width: 160px; height: 160px; opacity: 0.04; }
  .blog-feature, .blog-feature img, .blog-placeholder.tall { min-height: 300px; }
}
