/*
Theme Name: Terminal Theme
Theme URI: https://github.com/owhowh0
Author: owh
Description: A terminal-inspired WordPress theme with JetBrains Mono font and Markdown post support.
Version: 1.0
License: MIT
Text Domain: terminal-theme
*/

/* ========== IMPORTS ========== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #141414;
    --border: #2a2a2a;
    --text: #c8c8c8;
    --text-muted: #666666;
    --text-bright: #e0e0e0;
    --accent: #00ff41;
    --accent-dim: #00cc33;
    --accent-glow: rgba(0, 255, 65, 0.15);
    --red: #ff5f56;
    --yellow: #ffbd2e;
    --green: #27c93f;
    --blue: #5fb3f0;
    --purple: #c084fc;
    --cyan: #22d3ee;
    --selection-bg: rgba(0, 255, 65, 0.2);
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--selection-bg);
    color: var(--accent);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
    color: #33ff66;
    text-shadow: 0 0 8px var(--accent-glow);
}

/* ========== LAYOUT ========== */
.site-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    flex: 1;
}

/* ========== TERMINAL WINDOW ========== */
.terminal-window {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.terminal-titlebar {
    background: var(--bg-secondary);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot.red { background: var(--red); }
.terminal-dot.yellow { background: var(--yellow); }
.terminal-dot.green { background: var(--green); }

.terminal-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.terminal-body {
    padding: 1.2rem 1.5rem;
}

/* ========== HEADER ========== */
.site-header {
    padding: 2.5rem 0 1rem;
}

.header-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.prompt-symbol {
    color: var(--accent);
    font-weight: 700;
}

.prompt-path {
    color: var(--blue);
}

.prompt-git {
    color: var(--purple);
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    letter-spacing: 0.05em;
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    text-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}

.site-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.site-description::before {
    content: '// ';
    color: var(--text-muted);
}

/* ========== NAVIGATION ========== */
.site-nav {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text);
    font-size: 0.85rem;
    padding: 0.3rem 0;
    position: relative;
}

.site-nav a::before {
    content: './';
    color: var(--accent);
}

.site-nav a:hover {
    color: var(--accent);
}

.site-nav .current-menu-item a {
    color: var(--accent);
}

/* ========== POST CARDS (Index) ========== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.2rem 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 0 15px var(--accent-glow);
}

.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-bright);
}

.post-card-title a {
    color: inherit;
}

.post-card-title a:hover {
    color: var(--accent);
}

.post-card-title::before {
    content: '> ';
    color: var(--accent);
}

.post-card-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.post-card-meta {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.post-tag {
    background: var(--bg-secondary);
    color: var(--cyan);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    border: 1px solid var(--border);
}

/* ========== SINGLE POST ========== */
.post-single {
    margin: 1rem 0 3rem;
}

.post-single-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.post-single-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.post-single-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.post-single-meta span::before {
    margin-right: 0.3rem;
}

/* ========== POST CONTENT (Markdown rendered) ========== */
.post-content {
    font-size: 0.95rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--text-bright);
    margin: 2rem 0 0.8rem;
    font-weight: 600;
}

.post-content h1 { font-size: 1.5rem; color: var(--accent); }
.post-content h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.post-content h3 { font-size: 1.15rem; }
.post-content h4 { font-size: 1rem; }

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
    margin: 0.8rem 0 1rem 1.5rem;
}

.post-content li {
    margin-bottom: 0.3rem;
}

.post-content li::marker {
    color: var(--accent);
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 0 4px 4px 0;
}

.post-content code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--cyan);
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1rem 0;
    position: relative;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.6;
}

.post-content pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 0.5rem;
    right: 0.8rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 1rem 0;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-dim);
    text-underline-offset: 3px;
}

.post-content a:hover {
    text-decoration-color: var(--accent);
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.8rem;
    text-align: left;
}

.post-content th {
    background: var(--bg-secondary);
    color: var(--accent);
    font-weight: 600;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .current {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 700;
}

/* ========== FOOTER ========== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-links svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-copy::before {
    content: '$ echo "';
}

.footer-copy::after {
    content: '"';
}

/* ========== CURSOR BLINK ========== */
.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ========== 404 ========== */
.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 h1 {
    font-size: 4rem;
    color: var(--red);
    margin-bottom: 1rem;
}

.error-404 p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== SEARCH ========== */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.search-form input[type="search"] {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 0.8rem;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-form input[type="search"]:focus {
    border-color: var(--accent);
}

.search-form button {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-form button:hover {
    background: #33ff66;
}

/* ========== PAGE TEMPLATE ========== */
.page-content {
    margin: 1rem 0 3rem;
}

.page-content h1 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

/* ========== FRONT PAGE / HERO ========== */
.home-hero {
    margin: 2rem 0 3rem;
}

.hero-intro {
    margin-bottom: 2rem;
}

.hero-greeting {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.hero-name {
    font-size: 2.2rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.hero-tagline {
    font-size: 1.1rem;
    color: var(--text);
}

.hero-tagline .highlight {
    color: var(--blue);
    font-weight: 500;
}

.hero-details {
    margin-bottom: 2rem;
}

.terminal-line {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.hero-list {
    list-style: none;
    padding: 0;
}

.hero-list li {
    padding: 0.15rem 0;
    color: var(--text);
}

.hero-list li .accent {
    color: var(--accent);
    margin-right: 0.5rem;
}

.hero-links {
    margin-top: 1.5rem;
}

.hero-link-list {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.hero-link-list a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.hero-link-list a:hover {
    color: var(--text-bright);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .site-wrapper {
        padding: 0 1rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .post-card-header {
        flex-direction: column;
        gap: 0.3rem;
    }

    .terminal-body {
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 480px) {
    .site-nav ul {
        gap: 0.8rem;
    }

    .site-title {
        font-size: 1.4rem;
    }
}

