/* dafer blog: styles for the blog content shown inside the home terminal,
   the theme toggle, and the light theme of the whole page.
   Colours come from the variables in style.css, so both themes just work. */

/* ---------- light theme (gruvbox material light) for the whole page ---------- */
[data-theme="light"] {
    --primary-cyan: #4c7a5d;
    --primary-green: #6c782e;
    --primary-purple: #945e80;
    --accent-orange: #c35e0a;
    --bg-dark: #e6ddc5;
    --bg-darker: #d9ceb0;
    --terminal-bg: #ede4cc;
    --terminal-border: #b8a988;
    --text-primary: #3c3836;
    --text-secondary: #654735;
    --text-dim: #7c6f64;
    --nvim-blue: #45707a;
    --nvim-yellow: #b47109;
    --grid-color: rgba(76, 122, 93, 0.1);
    --scan-line-color: rgba(76, 122, 93, 0.3);
    color-scheme: light;
}
[data-theme="light"] .eacc-pulse { color: var(--text-primary); }
[data-theme="light"] .title-text { filter: drop-shadow(0 0 12px rgba(76, 122, 93, 0.35)); }
[data-theme="light"] .terminal-container { box-shadow: 0 0 50px rgba(76, 122, 93, 0.2); }
html, body { transition: background-color 0.3s ease; }

/* ---------- theme toggle, right side of the terminal header ---------- */
.theme-toggle {
    font: inherit;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: none;
    border: 1px solid var(--terminal-border);
    border-radius: 4px;
    padding: 0 0.5rem;
    cursor: pointer;
}
.theme-toggle:hover { color: var(--primary-cyan); border-color: var(--primary-cyan); }

/* ---------- blog view ---------- */
#blog-view {
    max-width: 50rem;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#blog-view.shown { opacity: 1; transform: none; }
#blog-view a { color: var(--nvim-yellow); text-underline-offset: 0.2em; }
#blog-view a:hover { color: var(--primary-cyan); }

/* ./home ./blog/ links: small version of the home page buttons */
.bnav { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
#blog-view .bnav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--terminal-border);
    border-radius: 4px;
    background: rgba(137, 180, 130, 0.05);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
#blog-view .bnav a::before { content: "./"; color: var(--primary-green); }
#blog-view .bnav a:hover { border-color: var(--primary-cyan); box-shadow: 0 0 20px rgba(137, 180, 130, 0.3); transform: translateY(-2px); }

/* Title: the home page gradient */
.blog-title {
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 900;
    line-height: 1.2;
    margin: 0 0 0.4rem;
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-purple), var(--primary-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Headings: markdown markers, "#" link on hover */
#blog-view h2, #blog-view h3, #blog-view h4 { line-height: 1.3; margin: 2rem 0 0.6rem; scroll-margin-top: 1rem; }
#blog-view h2 { font-size: 1.25rem; color: var(--primary-purple); }
#blog-view h3 { font-size: 1.05rem; color: var(--primary-cyan); }
#blog-view h4 { font-size: 0.95rem; color: var(--nvim-yellow); }
#blog-view h2::before { content: "## "; color: var(--text-dim); }
#blog-view h3::before { content: "### "; color: var(--text-dim); }
#blog-view h4::before { content: "#### "; color: var(--text-dim); }
#blog-view .anchor { margin-left: 0.5rem; color: var(--accent-orange); text-decoration: none; opacity: 0; }
#blog-view h2:hover .anchor, #blog-view h3:hover .anchor, #blog-view h4:hover .anchor, #blog-view .anchor:focus { opacity: 1; }

/* Date + [tags] */
#blog-view .meta { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 1.2rem; }
#blog-view .tag { margin-right: 0.4rem; color: var(--primary-green); text-decoration: none; white-space: nowrap; }
#blog-view .tag::before { content: "["; color: var(--primary-cyan); }
#blog-view .tag::after { content: "]"; color: var(--primary-cyan); }
#blog-view .tag:hover, #blog-view .tag.active { color: var(--accent-orange); }

/* Post body */
#blog-view p, #blog-view ul, #blog-view ol, #blog-view blockquote, #blog-view pre, #blog-view table { margin: 0 0 1rem; }
#blog-view blockquote {
    margin-left: 0;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--terminal-border);
    border-radius: 8px;
    background: rgba(211, 134, 155, 0.05);
}
#blog-view code { color: var(--accent-orange); font-family: inherit; }
#blog-view pre {
    padding: 0.8rem 1rem;
    overflow-x: auto;
    background: var(--bg-darker);
    border: 1px solid var(--terminal-border);
    border-radius: 4px;
    line-height: 1.5;
}
#blog-view pre code { color: var(--text-primary); }
#blog-view img { max-width: 100%; }
#blog-view hr { border: 0; border-top: 1px dashed var(--terminal-border); margin: 2rem 0; }
#blog-view table { border-collapse: collapse; }
#blog-view th, #blog-view td { border: 1px solid var(--terminal-border); padding: 0.3rem 0.6rem; }

/* Table of contents */
#blog-view .toc { font-size: 0.85rem; border-left: 2px solid var(--terminal-border); padding-left: 1rem; margin-bottom: 1.5rem; }
#blog-view .toc:empty { display: none; }
#blog-view .toc ul { list-style: none; margin: 0; padding: 0; }
#blog-view .toc ul ul { padding-left: 1.2rem; }
#blog-view .toc a { color: var(--text-dim); text-decoration: none; }
#blog-view .toc a:hover { color: var(--primary-cyan); }

/* Index: search prompt, tag filter, post list */
.search { display: flex; align-items: center; gap: 0.6rem; border-bottom: 1px solid var(--terminal-border); padding-bottom: 0.3rem; margin-top: 1rem; }
.search span { color: var(--primary-green); }
.search input { flex: 1; font: inherit; color: var(--text-primary); background: none; border: 0; outline: none; caret-color: var(--primary-cyan); }
.tag-filter { font-size: 0.85rem; margin: 0.9rem 0 1.8rem; }
#blog-view .posts { list-style: none; padding: 0; }
#blog-view .entry { margin-bottom: 1.4rem; }
#blog-view .entry > a { font-weight: 700; color: var(--text-primary); text-decoration: none; }
#blog-view .entry > a::before { content: "> "; color: var(--primary-cyan); }
#blog-view .entry > a:hover { color: var(--primary-cyan); }
#blog-view .entry .meta { margin: 0; }
#blog-view .entry p { margin: 0; color: var(--text-secondary); }
#blog-view .empty { color: var(--text-dim); }
