/* ================================================
   VARIABLES — LIGHT MODE
================================================ */
:root {
  --color-bg:       #f0f4f8;
  --color-surface:  #ffffff;
  --color-primary:  #0b1f33;
  --color-secondary:#0d3b66;
  --color-accent:   #149ddd;
  --color-accent2:  #38bdf8;
  --color-text:     #334155;
  --color-muted:    #64748b;
  --color-border:   #dbe4ee;
  --shadow:         0 4px 24px rgba(15,23,42,0.07);
  --shadow-card:    0 1px 3px rgba(15,23,42,0.06), 0 8px 32px rgba(15,23,42,0.08);
  --shadow-glow:    0 0 20px rgba(20,157,221,0.2);
  --radius:         14px;
}

/* ================================================
   VARIABLES — DARK MODE
================================================ */
html[data-mode="dim"] {
  --color-bg:       #0a0f1e;
  --color-surface:  #111827;
  --color-primary:  #e2e8f0;
  --color-secondary:#93c5fd;
  --color-accent:   #38bdf8;
  --color-accent2:  #67e8f9;
  --color-text:     #cbd5e1;
  --color-muted:    #64748b;
  --color-border:   #1e293b;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-card:    0 1px 3px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.3);
  --shadow-glow:    0 0 24px rgba(56,189,248,0.18);
}

/* ================================================
   KEYFRAMES
================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(56,189,248,0.4); }
  50%      { opacity: 0.7; transform: scale(0.85); box-shadow: 0 0 0 4px rgba(56,189,248,0); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes scanline {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100vh); }
}

/* ================================================
   BASE
================================================ */
html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

::selection { background: rgba(56,189,248,0.25); color: inherit; }

body {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.78;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4 { font-family: 'Inter', sans-serif; }

/* ================================================
   HEADER / NAVBAR
================================================ */
header {
  background: linear-gradient(90deg, #060f1c 0%, #0a1f3d 100%) !important;
  box-shadow: 0 1px 0 rgba(56,189,248,0.08), 0 4px 24px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 2px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(56,189,248,0.15) !important;
}

header a, header svg, header button {
  color: #fff !important;
  fill: #fff !important;
}

header a:hover { color: var(--color-accent) !important; }

img.logo {
  height: 38px !important;
  width: auto !important;
  display: block;
}

.nav_brand {
  display: flex;
  align-items: center;
}

footer .icon_2 {
  height: 48px !important;
  width: auto !important;
}

/* ================================================
   LAYOUT GRID — ARTICLES (3 colonnes)
================================================ */
div.grid-inverse.wrap.content {
  display: grid !important;
  grid-template-columns: 220px minmax(0, 1fr) 230px !important;
  gap: 1.5rem !important;
  max-width: 100% !important;
  margin: 1.5rem 0 !important;
  padding: 0 !important;
  align-items: start !important;
}

/* ================================================
   ARTICLE
================================================ */
article.post_content {
  order: 2;
  background: var(--color-surface) !important;
  border-radius: var(--radius) !important;
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow-card) !important;
  border: 1px solid var(--color-border);
  min-width: 0;
}

h1.post_title {
  font-size: 2.1rem !important;
  font-weight: 800;
  color: var(--color-primary) !important;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

h1.post_title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
  margin-top: 12px;
  border-radius: 2px;
}

div.post_meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  color: var(--color-muted);
  font-size: 0.93rem;
}

