/* ROCCODROM CUSTOM CSS - RESTORED VAIO-RETRO FINAL MASTER
   Stil: Zentriert, Grün, Ruhige Metadaten, Mobil-Optimiert
   Inklusive: Gallery, Lightbox, Smartphone-Image-Fix
*/

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --accent: #2ecc71;
    --text: #c9d1d9;
    --text-muted: #6e7681;
    --link: #58a6ff;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body {
    background-color: var(--bg); color: var(--text);
    font-family: var(--font-main); margin: 0; padding: 0;
    line-height: 1.5; letter-spacing: -0.01em;
}

header, main, footer {
    max-width: 800px; margin: 0 auto; padding: 1rem 1.5rem; box-sizing: border-box;
}

/* Header & Titel (Zentriert laut Wunsch 08.02.26) */
header { text-align: center; padding: 4rem 1rem 2rem 1rem; }
header h1 {
    font-family: var(--font-mono); color: var(--accent);
    font-size: 1.8rem; text-transform: lowercase; margin: 0;
}
header h1::before { content: "> "; opacity: 0.5; }

/* Navigation */
nav { margin-top: 1.5rem; font-family: var(--font-mono); font-size: 0.8rem; }
nav a { color: var(--accent); text-decoration: none; margin: 0 10px; opacity: 0.7; }
nav a:hover { opacity: 1; text-decoration: underline; }

/* Kompakte Suche */
.search-container { display: flex; justify-content: center; }
#search-input, #media-search, #type-filter {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--accent); font-family: var(--font-mono);
    padding: 10px; margin: 1.5rem auto; width: 100%; max-width: 320px;
    border-radius: 6px; outline: none; display: block;
}

/* Index-Liste & Metadaten (Broad on Portrait Phones) */
#index-list { list-style: none; padding: 0; margin: 0; width: 100%; }
.post-item, .post-meta {
    display: flex; align-items: baseline; padding: 0.7rem 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5); gap: 15px;
}
.post-date, .post-meta {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); min-width: 85px;
}
.post-item a { color: var(--link); text-decoration: none; font-weight: 500; flex-grow: 1; }
.tag-link { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); text-decoration: none; }
.tag-link:hover { color: var(--accent); }

/* --- DOKUMENT-OPTIK (Präziser Bild & Unterschrift Fix) --- */
main p {
    text-align: left; /* Normaler Text bleibt linksbündig */
    margin: 1rem 0;
}

main figure {
    width: 100%;
    max-width: 100%;
    margin: 2.5rem 0; /* Mehr Abstand für Bilder vom Text */
    padding: 0;
    text-align: center; /* NUR Bilder und Captions zentrieren */
}

main img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 0.7rem auto; /* Zentriert das Bild im Container */
    border-radius: 4px;
    border: 1px solid var(--border);
    box-sizing: border-box;
    cursor: zoom-in;
}

main figcaption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 0.5rem;
    display: block;
    text-align: center; /* Sicherstellen, dass Text unter dem Bild bleibt */
}

/* --- NEU: GALLERY DARSTELLUNG (Pandoc) --- */
.gallery {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px; margin: 2rem 0;
}
.gallery img {
    margin: 0 !important; width: 100%; height: 160px;
    object-fit: cover; border: 1px solid var(--border);
}

/* Mediathek Grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.media-preview { aspect-ratio: 16/9; background: #000; position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.media-info { padding: 10px; font-family: var(--font-mono); font-size: 0.75rem; }
.folder-tag { color: var(--accent); font-size: 0.65rem; display: block; }
.backlinks { margin-top: 5px; font-size: 0.65rem; color: var(--text-muted); }
.backlinks a { color: var(--accent); text-decoration: none; margin-right: 5px; }

/* Player & Modals (Lightbox & Video kombiniert) */
.sticky-player { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--surface); border-top: 2px solid var(--accent); padding: 12px; z-index: 1000; }
.player-controls { max-width: 800px; margin: 0 auto; display: flex; align-items: center; gap: 15px; }
#main-audio { flex-grow: 1; height: 30px; filter: invert(1) hue-rotate(90deg) brightness(1.5); }

.modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); display: none; align-items: center; 
    justify-content: center; z-index: 2000; padding: 20px;
}
.modal-content img, .modal-content video { 
    max-width: 100%; max-height: 90vh; border: 1px solid var(--accent); 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
}

/* Footer */
footer { margin-top: 5rem; padding: 3rem 1rem; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 0.75rem; }
.portrait { width: 60px; height: 60px; filter: grayscale(1) opacity(0.5); border-radius: 4px; margin-bottom: 1rem; }

/* --- MOBILE OPTIMIERUNG --- */
@media (max-width: 600px) {
    header { padding: 2rem 1rem 1rem 1rem; }
    header h1 { font-size: 1.4rem; }
    main { padding: 0.5rem 1rem; }
    .post-item { flex-direction: column; gap: 2px; padding: 1rem 0; }
    .post-date { min-width: auto; opacity: 0.6; }
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gallery { grid-template-columns: repeat(2, 1fr); gap: 5px; }
    body { padding-bottom: 100px; } /* Platz für Player */
}
