/* ==========================================================================
   LinuxWays Theme — Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (defaults — overridden by customizer)
   -------------------------------------------------------------------------- */
:root {
  --color-accent:  #39d353;
  --color-hover:   #4f8ef7;
  --color-bg:      #0d1117;
  --color-surface: #161b22;
  --color-border:  #30363d;
  --color-text:    #e6edf3;
  --color-muted:   #8b949e;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.6);

  --transition: 0.2s ease;

  --container-width: 1280px;
  --container-pad:   clamp(1rem, 4vw, 2rem);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--color-hover); }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: var(--radius-sm); }

ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
h1,h2,h3,h4,h5,h6 { line-height: 1.25; font-weight: 700; color: var(--color-text); }
p + p { margin-top: .75rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted); }

/* --------------------------------------------------------------------------
   3. Utility
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.screen-reader-text:focus {
  position: fixed;
  top: 1rem; left: 1rem;
  width: auto; height: auto;
  clip: auto;
  background: var(--color-surface);
  color: var(--color-text);
  padding: .75rem 1.25rem;
  border-radius: var(--radius-md);
  z-index: 9999;
  font-weight: 600;
}

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-accent);
  color: #0d1117;
  border-color: var(--color-accent);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--color-hover);
  border-color: var(--color-hover);
  color: #fff;
  box-shadow: 0 0 20px rgba(79,142,247,.3);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover { background: var(--color-accent); color: #0d1117; }

.btn-sm { padding: .45rem .9rem; font-size: .8rem; }

/* --------------------------------------------------------------------------
   5. Site Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,17,23,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 64px;
}

/* Branding */
.site-branding { flex-shrink: 0; }
.custom-logo { height: 36px; width: auto; }
.site-title-link { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.site-title-terminal {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -.02em;
}
.site-title-terminal::before { content: '> '; opacity: .6; }

/* Navigation */
.main-navigation { flex: 1; }
.nav-list { display: flex; align-items: center; gap: .25rem; }
.nav-list li a {
  display: block;
  padding: .45rem .75rem;
  color: var(--color-muted);
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-list li a:hover,
.nav-list li.current-menu-item > a,
.nav-list li.current-menu-ancestor > a {
  color: var(--color-text);
  background: var(--color-surface);
}
.nav-list li.current-menu-item > a { color: var(--color-accent); }

/* Dropdown */
.nav-list .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  z-index: 200;
}
.nav-list li { position: relative; }
.nav-list li:hover > .sub-menu,
.nav-list li:focus-within > .sub-menu { display: block; }
.nav-list .sub-menu li a { padding: .5rem .75rem; border-radius: var(--radius-sm); }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.search-toggle, .menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  transition: color var(--transition), background var(--transition);
}
.search-toggle:hover, .menu-toggle:hover { color: var(--color-text); background: var(--color-surface); }
.menu-toggle { display: none; }

/* Search Bar */
.header-search {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1rem 0;
  animation: slideDown .2s ease;
}
.header-search form { display: flex; gap: .75rem; align-items: center; }
.header-search .search-field {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: .65rem 1rem;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search .search-field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(57,211,83,.15);
}
.header-search .search-field::placeholder { color: var(--color-muted); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   6. Layout
   -------------------------------------------------------------------------- */
.site-main { padding-block: 0 4rem; }

.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
  padding-block: 3rem;
}
.layout-full { padding-block: 3rem; }

.content-area { min-width: 0; }

/* --------------------------------------------------------------------------
   7. Widget Area / Sidebar
   -------------------------------------------------------------------------- */
.widget-area { position: sticky; top: 80px; }

.widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.widget-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-muted);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--color-border);
}
.widget ul li {
  padding: .4rem 0;
  border-bottom: 1px solid rgba(48,54,61,.5);
  font-size: .9rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--color-text); }
.widget ul li a:hover { color: var(--color-accent); }

