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

/* =============================================
   custom properties
   ============================================= */

/* sepia light theme */
[data-theme="light"] {
    --color-bg: #f5f2e8;
    --color-bg-header: #ddd8c8;
    --color-bg-sidebar: #ede9de;
    --color-border: #c8c4b8;
    --color-section-title: #3a2010;
    --color-text: #1a1a1a;
    --color-text-muted: #666;
    --color-text-desc: #444;
    --color-theme-toggle: #666;
    --color-accent: #3a2010;
    --color-link: #7a4f2a;
    --color-link-visited: #3d2510;
    --color-input-bg: #ede9de;
    --color-input-text: #1a1a1a;
}

/* yahoo-inspired light theme */
/*[data-theme="light"] {
    --color-bg: #f0f4f8;
    --color-bg-header: #c5d8ec;
    --color-bg-sidebar: #dce8f0;
    --color-border: #a8c0d6;
    --color-text: #1a1a2e;
    --color-text-muted: #5a6a7a;
    --color-text-desc: #4a5a6a;
    --color-theme-toggle: #8a9aaa;
    --color-accent: #1a4a7a;
    --color-section-title: #1a4a7a;
    --color-link: #1a4a7a;
    --color-link-visited: #6a3a8a;
    --color-input-bg: #e4eef6;
    --color-input-text: #1a1a2e;
}*/

[data-theme="dark"] {
    --color-bg: #14181d;
    --color-bg-header: #0a0f14;
    --color-bg-sidebar: #11151c;
    --color-border: #2a3340;
    --color-section-title: #e6e6e6;
    --color-text: #c7c7c7;
    --color-text-muted: #ff8f40;
    --color-text-desc: #bbb;
    --color-theme-toggle: #555;
    --color-accent: #39bae6;
    --color-link: #39bae6;
    --color-link-visited: #26a98b;
    --color-input-bg: #1a1f26;
    --color-input-text: #c7c7c7;
}

/* theme toggle button */
#theme-toggle {
    margin-left: auto;
    background: none;
    border: none; /*1px solid var(--color-border);*/
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    color: var(--color-theme-toggle);
}

/* =============================================
   base
   ============================================= */
body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    background: var(--color-bg);
    color: var(--color-text);
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px;
}

/* =============================================
   header
   ============================================= */
.site-header {
    background: var(--color-bg-header);
    border: 1px solid var(--color-border);
    padding: 6px 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-accent);
}

.site-stats {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* =============================================
   search
   ============================================= */
.search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-row input {
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid var(--color-border);
    width: 240px;
    background: var(--color-input-bg);
    color: var(--color-input-text);
}

.search-row input:focus {
    outline: none;
    border: 1px solid var(--color-border);
}

#search-count {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* =============================================
   layout - sidebar + main content grid
   ============================================= */
.layout {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
}

/* =============================================
   sidebar
   ============================================= */
.sidebar {
    border: 1px solid var(--color-border);
    padding: 8px;
    background: var(--color-bg-sidebar);
    align-self: start;
}

.sidebar-heading {
    font-size: 11px;
    font-weight: bold;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 3px;
    margin-bottom: 4px;
}

.sidebar a {
    display: block;
    font-size: 12px;
    color: var(--color-link);
    text-decoration: none;
    padding: 2px 0;
    line-height: 1.5;
}

.sidebar a:visited {
    color: var(--color-link-visited);
}

.sidebar a:hover {
    text-decoration: underline;
}

.sidebar-recent {
    font-size: 11px;
}

/* =============================================
   category sections
   ============================================= */
.section {
    border: 1px solid var(--color-border);
    padding: 8px 10px;
    margin-bottom: 8px;
    background: var(--color-bg);
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 4px;
}

.section-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--color-section-title);
}

.section-count {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* =============================================
   link grid - three columns within each section
   ============================================= */
.link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 12px;
}

.link-item {
    padding: 2px 0;
}

.link-item a {
    font-size: 12px;
    color: var(--color-link);
    text-decoration: none;
    line-height: 1.5;
}

.link-item a:visited {
    color: var(--color-link-visited);
}

.link-item a:hover {
    text-decoration: underline;
}

.link-item .desc {
    font-size: 11px;
    color: var(--color-text-desc);
    line-height: 1.3;
}

/* dead link indicator - populated by lychee check */
.skull {
    font-size: 11px;
    margin-left: 3px;
    color: var(--color-accent);
}

.link-hidden {
    display: none;
}

.show-more {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.show-more a {
    color: var(--color-link);
}
