/*
 * ============================================
 * === MATRIX GREEN TERMINAL THEME ===
 * === Ghost CMS - PRO IT ===
 * === Dopasowany do logo >_ ===
 * ============================================
 */

/* --- 1. Podstawowa Paleta Kolorów --- */
:root {
  /* Tła */
  --theme-bg: #0a0a0a;
  --theme-content-bg: #1a1a1a;
  --theme-header-bg: #000000;

  /* Tekst */
  --theme-text: #e0e0e0;
  --theme-text-bright: #ffffff;
  --theme-text-subtle: #888888;

  /* Matrix Green */
  --theme-matrix-green: #00FF41;
  --theme-matrix-dark: #00D900;
  --theme-matrix-dim: #00AA00;

  /* Efekty Glow */
  --theme-glow-green: rgba(0, 255, 65, 0.6);
  --theme-glow-green-strong: rgba(0, 255, 65, 0.8);
  --theme-glow-green-subtle: rgba(0, 255, 65, 0.2);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  /* Container */
  --container-width: 1200px;
}

/* --- 2. Reset & Basics --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Vignette effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* --- 3. Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--theme-text-bright);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-sm);
}

/* --- 4. Links --- */
a {
  color: var(--theme-matrix-green);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--theme-text-bright);
  text-shadow: 0 0 10px var(--theme-glow-green);
}

/* --- 5. Terminal Prompt --- */
.terminal-prompt {
  color: var(--theme-matrix-green);
  font-weight: 700;
  margin-right: 0.5rem;
  text-shadow: 0 0 5px var(--theme-glow-green-subtle);
}

.terminal-text {
  font-family: 'Courier New', monospace;
}

/* --- 6. Scan Line Effect (Enhanced) --- */
.terminal-scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Horizontal scan lines */
.terminal-scanline::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 255, 65, 0.03) 50%
  );
  background-size: 100% 3px;
  animation: scan 8s linear infinite;
}

/* Moving scan beam */
.terminal-scanline::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 255, 65, 0.08) 50%,
    transparent
  );
  animation: scan-beam 10s linear infinite;
  opacity: 0.5;
}

@keyframes scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(3px); }
}

@keyframes scan-beam {
  0% { top: -100px; }
  100% { top: 100%; }
}

/* --- 7. Container --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* --- 8. Header --- */
#header,
.site-header {
  background: var(--theme-header-bg);
  color: var(--theme-text-bright);
  border: none;
  border-top: 3px solid var(--theme-matrix-green);
  box-shadow:
    0 3px 20px var(--theme-glow-green),
    0 5px 15px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--theme-glow-green-subtle);
  padding: var(--spacing-sm) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.95);
}

.header-content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  color: var(--theme-text-bright);
  font-size: 1.5rem;
  font-weight: 900;
  text-shadow: 0 0 15px var(--theme-glow-green-strong);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
}

.site-title:hover {
  color: var(--theme-text-bright);
}

.site-logo img {
  height: 50px;
  filter: drop-shadow(0 0 10px var(--theme-glow-green));
}

/* --- 9. Navigation --- */
#main-navigation,
.site-navigation {
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: var(--spacing-sm);
  margin: 0;
  padding: 0;
}

.nav-item {
  margin: 0;
}

.nav-link {
  color: var(--theme-text-subtle);
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  background-color: rgba(0, 255, 65, 0.1);
  color: var(--theme-matrix-green);
  text-shadow: 0 0 8px var(--theme-glow-green);
}

.nav-item.nav-current .nav-link {
  background-color: rgba(0, 255, 65, 0.15);
  color: var(--theme-matrix-green);
  text-shadow: 0 0 12px var(--theme-glow-green-strong);
  border-bottom: 2px solid var(--theme-matrix-green);
}

/* --- 10. Main Content --- */
.site-main {
  min-height: 70vh;
  padding: var(--spacing-lg) 0;
}

/* --- 11. Hero Section --- */
.hero-section {
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--theme-glow-green-subtle);
  padding: var(--spacing-xl) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 15px var(--theme-glow-green-strong);
}

