/* Blog & post styles — editorial layer on top of dashboard.css */

/* ============================================================
   Sticky nav (shared between blog list and post pages)
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .site-nav,
:root[data-theme="light"] .site-nav {
  background: rgba(255, 255, 255, 0.7);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.site-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text, inherit);
  text-decoration: none;
}

.site-nav-brand i { font-size: 1.1rem; color: var(--accent-purple); }

.site-nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.site-nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.site-nav-link:hover {
  color: var(--text, inherit);
  background: rgba(255, 255, 255, 0.04);
}

.site-nav-link.active {
  color: var(--text, inherit);
  background: rgba(139, 92, 246, 0.12);
}

[data-theme="light"] .site-nav-link.active {
  background: rgba(109, 40, 217, 0.1);
}

.site-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   Status pill (color-coded health indicator — used on dashboard hero)
   ============================================================ */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-pill i { font-size: 1em; }

.status-pill-ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.32);
  color: var(--accent-green);
}

.status-pill-info {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.32);
  color: var(--accent-blue);
}

.status-pill-warn {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.34);
  color: var(--accent-yellow);
}

.status-pill-err {
  background: rgba(236, 72, 153, 0.14);
  border-color: rgba(236, 72, 153, 0.32);
  color: var(--accent-pink);
}

/* ============================================================
   Dashboard hero (mirrors blog hero, slightly tighter)
   ============================================================ */

.dashboard-hero {
  max-width: 780px;
  margin: 3rem auto 2rem;
  padding: 0 1.25rem;
  text-align: center;
}

.dashboard-hero-title {
  font-size: clamp(1.85rem, 4.6vw, 2.75rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 1.1rem 0 0.85rem;
}

.dashboard-hero-accent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dashboard-hero-subtitle {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* ============================================================
   Blog hero
   ============================================================ */

.blog-hero {
  max-width: 760px;
  margin: 3.5rem auto 2.5rem;
  padding: 0 1.25rem;
  text-align: center;
}

.blog-hero-eyebrow {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

[data-theme="light"] .blog-hero-eyebrow {
  background: rgba(109, 40, 217, 0.08);
}

.blog-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

.blog-hero-accent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ============================================================
   Blog list — cards with title-first hierarchy
   ============================================================ */

.blog-list {
  max-width: 760px;
  margin: 0 auto 4rem;
  padding: 0 1.25rem;
  display: grid;
  gap: 1rem;
}

.blog-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  border-radius: 14px;
}

.blog-card {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -16px rgba(139, 92, 246, 0.35);
}

.blog-card:hover .blog-card-cover svg { transform: scale(1.03); }

.blog-card:hover .blog-card-arrow {
  transform: translateX(4px);
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.18);
}

.blog-card-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  background: linear-gradient(135deg, #4c1d95, #1e3a8a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-card-cover svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.45s ease;
}

.blog-card-body {
  position: relative;
  padding: 1.5rem 1.75rem 1.6rem;
  min-width: 0;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  color: var(--text, inherit);
  /* Reserve space so the absolute arrow doesn't overlap a long title. */
  padding-right: 3rem;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.blog-card-meta-item i { font-size: 0.85em; opacity: 0.8; }

.blog-card-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.blog-card-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-muted);
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease;
}

[data-theme="light"] .blog-card-arrow {
  background: rgba(109, 40, 217, 0.08);
}

/* ============================================================
   Tag pills (used in cards + post header)
   ============================================================ */

.tag-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

[data-theme="light"] .tag-pill {
  background: rgba(109, 40, 217, 0.06);
  border-color: rgba(109, 40, 217, 0.15);
}

/* ============================================================
   Post page (article view)
   ============================================================ */

.post-wrapper {
  max-width: 760px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
}

.post-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}

.post-back-link:hover { color: var(--accent-purple); }

.post-header {
  margin-bottom: 2.5rem;
}

.post-title {
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

.post-lede {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-weight: 400;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .post-meta {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.post-content {
  padding: 2.5rem;
  border-radius: 16px;
  line-height: 1.7;
  font-size: 1rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 2.25rem;
  letter-spacing: -0.015em;
}

.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.15rem; }

.post-content > :first-child { margin-top: 0; }

.post-content pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

[data-theme="light"] .post-content pre {
  background: rgba(15, 23, 42, 0.05);
}

.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

.post-content :not(pre) > code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

[data-theme="light"] .post-content :not(pre) > code {
  background: rgba(15, 23, 42, 0.06);
}

.post-content blockquote {
  border-left: 3px solid var(--accent-purple);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--text-muted);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.post-content th,
.post-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

[data-theme="light"] .post-content th,
[data-theme="light"] .post-content td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.post-content th { font-weight: 600; color: var(--accent-purple); }

.post-nav {
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

[data-theme="light"] .post-nav {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.post-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.15s;
}

.post-nav-link:hover { color: var(--accent-blue); }

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 640px) {
  .site-nav-inner { padding: 0.7rem 1rem; gap: 0.75rem; }
  .site-nav-brand span { display: none; }
  .site-nav-links { gap: 0; }
  .site-nav-link { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
  .site-nav-actions .btn { padding: 0.4rem 0.7rem; font-size: 0.82rem; }

  .blog-hero { margin: 2rem auto 1.5rem; }
  .blog-card { padding: 1.25rem; gap: 1rem; }
  .blog-card-arrow { width: 32px; height: 32px; }
  .post-content { padding: 1.5rem; }
}

/* === Phase B: trust signal layer === */

/* ============================================================
   Trust strip — row of trust badges (cards + detail pages)
   ============================================================ */

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.25rem 0;
}

/* ============================================================
   Trust badge — chip style, slightly more prominent than .tag-pill
   ============================================================ */

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  transition: background 150ms ease, border-color 150ms ease;
  cursor: pointer;
}

.trust-badge i { font-size: 0.9em; }

/* SBOM — green tint (matches status-pill-ok family) */
.trust-badge--sbom {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: var(--accent-green);
}

.trust-badge--sbom:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
}

