/* ============================================================
   article.css — Ubuntu Guard Blog Article Pages
   Loaded after ../../styles-v3.css
   Handles layout for individual article reading pages.
   Brand colors sourced from styles-v3.css variables.
   ============================================================ */

/* ── Color Aliases (legacy article vars → brand tokens) ──── */
:root {
  --bright-green:   var(--teal-primary);   /* #1a7fc8 — was green #37ae91 */
  --soft-teal:      var(--teal-accent);    /* #3bbdc6 — was #78AEAD */
  --accent-red:     var(--coral-accent);   /* #FF6B6B */
  --warning-yellow: #f4c542;
  --code-bg:        #131619;
  --border-subtle:  rgba(26, 127, 200, 0.15);
}

/* ── Article Blog Header (title + meta strip) ─────────────── */
.blog-header {
  background: linear-gradient(180deg, var(--accent-gray, #232629) 0%, var(--dark-bg) 100%);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.blog-header h1 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--off-white);
  max-width: 820px;
  margin: 0 auto 1rem;
  line-height: 1.25;
}

.blog-meta {
  color: rgba(245, 245, 245, 0.5);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

/* ── Article Content Wrapper ──────────────────────────────── */
.blog-content {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--muted-gray);
}

.blog-content p {
  margin: 1.35rem 0;
}

.blog-content h2 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--teal-primary);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.blog-content h3 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--teal-accent);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.blog-content strong {
  font-weight: 700;
  color: var(--off-white);
}

.blog-content em {
  color: var(--muted-gray);
  font-style: italic;
}

.blog-content ul,
.blog-content ol {
  padding-left: 1.5rem;
  margin: 1.25rem 0;
  line-height: 1.85;
}

.blog-content li {
  margin-bottom: 0.65rem;
}

.blog-content a {
  color: var(--teal-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(59, 189, 198, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-content a:hover {
  color: var(--teal-primary);
  border-bottom-color: var(--teal-primary);
}

/* ── Article Meta Info Bar ───────────────────────────────── */
.article-meta-info {
  text-align: center;
  color: rgba(245, 245, 245, 0.55);
  font-size: 0.88rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-meta-info span {
  margin: 0 0.4rem;
}

.reading-time {
  display: inline-block;
  background: rgba(26, 127, 200, 0.1);
  border: 1px solid rgba(26, 127, 200, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--teal-accent);
}

/* ── Callout Boxes ──────────────────────────────────────── */
.emphasis {
  background: linear-gradient(to right, rgba(26, 127, 200, 0.1), transparent);
  border-left: 3px solid var(--teal-primary);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.warning-box {
  background: linear-gradient(to right, rgba(244, 197, 66, 0.08), transparent);
  border-left: 3px solid #f4c542;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.danger-box {
  background: linear-gradient(to right, rgba(255, 107, 107, 0.08), transparent);
  border-left: 3px solid var(--coral-accent);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.emphasis p:first-child,
.warning-box p:first-child,
.danger-box p:first-child { margin-top: 0; }

.emphasis p:last-child,
.warning-box p:last-child,
.danger-box p:last-child { margin-bottom: 0; }

/* ── Stats Grid ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: 'Exo 2', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--teal-primary);
  display: block;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted-gray);
}

/* ── Tables ─────────────────────────────────────────────── */
.ranking-table {
  margin: 2rem 0;
  width: 100%;
  border-collapse: collapse;
  background: rgba(26, 127, 200, 0.04);
  border-radius: 8px;
  overflow: hidden;
}

.ranking-table th {
  background: rgba(26, 127, 200, 0.12);
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--teal-primary);
  border-bottom: 2px solid rgba(26, 127, 200, 0.28);
}

.ranking-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--muted-gray);
}

.ranking-table tr:last-child td {
  border-bottom: none;
}

.ranking-table tr.highlight {
  background: rgba(26, 127, 200, 0.08);
  font-weight: 600;
  color: var(--off-white);
}

.rank-number {
  font-weight: 700;
  color: var(--teal-primary);
  font-size: 1.05rem;
}

/* ── Tech / Code Box ────────────────────────────────────── */
.tech-box {
  background: var(--code-bg);
  border: 1px solid rgba(26, 127, 200, 0.18);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  color: var(--muted-gray);
}

.tech-box-title {
  color: #f4c542;
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

/* ── Checklist ──────────────────────────────────────────── */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  padding-left: 1.75rem;
  position: relative;
  margin-bottom: 0.85rem;
}

.checklist li::before {
  content: "▶";
  position: absolute;
  left: 0;
  color: var(--teal-primary);
  font-weight: 700;
}

/* ── CTA Section ────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, rgba(26, 127, 200, 0.1), rgba(59, 189, 198, 0.07));
  border: 1px solid rgba(26, 127, 200, 0.28);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  margin: 3rem 0;
  text-align: center;
}

.cta-section h3 {
  font-family: 'Exo 2', sans-serif;
  color: var(--off-white);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.cta-section p {
  margin-bottom: 1.25rem;
}

.cta-button {
  display: inline-block;
  background: var(--teal-primary);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  margin: 0.4rem;
  border-bottom: none;
}

.cta-button:hover {
  background: #1568a8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 127, 200, 0.35);
  color: #fff;
  border-bottom: none;
}

/* ── Social Share ───────────────────────────────────────── */
.social-share {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 2.5rem 0;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  background: rgba(26, 127, 200, 0.08);
  color: var(--muted-gray);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.88rem;
  border: 1px solid rgba(26, 127, 200, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.share-btn:hover {
  background: rgba(26, 127, 200, 0.18);
  border-color: var(--teal-primary);
  color: var(--off-white);
  transform: translateY(-1px);
  text-decoration: none;
}

.share-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Sources ────────────────────────────────────────────── */
.sources {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(26, 127, 200, 0.18);
  font-size: 0.92rem;
}

.sources h2 {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.1rem;
  color: var(--off-white);
  margin-bottom: 1rem;
  margin-top: 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.source-links a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: rgba(26, 127, 200, 0.08);
  color: var(--teal-accent);
  text-decoration: none;
  border: 1px solid rgba(26, 127, 200, 0.2);
  border-radius: 6px;
  font-size: 0.88rem;
  border-bottom: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.source-links a:hover {
  background: rgba(26, 127, 200, 0.18);
  border-color: var(--teal-primary);
  color: var(--off-white);
  border-bottom: none;
}

/* ── Back Link ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem 0;
  color: var(--teal-primary);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: none;
  padding: 0.65rem 1.25rem;
  border: 1px solid rgba(26, 127, 200, 0.35);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-link:hover {
  background: rgba(26, 127, 200, 0.1);
  border-color: var(--teal-primary);
  color: var(--off-white);
  border-bottom: none;
}

/* Center back-link when it's a block-level element */
a.back-link[style*="text-align: center"],
.blog-content > a.back-link {
  display: block;
  text-align: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ranking-table {
    font-size: 0.86rem;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 0.65rem 0.7rem;
  }

  .social-share {
    flex-direction: column;
    align-items: stretch;
  }

  .share-btn {
    justify-content: center;
  }

  .cta-section {
    padding: 1.5rem 1.25rem;
  }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cta-button,
  .share-btn,
  .back-link,
  .source-links a {
    transition: none;
  }
}
