/* ========================================
   TAKAWASI - Wiki Style Layout
   左サイドバー固定 + 右メインコンテンツ
   白背景基調・情報密度重視
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --sidebar-width: 240px;
    --bg: #ffffff;
    --bg-sidebar: #f8f9fa;
    --bg-hover: #e9ecef;
    --bg-card: #f8f9fa;
    --text: #212529;
    --text-muted: #6c757d;
    --text-dim: #adb5bd;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --border: #dee2e6;
    --border-light: #e9ecef;
    --font: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', Consolas, monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}

/* ========================================
   Layout Structure
   ======================================== */
.wiki-layout {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Sidebar - 左固定ナビ
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-header {
    padding: 0.75rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.sidebar-logo:hover {
    color: var(--accent);
}

/* Navigation Tree */
.nav-tree {
    list-style: none;
}

.nav-section {
    margin-bottom: 0.125rem;
}

.nav-section > a,
.nav-section > span {
    display: block;
    padding: 0.5rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s;
}

.nav-section > a:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.nav-section.active > a {
    color: var(--accent);
    background: var(--bg-hover);
    border-left: 3px solid var(--accent);
    padding-left: calc(1.25rem - 3px);
}

/* Sub Navigation */
.nav-sub {
    list-style: none;
    display: none;
}

.nav-section.active .nav-sub,
.nav-section.expanded .nav-sub,
.nav-section:hover .nav-sub {
    display: block;
}

.nav-sub li a {
    display: block;
    padding: 0.375rem 1.25rem 0.375rem 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: all 0.15s;
}

.nav-sub li a:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.nav-sub li.active a {
    color: var(--accent);
    font-weight: 500;
}

/* Deep Sub Navigation */
.nav-sub .nav-sub li a {
    padding-left: 2.75rem;
    font-size: 0.75rem;
}

/* ========================================
   Main Content - 右メイン
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    max-width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.page-header .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

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

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

/* Section Headers */
h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--text);
}

/* ========================================
   Content Components
   ======================================== */
p {
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.8;
}

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

a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Link List */
.link-list {
    list-style: none;
    margin: 0.75rem 0;
}

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

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

.link-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    font-size: 0.875rem;
}

.link-list a:hover {
    color: var(--accent);
    text-decoration: none;
}

.link-list .meta {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.content-section {
    background: var(--bg-card);
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.content-section h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    color: var(--accent);
}

/* Status Badge */
.status {
    display: inline-block;
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-hover);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 2px;
}

.status.active {
    background: var(--accent);
    color: white;
}

/* ========================================
   Article Content
   ======================================== */
.article-content {
    max-width: 720px;
}

.article-content p {
    margin-bottom: 1.25rem;
    color: var(--text);
    line-height: 1.9;
}

.article-content h2 {
    margin-top: 2.5rem;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

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

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

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

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-accent {
    border-left: 4px solid var(--accent);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

.btn:hover {
    background: var(--accent-hover);
    color: white;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* ========================================
   Tables
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-card);
}

tr:hover {
    background: var(--bg-card);
}

/* ========================================
   Footer
   ======================================== */
.page-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ========================================
   Navigation Bottom
   ======================================== */
.nav-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.nav-bottom a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1.25rem;
    }

    .wiki-layout {
        flex-direction: column;
    }

    .nav-sub {
        display: block;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* ========================================
   Utility Classes
   ======================================== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ========================================
   Site Mission Statement
   ======================================== */
.site-mission {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    text-align: center;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fc 100%);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}
