/* Effects — texture, ambient glow, animated sidelines, experimental flair. */

/* --- Subtle noise texture on background --- */

html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* --- Animated sideline glow --- */

.post-view article,
.home-view .post-list {
  position: relative;
}

.post-view article::before,
.home-view .post-list::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--color-primary) 20%,
    var(--color-accent) 50%,
    var(--color-primary) 80%,
    transparent 100%
  );
  opacity: 0.6;
  animation: sideline-pulse 4s ease-in-out infinite;
}

@keyframes sideline-pulse {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.8;
  }
}

/* --- Glow on post cards on hover --- */

.post-card {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.post-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 12px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

/* --- Hero image ambient glow --- */

.post-hero {
  box-shadow: 0 8px 32px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

/* --- Header bottom glow line --- */

.site-header {
  box-shadow:
    0 1px 0 var(--color-border),
    0 4px 16px color-mix(in srgb, var(--color-primary) 10%, transparent);
}

/* --- Tag pills glow on hover --- */

.tag {
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

.tag:hover {
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

/* --- Pagination active glow --- */

.pagination .page-num.active {
  box-shadow: 0 0 10px color-mix(in srgb, var(--color-primary) 50%, transparent);
}

/* --- Content surface card effect --- */

.post-view article {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

/* --- Sidebar subtle border glow --- */

.site-sidebar {
  border-left-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
}

/* --- Footer fade-in line --- */

.site-footer {
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--color-primary) 5%, transparent)
  );
}

/* --- Theme-specific glow accent --- */

:root {
  --glow-accent: var(--color-accent);
}

[data-theme='light'] {
  --glow-accent: var(--color-accent);
}

/* --- Reduce motion for accessibility --- */

@media (prefers-reduced-motion: reduce) {
  .post-view article::before,
  .home-view .post-list::before {
    animation: none;
    opacity: 0.5;
  }

  .post-card:hover {
    transform: none;
  }
}
