/*
Theme Name: BIM me UP! Knowledge Graph
Theme URI: https://bim-me-up.com/
Author: Lejla
Description: Dark, technical knowledge-graph theme for BIM me UP!. The homepage shows the whole blog as an interactive graph (topics, tags and links between posts), every post shows its connected posts, plus bilingual (DE/EN) navigation, Jetpack subscriptions and comments.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bim-me-up
*/

:root {
  --radius: 0.5rem;
  --background: oklch(0.145 0.018 260);
  --foreground: oklch(0.93 0.01 250);
  --card: oklch(0.19 0.022 260 / 0.72);
  --popover: oklch(0.2 0.02 260);
  --primary: #00D2DD;
  --hover: #FB007E;
  --primary-foreground: oklch(0.15 0.02 260);
  --secondary: oklch(0.24 0.025 260);
  --muted: oklch(0.22 0.02 260);
  --muted-foreground: oklch(0.66 0.025 255);
  --border: oklch(0.42 0.03 255 / 0.35);
  --input: oklch(0.42 0.03 255 / 0.4);
  --destructive: oklch(0.65 0.2 25);
  --shadow-glow: 0 0 40px -8px color-mix(in oklab, var(--primary) 55%, transparent);
  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; background: var(--background); color: var(--foreground); }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; line-height: 1.5; }
::selection { background: color-mix(in oklab, var(--primary) 35%, transparent); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted-foreground); }
.glass { background: var(--card); backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--border); }
.grid-bg {
  background-image:
    linear-gradient(color-mix(in oklab, var(--foreground) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--foreground) 4%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
}
.kicker { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--primary); margin: 0 0 0.75rem; }