.hero-description {
  font-size: 1.2rem;
  color: var(--theme-text);
  max-width: 700px;
  margin: 0 auto;
}

/* --- 12. Homepage Top Grid (Latest + Next 3) --- */
.homepage-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

/* --- 12a. Latest Post Hero (2/3 width, left) --- */
.latest-post-hero {
  background: var(--theme-content-bg);
  border: 2px solid var(--theme-matrix-green);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 5px 30px rgba(0, 255, 65, 0.3),
    inset 0 2px 0 var(--theme-glow-green-subtle);
  transition: all 0.4s ease;
  position: relative;
}

.latest-post-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
  transition: left 0.6s;
}

.latest-post-hero:hover::before {
  left: 100%;
}

.latest-post-hero:hover {
  border-color: var(--theme-text-bright);
  box-shadow:
    0 10px 50px rgba(0, 255, 65, 0.5),
    inset 0 2px 0 var(--theme-glow-green-subtle);
  transform: translateY(-3px);
}

.latest-post-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.latest-post-image {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.latest-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.latest-post-hero:hover .latest-post-image img {
  transform: scale(1.05);
}

.latest-post-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, var(--theme-content-bg), transparent);
}

.latest-post-content {
  padding: var(--spacing-xl);
}

.latest-post-tag {
  display: inline-block;
  background: var(--theme-matrix-green);
  color: #000;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  box-shadow: 0 0 10px var(--theme-glow-green);
}

.latest-post-title {
  font-size: 2.5rem;
  color: var(--theme-text-bright);
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
  text-shadow: 0 0 20px var(--theme-glow-green);
}

.latest-post-hero:hover .latest-post-title {
  color: var(--theme-matrix-green);
  text-shadow: 0 0 30px var(--theme-glow-green-strong);
}

.latest-post-excerpt {
  font-size: 1.2rem;
  color: var(--theme-text);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.latest-post-meta {
  display: flex;
  gap: var(--spacing-md);
  font-size: 0.95rem;
  color: var(--theme-text-subtle);
  flex-wrap: wrap;
}

/* --- 12b. Next Posts Sidebar (1/3 width, right, vertical) --- */
.next-posts-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  height: 100%;
}

.next-post-compact {
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.3s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.next-post-compact:hover {
  border-color: var(--theme-matrix-green);
  box-shadow: 0 0 15px var(--theme-glow-green-subtle);
  transform: translateY(-2px);
}

.next-post-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.next-post-thumb {
  width: 100%;
  height: 140px;
  flex-shrink: 0;
  overflow: hidden;
}

.next-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.next-post-compact:hover .next-post-thumb img {
  transform: scale(1.1);
}

.next-post-info {
  flex: 1;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.next-post-tag {
  display: inline-block;
  color: var(--theme-matrix-green);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.next-post-title {
  font-size: 1.1rem;
  color: var(--theme-text-bright);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  font-weight: 700;
}

.next-post-compact:hover .next-post-title {
  color: var(--theme-matrix-green);
}

.next-post-excerpt {
  font-size: 0.9rem;
  color: var(--theme-text);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  flex: 1;
}

.next-post-meta {
  font-size: 0.8rem;
  color: var(--theme-text-subtle);
  margin-top: auto;
}

/* --- 12c. Featured Posts Section (with images) --- */
.featured-posts-section {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--theme-matrix-dim);
  border-bottom: 1px solid var(--theme-matrix-dim);
}

.featured-title {
  color: var(--theme-matrix-green);
  font-size: 1.3rem;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 0 8px var(--theme-glow-green);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

.featured-card-image {
  background: var(--theme-content-bg);
  border: 2px solid var(--theme-matrix-dim);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  animation: pulse-border 3s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: var(--theme-matrix-dim);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
  }
  50% {
    border-color: var(--theme-matrix-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
  }
}

.featured-card-image:hover {
  border-color: var(--theme-matrix-green);
  box-shadow: 0 0 20px var(--theme-glow-green);
  transform: translateY(-3px);
  animation: none;
}

.featured-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--theme-matrix-green);
  font-size: 2rem;
  text-shadow: 0 0 10px var(--theme-glow-green);
  animation: star-glow 2s ease-in-out infinite;
  z-index: 10;
}

@keyframes star-glow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.featured-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-card-image:hover .featured-image img {
  transform: scale(1.05);
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, var(--theme-content-bg), transparent);
}

