/* ==========================================================================
   ZEN C - CGIT THEME (MATCHING MAIN SITE)
   ========================================================================== */

/* 1. IMPORTS & VARIABLES (Exact match from your style.css) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Kaisei+Tokumin:wght@700;800&display=swap');

:root {
    /* "Zen Temple" Color Palette */
    --bg: #161615;
    --surface: #1c1c1b;
    --fg: #d1d1cf;
    --muted: #8a8a88;
    --border: rgba(232, 230, 227, 0.08);
    --primary: #e8e6e3;

    /* Syntax Highlighting */
    --kwd: #ff9f6e;
    --str: #a3be8c;
    --typ: #ebcb8b;
    --fn: #88c0d0;
    --num: #d08770;
    --com: #656a70;

    /* Fonts */
    --font-ui: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-brand: 'Kaisei Tokumin', serif;
}

/* 2. BASE STYLES */
body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-ui);
    margin: 0; padding: 0;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Main Container */
div#cgit {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 3. HEADER (Matches Main Site Header) */
table#header {
    width: 100%;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}
table#header td.logo { display: none; } 
table#header td.main {
    font-family: var(--font-brand);
    font-size: 2.5rem; /* Larger to match "Zen C" branding */
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1;
}
table#header td.main a { color: var(--primary); text-decoration: none; }
table#header td.sub {
    color: var(--muted);
    font-family: var(--font-ui);
    padding-top: 0.5rem;
}

/* Search Box styling */
table#header form { display: inline-block; margin-left: auto; }
select, input {
    background: #000;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    outline: none;
}
input:focus { border-color: var(--muted); }

/* 4. TABS (Summary, Log, Tree) */
table.tabs {
    border-bottom: 1px solid var(--border);
    border-collapse: collapse;
    margin-bottom: 2rem;
    width: 100%;
}

table.tabs td {
    padding: 12px 0;
    font-size: 0.9rem;
    vertical-align: middle;
}

table.tabs td a {
    color: var(--muted);
    padding: 6px 16px;
    margin-right: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
    display: inline-block;
}

table.tabs td a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

table.tabs td a.active {
    background: var(--fg);
    color: var(--bg); /* Inverted for active state */
    font-weight: 600;
}

table.tabs td.form { text-align: right; width: 1%; white-space: nowrap; }

/* 5. CONTENT TABLES (The File Browser) */
div.content { margin-top: 1rem; }

table.list {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px; 
    overflow: hidden;
}

/* Table Header */
table.list th {
    text-align: left;
    background: #121211; /* Slightly darker than surface */
    padding: 14px 16px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
table.list th a { color: var(--muted); }

/* Table Rows */
table.list td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
}
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover { background: rgba(255,255,255,0.03); }
table.list tr.nohover:hover { background: none; }

/* Mode & Links */
table.list td.mode { color: var(--com); font-size: 0.8rem; }
table.list td a { color: var(--fg); font-weight: 500; }
table.list td a[href$="/"] { color: var(--fn); /* Folders get function color */ font-weight: 700; }

/* 6. COMMIT LOG */
table.commit-info {
    width: 100%;
    margin-bottom: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 6px;
    font-family: var(--font-mono);
}
div.commit-subject { font-size: 1.1rem; font-weight: 600; color: var(--primary); margin-bottom: 0.75rem; font-family: var(--font-ui); }
div.commit-msg { color: var(--muted); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.6; }

/* 7. CODE VIEW (Syntax Highlighting) */
table.blob {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-top: 1rem;
    background: #000; /* Pitch black for code background */
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

table.blob td.linenumbers {
    border-right: 1px solid var(--border);
    padding: 10px 15px;
    text-align: right;
    color: var(--com);
    background: #0a0a0a;
    user-select: none;
    font-size: 0.85rem;
}
table.blob td.linenumbers a { color: var(--com); }
table.blob td.lines { padding: 10px 20px; color: var(--fg); line-height: 1.5; }

/* Syntax Highlighting Mapping */
.hl.k { color: var(--kwd); font-weight: bold; }
.hl.s { color: var(--str); }
.hl.c { color: var(--com); font-style: italic; }
.hl.t { color: var(--typ); }
.hl.n { color: var(--num); }
.hl.f { color: var(--fn); }

/* 8. FOOTER */
div.footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    font-family: var(--font-ui);
}