/* --------------------------------------------------------------------------
   8. Section Headers
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.section-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--color-accent);
  border-radius: 2px;
  margin-right: .6rem;
  vertical-align: middle;
}
.section-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-muted);
}
.section-link:hover { color: var(--color-accent); }

/* --------------------------------------------------------------------------
   9. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 7rem);
  background: var(--color-bg);
}

/* Animated grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(57,211,83,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57,211,83,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
  pointer-events: none;
}

/* Glow blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: .35;
}
.hero::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(57,211,83,.4) 0%, transparent 70%);
  top: -100px; left: -80px;
}
.hero::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(79,142,247,.35) 0%, transparent 70%);
  bottom: -80px; right: -60px;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  background: rgba(57,211,83,.1);
  border: 1px solid rgba(57,211,83,.25);
  border-radius: 100px;
  padding: .35rem 1rem;
  margin-bottom: 1.25rem;
}
.hero-badge::before { content: '●'; font-size: .5rem; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.hero-title {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--color-text) 60%, var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-muted);
  max-width: 480px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

/* Terminal Widget */
.hero-terminal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(57,211,83,.05);
  font-family: var(--font-mono);
  font-size: .875rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: rgba(0,0,0,.3);
  border-bottom: 1px solid var(--color-border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #27c93f; }
.terminal-title { margin-left: auto; font-size: .75rem; color: var(--color-muted); }

.terminal-body { padding: 1.25rem 1.5rem; line-height: 1.8; }
.terminal-body p { display: flex; gap: .6rem; align-items: flex-start; }
.prompt { color: var(--color-accent); user-select: none; flex-shrink: 0; }
.cmd { color: var(--color-text); }
.output { color: var(--color-muted); padding-left: 1.4rem; }
.error-text { color: #f85149; }
.cursor {
  color: var(--color-accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* --------------------------------------------------------------------------
   10. Category Strip
   -------------------------------------------------------------------------- */
.category-strip {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.cat-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.cat-chip:hover { border-color: var(--color-accent); color: var(--color-accent); background: rgba(57,211,83,.07); }
.cat-count {
  font-size: .7rem;
  background: var(--color-border);
  border-radius: 100px;
  padding: .1rem .45rem;
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   11. Posts Section & Grid
   -------------------------------------------------------------------------- */
.posts-section { padding-block: 4rem; }

.posts-grid {
  display: grid;
  gap: 1.75rem;
}
.posts-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.posts-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.posts-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------------------------------------------------------
   12. Post Card
   -------------------------------------------------------------------------- */
.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.post-card:hover {
  border-color: rgba(57,211,83,.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(57,211,83,.06);
}

/* Thumbnail */
.card-thumb-link { display: block; overflow: hidden; aspect-ratio: 16/9; }
.card-thumb { width: 100%; height: 100%; position: relative; overflow: hidden; }
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .card-thumb img { transform: scale(1.04); }
.card-cat-overlay {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--color-accent);
  color: #0d1117;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .65rem;
  border-radius: 100px;
}

/* Card Body */
.card-body { padding: 1.25rem 1.25rem 1.5rem; flex: 1; display: flex; flex-direction: column; gap: .75rem; }
.card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; flex: 1; }
.card-title a { color: var(--color-text); }
.card-title a:hover { color: var(--color-accent); }
.card-excerpt { font-size: .875rem; color: var(--color-muted); line-height: 1.6; }
.card-read-more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: auto;
  transition: gap var(--transition);
}
.card-read-more:hover { gap: .6rem; color: var(--color-hover); }

/* Featured Card */
.post-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
  border-color: rgba(57,211,83,.2);
  background: linear-gradient(135deg, var(--color-surface), rgba(57,211,83,.03));
}
.post-card--featured .card-thumb-link {
  width: 50%;
  flex-shrink: 0;
  aspect-ratio: auto;
}
.post-card--featured .card-thumb { height: 100%; }
.post-card--featured .card-body { padding: 2rem; gap: 1rem; }
.post-card--featured .card-title { font-size: clamp(1.2rem, 3vw, 1.6rem); }

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  background: rgba(57,211,83,.12);
  border: 1px solid rgba(57,211,83,.3);
  border-radius: 100px;
  padding: .2rem .75rem;
}
.featured-badge::before { content: '★'; }

/* Post Meta */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  font-size: .78rem;
  color: var(--color-muted);
}
.meta-item { display: inline-flex; align-items: center; gap: .3rem; }
.meta-item a { color: var(--color-muted); }
.meta-item a:hover { color: var(--color-accent); }
.cat-badge {
  background: rgba(57,211,83,.1);
  color: var(--color-accent);
  border: 1px solid rgba(57,211,83,.2);
  border-radius: 100px;
  padding: .1rem .6rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cat-badge:hover { background: rgba(57,211,83,.2); color: var(--color-accent); }

/* --------------------------------------------------------------------------
   13. Single Post
   -------------------------------------------------------------------------- */
.single-header { margin-bottom: 2.5rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb [aria-current="page"] { color: var(--color-text); }

.single-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-block: 1rem 1.25rem;
}

.single-excerpt {
  font-size: 1.1rem;
  color: var(--color-muted);
  line-height: 1.6;
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.author-mini {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}
.author-mini .author-avatar { border-radius: 50%; width: 40px; height: 40px; object-fit: cover; }
.author-name { font-size: .9rem; font-weight: 600; display: block; color: var(--color-text); }
.author-name:hover { color: var(--color-accent); }
.author-bio-short { font-size: .78rem; color: var(--color-muted); }

.single-hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  aspect-ratio: 16/9;
}
.single-hero-image .hero-img { width: 100%; height: 100%; object-fit: cover; }

/* Entry Content (rich text) */
.entry-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}
.entry-content > * + * { margin-top: 1.5rem; }
.entry-content h2 { font-size: 1.6rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.entry-content h3 { font-size: 1.3rem; margin-top: 2rem; }
.entry-content h4 { font-size: 1.1rem; margin-top: 1.75rem; }
.entry-content p { margin-bottom: .25rem; }
.entry-content ul, .entry-content ol { padding-left: 1.75rem; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .4rem; }
.entry-content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--color-hover); }
.entry-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  background: rgba(57,211,83,.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-muted);
  font-style: italic;
}
.entry-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .15em .4em;
  color: var(--color-accent);
}
.entry-content pre {
  background: #010409;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  position: relative;
}
.entry-content pre::before {
  content: attr(data-lang);
  position: absolute;
  top: .75rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text);
  font-size: .875rem;
  line-height: 1.7;
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.entry-content th { background: var(--color-surface); padding: .75rem 1rem; text-align: left; border: 1px solid var(--color-border); }
.entry-content td { padding: .65rem 1rem; border: 1px solid var(--color-border); }
.entry-content tr:nth-child(even) td { background: rgba(22,27,34,.5); }
.entry-content img { border-radius: var(--radius-md); }
.entry-content figure { text-align: center; }
.entry-content figcaption { font-size: .8rem; color: var(--color-muted); margin-top: .5rem; }
.entry-content hr { border: none; border-top: 1px solid var(--color-border); margin-block: 2.5rem; }