.featured-content {
  padding: var(--spacing-md);
}

.featured-tag {
  display: inline-block;
  color: var(--theme-matrix-green);
  font-size: 0.75rem;
  margin-bottom: var(--spacing-xs);
}

.featured-card-title {
  font-size: 1.2rem;
  color: var(--theme-text-bright);
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
}

.featured-card-image:hover .featured-card-title {
  color: var(--theme-matrix-green);
}

.featured-card-excerpt {
  font-size: 0.9rem;
  color: var(--theme-text-subtle);
  margin: 0;
  line-height: 1.4;
}

/* --- 13. Posts Container --- */
.posts-container {
  margin-top: var(--spacing-lg);
}

.section-title {
  color: var(--theme-matrix-green);
  font-size: 1.5rem;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 0 10px var(--theme-glow-green);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--theme-matrix-dim);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

/* --- 14. Post Card (Enhanced) --- */
.post-card {
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 var(--theme-glow-green-subtle);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 255, 65, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.post-card:hover {
  border-color: var(--theme-matrix-green);
  box-shadow:
    0 8px 30px var(--theme-glow-green),
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 var(--theme-glow-green-subtle);
  transform: translateY(-8px);
}

.post-card-link {
  display: block;
  color: var(--theme-text);
}

.post-card-link:hover {
  color: var(--theme-text);
  text-shadow: none;
}

.post-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.05);
}

.post-card-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--theme-content-bg));
}

.post-card-content {
  padding: var(--spacing-md);
}

.post-card-tag {
  display: inline-block;
  color: var(--theme-matrix-green);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
}

.post-card-title {
  font-size: 1.5rem;
  color: var(--theme-text-bright);
  margin-bottom: var(--spacing-sm);
}

.post-card:hover .post-card-title {
  color: var(--theme-matrix-green);
  text-shadow: 0 0 10px var(--theme-glow-green);
}

.post-card-excerpt {
  color: var(--theme-text);
  margin-bottom: var(--spacing-sm);
  font-size: 0.95rem;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  font-size: 0.85rem;
  color: var(--theme-text-subtle);
}

/* --- 14. Featured Posts --- */
.featured-posts {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  border-top: 2px solid var(--theme-matrix-dim);
  border-bottom: 2px solid var(--theme-matrix-dim);
}

.section-title {
  color: var(--theme-matrix-green);
  text-shadow: 0 0 10px var(--theme-glow-green);
  margin-bottom: var(--spacing-md);
  font-size: 1.75rem;
}

/* --- 15. Single Post --- */
.post,
.page {
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--theme-glow-green-subtle);
  padding: var(--spacing-xl) var(--spacing-md);
}

.post-header,
.page-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--theme-matrix-dim);
}

.post-tag {
  display: inline-block;
  background-color: var(--theme-matrix-green);
  color: #000;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-bottom: var(--spacing-sm);
  box-shadow: 0 0 5px var(--theme-glow-green-subtle);
}

.post-title,
.page-title {
  font-size: 3rem;
  text-shadow: 0 0 15px var(--theme-glow-green-strong);
  margin-bottom: var(--spacing-md);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  font-size: 1rem;
  color: var(--theme-text-subtle);
}

.post-image,
.page-image {
  margin: var(--spacing-lg) 0;
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.post-image img,
.page-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-content,
.page-content {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: var(--spacing-lg);
}

.post-content img,
.page-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  margin: var(--spacing-md) 0;
}

.post-content pre,
.page-content pre {
  background: var(--theme-bg);
  border: 1px solid var(--theme-matrix-green);
  border-left: 3px solid var(--theme-matrix-green);
  border-radius: 4px;
  padding: var(--spacing-sm);
  overflow-x: auto;
  margin: var(--spacing-md) 0;
  box-shadow: 0 0 10px var(--theme-glow-green-subtle);
}

