/* =============================================================================
   main.css — Sven Poeche Blog Theme
   Minimal, responsive, vanilla CSS with custom properties
   ============================================================================= */

/* ═══ COLOR SYSTEM ═══ */
:root {
  /* Surfaces */
  --base: #0a0a0a;
  --surface-1: #111111;
  --surface-2: #1a1a1a;
  --surface-3: #222222;

  /* Navy Branding */
  --navy-dark: #0f1f33;
  --navy-mid: #152a45;
  --navy-brand: #1e3a5c;
  --navy-light: #264d73;

  /* Blue Accents */
  --blue-dark: #1e40af;
  --blue-mid: #2563eb;
  --blue-primary: #3b82f6;
  --blue-light: #60a5fa;

  /* Orange Signals */
  --orange: #f59e0b;
  --orange-light: #fbbf24;
  --orange-dark: #d97706;
  --orange-text: #f59e0b;

  /* Text */
  --text-headline: #f0f0f0;
  --text-body: #d4d4d4;
  --text-secondary: #999999;
  --text-muted: #666666;

  /* Borders */
  --border-subtle: #1f1f1f;
  --border-default: #2a2a2a;
  --border-strong: #333333;

  /* Typography */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Spacing (unchanged) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --container-width: 1200px;
  --container-narrow: 720px;
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-lg: 0.75rem;
}

/* ═══ LIGHT MODE ═══ */
[data-theme="light"] {
  --base: #ffffff;
  --surface-1: #dfe4ed;
  --surface-2: #f0f0f1;
  --surface-3: #e8e8e9;

  --navy-dark: #eff6ff;
  --navy-mid: #dbeafe;
  --navy-brand: #bfdbfe;
  --navy-light: #93c5fd;

  --blue-dark: #1e40af;
  --blue-mid: #2563eb;
  --blue-primary: #2563eb;
  --blue-light: #1d4ed8;

  --orange: #d97706;
  --orange-light: #b45309;
  --orange-dark: #92400e;
  --orange-text: #b45309;

  --text-headline: #111827;
  --text-body: #374151;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --border-subtle: #f0f0f1;
  --border-default: #e5e7eb;
  --border-strong: #d1d5db;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --base: #ffffff;
    --surface-1: #dfe4ed;
    --surface-2: #f0f0f1;
    --surface-3: #e8e8e9;

    --navy-dark: #eff6ff;
    --navy-mid: #dbeafe;
    --navy-brand: #bfdbfe;
    --navy-light: #93c5fd;

    --blue-dark: #1e40af;
    --blue-mid: #2563eb;
    --blue-primary: #2563eb;
    --blue-light: #1d4ed8;

    --orange: #d97706;
    --orange-light: #b45309;
    --orange-dark: #92400e;
    --orange-text: #b45309;

    --text-headline: #111827;
    --text-body: #374151;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border-subtle: #f0f0f1;
    --border-default: #e5e7eb;
    --border-strong: #d1d5db;
  }
}


/* ═══ RESET / BASE ═══ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

a {
  color: var(--blue-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--blue-light); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-headline);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
p { margin: 0; }


/* ═══ LAYOUT ═══ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow {
  max-width: var(--container-narrow);
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
}


/* ═══ SITE HEADER ═══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .site-header {
  background: rgba(223, 228, 237, 0.9);
  border-bottom-color: var(--border-default);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-header {
    background: rgba(223, 228, 237, 0.9);
    border-bottom-color: var(--border-default);
  }
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo__img {
  height: 28px;
  width: auto;
}
.site-logo__fallback {
  display: flex;
  width: 28px;
  height: 28px;
  background: var(--navy-brand);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
}
.site-logo__text {
  color: var(--text-headline);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Dark mode: show dark logo, hide light logo and fallback */
.site-logo__img--light { display: none; }
.site-logo__img ~ .site-logo__fallback { display: none; }