/* ---------- header ---------- */
.bmu-header { position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; }
@media (min-width: 768px) { .bmu-header { padding: 1rem 2rem; } }
.admin-bar .bmu-header { top: 32px; }
.bmu-logo { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 1.125rem; letter-spacing: 0.15em; }
.bmu-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: var(--shadow-glow); }
.bmu-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--primary); opacity: .4; animation: bmu-ping 1.6s cubic-bezier(0,0,.2,1) infinite; }
@keyframes bmu-ping { 75%, 100% { transform: scale(2); opacity: 0; } }
.bmu-nav { display: flex; align-items: center; gap: 0.5rem; position: relative; }
.bmu-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.bmu-link, .bmu-nav ul a { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); padding: 0.45rem 0.8rem; border-radius: 999px; transition: color .15s; }
.bmu-link:hover, .bmu-nav ul a:hover { background: var(--hover); color: #fff; }
.bmu-nav .current-menu-item a { color: var(--primary); }
.bmu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border-radius: 999px; padding: 0.45rem 0.9rem; font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; border: 1px solid var(--border); background: var(--card); backdrop-filter: blur(14px); transition: color .15s, box-shadow .15s; }
.bmu-btn:not(.bmu-btn--primary):hover { background: var(--hover); color: #fff; border-color: transparent; }
.bmu-btn--primary { background: var(--primary); color: var(--primary-foreground); border-color: transparent; border-radius: var(--radius); }
.bmu-btn--primary:hover { color: var(--primary-foreground); box-shadow: var(--shadow-glow); }
.bmu-btn svg { width: 14px; height: 14px; }
.bmu-lang { display: flex; padding: 2px; border-radius: 999px; }
.bmu-lang a, .bmu-lang button { display: inline-block; text-decoration: none; border: 0; background: transparent; cursor: pointer; padding: 0.35rem 0.75rem; border-radius: 999px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; color: var(--muted-foreground); }
.bmu-lang a:hover, .bmu-lang button:hover { background: var(--hover); color: #fff; }
.bmu-lang a.is-active, .bmu-lang button.is-active { background: var(--primary); color: var(--primary-foreground); }
.bmu-pop { position: absolute; right: 0; top: calc(100% + 0.5rem); width: 18rem; padding: 1rem; border-radius: var(--radius); background: var(--popover); border: 1px solid var(--border); box-shadow: 0 20px 50px -20px #000; }
.bmu-pop[hidden] { display: none; }

/* ---------- subscribe ---------- */
.bmu-subscribe-title { margin: 0 0 0.25rem; font-size: 0.9rem; font-weight: 500; }
.bmu-subscribe-text { margin: 0 0 0.75rem; font-size: 0.75rem; color: var(--muted-foreground); }
.bmu-subscribe input[type=email], .bmu-subscribe #subscribe-field,
.wp-block-jetpack-subscriptions input[type=email] {
  width: 100% !important; height: 2.25rem; padding: 0 0.75rem !important; border-radius: var(--radius) !important; border: 1px solid var(--input) !important; background: transparent !important; color: var(--foreground) !important; font-family: var(--font-mono) !important; font-size: 0.75rem !important;
}
.bmu-subscribe button, .bmu-subscribe .wp-block-button__link, .bmu-subscribe input[type=submit],
.wp-block-jetpack-subscriptions button {
  width: 100% !important; margin: 0.5rem 0 0 !important; padding: 0.55rem 0.9rem !important; border: 0 !important; border-radius: var(--radius) !important; background: var(--primary) !important; color: var(--primary-foreground) !important; font-family: var(--font-mono) !important; font-size: 0.75rem !important; cursor: pointer;
}
.bmu-subscribe p { margin: 0; }
.bmu-subscribe .wp-block-jetpack-subscriptions__form-elements { display: block !important; }
.bmu-subscribe #subscribe-submit { width: 100% !important; }

/* ---------- home / graph ---------- */
.bmu-home { position: relative; min-height: 100vh; overflow: hidden; }
.bmu-home .grid-bg, .bmu-graph-wrap { position: absolute; inset: 0; }
#bmu-graph { width: 100%; height: 100%; display: block; touch-action: none; }
.bmu-home-intro { position: relative; z-index: 10; padding: 6.5rem 1.25rem 0; max-width: 40rem; pointer-events: none; }
@media (min-width: 768px) { .bmu-home-intro { padding-left: 2rem; } }
.bmu-home-intro > * { pointer-events: auto; }
.bmu-home-title { margin: 0; font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.bmu-home-title span { color: var(--primary); }
.bmu-tagline { margin: 0.625rem 0 3rem; font-size: 0.875rem; color: var(--muted-foreground); }
.bmu-search { width: 18rem; max-width: 100%; height: 2.6rem; padding: 0 1rem; border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.8rem; outline: none; }
.bmu-search:focus { border-color: var(--primary); }
.bmu-topics { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; max-width: 36rem; }
.bmu-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground); font-family: var(--font-mono); font-size: 0.72rem; cursor: pointer; }
.bmu-chip i { width: 6px; height: 6px; border-radius: 50%; }
.bmu-chip:hover { color: var(--foreground); }
.bmu-chip.is-active { color: var(--foreground); border-color: var(--chip, var(--primary)); box-shadow: 0 0 0 1px var(--chip, var(--primary)) inset; }
.bmu-latest { position: relative; z-index: 10; padding: 0 1.25rem 6rem; margin-top: 2rem; max-width: 24rem; pointer-events: auto; }
@media (min-width: 768px) { .bmu-latest { padding-left: 2rem; } }
.bmu-latest-list { display: grid; gap: 0.75rem; }
.bmu-card { display: block; padding: 1rem; border-radius: 0.75rem; transition: border-color .15s; }
.bmu-card:hover { border-color: color-mix(in oklab, var(--primary) 60%, transparent); }
.bmu-card-meta { display: flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted-foreground); }
.bmu-card-meta i { width: 7px; height: 7px; border-radius: 50%; }
.bmu-card h3 { margin: 0.5rem 0 0.4rem; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.bmu-card:hover h3 { color: var(--primary); }
.bmu-card p { margin: 0; font-size: 0.85rem; color: var(--muted-foreground); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bmu-legend { position: absolute; right: 1.25rem; text-align: right; bottom: 1.5rem; z-index: 10; font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted-foreground); display: none; }
@media (min-width: 1024px) { .bmu-legend { display: block; right: 2rem; } }
.bmu-legend div { display: flex; gap: 1rem; margin-bottom: 0.4rem; }
.bmu-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.bmu-legend .l-post { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.bmu-legend .l-topic { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--primary); }
.bmu-legend .l-tag { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--muted-foreground); }
.bmu-legend .l-ref { width: 14px; height: 1px; background: var(--primary); }

/* ---------- single ---------- */
.bmu-page { position: relative; min-height: 100vh; }
.bmu-page > .grid-bg { position: absolute; inset: 0; opacity: .6; pointer-events: none; }
.bmu-single { position: relative; max-width: 80rem; margin: 0 auto; padding: 7rem 1.25rem 4rem; display: grid; gap: 3rem; }
@media (min-width: 1024px) { .bmu-single { grid-template-columns: minmax(0, 1fr) 22rem; padding-left: 2rem; padding-right: 2rem; } }
.bmu-back { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); }
.bmu-back:hover { color: var(--primary); }
.bmu-meta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); }
.bmu-cat { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.6rem; border: 1px solid; border-radius: 999px; }
.bmu-cat i { width: 6px; height: 6px; border-radius: 50%; }
.bmu-title { margin: 1rem 0 0; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
.bmu-cover { margin-top: 2rem; width: 100%; max-height: 420px; object-fit: cover; border-radius: 0.75rem; border: 1px solid var(--border); }
.bmu-tags { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bmu-tags a { padding: 0.1rem 0.5rem; border-radius: 4px; background: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-foreground); }
.bmu-tags a:hover { color: var(--primary); }
.bmu-aside { padding-bottom: 2.5rem; }
@media (min-width: 1024px) { .bmu-aside { position: sticky; top: 5rem; height: calc(100vh - 6rem); overflow-y: auto; } }
.bmu-mini { height: 16rem; border-radius: 0.75rem; overflow: hidden; }
#bmu-mini-graph { width: 100%; height: 100%; display: block; touch-action: none; }
.bmu-aside h2 { margin-top: 1.5rem; }
.bmu-aside h2:first-child { margin-top: 0; }
#bmu-related { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.bmu-related { display: flex; gap: 0.5rem; padding: 0.75rem; border-radius: var(--radius); }
.bmu-related:hover { border-color: color-mix(in oklab, var(--primary) 60%, transparent); }
.bmu-related > i { margin-top: 0.4rem; width: 8px; height: 8px; flex: none; border-radius: 50%; }
.bmu-related b { display: block; font-size: 0.875rem; font-weight: 500; line-height: 1.35; }
.bmu-related:hover b { color: var(--primary); }
.bmu-related small { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.4rem; }
.bmu-year { font-family: var(--font-mono); font-size: 10px; color: var(--muted-foreground); }
.bmu-reason { font-family: var(--font-mono); font-size: 10px; padding: 0 0.35rem; border-radius: 4px; background: var(--muted); color: var(--muted-foreground); }
.bmu-reason--ref-out, .bmu-reason--ref-in { background: color-mix(in oklab, var(--primary) 15%, transparent); color: var(--primary); }
.bmu-box { padding: 1rem; border-radius: var(--radius); margin-top: 1.5rem; }
.bmu-bio { margin-top: 1.5rem; font-size: 0.75rem; line-height: 1.6; color: var(--muted-foreground); }

/* ---------- generic page / listing ---------- */
.bmu-narrow { position: relative; max-width: 44rem; margin: 0 auto; padding: 8rem 1.25rem 5rem; }
.bmu-list { position: relative; max-width: 56rem; margin: 0 auto; padding: 8rem 1.25rem 5rem; }
.bmu-list .bmu-latest-list { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.bmu-pagination { margin-top: 2rem; display: flex; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.8rem; }
.bmu-pagination .page-numbers { padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); }
.bmu-pagination .current { border-color: var(--primary); color: var(--primary); }

/* ---------- post content ---------- */
.prose-post { font-size: 1.05rem; line-height: 1.8; color: color-mix(in oklab, var(--foreground) 88%, transparent); max-width: 48rem; margin-top: 2rem; }
.prose-post h1, .prose-post h2, .prose-post h3, .prose-post h4 { color: var(--foreground); font-weight: 600; line-height: 1.3; margin: 2.2em 0 0.7em; }
.prose-post h2 { font-size: 1.6rem; }
.prose-post h3 { font-size: 1.3rem; }
.prose-post p { margin: 1em 0; }
.prose-post a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.prose-post a:hover { text-decoration-color: var(--primary); }
.prose-post img { border-radius: var(--radius); height: auto; max-width: 100%; border: 1px solid var(--border); }
.prose-post figure { margin: 1.5em 0; }
.prose-post figcaption { font-size: 0.85rem; color: var(--muted-foreground); text-align: center; font-family: var(--font-mono); }
.prose-post ul { list-style: disc; padding-left: 1.4em; }
.prose-post ol { list-style: decimal; padding-left: 1.4em; }
.prose-post li { margin: 0.35em 0; }
.prose-post blockquote { margin: 1.5em 0; border-left: 2px solid var(--primary); padding-left: 1em; color: var(--muted-foreground); font-style: italic; }
.prose-post code { font-family: var(--font-mono); font-size: 0.88em; background: var(--muted); padding: 0.1em 0.35em; border-radius: 4px; }
.prose-post pre { font-family: var(--font-mono); background: var(--muted); padding: 1em; border-radius: var(--radius); overflow-x: auto; font-size: 0.85rem; }
.prose-post pre code { background: none; padding: 0; }
.prose-post table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.prose-post td, .prose-post th { border: 1px solid var(--border); padding: 0.4em 0.6em; }
.prose-post iframe { max-width: 100%; border-radius: var(--radius); }
.prose-post .wp-block-embed iframe, .prose-post .embed-youtube iframe { width: 100%; height: auto; aspect-ratio: 16/9; }
.prose-post .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.prose-post .alignleft { float: left; margin: 0.5em 1.5em 1em 0; }
.prose-post .alignright { float: right; margin: 0.5em 0 1em 1.5em; }
.prose-post .wp-block-image img { margin: 0 auto; display: block; }
.prose-post .wp-block-button__link { display: inline-block; background: var(--primary); color: var(--primary-foreground); padding: 0.5em 1em; border-radius: var(--radius); text-decoration: none; }
.prose-post .sharedaddy, .prose-post .jp-relatedposts { display: none; }

/* ---------- comments ---------- */
.bmu-comments { margin-top: 4rem; max-width: 48rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.bmu-comments-title { margin: 0 0 1.5rem; font-size: 1.4rem; font-weight: 600; }
.bmu-comment-list, .bmu-comment-list .children { list-style: none; margin: 0; padding: 0; }
.bmu-comment-list .children { margin-left: 1.25rem; padding-left: 1.25rem; border-left: 1px solid var(--border); }
.bmu-comment { margin: 0 0 1rem; }
.bmu-comment-body { padding: 1rem 1.1rem; border-radius: var(--radius); }
.bmu-comment-head { display: flex; align-items: center; gap: 0.6rem; }
.bmu-comment-head img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); }
.bmu-comment-author { font-weight: 600; font-size: 0.9rem; }
.bmu-comment-author a { color: var(--primary); }
.bmu-comment-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted-foreground); }
.bmu-comment-text { font-size: 0.95rem; line-height: 1.7; color: color-mix(in oklab, var(--foreground) 88%, transparent); }
.bmu-comment-text p { margin: 0.6em 0; }
.bmu-comment-text a { color: var(--primary); }
.bmu-comment.bypostauthor > .bmu-comment-body { border-color: color-mix(in oklab, var(--primary) 50%, transparent); }
.bmu-badge { font-family: var(--font-mono); font-size: 10px; padding: 0 0.4rem; border-radius: 4px; background: color-mix(in oklab, var(--primary) 15%, transparent); color: var(--primary); }
.bmu-comment-actions { display: flex; gap: 1rem; font-family: var(--font-mono); font-size: 0.72rem; }
.bmu-comment-actions a { color: var(--muted-foreground); }
.bmu-comment-actions a:hover { color: var(--primary); }
.bmu-awaiting { font-family: var(--font-mono); font-size: 0.72rem; color: var(--primary); }
.comment-respond { margin-top: 2rem; padding: 1.25rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.comment-reply-title { margin: 0 0 0.5rem; font-size: 1.15rem; font-weight: 600; }
.comment-reply-title small { margin-left: 0.75rem; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; }
.comment-reply-title small a { color: var(--primary); }
.comment-notes, .logged-in-as { font-size: 0.8rem; color: var(--muted-foreground); }
.logged-in-as a { color: var(--primary); }
.comment-form p { margin: 0 0 1rem; }
.comment-form label { display: block; margin-bottom: 0.35rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-foreground); }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width: 100%; padding: 0.6rem 0.75rem; border-radius: var(--radius); border: 1px solid var(--input); background: color-mix(in oklab, var(--background) 60%, transparent); outline: none;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); }
.comment-form textarea { min-height: 8rem; resize: vertical; }
.comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.comment-form-cookies-consent label { margin: 0; }
.comment-form .form-submit { margin: 0; }
.comment-form .submit { border: 0; cursor: pointer; padding: 0.6rem 1.2rem; border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); font-family: var(--font-mono); font-size: 0.8rem; }
.comment-form .submit:hover { box-shadow: var(--shadow-glow); }
.required { color: var(--primary); }
.bmu-comments-closed { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-foreground); }