.post-content code,
.page-content code {
  background: var(--theme-bg);
  color: var(--theme-matrix-green);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

.post-content pre code,
.page-content pre code {
  background: transparent;
  padding: 0;
}

.post-content blockquote,
.page-content blockquote {
  border-left: 4px solid var(--theme-matrix-green);
  background: rgba(0, 255, 65, 0.05);
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-md) 0;
  font-style: italic;
  color: var(--theme-text);
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
  margin-left: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.post-content li,
.page-content li {
  margin-bottom: 0.5rem;
}

/* --- 15. Post Footer --- */
.post-footer {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 2px solid var(--theme-matrix-dim);
}

.post-tags {
  margin-bottom: var(--spacing-md);
}

.tag {
  display: inline-block;
  background-color: transparent;
  color: var(--theme-matrix-green);
  border: 2px solid var(--theme-matrix-green);
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.tag:hover {
  background-color: rgba(0, 255, 65, 0.15);
  border-color: var(--theme-text-bright);
  color: var(--theme-text-bright);
  box-shadow: 0 0 10px var(--theme-glow-green);
}

/* --- 16. Author Card --- */
.author-card {
  background: var(--theme-bg);
  border: 1px solid var(--theme-matrix-green);
  border-radius: 4px;
  padding: var(--spacing-md);
  box-shadow: 0 0 10px var(--theme-glow-green-subtle);
}

.author-info {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--theme-matrix-green);
  box-shadow: 0 0 10px var(--theme-glow-green);
}

.author-name {
  color: var(--theme-matrix-green);
  margin-bottom: var(--spacing-xs);
}

.author-bio {
  color: var(--theme-text);
  margin: 0;
}

/* --- 17. Related Posts --- */
.related-posts {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 2px solid var(--theme-matrix-dim);
}

.related-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  color: var(--theme-matrix-green);
  text-shadow: 0 0 10px var(--theme-glow-green);
}

/* --- 18. Tag/Author Header --- */
.tag-header,
.author-header {
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--theme-glow-green-subtle);
  padding: var(--spacing-xl) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.tag-title,
.author-title {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 15px var(--theme-glow-green-strong);
}

.tag-description,
.author-bio {
  font-size: 1.1rem;
  color: var(--theme-text);
  max-width: 700px;
  margin: 0 auto var(--spacing-sm) auto;
}

.tag-count,
.author-post-count {
  color: var(--theme-text-subtle);
}

.author-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--theme-matrix-green);
  box-shadow: 0 0 20px var(--theme-glow-green);
  margin-bottom: var(--spacing-md);
}

.author-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  color: var(--theme-text-subtle);
}

/* --- 19. Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  font-family: 'Courier New', monospace;
}

.pagination a,
.pagination span {
  background-color: transparent;
  color: var(--theme-matrix-green);
  border: 2px solid var(--theme-matrix-green);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background-color: rgba(0, 255, 65, 0.15);
  color: var(--theme-text-bright);
  border-color: var(--theme-text-bright);
  box-shadow: 0 0 15px var(--theme-glow-green);
  text-shadow: none;
}

.pagination .page-number {
  background-color: var(--theme-matrix-green);
  color: #000;
  border-color: var(--theme-matrix-green);
  box-shadow: 0 0 10px var(--theme-glow-green);
}

/* --- 20. Buttons --- */
.btn,
.btn-primary {
  display: inline-block;
  background-color: var(--theme-matrix-green);
  color: #000;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  padding: 0.8rem 2rem;
  box-shadow:
    0 0 15px var(--theme-glow-green),
    0 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn:hover,
.btn-primary:hover {
  background-color: var(--theme-text-bright);
  color: #000;
  box-shadow:
    0 0 25px rgba(255, 255, 255, 0.8),
    0 4px 10px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
  text-shadow: none;
}

/* --- 21. Footer --- */
#footer,
.site-footer {
  background: var(--theme-header-bg);
  color: var(--theme-text-subtle);
  border-top: 1px solid var(--theme-matrix-dim);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
}

.footer-content {
  text-align: center;
}

.footer-info {
  margin-bottom: var(--spacing-md);
}

.footer-text {
  font-size: 1.1rem;
  color: var(--theme-text);
}

.footer-description {
  color: var(--theme-text-subtle);
  font-size: 0.95rem;
}

.footer-navigation {
  margin: var(--spacing-md) 0;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-nav-link {
  color: var(--theme-matrix-green);
}

.footer-credits {
  font-size: 0.85rem;
  color: var(--theme-text-subtle);
  margin-top: var(--spacing-md);
}

.footer-credits .separator {
  margin: 0 0.5rem;
}

/* --- 22. Error Page --- */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-content {
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  padding: var(--spacing-xl);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--theme-glow-green-subtle);
}

.error-code {
  font-size: 6rem;
  color: var(--theme-matrix-green);
  text-shadow: 0 0 30px var(--theme-glow-green-strong);
  margin-bottom: var(--spacing-sm);
}

.error-message {
  font-size: 1.5rem;
  color: var(--theme-text-bright);
  margin-bottom: var(--spacing-sm);
}

.error-description {
  color: var(--theme-text);
  margin-bottom: var(--spacing-lg);
}

/* --- 23. No Posts --- */
.no-posts {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--theme-content-bg);
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
}

