/*
Theme Name: 404 Not Forgotten
Theme URI: https://apr20.net
Author: apr20
Description: モダンな記事ベースのハウトゥ情報サイト用テーマ
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: 404-not-forgotten
*/

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --text: #e5e5e5;
    --text-muted: #a3a3a3;
    --border: #2a2a2a;
    --accent: #22d3ee;
    --code-bg: #1e1e1e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
}

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

a:hover {
    color: var(--primary);
}

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.site-title span {
    color: var(--accent);
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.main-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--text);
}

/* Main Content */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.article-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.article-card .category {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card h2 a {
    color: var(--text);
}

.article-card h2 a:hover {
    color: var(--accent);
}

.article-card .excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Single Article */
.single-article {
    max-width: 800px;
    margin: 0 auto;
}

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

.single-article h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.single-article .entry-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.entry-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content code {
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.entry-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.entry-content pre code {
    background: none;
    padding: 0;
}

.entry-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Sidebar */
.with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget h3 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.widget li:last-child {
    border-bottom: none;
}

/* TOC */
.toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc ul {
    list-style: none;
}

.toc li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.toc a {
    color: var(--text-muted);
}

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

/* Search */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input[type=search] {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
}

.search-form input[type=search]:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* Footer */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 968px) {
    .with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .single-article h1 {
        font-size: 1.75rem;
    }
    
    .site-main {
        padding: 2rem 1rem;
    }
}