/* ---------- footer ---------- */
.bmu-footer { position: relative; padding: 2rem 1.25rem; text-align: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-foreground); border-top: 1px solid var(--border); }
.home .bmu-footer { display: none; }
.bmu-single > article { min-width: 0; }
.prose-post video, .prose-post .wp-video, .prose-post .wp-video-shortcode, .prose-post .mejs-container { max-width: 100% !important; width: 100% !important; height: auto !important; }
.prose-post .wp-block-video video { border-radius: var(--radius); }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Archive */
.bmu-archive { max-width: 48rem; margin: 0 auto; padding: 7rem 1.25rem 4rem; position: relative; z-index: 1; }
.bmu-archive h1 { font-size: 2rem; margin: 0 0 .5rem; }
.bmu-archive-year { margin-top: 2.5rem; }
.bmu-archive-year h2 { font-family: var(--font-mono); font-size: .875rem; color: var(--primary); letter-spacing: .1em; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.bmu-archive ul { list-style: none; margin: 0; padding: 0; }
.bmu-archive li { display: flex; align-items: baseline; gap: .9rem; padding: .55rem 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 50%, transparent); }
.bmu-archive time { font-family: var(--font-mono); font-size: .75rem; color: var(--muted-foreground); min-width: 3.5rem; }
.bmu-archive .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.bmu-archive li a { flex: 1; }
.bmu-archive li a:hover { color: var(--primary); }
.bmu-archive .rt { font-family: var(--font-mono); font-size: .7rem; color: var(--muted-foreground); }