/* --- 24. Scrollbars --- */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--theme-bg);
  border-left: 1px solid var(--theme-matrix-dim);
}

::-webkit-scrollbar-thumb {
  background: var(--theme-matrix-green);
  border-radius: 6px;
  box-shadow: 0 0 5px var(--theme-glow-green-subtle);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-text-bright);
  box-shadow: 0 0 8px var(--theme-glow-green);
}

/* --- 25. Responsive Design --- */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .hero-title,
  .post-title,
  .page-title,
  .tag-title,
  .author-title {
    font-size: 2rem;
  }

  .author-info {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .post-title,
  .page-title {
    font-size: 1.5rem;
  }
}

/* --- 26. Koenig Editor Styles --- */

/* Ghost Editor Image Widths */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  transform: translateX(calc(50vw - 50%));
}

.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Koenig Gallery */
.kg-gallery-container {
  display: flex;
  flex-direction: column;
  margin: var(--spacing-md) 0;
  max-width: 100%;
}

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.kg-gallery-image img {
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--theme-matrix-dim);
}

.kg-gallery-row:not(:first-of-type) {
  margin: 0.75rem 0 0;
}

.kg-gallery-image:not(:first-of-type) {
  margin: 0 0 0 0.75rem;
}

/* Koenig Cards */
.kg-card {
  margin: var(--spacing-md) 0;
}

.kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  overflow: hidden;
}

.kg-bookmark-card {
  width: 100%;
  border: 1px solid var(--theme-matrix-dim);
  border-radius: 4px;
  overflow: hidden;
  background: var(--theme-content-bg);
  transition: all 0.3s ease;
}

.kg-bookmark-card:hover {
  border-color: var(--theme-matrix-green);
  box-shadow: 0 0 15px var(--theme-glow-green-subtle);
}

.kg-bookmark-container {
  display: flex;
  color: var(--theme-text);
  text-decoration: none;
  min-height: 148px;
}

.kg-bookmark-content {
  flex-grow: 1;
  padding: var(--spacing-md);
}

.kg-bookmark-title {
  color: var(--theme-matrix-green);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.4;
}

.kg-bookmark-description {
  color: var(--theme-text);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  max-height: 48px;
  overflow: hidden;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  margin-top: 0.8rem;
  color: var(--theme-text-subtle);
  font-size: 0.85rem;
}

.kg-bookmark-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.kg-bookmark-thumbnail {
  position: relative;
  min-width: 33%;
  max-height: 100%;
}

