@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; }

/* FIX FÜR RECHTS-WISCHEN */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

* { 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;
}

.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; z-index: 1100; }
.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; }
}

@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); 
        visibility: hidden; /* FIX: Versteckt es vor dem Browser-Scroll */
        z-index: 1050;
    }
    .nav-links.active { 
        right: 0; 
        visibility: visible; /* FIX: Macht es beim Öffnen wieder berechenbar */
    }
}

.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); }

#backToTop {
  position: fixed; bottom: 40px; right: 40px; width: 55px; height: 55px;
  background: transparent; color: #00ffcc; border: 2px solid #00ffcc; 
  border-radius: 50%; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.5), 0 0 5px rgba(0, 255, 204, 0.3);
  opacity: 0; visibility: hidden; z-index: 1000; outline: none;
}
#backToTop svg { width: 26px; height: 26px; transition: transform 0.3s ease; }
#backToTop:hover { background: rgba(0, 255, 204, 0.1); border-color: #00ffcc; box-shadow: 0 0 20px rgba(0, 255, 204, 0.9), 0 0 10px rgba(0, 255, 204, 0.6); }
#backToTop:hover svg { filter: drop-shadow(0 0 3px rgba(0, 255, 204, 0.8)); }
#backToTop:focus { border-color: #ffffff; box-shadow: 0 0 20px rgba(255, 255, 255, 0.9); }
#backToTop.show { opacity: 1; visibility: visible; }

@media (max-width: 600px) {
  #backToTop { bottom: 25px; right: 25px; width: 48px; height: 48px; }
  #backToTop svg { width: 22px; height: 22px; }
}

#cacheButton {
    background-color: #e63939; color: white; border: none; padding: 14px 28px;
    font-size: 12px; font-weight: bold; border-radius: 8px; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(230, 57, 57, 0.3);
}
#cacheButton:hover { background-color: #c1121f; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(230, 57, 57, 0.4); }
#cacheButton:active { transform: scale(0.98); }
#status { margin-top: 15px; font-size: 15px; font-weight: 500; min-height: 22px; }