/* Light mode: hide dark logo, show light logo (or fallback if no light logo) */
[data-theme="light"] .site-logo__img--dark { display: none; }
[data-theme="light"] .site-logo__img--light { display: block; }
[data-theme="light"] .site-logo__img--light ~ .site-logo__fallback { display: none; }
[data-theme="light"] .site-logo__fallback { display: flex; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-logo__img--dark { display: none; }
  :root:not([data-theme="dark"]) .site-logo__img--light { display: block; }
  :root:not([data-theme="dark"]) .site-logo__img--light ~ .site-logo__fallback { display: none; }
  :root:not([data-theme="dark"]) .site-logo__fallback { display: flex; }
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-nav__link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.header-nav__link:hover {
  color: var(--text-headline);
  background: var(--surface-2);
}
.header-nav__link--active {
  color: var(--text-headline);
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  gap: 2px;
  margin-left: 8px;
  padding: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.lang-toggle__btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-toggle__btn--active {
  background: var(--blue-primary);
  color: #fff;
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 14px;
  transition: all 0.15s ease;
}
.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-headline);
}

/* Hamburger (mobile only) */
.header-hamburger {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* Mobile */
@media (max-width: 640px) {
  .header-nav__link { display: none; }
  .lang-toggle { display: none; }
  .header-hamburger { display: flex; }

  .header-nav.is-open .header-nav__link,
  .header-nav.is-open .lang-toggle {
    display: flex;
  }
  .header-nav.is-open {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-default);
    flex-direction: column;
    padding: 16px 24px;
    gap: 8px;
  }
}


/* ═══ MAGAZINE GRID ═══ */
.magazine-grid {
  padding-top: 32px;
}
.grid-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "featured medium1"
    "featured medium2";
  gap: 16px;
  margin-bottom: 16px;
}
.grid-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--border-default);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
[data-theme="light"] .card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  }
}

.card__image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-mid));
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card__tag {
  display: inline-block;
  color: var(--blue-primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.card__title {
  color: var(--text-headline);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.card__title a {
  color: inherit;
  text-decoration: none;
}
.card__excerpt {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}
.card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: auto;
}

.card__reading-time {
  color: var(--text-secondary);
}

/* Featured Card */
.card-featured {
  grid-area: featured;
  display: grid;
  grid-template-rows: 1fr auto;
}
.card-featured .card__image {
  height: 100%;
  min-height: 200px;
}
.card-featured .card__title {
  font-size: 24px;
}

/* Hide excerpt on medium and small cards (only featured shows it) */
.card-medium .card__excerpt,
.card-small .card__excerpt { display: none; }

/* Only show first topic tag per card */
.card__tag ~ .card__tag { display: none; }

/* Medium Card */
.card-medium .card__image {
  height: 130px;
}
.card-medium .card__title {
  font-size: 15px;
}

/* Small Card */
.card-small {
  flex-direction: row;
}
.card-small .card__image {
  width: 140px;
  min-height: 100%;
  flex-shrink: 0;
}
.card-small .card__body {
  padding: 14px;
  justify-content: center;
}
.card-small .card__title {
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-small .card__tag {
  font-size: 10px;
  margin-bottom: 4px;
}

/* Assign grid areas to medium cards by position */
.grid-top .card-medium:nth-child(2) { grid-area: medium1; }
.grid-top .card-medium:nth-child(3) { grid-area: medium2; }

/* Grid Responsive */
@media (max-width: 960px) {
  .grid-top {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "featured featured"
      "medium1  medium2";
  }
  .card-featured {
    display: flex;
  }
  .card-featured .card__image {
    height: 220px;
    min-height: auto;
  }
  .card-featured .card__title { font-size: 22px; }
  .grid-bottom {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .grid-top {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "featured"
      "medium1"
      "medium2";
  }
  .card-featured .card__image { height: 180px; }
  .card-featured .card__title { font-size: 20px; }
  .grid-bottom {
    grid-template-columns: 1fr;
  }
  .card-small .card__image { width: 110px; }
}

/* ═══ ORANGE ACCENTS ═══ */
.badge-neu {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--orange);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  z-index: 2;
}
[data-theme="light"] .badge-neu { color: #fff; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .badge-neu { color: #fff; }
}

.card--series,
.card--series:hover {
  border-left: 3px solid var(--orange);
}
.series-badge-img {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--orange);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
  word-spacing: 0.15em;
}
[data-theme="light"] .series-badge-img {
  background: rgba(255, 255, 255, 0.92);
  color: var(--orange-text);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .series-badge-img {
    background: rgba(255, 255, 255, 0.92);
    color: var(--orange-text);
  }
}

/* ═══ POST HERO ═══ */
.post-hero {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 24px 24px 0;
}
.post-hero__image {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.post-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-hero__image--gradient {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-mid), var(--navy-brand));
}
.post-hero__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--base));
}