.kg-bookmark-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- 27. Responsive Styles --- */
@media (max-width: 1024px) {
  /* Stack homepage grid on tablets */
  .homepage-top-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .next-posts-sidebar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
  }

  .next-post-compact {
    flex-direction: column;
  }

  .next-post-thumb {
    width: 100%;
    height: 150px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Mobile: single column */
  .homepage-top-grid,
  .next-posts-sidebar,
  .featured-grid,
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .latest-post-hero {
    min-height: auto;
  }

  .latest-post-image {
    height: 250px;
  }

  .next-post-compact {
    flex-direction: row;
  }

  .next-post-thumb {
    width: 100px;
    height: 100px;
  }

  .site-header .container {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .site-navigation {
    width: 100%;
  }

  .nav-list {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .hero-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  /* Small mobile */
  .next-post-compact {
    flex-direction: column;
  }

  .next-post-thumb {
    width: 100%;
    height: 150px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .featured-badge {
    font-size: 1.5rem;
  }
}

/* --- 28. Ghost Portal & Subscribe CTA --- */

/* Subscribe button in navigation - Call To Action */
.nav-subscribe {
  background: var(--theme-matrix-green) !important;
  color: #000 !important;
  font-weight: 700;
  padding: 0.6rem 1.2rem !important;
  border-radius: 4px;
  box-shadow: 0 0 15px var(--theme-glow-green);
  animation: pulse-glow 2s ease-in-out infinite;
}

.nav-subscribe:hover {
  background: var(--theme-text-bright) !important;
  color: #000 !important;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  text-shadow: none !important;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 15px var(--theme-glow-green);
  }
  50% {
    box-shadow: 0 0 25px var(--theme-glow-green-strong);
  }
}

/* Sign in button */
.nav-signin {
  border: 1px solid var(--theme-matrix-dim);
}

.nav-signin:hover {
  border-color: var(--theme-matrix-green);
}

/* --- 29. Floating Subscribe Button --- */
.floating-subscribe {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1000;
  background: var(--theme-matrix-green);
  color: #000;
  padding: 1rem 1.5rem;
  border-radius: 32px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 255, 65, 0.6);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: float-bounce 3s ease-in-out infinite;
}

.floating-subscribe:hover {
  background: var(--theme-text-bright);
  color: #000;
  box-shadow: 0 6px 30px rgba(255, 255, 255, 0.8);
  transform: translateY(-3px) scale(1.05);
  text-shadow: none;
}

@keyframes float-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.floating-subscribe-icon {
  font-size: 1.2rem;
  animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

/* --- 30. Subscribe Form Section --- */
.subscribe-section {
  background: var(--theme-content-bg);
  border: 2px solid var(--theme-matrix-green);
  border-radius: 8px;
  padding: var(--spacing-xl);
  margin: var(--spacing-xl) 0;
  box-shadow:
    0 5px 30px rgba(0, 255, 65, 0.3),
    inset 0 2px 0 var(--theme-glow-green-subtle);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.subscribe-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(0, 255, 65, 0.05),
    transparent
  );
  animation: scan-diagonal 10s linear infinite;
}

@keyframes scan-diagonal {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.subscribe-title {
  font-size: 2rem;
  color: var(--theme-matrix-green);
  text-shadow: 0 0 15px var(--theme-glow-green-strong);
  margin-bottom: var(--spacing-sm);
  position: relative;
  z-index: 1;
}

.subscribe-description {
  font-size: 1.1rem;
  color: var(--theme-text);
  margin-bottom: var(--spacing-lg);
  position: relative;
  z-index: 1;
}

.subscribe-form {
  display: flex;
  gap: var(--spacing-sm);
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.subscribe-email {
  flex: 1;
  background: var(--theme-bg);
  border: 2px solid var(--theme-matrix-dim);
  color: var(--theme-text);
  padding: 0.8rem 1.2rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.subscribe-email:focus {
  outline: none;
  border-color: var(--theme-matrix-green);
  box-shadow: 0 0 15px var(--theme-glow-green-subtle);
  background: rgba(0, 255, 65, 0.05);
}

.subscribe-email::placeholder {
  color: var(--theme-text-subtle);
}

.subscribe-button {
  background: var(--theme-matrix-green);
  color: #000;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px var(--theme-glow-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.subscribe-button:hover {
  background: var(--theme-text-bright);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .floating-subscribe {
    bottom: 20px;
    right: 20px;
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
  }

  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-button {
    width: 100%;
  }
}

/* --- 31. Hide Default Ghost Portal Button --- */
/* Ukryj domyślny czarny przycisk Subscribe z Ghost Portal */
.gh-portal-triggerbtn-iframe,
iframe[title="portal-trigger"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* --- 32. Ghost Portal Styling (Matrix Theme) --- */
/* Stylizacja Portal popup w stylu Matrix */

/* Portal backdrop/overlay */
.gh-portal-backdrop {
  background: rgba(0, 0, 0, 0.9) !important;
}

/* Main portal container */
.gh-portal-popup-wrapper,
.gh-portal-popup-container {
  background: var(--theme-content-bg, #1a1a1a) !important;
  border: 2px solid var(--theme-matrix-green, #00FF41) !important;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.5) !important;
}

/* Portal header */
.gh-portal-header {
  background: var(--theme-bg, #0a0a0a) !important;
  border-bottom: 1px solid var(--theme-matrix-green, #00FF41) !important;
}

/* Portal titles */
.gh-portal-main-title,
.gh-portal-signup-title,
.gh-portal-signin-title {
  color: var(--theme-matrix-green, #00FF41) !important;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.6) !important;
  font-family: 'Courier New', monospace !important;
}

/* Portal text */
.gh-portal-text,
.gh-portal-content p,
.gh-portal-input-label {
  color: var(--theme-text, #e0e0e0) !important;
  font-family: 'Courier New', monospace !important;
}

/* Portal inputs */
.gh-portal-input,
.gh-portal-input-field {
  background: var(--theme-bg, #0a0a0a) !important;
  border: 2px solid var(--theme-matrix-dim, #00AA00) !important;
  color: var(--theme-text, #e0e0e0) !important;
  font-family: 'Courier New', monospace !important;
}

.gh-portal-input:focus,
.gh-portal-input-field:focus {
  border-color: var(--theme-matrix-green, #00FF41) !important;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3) !important;
  background: rgba(0, 255, 65, 0.05) !important;
}

/* Portal buttons */
.gh-portal-btn,
.gh-portal-btn-primary {
  background: var(--theme-matrix-green, #00FF41) !important;
  color: #000 !important;
  font-family: 'Courier New', monospace !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.6) !important;
  text-transform: uppercase !important;
}

.gh-portal-btn:hover,
.gh-portal-btn-primary:hover {
  background: var(--theme-text-bright, #ffffff) !important;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8) !important;
  transform: translateY(-2px) !important;
}

/* Secondary buttons */
.gh-portal-btn-secondary,
.gh-portal-btn-text {
  color: var(--theme-matrix-green, #00FF41) !important;
  border-color: var(--theme-matrix-green, #00FF41) !important;
  font-family: 'Courier New', monospace !important;
}

/* Links */
.gh-portal-link,
.gh-portal-signin-link,
.gh-portal-signup-link {
  color: var(--theme-matrix-green, #00FF41) !important;
  font-family: 'Courier New', monospace !important;
}

.gh-portal-link:hover {
  text-decoration: underline !important;
}

/* Close button */
.gh-portal-closeicon,
.gh-portal-close-icon {
  color: var(--theme-matrix-green, #00FF41) !important;
}

.gh-portal-closeicon:hover {
  color: var(--theme-text-bright, #ffffff) !important;
}

/* Success message */
.gh-portal-notification,
.gh-portal-notification-text {
  background: var(--theme-content-bg, #1a1a1a) !important;
  border: 2px solid var(--theme-matrix-green, #00FF41) !important;
  color: var(--theme-text, #e0e0e0) !important;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.4) !important;
}

/* Loading spinner */
.gh-portal-spinner,
.gh-portal-loadingicon {
  border-color: var(--theme-matrix-green, #00FF41) !important;
  border-top-color: transparent !important;
}

/* Portal footer */
.gh-portal-footer {
  border-top: 1px solid var(--theme-matrix-dim, #00AA00) !important;
  background: var(--theme-bg, #0a0a0a) !important;
}

/* Powered by Ghost */
.gh-portal-powered {
  color: var(--theme-text-subtle, #888888) !important;
}

/* --- 33. Print Styles --- */
@media print {
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .terminal-scanline,
  .site-header,
  .site-footer,
  .site-navigation,
  .floating-subscribe,
  .subscribe-section {
    display: none;
  }
}

/* ============================================ */
/* Koniec motywu Matrix Green Terminal */
/* ============================================ */
