/*
Theme Name: Optimiert V2
Theme URI:
Author: Hii
Description: Dokumentations-Theme V2 — zweispaltig, Velvelyne Font
Version: 2.1
License: GNU General Public License v2 or later
Text Domain: optimiert-v2
*/

@font-face {
  font-family: 'Velvelyne';
  src: url('fonts/Velvelyne-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Velvelyne';
  src: url('fonts/Velvelyne-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Velvelyne';
  src: url('fonts/Velvelyne-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

:root {
  --bg: #0e0e0e;
  --text: #e8e4dc;
  --muted: #555;
  --hover-bg: #e8e4dc;
  --active-color: #e8e4dc;
  --visited-color: #3a3a3a;
  --sidebar-w: 380px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Velvelyne', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
}

/* ── OUTER WRAP ── */
.site-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── HEADER ── */
.site-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 6px;
}
.header-right { text-align: right; }

/* ── FILTER ── */
.filter-row {
  display: flex;
  margin-top: 36px;
  gap: 0;
}
.filter-label {
  font-size: 14px;
  padding: 4px 12px 4px 0;
  color: var(--muted);
  margin-right: 12px;
}
.filter-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  background: none;
  border: none;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--muted);
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--text);
  color: var(--bg);
}

/* ── ZWEI-SPALTEN ── */
.content-wrap {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0 48px;
  margin-top: 32px;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 40px;
}


.section-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 28px 0 8px;
}

/* ── LOG ENTRY (sidebar) ── */
.log-entry { }
.log-entry.is-child       { padding-left: 16px; }
.log-entry.is-child > .log-row .log-name { font-weight: 300; font-size: 15px; }
.log-entry.is-grandchild  { padding-left: 32px; }
.log-entry.is-grandchild > .log-row .log-name { font-weight: 300; font-size: 14px; color: #888; }

.log-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 6px 3px 0;
  cursor: pointer;
  user-select: none;
}
.log-row:hover { background: var(--hover-bg); }
.log-row:hover .log-name,
.log-row:hover .log-indicator { color: var(--bg); }

.log-indicator {
  flex-shrink: 0;
  width: 16px;
  color: var(--muted);
  font-size: 12px;
}
.log-name {
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}
.log-type {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 300;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 6px;
  letter-spacing: 0.04em;
}
.log-entry.is-active > .log-row .log-type { color: var(--bg); }
.log-row:hover .log-type { color: var(--bg); }

/* Aktiv */
.log-entry.is-active > .log-row .log-name {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text);
}
.log-entry.is-active > .log-row .log-indicator { color: var(--text); }

/* Besucht */
.log-entry.was-visited:not(.is-active) > .log-row .log-name {
  color: var(--visited-color);
}

/* ── CONTENT PANEL (rechts) ── */
.content-panel {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 40px;
}
.content-panel::-webkit-scrollbar { display: none; }

.content-empty {
  color: var(--muted);
  padding-top: 4px;
}

.content-block {
  display: none;
}
.content-block.is-visible {
  display: block;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.content-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}
.content-meta-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 4px;
}
.content-text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  margin-bottom: 24px;
  width: 100%;
}
.content-text p + p { margin-top: 10px; }
.content-text a { color: var(--text); text-decoration: none; }
.content-text a:hover { text-decoration: underline; }

/* ── GALERIE ── */
.gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 4px !important;
  margin: 10px 0 20px !important;
  width: 100% !important;
}
.gallery .gallery-item {
  width: auto !important; margin: 0 !important; padding: 0 !important;
  float: none !important; aspect-ratio: 3/2; overflow: hidden;
  background: #1a1a1a; cursor: pointer;
}
.gallery .gallery-item a { display: block !important; width: 100% !important; height: 100% !important; }
.gallery .gallery-item img {
  width: 100% !important; height: 100% !important;
  object-fit: cover !important; display: block !important;
  transition: opacity 0.15s;
}
.gallery .gallery-item:hover img { opacity: 0.8; }
.gallery-caption, .gallery .gallery-caption { display: none !important; }
.gallery-icon { height: 100%; display: block; }
br.clear { display: none; }

.wp-block-gallery { gap: 4px !important; }
.wp-block-gallery .wp-block-image { margin: 0 !important; cursor: pointer; }
.wp-block-gallery .wp-block-image img { transition: opacity 0.15s; }
.wp-block-gallery .wp-block-image:hover img { opacity: 0.8; }

/* ── VIDEO ── */
.video-block { margin-top: 12px; margin-bottom: 20px; background: #111; width: 100%; }
.video-block-inner { aspect-ratio: 16/9; width: 100%; }
.video-block-inner iframe { width: 100%; height: 100%; border: none; display: block; }

/* ── FOOTER ── */
.site-footer {
  flex-shrink: 0;
  padding: 10px 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  color: var(--muted);
  line-height: 1.4;
  font-size: 12px;
}
.site-footer div:last-child { text-align: right; }

/* ── LIGHTBOX ── */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.97); z-index: 9999;
  align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox > img { max-width: 92vw; max-height: 90vh; object-fit: contain; display: block; }
.lightbox-close {
  position: fixed; top: 20px; right: 28px;
  font-family: inherit; font-size: 28px;
  color: #777; cursor: pointer; background: none; border: none; z-index: 3;
}
.lightbox-close:hover { color: var(--text); }
.lightbox-prev, .lightbox-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  font-family: inherit; font-size: 36px;
  color: #777; background: none; border: none;
  cursor: pointer; padding: 24px; z-index: 3;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--text); }
.lightbox-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #555; letter-spacing: 0.1em; z-index: 3;
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .content-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
}
