@import url('fonts.css');

:root {
    --bg-dark: #0a0f18; --surface: #161e2d; --primary: #6366f1;
    --primary-hover: #4f46e5; --accent: #38bdf8; --text-main: #f1f5f9;
    --text-muted: #94a3b8; --danger: #ef4444; --border: #2d3748; --radius: 12px;
}

@font-face { font-family: 'Inter'; font-display: swap; }
@font-face { font-family: 'Playfair Display'; font-display: swap; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark); color: var(--text-main);
    font-family: 'Inter', sans-serif; line-height: 1.6;
    background-image: radial-gradient(var(--border) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 900; line-height: 1.1; }

.header-main {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 5%; background: rgba(22, 30, 45, 0.9);
    backdrop-filter: blur(10px); border-bottom: 2px solid var(--primary);
    position: sticky; top: 0; z-index: 1000; min-height: 110px;
}

/* ZEIT-BOX */
.datetime-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 15px;
    text-align: center;
    min-width: 200px;
}

.logo-area img { width: 180px; height: 90px; object-fit: contain; }

.portal-container {
    display: grid; grid-template-columns: 1fr 320px;
    gap: 30px; max-width: 98%; margin: 40px auto; padding: 0 2%;
}

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; align-content: start; }

.post-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: 0.3s;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.post-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--border); }
.post-card-body { padding: 2rem; flex-grow: 1; }

.btn-primary { background: var(--primary); color: white; padding: 0.6rem 1.2rem; border-radius: 6px; text-decoration: none; font-weight: 700; display: inline-block; transition: 0.2s; }
.btn-primary:hover { background: var(--primary-hover); }

aside { align-self: start; }
.sticky-wrapper { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 20px; }

.card-panel { background: var(--surface); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--border); }

.footer-main { background: var(--surface); border-top: 1px solid var(--border); padding: 4rem 5% 2rem; margin-top: 60px; }
.footer-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: 0.2s; }
.footer-links a:hover { color: var(--text-main); }

.nav-container { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; list-style: none; gap: 1.5rem; }
.nav-links a { color: var(--text-main); text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }

.menu-toggle { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.menu-toggle span { width: 25px; height: 3px; background: var(--text-main); border-radius: 3px; }

@media (max-width: 1100px) { 
    .portal-container { grid-template-columns: 1fr; } 
    .datetime-box { display: none; } /* Platz sparen auf kleinen Geräten */
}

@media (max-width: 900px) {
    .menu-toggle { display: flex; }
    .nav-links { position: fixed; top: 0; right: -100%; width: 280px; height: 100vh; background: var(--surface); flex-direction: column; padding: 80px 40px; transition: 0.4s; box-shadow: -10px 0 30px rgba(0,0,0,0.5); }
    .nav-links.active { right: 0; }
}

/* Tabellen-Styles für Editor */
.read-content table { width: 100%; border-collapse: collapse; margin: 25px 0; border: 1px solid var(--border); }
.read-content td, .read-content th { border: 1px solid var(--border); padding: 12px; text-align: left; }
.read-content th { background: rgba(99, 102, 241, 0.1); color: var(--accent); }

/* Back to Top */
/* Basis-Setup für den Button */
#backToTop {
  position: fixed;
  bottom: 40px; /* Ein Stück höher, um nicht im Footer zu "verschwinden" */
  right: 40px;
  width: 55px; /* Etwas größer für bessere Erkennbarkeit */
  height: 55px;
  background: transparent; /* Neon-Effekt braucht Transparenz */
  color: #00ffcc; /* Neon-Akzentfarbe */
  border: 2px solid #00ffcc; /* Neon-Akzent-Border */
  border-radius: 50%; /* Kreisrund */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Der Neon-Glow-Effekt */
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.5), /* Erster, weicher Glow */
              0 0 5px rgba(0, 255, 204, 0.3);   /* Zweiter, innerer Glow */
  opacity: 0; /* Standardmäßig unsichtbar */
  visibility: hidden;
  z-index: 1000;
  outline: none; /* Verhindert Standard-Fokus-Rahmen */
}

/* Stil für das Icon (Pfeil) */
#backToTop svg {
  width: 26px;
  height: 26px;
  transition: transform 0.3s ease;
}

/* Neon-Glow beim Hover-Effekt */
#backToTop:hover {
  background: rgba(0, 255, 204, 0.1); /* Hauch von Farbe beim Hover */
  border-color: #00ffcc;
  /* Starker, leuchtender Glow beim Hover */
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.9), /* Starker Glow */
              0 0 10px rgba(0, 255, 204, 0.6);  /* Hellerer innerer Glow */
}

/* Icon-Glow beim Hover */
#backToTop:hover svg {
  filter: drop-shadow(0 0 3px rgba(0, 255, 204, 0.8));
}

/* Stil für den Fokus-Status (Tastaturnavigation) */
#backToTop:focus {
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
}

/* Sichtbar-Status (wird per JS gesteuert) */
#backToTop.show {
  opacity: 1;
  visibility: visible;
}

/* Responsivität: Etwas kleiner auf Mobilgeräten */
@media (max-width: 600px) {
  #backToTop {
    bottom: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
  }
  #backToTop svg {
    width: 22px;
    height: 22px;
  }
}