/* ============================================================
   B-Jay.de – Frontend CSS
   ============================================================ */

:root {
  --brand:       #01334b;
  --brand-mid:   #024d72;
  --brand-light: #0a6999;
  --bg:          #111518;
  --bg2:         #181d21;
  --bg3:         #1f262c;
  --bg4:         #252d34;
  --border:      #2a333b;
  --border2:     #334050;
  --text:        #e2e8ed;
  --muted:       #7a8d9a;
  --muted2:      #556070;
  --link:        #3d9fd4;
  --code-bg:     #0e1317;
  --accent-hl:   #0a6999;
  --max:         1080px;
  --radius:      10px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  line-height: 1.75;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: #7cc8f0; }

/* ── Header ── */
header { background: #0b0f12; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-bar { height: 4px; background: linear-gradient(90deg, var(--brand) 0%, var(--accent-hl) 50%, var(--brand) 100%); }
.nav-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.5rem; gap: 1.5rem; }

.site-logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.logo-mark { width: 36px; height: 36px; background: var(--brand); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; color: white; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,0.07), 0 4px 12px rgba(1,51,75,0.5); }
.logo-name { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.logo-sub  { font-size: 0.7rem; color: var(--muted); font-weight: 500; }

.nav-right { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }

.nav-ch-btn { display: flex; align-items: center; gap: 0.4rem; background: var(--bg3); border: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; font-weight: 600; padding: 0.35rem 0.75rem; border-radius: 6px; cursor: pointer; transition: all 0.15s; text-decoration: none; font-family: 'DM Sans', sans-serif; }
.nav-ch-btn:hover { border-color: var(--brand-light); color: var(--text); background: var(--bg4); }
.yt-dot { width: 8px; height: 8px; border-radius: 50%; background: #cc2222; flex-shrink: 0; }

.nav-search { position: relative; }
.nav-search input { background: var(--bg3); border: 1px solid var(--border); color: var(--text); padding: 0.38rem 0.8rem 0.38rem 2rem; border-radius: 6px; font-size: 0.82rem; width: 150px; outline: none; transition: border-color 0.2s, width 0.3s; font-family: 'DM Sans', sans-serif; }
.nav-search input:focus { border-color: var(--brand-light); width: 220px; }
.nav-search::before { content: '⌕'; position: absolute; left: 0.55rem; top: 50%; transform: translateY(-50%); color: var(--muted2); font-size: 1rem; pointer-events: none; }

/* ── Page wrap ── */
.page-wrap { max-width: var(--max); margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── Page intro ── */
.page-intro { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-intro h1 { font-size: 1.5rem; font-weight: 700; }
.page-intro p  { font-size: 0.9rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Filter pills ── */
.filter-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-pill { padding: 0.32rem 0.9rem; border-radius: 100px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif; text-decoration: none; display: inline-block; }
.filter-pill:hover { border-color: var(--brand-light); color: var(--text); }
.filter-pill.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ── Video grid ── */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }

.video-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; }
.video-card:hover { border-color: var(--brand-light); transform: translateY(-3px); box-shadow: 0 8px 28px rgba(1,51,75,0.35); }
.video-card.wide { grid-column: span 2; }
.video-card.wide .v-play-btn { width: 58px; height: 58px; font-size: 1.4rem; }

.v-thumb { aspect-ratio: 16/9; position: relative; overflow: hidden; background: #0a1018; }
.v-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; opacity: 0.18; }
.tb1 { background: radial-gradient(ellipse at 30% 60%, #012a40, #040d14); }
.tb2 { background: radial-gradient(ellipse at 70% 40%, #011f35, #040a10); }
.tb3 { background: radial-gradient(ellipse at 40% 30%, #01253b, #060c12); }

.v-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(1,51,75,0); transition: background 0.2s; }
.video-card:hover .v-play { background: rgba(1,51,75,0.3); }
.v-play-btn { width: 46px; height: 46px; border-radius: 50%; background: #cc2020; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; opacity: 0; transform: scale(0.8); transition: opacity 0.2s, transform 0.2s; box-shadow: 0 3px 16px rgba(200,0,0,0.5); }
.video-card:hover .v-play-btn { opacity: 1; transform: scale(1); }

.v-cat { position: absolute; top: 8px; left: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 100px; }
.cat-howto { background: var(--brand); color: #a8d8f0; border: 1px solid var(--brand-light); }
.cat-test  { background: rgba(1,51,75,0.6); color: #7ac0e0; border: 1px solid #2a6080; }
.cat-news  { background: rgba(30,38,44,0.85); color: var(--muted); border: 1px solid var(--border2); }
.cat-default { background: rgba(30,38,44,0.85); color: var(--muted); border: 1px solid var(--border2); }

.v-ch { position: absolute; top: 8px; right: 8px; font-size: 0.64rem; font-weight: 600; background: rgba(0,0,0,0.65); color: #8ab5cc; padding: 2px 7px; border-radius: 100px; border: 1px solid rgba(255,255,255,0.07); display: flex; align-items: center; gap: 0.3rem; }
.v-ch::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #cc2020; }
.v-dur { position: absolute; bottom: 7px; right: 7px; font-family: 'DM Mono', monospace; font-size: 0.7rem; background: rgba(0,0,0,0.78); color: var(--text); padding: 1px 6px; border-radius: 4px; font-weight: 500; }

.v-body { padding: 0.95rem 1.1rem 1.1rem; }
.v-meta { font-size: 0.73rem; color: var(--muted2); margin-bottom: 0.35rem; }
.v-title { font-size: 0.96rem; font-weight: 700; line-height: 1.4; color: var(--text); margin-bottom: 0.5rem; transition: color 0.15s; }
.video-card:hover .v-title { color: #7cc8f0; }
.v-excerpt { font-size: 0.83rem; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.7rem; }

.v-footer { display: flex; align-items: center; gap: 0.6rem; }
.v-read { font-size: 0.78rem; font-weight: 700; color: var(--link); display: inline-flex; align-items: center; gap: 0.25rem; }
.v-read::after { content: '→'; transition: transform 0.15s; }
.video-card:hover .v-read::after { transform: translateX(3px); }
.v-material { font-size: 0.7rem; font-weight: 700; background: rgba(1,51,75,0.3); border: 1px solid var(--brand-mid); color: #5ab3d9; padding: 2px 8px; border-radius: 100px; }

/* ── Single post ── */
.single-wrap { max-width: 760px; }
.breadcrumb { font-size: 0.78rem; color: var(--muted2); margin-bottom: 1.4rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted2); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb .sep { opacity: 0.35; }

.s-cats { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.s-cat { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 10px; border-radius: 100px; }
.s-cat.tag-style { background: var(--bg3); border: 1px solid var(--border2); color: var(--muted); }

.s-title { font-size: 1.65rem; font-weight: 700; line-height: 1.3; color: var(--text); margin-bottom: 0.85rem; }
.s-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.8rem; color: var(--muted); padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.s-author { display: flex; align-items: center; gap: 0.4rem; }
.s-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); border: 1.5px solid var(--brand-mid); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; color: #a8d8f0; overflow: hidden; }
.s-avatar img { width: 100%; height: 100%; object-fit: cover; }
.s-ch-tag { font-size: 0.7rem; font-weight: 700; background: rgba(1,51,75,0.35); border: 1px solid var(--brand-mid); color: #5ab3d9; padding: 2px 8px; border-radius: 100px; display: flex; align-items: center; gap: 0.3rem; }
.s-ch-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #cc2020; }

/* Embed */
.embed-block { margin: 1.5rem 0 1.8rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border2); box-shadow: 0 4px 30px rgba(1,51,75,0.25); }
.embed-block iframe { display: block; width: 100%; aspect-ratio: 16/9; border: none; }

/* Post content */
.post-content { color: #ccd5dc; font-size: 0.96rem; line-height: 1.8; }
.post-content p { margin-bottom: 1rem; }
.post-content strong { color: var(--text); }
.post-content h2 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 2rem 0 0.7rem; padding-left: 0.85rem; border-left: 3px solid var(--brand-light); }
.post-content ul, .post-content ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.post-content li { margin-bottom: 0.3rem; }
.post-content blockquote { border-left: 3px solid var(--brand-mid); padding: 0.6rem 1rem; background: rgba(1,51,75,0.1); border-radius: 0 8px 8px 0; margin: 1rem 0; color: var(--muted); }

/* Info box */
.info-box { background: rgba(1,51,75,0.15); border: 1px solid rgba(1,51,75,0.5); border-left: 3px solid var(--brand-light); border-radius: 0 var(--radius) var(--radius) 0; padding: 0.8rem 1rem; font-size: 0.88rem; color: #a0bfcc; margin: 1rem 0; }
.info-box strong { color: #5ab3d9; }

/* Inline code */
code { background: var(--code-bg); border: 1px solid var(--border2); border-radius: 4px; padding: 1px 5px; font-family: 'DM Mono', monospace; font-size: 0.84em; color: #e8a060; }

/* Code blocks */
.code-wrap { position: relative; margin: 1rem 0; }
.code-header { display: flex; align-items: center; justify-content: space-between; background: var(--bg4); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; padding: 0.45rem 0.9rem; }
.code-lang-label { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.12em; }
.copy-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--muted); font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 5px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; }
.copy-btn:hover { border-color: var(--brand-light); color: #5ab3d9; }
.copy-btn.ok    { border-color: #3a8a50; color: #6fc98a; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 1.1rem; overflow-x: auto; font-family: 'DM Mono', monospace; font-size: 0.81rem; line-height: 1.75; color: #b8c8d5; }
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }

/* Link box */
.link-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 1.4rem 0; }
.link-box-head { background: linear-gradient(90deg, rgba(1,51,75,0.4) 0%, transparent 100%); border-bottom: 1px solid var(--border); padding: 0.55rem 1rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #5ab3d9; display: flex; align-items: center; gap: 0.4rem; }
.link-box-head::before { content: '🔗'; font-size: 0.85rem; }
.link-box ul { list-style: none; }
.link-box ul li { border-bottom: 1px solid var(--border); }
.link-box ul li:last-child { border-bottom: none; }
.link-box ul li a { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; color: var(--link); font-size: 0.88rem; transition: background 0.12s; }
.link-box ul li a:hover { background: rgba(1,51,75,0.2); color: #7cc8f0; text-decoration: none; }
.link-box ul li a::before { content: '↗'; font-size: 0.7rem; opacity: 0.6; flex-shrink: 0; }
.link-note { margin-left: auto; font-size: 0.7rem; color: var(--muted2); font-style: italic; }

/* Tags */
.post-tags { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.tags-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted2); font-weight: 700; margin-bottom: 0.6rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { background: var(--bg3); border: 1px solid var(--border); color: var(--muted); font-size: 0.75rem; padding: 3px 10px; border-radius: 100px; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.tag:hover { border-color: var(--brand-light); color: #5ab3d9; text-decoration: none; }

/* Aff notice */
.aff-note { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.77rem; color: var(--muted2); margin-top: 1.5rem; font-style: italic; }

/* Post nav */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pn-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; cursor: pointer; transition: border-color 0.18s, background 0.18s; text-decoration: none; display: block; }
.pn-item:hover { border-color: var(--brand-light); background: rgba(1,51,75,0.1); text-decoration: none; }
.pn-item.right { text-align: right; }
.pn-dir   { font-size: 0.68rem; color: var(--muted2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.pn-title { color: var(--text); font-weight: 600; font-size: 0.86rem; line-height: 1.4; }

/* Author box */
.author-box { background: linear-gradient(135deg, rgba(1,51,75,0.2) 0%, var(--bg2) 100%); border: 1px solid var(--border2); border-radius: 12px; padding: 1.1rem 1.3rem; display: flex; align-items: center; gap: 1.1rem; margin-top: 1.5rem; }
.a-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); border: 2px solid var(--brand-mid); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; color: #a8d8f0; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(1,51,75,0.2); }
.a-info h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.a-info p  { font-size: 0.8rem; color: var(--muted); }
.social-row { display: flex; gap: 0.4rem; margin-left: auto; flex-shrink: 0; }
.soc-btn { width: 32px; height: 32px; border-radius: 7px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; cursor: pointer; color: var(--muted); transition: border-color 0.15s, color 0.15s; text-decoration: none; }
.soc-btn:hover { border-color: var(--brand-light); color: #5ab3d9; text-decoration: none; }

/* Pagination */
.pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.page-btn { padding: 0.4rem 0.85rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg2); color: var(--muted); font-size: 0.82rem; font-weight: 600; transition: all 0.15s; }
.page-btn:hover, .page-btn.active { background: var(--brand); border-color: var(--brand); color: white; text-decoration: none; }

/* Flash messages */
.flash { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.88rem; font-weight: 600; }
.flash.ok  { background: rgba(60,140,80,0.15); border: 1px solid #3a8a50; color: #6fc98a; }
.flash.err { background: rgba(200,50,50,0.15); border: 1px solid #993333; color: #ff8888; }

/* Footer */
footer { background: #0b0f12; border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-bar { height: 3px; background: linear-gradient(90deg, var(--brand) 0%, var(--accent-hl) 100%); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer-logo { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; font-weight: 700; color: var(--text); text-decoration: none; }
.footer-logo-mark { width: 28px; height: 28px; background: var(--brand); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #a8d8f0; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.78rem; color: var(--muted2); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { font-size: 0.75rem; color: var(--muted2); }

/* No results */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-state h2 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text); }

/* Responsive */
@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .video-card.wide { grid-column: span 2; }
}

@media (max-width: 600px) {
  .video-grid { grid-template-columns: 1fr; }
  .video-card.wide { grid-column: span 1; }
  .post-nav { grid-template-columns: 1fr; }
  .nav-inner { flex-wrap: wrap; gap: 0.5rem; }
  .nav-search input { width: 120px; }
}

/* ============================================================
   Light Mode (Frontend)
   ============================================================ */
[data-theme="light"] {
  --brand:       #01334b;
  --brand-mid:   #024d72;
  --brand-light: #0a6999;
  --bg:          #f2f5f8;
  --bg2:         #ffffff;
  --bg3:         #e8eef3;
  --bg4:         #dde5ec;
  --border:      #c5d3dc;
  --border2:     #b0c0cc;
  --text:        #1a2530;
  --muted:       #55707f;
  --muted2:      #7a90a0;
  --link:        #0a6999;
  --code-bg:     #f0f4f8;
  --accent-hl:   #0a6999;
}

[data-theme="light"] header { background: #ffffff; border-bottom-color: var(--border); }
[data-theme="light"] .nav-ch-btn { background: #f2f5f8; color: #55707f; }
[data-theme="light"] .nav-ch-btn:hover { background: #e8eef3; color: var(--text); }
[data-theme="light"] .nav-search input { background: #f2f5f8; color: var(--text); border-color: var(--border); }
[data-theme="light"] .video-card { background: #ffffff; }
[data-theme="light"] .v-title { color: var(--text); }
[data-theme="light"] pre  { background: #f0f4f8; color: #1a2530; border-color: var(--border); }
[data-theme="light"] code { background: #e8eef3; color: #01334b; border-color: var(--border); }
[data-theme="light"] footer { background: #01334b; }
[data-theme="light"] footer .footer-copy,
[data-theme="light"] footer .footer-links a { color: rgba(255,255,255,0.65); }
[data-theme="light"] footer .footer-links a:hover { color: #fff; }
[data-theme="light"] footer .footer-logo { color: #fff; }
[data-theme="light"] .link-box { background: #f8fafc; }
[data-theme="light"] .info-box { background: rgba(1,51,75,0.06); color: var(--text); }

/* Theme toggle button (frontend) */
.nav-theme-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.nav-theme-btn:hover { border-color: var(--brand-light); color: var(--text); }

/* ── Logo als Bild (kein Text daneben) ── */
.logo-mark-img {
  width: auto;
  height: 40px;
  max-width: 160px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.logo-mark-img img {
  width: auto;
  height: 40px;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.footer-logo-mark-img {
  width: auto;
  height: 32px;
  max-width: 120px;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.footer-logo-mark-img img {
  width: auto;
  height: 32px;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

/* ── Header-Logo als Bild ───────────────────────────────────── */
.site-logo-img {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.header-logo-img {
  height: 40px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ── Footer-Logo als Bild ───────────────────────────────────── */
.footer-logo-img {
  height: 30px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  display: block;
}
