/* =============================================================================
   ARCHIVE PAGES
   ============================================================================= */

/* Archive page styles */
.archive h1 {
    margin-bottom: 40px;
}

.archive-post-count {
    font-size: 0.6em;
    color: var(--text-secondary);
    margin-left: 8px;
    font-weight: normal;
    vertical-align: middle;
}

.archive-year {
    margin-bottom: 40px;
}

.archive-year > h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.archive-year > h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.archive-year > h2 a:hover {
    color: var(--hover-color);
}

.archive-month {
    margin-bottom: 30px;
    margin-left: 20px;
}

.archive-month > h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
}

.archive-month > h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.archive-month > h3 a:hover {
    color: var(--hover-color);
}

.archive-post-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0 20px;
}

.archive-post-list li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.archive-post-list .post-title {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.archive-post-list .post-title:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.archive-post-list .post-title.draft-title {
    color: var(--draft-title-color);
}

.archive-post-list .archive-metadata {
    margin-left: 8px;
}

.archive-post-list .category-link {
    display: inline-block;
    background: var(--category-bg);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    text-decoration: none;
    color: var(--category-text);
    font-weight: 600;
}

.archive-post-list .category-link:hover {
    background: var(--category-hover-bg);
    color: var(--hover-color-dark);
}

.archive-post-list .tag {
    display: inline-block;
    background: var(--tag-bg);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    text-decoration: none;
    color: var(--text-secondary);
}

.archive-post-list .tag:hover {
    background: var(--tag-hover-bg);
    color: var(--text-color);
}

/* Archive page with right-hand TOC using extra viewport space */
.archive-with-toc {
    /* No special layout - archive content keeps full width */
}

/* Archive TOC - hidden by default, only shown when viewport has room */
.archive-toc {
    display: none;
    font-size: 0.85em;
    line-height: 1.4;
}

/* Show the TOC fixed in the space to the right of the main content area.
   Layout: 280px (left nav sidebar) + 800px (content) + 20px (gap) = 1100px.
   Minimum viewport to fit a 160px TOC with 20px right margin: 1280px. */
@media (min-width: 1280px) {
    .archive-toc {
        display: block;
        position: fixed;
        left: calc(280px + 800px + 20px);
        top: 20px;
        width: 160px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

.archive-toc-years {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-toc-year {
    margin-bottom: 8px;
}

.archive-toc-year > a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.archive-toc-year > a:hover {
    color: var(--hover-color);
}

.archive-toc-months {
    list-style: none;
    margin: 0;
    padding: 0 0 0 12px;
}

.archive-toc-months li {
    margin-bottom: 2px;
}

.archive-toc-months a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 2px 0;
    transition: color 0.2s ease;
    font-size: 0.9em;
}

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

.archive-toc-count {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: normal;
}
