/* ==========================================================================
   CIBERCELIA - Modern Cybersecurity Web Platform
   Espacio Didáctico Colaborativo para el Alumnado del Curso de Especialización
   ========================================================================== */

:root {
  /* Color Palette - Cyber Dark (Default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-input: rgba(15, 23, 42, 0.8);
  --border-color: rgba(56, 189, 248, 0.15);
  --border-color-hover: rgba(6, 182, 212, 0.5);
  --border-glow: rgba(0, 240, 255, 0.3);

  /* Brand Accents */
  --accent-cyan: #00f0ff;
  --accent-cyan-dim: rgba(0, 240, 255, 0.12);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-purple-dim: rgba(139, 92, 246, 0.12);
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-glow: 0 0 10px rgba(0, 240, 255, 0.5);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Layout & Spacing */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --container-max: 1200px;
  --article-max: 960px;
  --header-height: 72px;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(0, 240, 255, 0.15);
  --shadow-purple-glow: 0 0 25px rgba(139, 92, 246, 0.2);
  --backdrop-blur: blur(16px);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(241, 245, 249, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-input: rgba(248, 250, 252, 0.9);
  --border-color: rgba(14, 165, 233, 0.2);
  --border-color-hover: rgba(2, 132, 199, 0.5);
  --border-glow: rgba(2, 132, 199, 0.2);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-glow: none;

  --accent-cyan: #0284c7;
  --accent-cyan-dim: rgba(2, 132, 199, 0.1);
  --accent-purple: #7c3aed;
  --accent-purple-dim: rgba(124, 58, 237, 0.1);

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  background: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
    var(--bg-primary);
}

/* Subtle Grid background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #38bdf8;
}

code, pre {
  font-family: var(--font-mono);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-logo {
  transform: rotate(-8deg) scale(1.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-mono);
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}

.nav-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-dim);
}

.btn-github {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-github:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.mobile-menu-toggle {
  display: none;
}

/* Educational Notice / Disclaimer Banner */
.disclaimer-banner {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.25rem;
  margin: 1.5rem auto 0;
  max-width: 820px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.disclaimer-icon {
  color: var(--accent-purple);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Hero Section */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
  position: relative;
}

.hero-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #60a5fa 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* Quick Metrics Bar */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto 2.5rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.8rem;
  text-align: center;
  transition: all 0.25s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.metric-number {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* Controls & Filters Section */
.controls-section {
  margin-bottom: 2rem;
}

.search-box-wrapper {
  position: relative;
  max-width: 680px;
  margin: 0 auto 1.25rem;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.9rem 1.2rem 0.9rem 3.2rem;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  backdrop-filter: var(--backdrop-blur);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan-dim);
  background: var(--bg-secondary);
}

.search-clear {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  display: none;
}

.filter-pills-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #0B0F19;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.3);
}

.tag-pills-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-filter-btn {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-filter-btn:hover, .tag-filter-btn.active {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: var(--accent-purple-dim);
}

/* Section Header */
.content-section {
  padding: 1rem 0 3.5rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.section-title {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title-icon {
  color: var(--accent-cyan);
}

.section-count {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: normal;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  background: var(--bg-card-hover);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.category-tag.post {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.category-tag.noticia {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.category-tag.recurso {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-tag.curso {
  background: rgba(139, 92, 246, 0.12);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.category-tag.proyecto {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.65rem;
}

.card-title a {
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--accent-cyan);
}

.card-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.card-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.card-tag:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
  font-size: 0.8rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #0B0F19;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.card-action-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.card-action-btn:hover {
  background: var(--accent-cyan-dim);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.empty-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Contribution Guide Section */
.contribute-section {
  padding: 3.5rem 0;
  margin-top: 2rem;
  background: transparent;
  border-top: 1px solid var(--border-color);
}

.contribute-box {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.contribute-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.step-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.step-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  margin-top: 0.75rem;
  display: block;
  overflow-x: auto;
}

.btn-primary-glow {
  background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
  color: #ffffff;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
  transition: all 0.25s ease;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 240, 255, 0.5);
  color: #ffffff;
}

/* ==========================================================================
   Full Article Page Styles (post.html)
   ========================================================================== */

.article-page-layout {
  max-width: var(--article-max);
  margin: 2rem auto 4rem;
  padding: 0 1rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb-nav a {
  color: var(--text-secondary);
}

.breadcrumb-nav a:hover {
  color: var(--accent-cyan);
}

.breadcrumb-separator {
  color: var(--border-color-hover);
}

.article-card-main {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.75rem 3rem;
  box-shadow: var(--shadow-md);
}

.article-header-block {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
}

.article-main-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0.75rem 0 1rem;
  line-height: 1.2;
}

.article-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-author-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #0B0F19;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-author-meta h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.article-author-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.article-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-article-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-article-action:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}

/* Markdown Reader Content Styles */
.markdown-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.markdown-body h1 {
  font-size: 1.9rem;
  margin: 2rem 0 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.markdown-body h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.85rem;
  color: var(--accent-cyan);
}

.markdown-body h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.6rem;
}

.markdown-body p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
  color: var(--text-secondary);
}

.markdown-body li {
  margin-bottom: 0.45rem;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent-purple);
  padding: 0.85rem 1.25rem;
  background: var(--accent-purple-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  color: var(--text-primary);
}

/* Callouts / Alerts */
.callout {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-note {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
}

.callout-important {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}

.callout-warning, .callout-caution {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
}

.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}

.callout-title {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.callout-body p {
  margin-bottom: 0 !important;
  font-size: 0.95rem;
}

.markdown-body pre {
  background: #060911 !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

/* Modern Responsive Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.markdown-body table, .styled-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  margin: 0;
  table-layout: auto;
}

.markdown-body th, .styled-table th {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 0.9rem;
  border: none;
  border-bottom: 2px solid var(--border-color);
  white-space: normal;
  text-wrap: balance;
  vertical-align: middle;
  line-height: 1.35;
}

.markdown-body td, .styled-table td {
  padding: 0.85rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
  line-height: 1.4;
}

.markdown-body tbody tr:last-child td, .styled-table tbody tr:last-child td {
  border-bottom: none;
}

.markdown-body tbody tr:nth-child(even), .styled-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .markdown-body tbody tr:nth-child(even),
[data-theme="light"] .styled-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}

.markdown-body tbody tr:hover, .styled-table tbody tr:hover {
  background: var(--bg-card-hover);
  transition: background 0.15s ease;
}

/* Status Badges inside Tables */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill.status-low, .status-pill.status-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.status-medium, .status-pill.status-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.status-high, .status-pill.status-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Diagram Container & Mermaid Styling */
.diagram-container {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 2rem 0;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border-color);
}

.diagram-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glow);
}

.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
  font-family: var(--font-sans) !important;
}

.code-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.code-copy-btn:hover {
  background: var(--accent-cyan);
  color: #0B0F19;
}

/* Article Page Bottom Callout */
.article-contrib-callout {
  background: var(--bg-card);
  border: 1px dashed var(--border-color-hover);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.article-contrib-text h4 {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.article-contrib-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 3rem 0 2rem;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contribute-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .article-card-main {
    padding: 2rem 1.5rem;
  }
  .article-contrib-callout {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .article-card-main {
    padding: 1.5rem 1rem;
  }
  .markdown-body th, .styled-table th,
  .markdown-body td, .styled-table td {
    padding: 0.65rem 0.5rem;
    font-size: 0.8rem;
  }
  .status-pill {
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
  }
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