/* Post Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.tag-link {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: .3rem .8rem;
  font-size: .78rem;
  color: var(--color-muted);
  transition: border-color var(--transition), color var(--transition);
}
.tag-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Share Bar */
.share-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.share-label { font-size: .85rem; font-weight: 600; color: var(--color-muted); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: border-color var(--transition), color var(--transition);
}
.share-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Post Navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.nav-prev, .nav-next { }
.nav-next { text-align: right; }
.post-navigation a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-muted);
  max-width: 100%;
}
.post-navigation a:hover { color: var(--color-accent); }

/* Author Box */
.author-box {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: 2.5rem;
}
.author-box .author-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-box-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-muted); margin-bottom: .25rem; }
.author-box-name { font-size: 1.1rem; font-weight: 700; display: block; color: var(--color-text); margin-bottom: .5rem; }
.author-box-name:hover { color: var(--color-accent); }
.author-box-desc { font-size: .875rem; color: var(--color-muted); margin-bottom: 1rem; }

/* Related Posts */
.related-posts { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border); }
.related-posts .section-title { margin-bottom: 1.5rem; }

/* --------------------------------------------------------------------------
   14. Page Header
   -------------------------------------------------------------------------- */
.page-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); }
.page-title { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; }

.page-article-header { margin-bottom: 2rem; }
.page-article-title { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 800; }
.page-hero-image { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; aspect-ratio: 16/9; }
.page-hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   15. Archive Banner
   -------------------------------------------------------------------------- */
