/* ================================================================
   rss.css – Stile für rss_view.php  (Slider + Lightbox)
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --surface:   #111418;
  --border:    #1e2530;
  --accent:    #00d4ff;
  --accent2:   #0099bb;
  --text:      #e2e8f0;
  --muted:     #6b7a8d;
  --radius:    10px;
  --font-body: system-ui, sans-serif;
  --font-mono: ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  position: sticky;
  top: 0;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.logo-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

header h1 {
  font-family: var(--font-mono);
  font-size: .95rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .04em;
}
header h1 a {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .04em;
  text-decoration: none;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}
.header-right a { color: var(--accent); text-decoration: none; }

/* ── Layout ──────────────────────────────────────────────────── */
main { max-width: 960px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--accent); }
.back-link::before { content: '←'; }

.count-bar {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.count-bar span { color: var(--accent); }

/* ── Übersichts-Karten ───────────────────────────────────────── */
.feed-grid { display: grid; gap: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  transition: border-color .2s, transform .2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.card.has-image { grid-template-columns: 200px 1fr; }
@media (max-width: 600px) { .card.has-image { grid-template-columns: 1fr; } }

.card-image { overflow: hidden; aspect-ratio: 4/3; }
.card.has-image .card-image { aspect-ratio: unset; }
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s;
}
.card:hover .card-image img { transform: scale(1.04); }

.card-body {
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.card-meta {
  display: flex;
  gap: .75rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  transition: color .15s;
}
.card:hover .card-title { color: var(--accent); }
.card-excerpt {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cta {
  align-self: flex-start;
  margin-top: .2rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: gap .15s;
}
.card:hover .card-cta { gap: .6rem; }
.card-cta::after { content: '→'; }

/* ── Galerie-Slider ──────────────────────────────────────────── */

/* Fallback (kein JS): alle Bilder untereinander */
.gallery { margin: 1.5rem 0 2rem; }

.gallery-fallback {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gallery-fallback figure { margin: 0; }
.gallery-fallback img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

/* Sobald JS .gallery-slider-active setzt: Fallback ausblenden */
.gallery.gallery-slider-active .gallery-fallback { display: none; }

/* Slider-Hülle */
.gallery-slider {
  display: none;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
  user-select: none;
}
.gallery.gallery-slider-active .gallery-slider { display: block; }

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.gallery-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Pfeile */
.gallery-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background .2s, border-color .2s;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.gallery-btn:hover { background: rgba(0,212,255,.25); border-color: var(--accent); }
.gallery-btn:disabled { opacity: .25; cursor: default; }
.gallery-btn.prev { left: .75rem; }
.gallery-btn.next { right: .75rem; }

/* Punkte */
.gallery-dots {
  position: absolute;
  bottom: .65rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .4rem;
  z-index: 10;
}
.gallery-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none; cursor: pointer; padding: 0;
  transition: background .2s, transform .2s;
}
.gallery-dot.active { background: var(--accent); transform: scale(1.3); }

/* Zähler */
.gallery-counter {
  position: absolute;
  top: .65rem; right: .85rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: rgba(255,255,255,.7);
  background: rgba(0,0,0,.45);
  padding: .2rem .5rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 10;
}
.gallery-slider { cursor: grab; }
.gallery-slider.dragging { cursor: grabbing; }

/* ── Lightbox ────────────────────────────────────────────────── */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.lb-overlay.lb-visible {
  opacity: 1;
  pointer-events: auto;
}

.lb-wrap {
  position: relative;
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  transition: transform .2s ease;
  will-change: transform;
  cursor: zoom-in;
  border-radius: 4px;
}
.lb-img:active { cursor: grabbing; }

/* Gemeinsame Basis für alle Lightbox-Buttons */
.lb-btn {
  position: fixed;
  background: rgba(17,20,24,.75);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background .18s, border-color .18s, color .18s;
  font-family: var(--font-mono);
}
.lb-btn:hover { background: rgba(0,212,255,.2); border-color: var(--accent); color: var(--accent); }

.lb-close {
  top: 1rem; right: 1rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  z-index: 1001;
}

.lb-prev, .lb-next {
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 1.5rem;
  z-index: 1001;
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-prev:disabled, .lb-next:disabled { opacity: .2; cursor: default; }

.lb-counter {
  position: fixed;
  top: 1rem; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  background: rgba(17,20,24,.75);
  padding: .25rem .7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index: 1001;
}

/* Zoom-Leiste */
.lb-zoombar {
  position: fixed;
  bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(17,20,24,.8);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: .35rem .6rem;
  backdrop-filter: blur(8px);
  z-index: 1001;
}
.lb-zoom-out, .lb-zoom-in, .lb-zoom-reset {
  position: static;          /* überschreibt fixed aus .lb-btn */
  transform: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: .95rem;
}
.lb-zoom-reset {
  width: auto;
  padding: 0 .55rem;
  border-radius: 12px;
  font-size: .72rem;
}
.lb-zoom-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  min-width: 3.5rem;
  text-align: center;
}

/* Hinweis für Screenreader: Lightbox schließen mit Escape */
.lb-overlay:focus-visible { outline: 2px solid var(--accent); }

/* ── Artikel-Ansicht ─────────────────────────────────────────── */
.article-meta {
  font-family: var(--font-mono);
  font-size: .73rem;
  color: var(--muted);
  margin-bottom: .75rem;
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.article-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2rem;
}

/* ── Prose ───────────────────────────────────────────────────── */
.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #cdd5e0;
  max-width: 720px;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 { color: var(--text); font-weight: 600; margin: 2rem 0 .75rem; line-height: 1.35; }
.article-content h1 { font-size: 1.6rem; }
.article-content h2 { font-size: 1.35rem; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.article-content h3 { font-size: 1.15rem; }
.article-content p  { margin-bottom: 1.2rem; }
.article-content a  { color: var(--accent); text-decoration-color: var(--accent2); }
.article-content a:hover { text-decoration: underline; }
.article-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1.25rem 0;
  display: block;
}
.article-content figure { margin: 1.5rem 0; }
.article-content figcaption { font-size: .8rem; color: var(--muted); margin-top: .4rem; font-style: italic; }
.article-content ul,
.article-content ol { margin: 1rem 0 1rem 1.4rem; }
.article-content li { margin-bottom: .4rem; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: .6rem 1.2rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
  background: var(--surface);
  border-radius: 0 6px 6px 0;
}
.article-content pre,
.article-content code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.article-content pre { padding: 1rem 1.25rem; overflow-x: auto; margin: 1.25rem 0; }
.article-content code { padding: .15em .4em; }
.article-content pre code { background: none; border: none; padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
.article-content th,
.article-content td { padding: .55rem .85rem; border: 1px solid var(--border); text-align: left; }
.article-content th { background: var(--surface); color: var(--text); font-weight: 600; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── Leer-State ──────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .875rem;
}
.empty strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: .5rem; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }
