/* Blog Styles - Synthwave Theme */
@view-transition {
  navigation: auto;
}

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Helvetica', 'Arial', sans-serif;
  min-height: 100vh;
}

.blog-container {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a1a 100%);
  position: relative;
}

.blog-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 81, 200, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.blog-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid rgba(255, 81, 200, 0.2);
}

.blog-header h1 {
  margin: 0;
  font-size: 32pt;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff51c8;
  text-shadow: 0 0 20px rgba(255, 81, 200, 0.5);
}

.blog-subhead {
  margin: 0.5rem 0 0;
  color: #b0b0b0;
  font-size: 11pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-link {
  text-decoration: none;
  font-weight: 600;
  color: #ff51c8;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10pt;
}

.back-link:hover {
  color: #ff7dd4;
  text-shadow: 0 0 10px rgba(255, 81, 200, 0.8);
  transform: translateX(-4px);
}

.blog-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
  min-height: 200px;
}

.blog-card {
  background: rgba(20, 10, 30, 0.8);
  border: 1px solid rgba(255, 81, 200, 0.3);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  cursor: pointer;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 81, 200, 0.1) 0%, rgba(0, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.blog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 81, 200, 0.6);
  box-shadow: 
    0 8px 32px rgba(255, 81, 200, 0.3),
    0 0 40px rgba(255, 81, 200, 0.1);
}

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

.blog-card img,
.blog-card > div:first-child {
  flex-shrink: 0;
}

.blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: brightness(0.8) contrast(1.1);
  transition: filter 0.4s;
}

.blog-card:hover img {
  filter: brightness(1) contrast(1.2);
}

.card-content {
  padding: 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.card-content h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: #ff51c8;
  text-shadow: 0 0 10px rgba(255, 81, 200, 0.3);
  line-height: 1.3;
}

.excerpt {
  color: #b0b0b0;
  margin-bottom: 1rem;
  line-height: 1.6;
  flex: 1;
}

.card-content time {
  display: block;
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.read-more {
  color: #00ffff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  transition: all 0.3s;
  display: inline-block;
  flex-shrink: 0;
  margin-top: auto;
}

.read-more:hover {
  color: #ff51c8;
  text-shadow: 0 0 10px rgba(255, 81, 200, 0.8);
  transform: translateX(4px);
}

/* Artikel-Seite: Scroll muss bis zum Ende funktionieren */
.blog-article-page,
.blog-article-page html {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100%;
}

.article-container {
  view-transition-name: article-morph;
}

.article-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  background: rgba(20, 10, 30, 0.6);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 81, 200, 0.2);
  border-right: 1px solid rgba(255, 81, 200, 0.2);
  min-height: 100vh;
  box-sizing: border-box;
}

.article-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 81, 200, 0.2);
}

.article-header-image {
  width: 200px;
  min-width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 81, 200, 0.3);
  box-shadow: 0 8px 32px rgba(255, 81, 200, 0.2);
  flex-shrink: 0;
}

.article-header-text {
  flex: 1;
  min-width: 0;
}

.article-header-text h1 {
  margin: 0 0 0.5rem;
}

@media (max-width: 640px) {
  .article-header {
    flex-direction: column;
  }
  .article-header-image {
    width: 100%;
    min-width: 100%;
    height: 200px;
  }
}