.archive-banner {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding-block: 3rem;
  text-align: center;
}
.archive-banner .container { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.archive-icon { font-size: 2.5rem; line-height: 1; }
.archive-title { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; }
.archive-title mark { background: none; color: var(--color-accent); }
.archive-description { max-width: 600px; color: var(--color-muted); font-size: 1rem; }
.archive-count { font-size: .8rem; color: var(--color-muted); background: var(--color-border); padding: .3rem .9rem; border-radius: 100px; }
.archive-avatar img { border-radius: 50%; width: 80px; height: 80px; object-fit: cover; }

/* --------------------------------------------------------------------------
   16. Pagination
   -------------------------------------------------------------------------- */
.pagination-wrap { margin-top: 3rem; display: flex; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: .75rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.page-numbers:hover { border-color: var(--color-accent); color: var(--color-accent); }
.page-numbers.current { background: var(--color-accent); color: #0d1117; border-color: var(--color-accent); font-weight: 700; }
.page-numbers.dots { background: none; border-color: transparent; }

/* --------------------------------------------------------------------------
   17. Comments
   -------------------------------------------------------------------------- */
.comments-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border); }
.comments-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 2rem; }
.comment-list { display: flex; flex-direction: column; gap: 1.5rem; }
.comment-item { list-style: none; }
.comment-body {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.comment-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.comment-avatar { border-radius: 50%; width: 48px; height: 48px; object-fit: cover; flex-shrink: 0; }
.comment-author-name { font-size: .9rem; font-weight: 600; }
.comment-time { font-size: .78rem; color: var(--color-muted); }
.comment-time a { color: var(--color-muted); }
.comment-reply { margin-left: auto; }
.comment-reply a { font-size: .8rem; color: var(--color-muted); border: 1px solid var(--color-border); padding: .25rem .65rem; border-radius: var(--radius-sm); }
.comment-reply a:hover { color: var(--color-accent); border-color: var(--color-accent); }
.comment-content { font-size: .9rem; color: var(--color-text); line-height: 1.7; }
.comment-awaiting { font-size: .78rem; color: var(--color-muted); background: rgba(255,189,46,.1); border: 1px solid rgba(255,189,46,.3); padding: .2rem .6rem; border-radius: var(--radius-sm); }
.comments-closed { color: var(--color-muted); font-size: .9rem; font-style: italic; margin: 1rem 0; }

/* Comment Form */
.comment-respond { margin-top: 2.5rem; }
.comment-reply-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.comment-form { display: flex; flex-direction: column; gap: 1rem; }
.comment-form label { display: block; font-size: .85rem; font-weight: 500; color: var(--color-muted); margin-bottom: .35rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: .7rem 1rem;
  font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(57,211,83,.15);
}
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form-comment label { font-size: 1rem; font-weight: 600; }
.form-allowed-tags { display: none; }
.comment-notes { font-size: .8rem; color: var(--color-muted); }
.required-field-message { font-size: .78rem; color: var(--color-muted); }

/* --------------------------------------------------------------------------
   18. 404 Page
   -------------------------------------------------------------------------- */
.error-404 {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
  padding-block: 4rem;
}
.error-terminal {
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .875rem;
}
.error-content { flex: 1; min-width: 260px; }
.error-code {
  font-size: clamp(5rem, 15vw, 8rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-accent), var(--color-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .25rem;
}
.error-title { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 1rem; }
.error-desc { color: var(--color-muted); margin-bottom: 2rem; }
.error-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.error-search { }
.error-search p { font-size: .85rem; color: var(--color-muted); margin-bottom: .75rem; }
.no-results { text-align: center; padding: 4rem 1rem; }
.no-results-terminal { max-width: 400px; margin: 0 auto 2rem; }
.no-results h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.no-results p { color: var(--color-muted); margin-bottom: 1.5rem; }
.no-results-msg { color: var(--color-muted); margin-bottom: 1.5rem; }

/* Search Form */
.search-form { display: flex; gap: .75rem; }
.search-field {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: .65rem 1rem;
  font-size: .95rem;
}
.search-field:focus { outline: none; border-color: var(--color-accent); }
.search-submit {
  padding: .65rem 1.25rem;
  background: var(--color-accent);
  color: #0d1117;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-size: .9rem;
  transition: background var(--transition);
}
.search-submit:hover { background: var(--color-hover); color: #fff; }

/* --------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-top: 4rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
  padding-block: 3rem;
}
.footer-brand { }
.footer-logo-link { display: inline-block; margin-bottom: .75rem; }
.footer-site-name { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--color-accent); }
.footer-tagline { font-size: .875rem; color: var(--color-muted); line-height: 1.6; margin-bottom: 1rem; }

.social-list { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.social-list li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.social-list li a:hover { border-color: var(--color-accent); color: var(--color-accent); background: rgba(57,211,83,.07); }

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  padding: .35rem .85rem;
  border-radius: 100px;
  transition: border-color var(--transition), color var(--transition);
}
.rss-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

.footer-col .widget { background: none; border: none; padding: 0; margin: 0; }
.footer-col .widget-title { font-size: .75rem; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
  border-top: 1px solid var(--color-border);
  gap: 1rem;
  flex-wrap: wrap;
}
.copyright { font-size: .82rem; color: var(--color-muted); }
.footer-menu { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-menu li a { font-size: .82rem; color: var(--color-muted); }
.footer-menu li a:hover { color: var(--color-accent); }

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */

/* Tablet: ≤ 1024px */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .layout-sidebar { grid-template-columns: 1fr; }
  .widget-area { position: static; }
  .posts-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-tagline { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-terminal { max-width: 520px; margin-inline: auto; }
}

/* Mobile: ≤ 768px */
@media (max-width: 768px) {
  .main-navigation { display: none; }
  .main-navigation.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 1rem 0; }
  .nav-list li a { padding: .75rem 1rem; border-radius: 0; border-bottom: 1px solid var(--color-border); }
  .nav-list .sub-menu { position: static; box-shadow: none; border: none; border-radius: 0; background: rgba(0,0,0,.2); padding: 0; }
  .menu-toggle { display: flex; }

  .header-inner { height: 60px; }

  /* Mobile nav overlay */
  .site-header.menu-open .main-navigation {
    display: block;
    position: fixed;
    top: 60px;
    left: 0; right: 0; bottom: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    overflow-y: auto;
    z-index: 99;
    padding: 1rem;
    animation: slideDown .2s ease;
  }

  .posts-grid--cols-2,
  .posts-grid--cols-3,
  .posts-grid--cols-4 { grid-template-columns: 1fr; }

  .post-card--featured { flex-direction: column; }
  .post-card--featured .card-thumb-link { width: 100%; }

  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-menu { justify-content: center; }

  .post-navigation { grid-template-columns: 1fr; }
  .nav-next { text-align: left; }

  .error-404 { flex-direction: column; gap: 2rem; text-align: center; }
  .error-actions { justify-content: center; }

  .author-box { flex-direction: column; }
  .share-bar { flex-wrap: wrap; }

  .archive-banner { padding-block: 2rem; }
  .hero { padding-block: 3rem; }
  .hero-inner { gap: 2rem; }
}

/* Small: ≤ 480px */
@media (max-width: 480px) {
  :root { --container-pad: 1rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { justify-content: center; }
  .btn { padding: .6rem 1.1rem; }
  .search-form { flex-direction: column; }
  .header-search form { flex-direction: column; }
  .cat-chips { gap: .4rem; }
}

/* --------------------------------------------------------------------------
   21. Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .widget-area, .share-bar, .post-navigation,
  .related-posts, .comments-section, .comment-respond, .hero-terminal { display: none !important; }
  body { background: #fff; color: #000; }
  .entry-content a { color: #000; text-decoration: underline; }
  .entry-content a[href]::after { content: ' (' attr(href) ')'; font-size: .8em; }
}

/* --------------------------------------------------------------------------
   22. Accessibility & Focus Styles
   -------------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