@media (max-width: 640px) {
  .post-hero__image { height: 220px; border-radius: 8px; }
  .post-hero { padding: 16px 16px 0; }
}

/* ═══ POST LAYOUT ═══ */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 960px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ═══ POST HEADER ═══ */
.post-header {
  padding-top: 24px;
  margin-bottom: 32px;
}
.post-header__tag {
  display: inline-block;
  color: var(--blue-primary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.post-header__tag ~ .post-header__tag {
  display: none;
}
.post-header__title {
  color: var(--text-headline);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.post-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  flex-wrap: wrap;
}
.post-header__meta .separator { color: var(--text-muted); }
.post-header__translation {
  color: var(--blue-primary);
  font-weight: 500;
}

/* ═══ POST CONTENT ═══ */
.post-content {
  max-width: var(--container-narrow);
  font-size: 16px;
  line-height: 1.8;
}
.post-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  scroll-margin-top: 80px;
}
.post-content h3 {
  font-size: 19px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
  scroll-margin-top: 80px;
}
.post-content p { margin-bottom: 20px; }
.post-content a {
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.3);
  text-underline-offset: 3px;
}
.post-content a:hover {
  text-decoration-color: var(--blue-primary);
}
.post-content strong { color: var(--text-headline); font-weight: 600; }
.post-content ul, .post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  list-style: disc;
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 8px; }
.post-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}
.post-content figure { margin: 32px 0; }
.post-content figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* Code blocks */
.post-content pre {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.post-content p code, .post-content li code {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue-light);
}

/* Blockquote */
.post-content blockquote {
  border-left: 3px solid var(--blue-primary);
  background: var(--surface-1);
  padding: 16px 20px;
  margin: 0 0 24px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}
.post-content blockquote p { margin-bottom: 0; }

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}
.post-content th, .post-content td {
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  text-align: left;
}
.post-content th {
  background: var(--surface-2);
  color: var(--text-headline);
  font-weight: 600;
}
.post-content tr:nth-child(even) {
  background: var(--surface-1);
}

/* Post Tags */
.post-tags {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.post-tags__item {
  background: var(--surface-2);
  border: 1px solid var(--blue-primary);
  color: var(--blue-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.post-tags__item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-light);
}
.post-tags__item--series {
  border-color: var(--orange);
  color: var(--orange-text);
}
.post-tags__item--series:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange-light);
}

.post-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 16px;
}

/* ═══ POST SIDEBAR ═══ */
.post-sidebar {
  position: sticky;
  top: 80px;
  padding-top: 24px;
}
.sidebar-section {
  margin-bottom: 32px;
}
.sidebar-section__title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Table of Contents */
.toc__list {
  list-style: none;
  padding: 0;
}
.toc__item {
  padding: 5px 0 5px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.toc__item:hover { color: var(--text-headline); }
.toc__item--active {
  color: var(--orange-text);
  border-left-color: var(--orange);
  font-weight: 500;
}
.toc__item--h3 {
  padding-left: 22px;
  font-size: 12px;
}
.toc__item a {
  color: inherit;
  text-decoration: none;
}

/* Series Navigation */
.series-nav {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 3px solid var(--orange);
}
.series-nav h3 {
  color: var(--orange-text);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.series-nav__list {
  list-style: none;
  padding: 0;
}
.series-nav__item {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.series-nav__item:last-child { border-bottom: none; }
.series-nav__item a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.series-nav__item a:hover { color: var(--text-headline); }
.series-nav__item--current a,
.series-nav__item--current a:hover { color: var(--orange-text); }
.series-nav__item--current {
  color: var(--text-headline);
  font-weight: 600;
  padding-left: 14px;
  position: relative;
}
.series-nav__item--current::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--orange);
  font-size: 12px;
}

/* Sidebar collapse toggle (tablet) */
.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}
.sidebar-toggle:hover {
  background: var(--surface-3);
  color: var(--text-headline);
}
.sidebar-toggle::after {
  content: ' ▸';
  float: right;
}
.sidebar-toggle.is-open::after {
  content: ' ▾';
}

