/*
Theme Name: HX29 Terminal
Description: Terminal-style WordPress block theme
Version: 3.0.0
Requires at least: 6.0
License: GNU General Public License v2 or later
Text Domain: hx29
*/

/* ── Theme variables (default: VT100 green) ─────────────────────── */
:root {
    --bg:     #000000;
    --fg:     #00ff00;
    --dim:    #008800;
    --accent: #00ff00;
    --font:   'Courier New', Courier, monospace;
    --fsize:  14px;
}

[data-theme="b"] {
    --bg:     #0d1117;
    --fg:     #e6edf3;
    --dim:    #79c0ff;
    --accent: #58a6ff;
}

[data-theme="c"] {
    --bg:     #1a0a2e;
    --fg:     #e0d0ff;
    --dim:    #ff79c6;
    --accent: #bf7fff;
}

[data-theme="d"] {
    --bg:     #fdf6e3;
    --fg:     #657b83;
    --dim:    #2aa198;
    --accent: #268bd2;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: var(--fsize);
    line-height: 1.4;
}

/* Make WordPress block wrappers form an exact 100vh flex column */
.wp-site-blocks {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.wp-site-blocks > * {
    margin: 0 !important;
    padding: 0 !important;
}

/* The group block wrapping the terminal should expand to fill remaining space */
.wp-site-blocks > .wp-block-group {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Terminal container ──────────────────────────────────────────── */
#terminal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    width: 100%;
    max-width: 160ch;
}

#terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: var(--fsize);
    line-height: 1.4;
    scrollbar-color: var(--dim) var(--bg);
    scrollbar-width: thin;
}

#terminal-output::-webkit-scrollbar {
    width: 6px;
}

#terminal-output::-webkit-scrollbar-track {
    background: var(--bg);
}

#terminal-output::-webkit-scrollbar-thumb {
    background: var(--dim);
}

/* ── Input line ──────────────────────────────────────────────────── */
#terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    height: 32px;
    background: var(--bg);
    white-space: nowrap;
}

#terminal-input-line span {
    color: var(--accent);
    font-weight: bold;
    font-size: var(--fsize);
    flex-shrink: 0;
}

#terminal-input {
    flex: 1;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg);
    font-family: var(--font);
    font-size: var(--fsize);
    height: 32px;
    caret-color: var(--accent);
}

#terminal-input::placeholder { color: var(--dim); }

/* ── Text helpers ────────────────────────────────────────────────── */
.command-echo { color: var(--fg); font-weight: bold; }
.error        { color: #ff5555; }
.dim          { color: var(--dim); }
.hx29-loading { color: var(--dim); }

a { color: var(--accent); }

/* ── Header/footer parts ─────────────────────────────────────────── */
.template-part-header {
    padding: 4px 16px;
    background: var(--bg);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.template-part-header h1 {
    margin: 0;
    padding: 0;
    color: var(--dim);
    font-family: var(--font);
    font-size: 12px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #terminal-container { padding: 8px; }
    #terminal-output, #terminal-input, #terminal-input-line span { font-size: 12px; }
}
