/* viewer.css — Git Archive Viewer.
   Light, monochrome aesthetic matching yorkshire.systems:
   pure black ink on warm white paper. Inter for UI, IBM Plex Mono for code. */

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

:root {
    --paper: #f5f5f5;
    --header: #f0edea;
    --ink: #0c0c0c;
    --muted: #8a887f;
    --line: #d7d4c9;
    --hover: #ebe9e0;
    --selected: #e3e0d4;
    --sans: "Inter", system-ui, -apple-system, Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header --------------------------------------------------------------- */
header {
    background: var(--header);
    /*border-bottom: 1px solid var(--ink);*/
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
header h1 {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}
header h1 .icon { color: var(--ink); }

.header_logo{
    width: 112px;
    height: auto;
    flex-shrink: 0;
    padding-top: 12px;
}

.header__id {
  font-weight: 600;
}

.picker { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.picker label {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}
select {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: var(--sans);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Layout --------------------------------------------------------------- */

.layout { flex: 1; display: flex; min-height: 0; }
aside {
    width: 320px;
    min-width: 220px;
    background: var(--paper);
    border-right: 1px solid var(--ink);
    overflow: auto;
    padding: 12px 8px;
    resize: horizontal;
}
.download {
    display: block;
    margin: 2px 8px 0;
    padding: 8px 10px;
    border: 1px solid var(--ink);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.download:hover { background: var(--ink); color: var(--paper); }
.sidebar-meta {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: var(--muted);
    padding: 8px 10px 12px;
}
main { flex: 1; overflow: auto; min-width: 0; }
.empty { padding: 48px; color: var(--muted); text-align: center; font-size: 0.95rem; }

/* File tree ------------------------------------------------------------ */

ul { list-style: none; margin: 0; padding-left: 14px; }
aside > ul { padding-left: 4px; }
li.dir > details > summary {
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 0.85rem;
    color: var(--ink);
    user-select: none;
}
li.dir > details > summary:hover { background: var(--hover); }
li.dir > details > summary::marker { color: var(--muted); }
li.file a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    text-decoration: none;
    color: var(--ink);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.85rem;
}
li.file a:hover { background: var(--hover); }
li.file.selected a { background: var(--selected); font-weight: 600; }
li.file .fsize {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* File view ------------------------------------------------------------ */

.file-header {
    position: sticky;
    top: 0;
    background: var(--paper);
    z-index: 1;
    border-bottom: 1px solid var(--ink);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.file-header .path {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--ink);
}
.file-header .meta {
    font-family: var(--mono);
    color: var(--muted);
    font-size: 0.75rem;
}

.code-wrap { display: flex; font-family: var(--mono); font-size: 13px; }
.gutter {
    text-align: right;
    padding: 16px 12px 16px 18px;
    color: var(--muted);
    user-select: none;
    background: var(--paper);
    border-right: 1px solid var(--line);
    white-space: pre;
    line-height: 1.55;
}
.code { padding: 16px 18px; overflow-x: auto; flex: 1; }
.code pre {
    margin: 0;
    line-height: 1.55;
    white-space: pre;
    tab-size: 4;
    font-family: var(--mono);
}
.code code { color: var(--ink); font-family: var(--mono); }
/* highlight.js theme paints its own background/padding on .hljs — strip those
   so our paper shows through, and keep every token in our mono face. */
.code code.hljs { background: transparent; padding: 0; }
.code .hljs,
.code .hljs span { font-family: var(--mono); }

.binary-note { padding: 48px; color: var(--muted); text-align: center; }
.error {
    margin: 20px;
    padding: 14px 18px;
    background: #fbeaea;
    border: 1px solid #c0392b;
    color: #c0392b;
    border-radius: 8px;
}

/* Sidebar toggle ------------------------------------------------------- */

/* Hidden on desktop; the sidebar is always visible there. */
.sidebar-toggle { display: none; }

@media (max-width: 820px) {
    /* Stack the archive picker beneath the logo/text. */
    header { flex-wrap: wrap; }
    .picker { width: 100%; margin-left: 0; }
    .picker select { width: 100%; }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 1rem;
        bottom: 1rem;
        z-index: 20;
        width: 48px;
        height: 48px;
        padding: 0;
        font-size: 1.25rem;
        line-height: 1;
        background: var(--paper);
        color: var(--ink);
        border: 1px solid var(--ink);
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(12, 12, 12, 0.18);
    }
    .sidebar-toggle:hover { background: var(--ink); color: var(--paper); }

    body.sidebar-collapsed aside { display: none; }
}