/* Sidebar Responsive */
@media (max-width: 960px) {
  .post-sidebar {
    position: static;
    padding-top: 0;
    margin-bottom: 32px;
  }
  .sidebar-toggle { display: block; }
  .sidebar-section { display: none; }
  .post-sidebar.is-open .sidebar-section { display: block; }
}

/* ═══ PAGINATION ═══ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border-subtle);
}
.pagination__btn {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pagination__btn:hover {
  background: var(--surface-3);
  color: var(--text-headline);
}
.pagination__btn--active {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: #fff;
}
.pagination__btn--disabled {
  opacity: 0.4;
  cursor: default;
}




/* ═══ FOOTER ═══ */
.site-footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links__item {
  color: var(--text-muted);
  font-size: 13px;
  transition: color 0.15s ease;
}
.footer-links__item:hover {
  color: var(--text-secondary);
}

[data-theme="light"] .footer-links__item {
  color: var(--text-secondary);
}
[data-theme="light"] .footer-links__item:hover {
  color: var(--text-headline);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .footer-links__item { color: var(--text-secondary); }
  :root:not([data-theme="dark"]) .footer-links__item:hover { color: var(--text-headline); }
}

.footer-rss {
  display: flex;
  align-items: center;
  gap: 4px;
}
.footer-social {
  display: flex;
  gap: 12px;
}
.footer-social__link {
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.footer-social__link:hover {
  color: var(--text-secondary);
}
[data-theme="light"] .footer-social__link { color: var(--text-secondary); }
[data-theme="light"] .footer-social__link:hover { color: var(--text-headline); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .footer-social__link { color: var(--text-secondary); }
  :root:not([data-theme="dark"]) .footer-social__link:hover { color: var(--text-headline); }
}
.footer-copy {
  color: var(--text-muted);
  font-size: 12px;
}

/* Hide plugin-injected language switcher (now in header) */
.lang-switcher { display: none !important; }

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}


/* ═══ NOSCRIPT ═══ */
.noscript-notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--orange-text);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
}

/* ═══ TAG PAGE (single tag) ═══ */
.tag-header {
  margin: 32px 0 24px;
}
.tag-header__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tag-header__description {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 8px;
}
.tag-empty-notice {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 15px;
  padding: 32px 0;
}
.tag-empty-notice a {
  color: var(--blue-primary);
  font-weight: 500;
}

/* ═══ TAGS PAGE (all tags) ═══ */
.tags-header__title {
  font-size: 28px;
  font-weight: 800;
  margin: 32px 0 32px;
}
.tags-section {
  margin-bottom: 32px;
}
.tags-section__title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tags-list__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.15s ease;
  text-decoration: none;
}
.tags-list__link:hover {
  background: var(--surface-3);
  color: var(--text-headline);
}
.tags-list__count {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.tags-list__link--topic {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}
.tags-list__link--topic:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-light);
}
.tags-list__link--series {
  border-color: var(--orange);
  color: var(--orange-text);
}
.tags-list__link--series:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange-light);
}

/* ═══ SEARCH PAGE ═══ */
.search-header__title {
  font-size: 28px;
  font-weight: 800;
  margin: 32px 0 24px;
}

/* ═══ 404 PAGE ═══ */
.error-page {
  text-align: center;
  padding: 80px 0;
}
.error-page__code {
  font-size: 96px;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 16px;
}
.error-page__message {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.error-page__button {
  display: inline-block;
  background: var(--blue-primary);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease;
}
.error-page__button:hover {
  background: var(--blue-mid);
  color: #fff;
}

/* ═══ PAGE (About, etc.) ═══ */
.page__header { margin: 32px 0 24px; }
.page__title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page__content {
  max-width: var(--container-narrow);
  font-size: 16px;
  line-height: 1.8;
}
.page__content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
}
.page__content h3 {
  font-size: 19px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
}
.page__content h4 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}
.page__content p { margin-bottom: 20px; }
.page__content a {
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.3);
  text-underline-offset: 3px;
}
.page__content a:hover {
  text-decoration-color: var(--blue-primary);
}
.page__content strong { color: var(--text-headline); font-weight: 600; }
.page__content ul, .page__content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  list-style: disc;
}
.page__content ol { list-style: decimal; }
.page__content li { margin-bottom: 8px; }


@media (max-width: 640px) {
  .error-page__code {
    font-size: 3.5rem;
  }
}