.article-container h1 {
  color: #ff51c8;
  font-size: 2.5rem;
  text-shadow: 0 0 20px rgba(255, 81, 200, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.article-author {
  color: #00ffff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.article-meta-sep {
  color: rgba(255, 81, 200, 0.7);
  font-weight: 300;
}

.article-container time {
  color: #888;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.article-body {
  line-height: 1.9;
  font-size: 1.1rem;
  color: #e0e0e0;
}

.article-body h2 {
  color: #ff51c8;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(255, 81, 200, 0.3);
}

.article-body h3 {
  color: #00ffff;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body a {
  color: #00ffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  transition: all 0.3s;
}

.article-body a:hover {
  color: #ff51c8;
  border-bottom-color: rgba(255, 81, 200, 0.6);
  text-shadow: 0 0 8px rgba(255, 81, 200, 0.5);
}

.article-body code {
  background: rgba(255, 81, 200, 0.1);
  color: #ff7dd4;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  border: 1px solid rgba(255, 81, 200, 0.2);
}

.article-body pre {
  background: rgba(10, 10, 20, 0.8);
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 81, 200, 0.3);
  box-shadow: 0 4px 16px rgba(255, 81, 200, 0.1);
  margin: 1.5rem 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.code-block-header {
  background: rgba(255, 81, 200, 0.1);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 81, 200, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s;
  flex-shrink: 0;
}

.code-block-header:hover {
  background: rgba(255, 81, 200, 0.15);
}

.code-block-header.collapsed {
  border-bottom: none;
}

.code-block-title {
  color: #ff51c8;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.code-block-description {
  color: #00ffff;
  text-transform: none;
  font-weight: 500;
}

.code-block-separator {
  color: rgba(255, 81, 200, 0.5);
  margin: 0 0.5rem;
}

.code-block-toggle {
  color: #00ffff;
  font-size: 1.2rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  width: 24px;
  height: 24px;
  justify-content: center;
}

.code-block-header.collapsed .code-block-toggle {
  transform: rotate(-90deg);
}

.code-block-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  border-top: 1px solid rgba(255, 81, 200, 0.2);
}

.code-block-content.expanded {
  max-height: 5000px;
  opacity: 1;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in;
  border-top: 1px solid rgba(255, 81, 200, 0.2);
}

.code-block-content pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  background: transparent;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e0e0e0;
  display: block;
}

/* Fallback für Code-Blöcke ohne Header (wird per JS hinzugefügt) */
.article-body pre:not(.has-header) {
  padding: 1.5rem;
  overflow-x: auto;
}

.article-body blockquote {
  border-left: 3px solid #ff51c8;
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: #b0b0b0;
  font-style: italic;
}

.article-body ul,
.article-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.share-buttons {
  margin-top: 4rem;
  padding: 2rem 0 2rem;
  border-top: 1px solid rgba(255, 81, 200, 0.2);
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #ff51c8 0%, #00ffff 100%);
  color: #0a0a0a;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(255, 81, 200, 0.3);
  cursor: pointer;
  font-family: inherit;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 81, 200, 0.5);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  background: rgba(20, 10, 30, 0.6);
  border: 2px dashed rgba(255, 81, 200, 0.3);
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.empty-state h2 {
  color: #ff51c8;
  margin-bottom: 1rem;
}

.empty-state p {
  color: #b0b0b0;
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
    min-height: 0;
  }

  .blog-header {
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 1rem 1.5rem;
  }

  .blog-header h1 {
    font-size: 24pt;
  }

  .article-container {
    padding: 2rem 1rem;
  }

  .article-container h1 {
    font-size: 1.8rem;
  }
}

/* View Transition: Karte → Artikel (Chrome, Edge) */
@supports (view-transition-name: none) {
  ::view-transition-group(article-morph) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  ::view-transition-old(article-morph) {
    animation: view-transition-fade-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  ::view-transition-new(article-morph) {
    animation: view-transition-fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
}

@keyframes view-transition-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes view-transition-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Fallback-Transition (Firefox, ältere Browser): Karte expandiert zu Artikel */
.article-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #0a0a0a;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.article-transition-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.article-transition-overlay.closing {
  opacity: 0;
}

.article-transition-panel {
  position: absolute;
  overflow: hidden;
  background: rgba(20, 10, 30, 0.98);
  border: 1px solid rgba(255, 81, 200, 0.3);
  box-shadow: 0 0 60px rgba(255, 81, 200, 0.2);
  transition: left 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-transition-content {
  padding: 2rem;
  padding-bottom: 5rem;
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.article-transition-loading {
  color: #888;
  padding: 4rem;
  text-align: center;
}