a.post_tag.button.button_translucent {
  background: rgba(56,189,248,0.08) !important;
  color: var(--color-accent) !important;
  border: 1px solid rgba(56,189,248,0.2) !important;
  border-radius: 999px !important;
  padding: 0.2rem 0.75rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

a.post_tag.button.button_translucent:hover {
  background: var(--color-accent) !important;
  color: #0a0f1e !important;
  box-shadow: 0 0 12px rgba(56,189,248,0.3);
}

div.post_toc { display: none !important; }

/* ================================================
   CORPS ARTICLE
================================================ */
div.post_body h2 {
  font-size: 1.45rem !important;
  font-weight: 700;
  color: var(--color-primary) !important;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
}

div.post_body h3 {
  font-size: 1.15rem !important;
  font-weight: 700;
  color: var(--color-primary) !important;
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
}

div.post_body a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(56,189,248,0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}

div.post_body a:hover {
  color: var(--color-accent2);
  border-bottom-color: var(--color-accent);
}

div.post_body blockquote {
  background: rgba(56,189,248,0.05);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.3rem 1rem 1.6rem;
  margin: 1.5rem 0;
  position: relative;
}

div.post_body blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 0.8rem;
  font-size: 3rem;
  color: var(--color-accent);
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

div.post_body img {
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  margin: 1.5rem 0;
  max-width: 100%;
}

div.post_body pre, div.post_body .highlight {
  border-radius: 12px !important;
  margin: 1.2rem 0;
  border: 1px solid rgba(56,189,248,0.1);
}

div.post_body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.87rem;
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  background: rgba(56,189,248,0.08);
  color: var(--color-accent);
}

div.post_body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ================================================
   TABLEAU
================================================ */
div.post_body table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.8rem 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

div.post_body thead {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

html[data-mode="dim"] div.post_body thead {
  background: linear-gradient(90deg, #0d1b2e, #0a3060) !important;
}

div.post_body th {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.9rem 1.1rem;
  border: none !important;
}

div.post_body td {
  padding: 0.8rem 1.1rem;
  border: none !important;
  border-bottom: 1px solid var(--color-border) !important;
  font-size: 0.95rem;
}

div.post_body tbody tr:last-child td { border-bottom: none !important; }
div.post_body tbody tr:nth-child(even) { background: rgba(56,189,248,0.03); }
div.post_body tbody tr:hover { background: rgba(56,189,248,0.06); transition: background 0.15s ease; }

/* ================================================
   TOC GAUCHE
================================================ */
#toc-left-panel {
  order: 1;
  position: sticky;
  top: 90px;
  align-self: start;
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-top: 3px solid var(--color-accent) !important;
  border-radius: var(--radius) !important;
  padding: 1.2rem 1rem !important;
}

#toc-left-panel h3 {
  font-size: 0.72rem !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent) !important;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border) !important;
}

#toc-left-panel #TableOfContents ul { list-style: none; padding: 0; margin: 0; }
#toc-left-panel #TableOfContents li { margin-bottom: 0; }

#toc-left-panel #TableOfContents a {
  display: block;
  padding: 0.28rem 0.6rem;
  font-size: 0.82rem;
  color: var(--color-muted) !important;
  text-decoration: none !important;
  border: none !important;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.18s ease;
}

#toc-left-panel #TableOfContents a:hover,
#toc-left-panel #TableOfContents a.toc-active {
  color: var(--color-accent) !important;
  border-left-color: var(--color-accent);
  background: rgba(56,189,248,0.07);
  padding-left: 0.9rem;
}

html[data-mode="dim"] #toc-left-panel #TableOfContents a.toc-active {
  background: rgba(56,189,248,0.1);
  box-shadow: inset 2px 0 0 var(--color-accent);
}

#toc-left-panel #TableOfContents a.toc-active { font-weight: 600; }
#toc-left-panel #TableOfContents ul ul a { padding-left: 1.2rem; font-size: 0.78rem; }

