/* ─── blog.css — SecurityAndTrust.io blog styles ──────────────────────────── */
/* Extends the shared site styles (nav, footer, variables) from base.html.j2   */

/* ── Shared page chrome ─────────────────────────────────────────────────────── */

.blog-index-page,
.article-page {
  padding-top: 5rem;   /* clear fixed nav */
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.blog-container,
.article-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Topic badges ────────────────────────────────────────────────────────────── */

.topic-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.topic-soc-2      { color: #00d4ff; background: rgba(0,212,255,0.08);  border: 1px solid rgba(0,212,255,0.25); }
.topic-vciso      { color: #60a5fa; background: rgba(96,165,250,0.08); border: 1px solid rgba(96,165,250,0.25); }
.topic-hipaa      { color: #a78bfa; background: rgba(167,139,250,0.08);border: 1px solid rgba(167,139,250,0.25); }
.topic-fedramp    { color: #fb923c; background: rgba(251,146,60,0.08); border: 1px solid rgba(251,146,60,0.25); }
.topic-pe         { color: #34d399; background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.25); }
.topic-pci-dss    { color: #f472b6; background: rgba(244,114,182,0.08);border: 1px solid rgba(244,114,182,0.25); }
.topic-risk       { color: #fbbf24; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25); }

/* ── Blog index ──────────────────────────────────────────────────────────────── */

.blog-index-header {
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.blog-index-header h1 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.blog-index-sub {
  color: var(--muted2);
  font-size: 0.95rem;
  max-width: 560px;
  line-height: 1.75;
}

/* Card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 5rem;
}

.blog-card {
  background: var(--bg2);
  transition: background 0.2s;
}

.blog-card:hover {
  background: var(--bg3);
}

.blog-card--empty {
  background: var(--bg);
  pointer-events: none;
}

.blog-card-inner {
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.blog-card-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.blog-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card-title a:hover {
  color: var(--cyan);
  text-decoration: none;
}

.blog-card-excerpt {
  color: var(--muted2);
  font-size: 0.88rem;
  line-height: 1.7;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 212, 255, 0.06);
}

.blog-read-more {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.2s;
}

.blog-read-more:hover {
  opacity: 0.75;
  text-decoration: none;
}

.blog-card-readtime {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.blog-empty {
  color: var(--muted2);
  font-size: 0.9rem;
  padding: 3rem 0;
}

/* ── Article page ────────────────────────────────────────────────────────────── */

.article-breadcrumb {
  padding: 2rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.article-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.article-breadcrumb a:hover {
  color: var(--muted2);
  text-decoration: none;
}

.article-header {
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  max-width: 800px;
}

.article-header-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.article-date,
.article-readtime {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.article-title {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}

.article-deck {
  font-size: 1.05rem;
  color: var(--muted2);
  line-height: 1.7;
  font-weight: 300;
  max-width: 680px;
}

/* Article body — the actual long-form content */
.article-body {
  max-width: 70ch;
  padding: 3rem 0;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 0.85rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.65rem;
  color: var(--text);
}

.article-body p {
  margin-bottom: 1.25rem;
  color: var(--muted2);
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body strong {
  color: var(--text);
  font-weight: 500;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--muted2);
}

.article-body li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.article-body a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body blockquote {
  border-left: 3px solid var(--cyan);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg2);
  color: var(--muted2);
  font-style: italic;
}

.article-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  color: var(--cyan);
}

.article-body pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.article-body th {
  background: var(--bg3);
  color: var(--text);
  font-weight: 600;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.article-body td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  color: var(--muted2);
}

.article-body tr:nth-child(even) td {
  background: var(--bg2);
}

/* CTA block */
.article-cta {
  border: 1px solid var(--border2);
  border-radius: 4px;
  background: var(--bg2);
  margin: 0 0 3rem;
  max-width: 70ch;
}

.article-cta-inner {
  padding: 2.25rem 2.5rem;
}

.article-cta h2 {
  font-size: 1.35rem;
  margin-top: 0.75rem;
  margin-bottom: 0.85rem;
  line-height: 1.25;
}

.article-cta p {
  color: var(--muted2);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  background: var(--cyan);
  color: var(--bg);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.8rem 1.75rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.article-cta-btn:hover {
  background: #33dcff;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.25);
  text-decoration: none;
}

/* Article prev/next nav */
.article-nav {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  max-width: 70ch;
}

.article-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}

.article-nav-link:hover {
  color: var(--cyan);
  text-decoration: none;
}

.article-nav-next {
  text-align: right;
  align-items: flex-end;
}

.article-nav-dir {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.article-nav-title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}

.article-back {
  padding: 1rem 0 4rem;
}

.article-back a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s;
}

.article-back a:hover {
  color: var(--muted2);
  text-decoration: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .article-nav-inner {
    grid-template-columns: 1fr;
  }

  .article-nav-next {
    text-align: left;
    align-items: flex-start;
  }

  .article-cta-inner {
    padding: 1.75rem;
  }
}