/* Multi-arch — blue/info tint */
.trust-badge--multi-arch {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: var(--accent-blue);
}

.trust-badge--multi-arch:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
}

/* Deps — neutral/info tint */
.trust-badge--deps {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
}

.trust-badge--deps:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
}

/* Verify — neutral/subtle (meta link, not a trust signal itself) */
.trust-badge--verify {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.trust-badge--verify:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="light"] .trust-badge--verify {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .trust-badge--verify:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
}

/* Trivy scan — default green (0 CRITICAL) */
.trust-badge--trivy {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: var(--accent-green);
}

.trust-badge--trivy:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
}

/* Trivy overrides per data-severity attribute */
.trust-badge--trivy[data-severity="critical"] {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.trust-badge--trivy[data-severity="critical"]:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
}

.trust-badge--trivy[data-severity="high"] {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.32);
  color: var(--accent-yellow);
}

.trust-badge--trivy[data-severity="high"]:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.48);
}

/* medium / low / info: keep default green (inherits .trust-badge--trivy) */

/* ============================================================
   Security scan section (detail page anchor)
   ============================================================ */

.security-section {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 80px;
}

[data-theme="light"] .security-section {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.security-section h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.security-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.security-section .scan-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ============================================================
   Severity grid — 5-column (Critical / High / Medium / Low / Info)
   ============================================================ */

.severity-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.severity-grid > * {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .severity-grid > * {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.06);
}

.severity-grid .count {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
}

.severity-grid .label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Color coding: critical (col 1) and high (col 2) only when > 0 */
.severity-grid > *:nth-child(1) .count[data-nonzero],
.severity-grid > *:nth-child(1).nonzero .count {
  color: #f87171;
}

.severity-grid > *:nth-child(2) .count[data-nonzero],
.severity-grid > *:nth-child(2).nonzero .count {
  color: var(--accent-yellow);
}

/* ============================================================
   Top advisories list
   ============================================================ */

.security-section .top-advisories {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 0;
}

.security-section .top-advisories li {
  font-size: 0.88rem;
  padding-bottom: 0.4rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Value proposition block (detail page top)
   ============================================================ */

.value-prop {
  border-left: 3px solid var(--accent-purple);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.value-prop > p {
  margin: 0;
}

/* ============================================================
   Postgres variants comparison table
   ============================================================ */

.variants-table-section {
  margin-top: 2rem;
  overflow-x: auto;
}

.variants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.variants-table th,
.variants-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

[data-theme="light"] .variants-table th,
[data-theme="light"] .variants-table td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.variants-table thead th {
  font-weight: 600;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.06);
}

[data-theme="light"] .variants-table thead th {
  background: rgba(109, 40, 217, 0.04);
}

.variants-table td:first-child code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
}

/* .tag-pill chips inside cells inherit existing styles — no override needed */

/* ============================================================
   Standalone page layout (verify-images.md and similar)
   ============================================================ */

.page-layout {
  /* Inherits body styles — no surprises */
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 6rem 1rem 2rem;
  border-radius: 16px;
  line-height: 1.7;
  font-size: 1rem;
}

.page-content article h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
}

.page-content article h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 2.25rem;
  scroll-margin-top: 80px;
}

.page-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

[data-theme="light"] .page-content code {
  background: rgba(15, 23, 42, 0.06);
}

.page-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

.page-content pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

[data-theme="light"] .page-content pre {
  background: rgba(15, 23, 42, 0.05);
}

/* Postgres variants comparison: only the active version's table is visible */
.variants-table-section .variants-table:not([data-active="true"]) {
  display: none;
}

/* Mobile adjustments for Phase B components */
@media (max-width: 640px) {
  .trust-strip { gap: 0.35rem; }

  .severity-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .severity-grid > *:nth-child(4),
  .severity-grid > *:nth-child(5) {
    grid-column: span 1;
  }

  .page-content {
    padding: 5rem 1rem 2rem;
  }
}