/* ================================================
   SIDEBAR DROITE
================================================ */
aside.sidebar {
  order: 3;
  position: sticky;
  top: 80px;
  align-self: start;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

aside.sidebar section.sidebar_inner > * {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

section.sidebar_inner input[type="search"],
section.sidebar_inner input[type="text"] {
  width: 100%;
  border: 1px solid var(--color-border) !important;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

section.sidebar_inner input:focus {
  outline: none;
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}

section.sidebar_inner a { color: var(--color-secondary); text-decoration: none; }
section.sidebar_inner a:hover { color: var(--color-accent); }

/* ================================================
   BARRE DE PROGRESSION
================================================ */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2), #818cf8);
  background-size: 200% 100%;
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  animation: gradientShift 3s ease infinite;
}

/* ================================================
   HOME LAYOUT
================================================ */
.home-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* ================================================
   HERO
================================================ */
.home-hero {
  background: linear-gradient(135deg, #060d1a 0%, #08183a 40%, #071428 100%);
  border-radius: 20px;
  padding: 3rem 3.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56,189,248,0.1);
  box-shadow: 0 0 0 1px rgba(56,189,248,0.05), 0 32px 80px rgba(0,0,0,0.4);
  animation: fadeInUp 0.6s ease forwards;
}

/* Dot-grid background */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(56,189,248,0.12) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Ambient glow */
.home-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 120px;
  background: radial-gradient(ellipse, rgba(56,189,248,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.25);
  color: #38bdf8;
  border-radius: 999px;
  padding: 0.32rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.2rem;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  background: #38bdf8;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-title {
  font-size: 2.4rem !important;
  font-weight: 900 !important;
  color: #fff !important;
  line-height: 1.12 !important;
  margin: 0 0 1rem !important;
  letter-spacing: -0.04em !important;
}

.hero-title::after { display: none !important; }

.hero-accent {
  background: linear-gradient(90deg, #38bdf8, #67e8f9, #818cf8);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

.hero-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 1.8rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #0a0f1e !important;
  border-radius: 10px;
  padding: 0.7rem 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  border: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(14,165,233,0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14,165,233,0.45);
  background: linear-gradient(135deg, #38bdf8, #67e8f9);
}

.btn-ghost {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22) !important;
  color: #fff !important;
}

/* ================================================
   TERMINAL WIDGET
================================================ */
.hero-terminal {
  position: relative;
  z-index: 1;
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  box-shadow:
    0 0 0 1px rgba(56,189,248,0.06),
    0 24px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.terminal-header {
  background: #161b22;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.terminal-red    { background: #ff5f56; }
.terminal-yellow { background: #ffbd2e; }
.terminal-green  { background: #27c93f; }

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 0.9rem 1.2rem;
  font-size: 0.79rem;
  line-height: 1.65;
  color: #c9d1d9;
}

.terminal-body p { margin: 0; }

.t-prompt {
  color: #3fb950;
  margin-right: 0.5rem;
  font-weight: 700;
  user-select: none;
}

.t-output { color: #8b949e; }
.t-muted  { color: rgba(139,148,158,0.6); }
.t-success { color: #56d364; }
.t-port   { color: #58a6ff; }
.t-service { color: #ffa657; }

.t-warn  { color: #f59e0b; font-weight: 700; }
.t-cve   { color: #f87171; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }

.t-cursor {
  display: inline-block;
  width: 7px;
  height: 0.9em;
  background: #38bdf8;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: blink 1.1s step-end infinite;
}

/* ================================================
   SECTION CARD ICON (SVG)
================================================ */
.section-card-icon {
  width: 40px;
  height: 40px;
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  color: var(--color-accent);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.section-card-icon svg {
  width: 20px;
  height: 20px;
}

.home-section-card:hover .section-card-icon {
  background: rgba(56,189,248,0.18);
  box-shadow: 0 0 12px rgba(56,189,248,0.2);
}

/* ================================================
   SECTIONS GRID (home)
================================================ */
.home-sections,
.home-recent {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.home-sections { animation-delay: 0.15s; }
.home-recent   { animation-delay: 0.3s;  }

.home-sections h2,
.home-recent h2 {
  font-size: 0.72rem !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--color-accent) !important;
  margin-bottom: 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.home-sections h2::after,
.home-recent h2::after { display: none; }

.home-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.home-section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid transparent;
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-decoration: none !important;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.home-section-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(56,189,248,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.home-section-card:hover {
  border-top-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(15,23,42,0.14), var(--shadow-glow);
}

html[data-mode="dim"] .home-section-card:hover {
  box-shadow: 0 12px 36px rgba(0,0,0,0.4), 0 0 20px rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.2);
}

.home-section-card:hover::after { opacity: 1; }

.section-card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
  line-height: 1;
}

.home-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.home-section-desc {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.home-section-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================================================
   RECENT ARTICLES GRID (home)
================================================ */
.home-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.home-recent-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.home-recent-card:hover {
  border-left-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(15,23,42,0.12);
}

html[data-mode="dim"] .home-recent-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 16px rgba(56,189,248,0.07);
}

.home-recent-title {
  font-size: 1rem !important;
  font-weight: 700;
  color: var(--color-primary) !important;
  text-decoration: none !important;
  border: none !important;
  line-height: 1.4;
}

.home-recent-title:hover {
  color: var(--color-accent) !important;
}

.home-recent-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  align-items: center;
  flex-wrap: wrap;
}

.home-recent-section {
  background: rgba(56,189,248,0.1);
  color: var(--color-accent);
  border-radius: 999px;
  padding: 0.1rem 0.65rem;
  font-weight: 700;
  text-transform: capitalize;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.section-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

span.section-tag {
  background: rgba(56,189,248,0.07);
  color: var(--color-accent);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================================================
   PAGES DE LISTE (sections)
================================================ */
.section-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

div.section-page { max-width: 100%; padding: 0 2rem; }

header.section-header {
  background: linear-gradient(135deg, #060d1a 0%, #0a1f3d 100%);
  color: #fff;
  padding: 2.8rem 3rem;
  margin-bottom: 2rem;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56,189,248,0.1);
}

header.section-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(56,189,248,0.1) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

header.section-header h1 {
  color: #fff !important;
  font-size: 2rem !important;
  font-weight: 800 !important;
  margin: 0 0 0.5rem !important;
  position: relative;
}

header.section-header h1::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #67e8f9);
  margin-top: 10px;
  border-radius: 2px;
}

.section-description {
  color: rgba(255,255,255,0.65);
  font-size: 1rem;
  margin: 0 0 1.2rem;
  position: relative;
}

.section-topics {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.section-topics-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
}

.section-topics-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.section-topic-pill {
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.22);
  color: #7dd3fc;
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.25);
  color: #38bdf8;
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
  position: relative;
}

div.section-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)) !important;
  gap: 1.2rem;
  padding: 1.5rem 2rem 2rem;
}

.section-grid {
  padding: 1.5rem 2rem 3rem;
}

article.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.7rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-left-color 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

article.section-card:hover {
  transform: translateY(-4px);
  border-left-color: var(--color-accent);
  box-shadow: 0 12px 36px rgba(15,23,42,0.13), var(--shadow-glow);
}

html[data-mode="dim"] article.section-card:hover {
  box-shadow: 0 12px 36px rgba(0,0,0,0.4), 0 0 20px rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.15);
  border-left-color: var(--color-accent);
}

article.section-card a {
  font-size: 1.05rem !important;
  font-weight: 700;
  color: var(--color-primary) !important;
  text-decoration: none !important;
  border: none !important;
  line-height: 1.3;
}

article.section-card a:hover { color: var(--color-accent) !important; }

.section-meta {
  font-size: 0.82rem;
  color: var(--color-muted);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.section-excerpt {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.section-read-more {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent) !important;
  text-decoration: none !important;
  border: none !important;
  white-space: nowrap;
  transition: gap 0.15s ease;
  letter-spacing: 0.01em;
}

.section-read-more:hover {
  color: var(--color-accent2) !important;
}

/* ================================================
   DARK MODE OVERRIDES
================================================ */
html[data-mode="dim"] body { background: var(--color-bg) !important; color: var(--color-text) !important; }
html[data-mode="dim"] article.post_content { background: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-mode="dim"] #toc-left-panel { background: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-mode="dim"] aside.sidebar section.sidebar_inner > * { background: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-mode="dim"] h1.post_title,
html[data-mode="dim"] div.post_body h2,
html[data-mode="dim"] div.post_body h3 { color: #e2e8f0 !important; }
html[data-mode="dim"] div.post_body p,
html[data-mode="dim"] div.post_body li { color: #cbd5e1; }
html[data-mode="dim"] div.post_body blockquote { background: rgba(56,189,248,0.06) !important; border-left-color: #38bdf8; }
html[data-mode="dim"] div.post_body tbody tr:nth-child(even) { background: rgba(255,255,255,0.02) !important; }
html[data-mode="dim"] div.post_body table { border-color: var(--color-border) !important; }
html[data-mode="dim"] div.post_body code { background: rgba(56,189,248,0.1); color: #67e8f9; }
html[data-mode="dim"] section.sidebar_inner input { background: var(--color-bg) !important; color: var(--color-text) !important; border-color: var(--color-border) !important; }
html[data-mode="dim"] section.sidebar_inner a { color: #93c5fd; }
html[data-mode="dim"] header.section-header { background: linear-gradient(135deg, #060d1a 0%, #0a1f3d 100%) !important; }
html[data-mode="dim"] article.section-card { background: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-mode="dim"] article.section-card a { color: #e2e8f0 !important; }
html[data-mode="dim"] .home-section-card,
html[data-mode="dim"] .home-recent-card { background: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-mode="dim"] .home-section-title,
html[data-mode="dim"] .home-recent-title { color: #e2e8f0 !important; }
html[data-mode="dim"] #reading-progress { background: linear-gradient(90deg, #38bdf8, #818cf8) !important; }

/* ================================================
   EMPTY SECTION STATE
================================================ */
.section-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-muted);
}

.section-empty-icon {
  width: 56px;
  height: 56px;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--color-accent);
}

.section-empty-icon svg { width: 26px; height: 26px; }

.section-empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

.section-empty p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0;
}

html[data-mode="dim"] .section-empty h3 { color: #e2e8f0; }

/* ================================================
   FOOTER
================================================ */
footer.footer { display: none !important; }

.site-footer {
  border-top: none;
  margin-top: 4rem;
  background: #1e293b;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.site-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.8rem 0;
  flex-wrap: wrap;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
  border: none !important;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0 !important;
  flex-shrink: 0;
}

.site-footer-logo {
  height: 28px !important;
  width: auto !important;
}

.site-footer-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.site-footer-nav a {
  font-size: 0.85rem;
  color: #94a3b8 !important;
  text-decoration: none !important;
  border: none !important;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-footer-nav a:hover {
  color: #38bdf8 !important;
  background: rgba(56,189,248,0.08);
}

.site-footer-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #94a3b8 !important;
  background: transparent;
  border: 1px solid #334155 !important;
  text-decoration: none !important;
  transition: all 0.18s ease;
}

.site-footer-social a svg { width: 16px; height: 16px; }

.site-footer-social a:hover {
  color: var(--color-accent) !important;
  border-color: rgba(56,189,248,0.3) !important;
  background: rgba(56,189,248,0.08);
}

.site-footer-bottom {
  border-top: 1px solid #334155;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
}

/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 1200px) {
  div.grid-inverse.wrap.content { grid-template-columns: minmax(0, 1fr) 230px !important; }
  #toc-left-panel { display: none !important; }
  article.post_content { order: 1; }
  aside.sidebar { order: 2; }
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding: 2.5rem;
  }
  .hero-terminal { display: none; }
  .hero-title { font-size: 2.2rem !important; }
}

@media (max-width: 768px) {
  div.grid-inverse.wrap.content { grid-template-columns: 1fr !important; }
  body { font-size: 16px; }
  article.post_content { padding: 1.2rem 1rem; border-radius: 0 !important; }
  h1.post_title { font-size: 1.7rem !important; }
  aside.sidebar { position: static !important; }
  .home-layout { padding: 1rem; gap: 2.5rem; }
  .home-hero { padding: 2rem 1.5rem; border-radius: 14px; }
  .hero-title { font-size: 2rem !important; }
  .hero-stats { gap: 1.5rem; }
  .home-sections-grid, .home-recent-grid { grid-template-columns: 1fr; }
  header.section-header { padding: 2rem 1.5rem; }
  div.section-grid { padding: 1rem 1rem 2rem; }
}
