:root {
    --bg: #ffffff;
    --fg: #444444;
    --accent: #1982d1;
    --border: #dddddd;
    --muted: #666666;
    --white: #ffffff;
    --hover-bg: #f0f0f0;
    --error: #f44336;
    --nav-arrow: #888888;
    --card: rgba(0, 0, 0, 0.02);
    --tag-bg: #eeeeee;
    --tag-hover: #d6d6d6;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    font-size: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    gap: 0.5rem;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    background-color: var(--bg);
    color: var(--accent);
    text-decoration: none;
}

.pagination-link:hover {
    background-color: var(--hover-bg);
    text-decoration: none;
}

.pagination-current {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    background-color: var(--accent);
    color: var(--white);
}

.pagination-ellipsis {
    padding: 0.5rem 1rem;
}

@media (max-width: 640px) {
    .pagination a {
        font-size: 0.9rem;
    }
}


/* Side navigation arrows */
.side-nav {
    position: fixed;
    top: 10rem;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
    z-index: 10;
}

.nav-arrow {
    position: absolute;
    top: 0;
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-arrow);
    opacity: 0.1;
    transition: opacity 0.2s;
    text-decoration: none;
    pointer-events: auto;
}

.nav-arrow:hover {
    opacity: 0.2;
    text-decoration: none;
}

.nav-prev {
    left: calc(50% - 480px - 128px);
}

.nav-next {
    right: calc(50% - 480px - 128px);
}

@media (max-width: 640px) {
    .side-nav {
        display: none;
    }
}

/* Comment Tree */
.comments-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.comment {
    margin-top: 1rem;
    padding-left: 2rem;
    border-left: 2px solid var(--border);
}

.comment-header {
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: bold;
}

.comment-date {
    font-size: 0.875rem;
    color: var(--muted);
}

.comment-content {
    margin-top: 0.5rem;
}

.comment-content p {
    margin: 0;
}

.comment-actions {
    margin-top: 0.5rem;
}

.comment-children {
    margin-top: 0.5rem;
}

/* Comment Form & UI */
.comment-actions-top {
    margin-bottom: 1rem;
}

.comment-toggle-link {
    font-size: 0.9em;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
}

.comment-toggle-link:hover {
    text-decoration: none;
}

.comment-form-container {
    display: none;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--card);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-form-name {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 1rem;
}

.comment-form-editor {
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 1rem;
    line-height: 1.4;
    overflow-y: auto;
}

.comment-form-editor:empty:before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.comment-form-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-form-error {
    display: none;
    color: var(--error);
    margin-bottom: 10px;
}

.btn-submit, .btn-cancel {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-submit {
    background: var(--accent);
    color: var(--white);
}

.btn-cancel {
    background: var(--tag-bg);
    color: var(--muted);
}

/* Site Header & Footer */
.site-header,
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 50;
    height: 4rem;
    background-color: var(--bg);
}

.site-header {
    top: 0;
    border-bottom: 1px solid var(--border);
}

.site-footer {
    bottom: 0;
    border-top: 1px solid var(--border);
}

.site-header-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
}

.site-footer-bar {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    gap: 0.5rem;
}

.site-footer-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

a.site-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--fg);
    text-decoration: none;
}

a.site-title:hover {
    text-decoration: none;
}

/* Header nav */
.site-header-bar nav {
    display: flex;
    gap: 1.5rem;
}

.site-header-bar nav a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
}

.site-header-bar nav a:hover {
    text-decoration: underline;
}

.site-header-bar nav a.active {
    font-weight: bold;
}

@media (max-width: 640px) {
    .site-header-bar {
        flex-wrap: nowrap;
    }

    .site-header-bar nav {
        gap: 0.75rem;
    }

    .site-header-bar nav a {
        font-size: 0.9rem;
    }

    .site-footer-bar {
        font-size: 0.9rem;
    }

    .site-footer-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
