/*
 * Copyright (c) Yurii Temniuk 2026-2026.
 */
.object-list {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.object-list-item {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
    gap: 16px;
}

.object-list-item:last-child {
    border-bottom: 0;
}

.object-list-content {
    flex: 1;
    min-width: 0;
}

.object-list-title {
    font-weight: 600;
}

.object-list-meta {
    margin-top: 2px;
    color: #777;
    font-size: 13px;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
}

.object-list-info {
    flex: 0 0 auto;
    color: #777;
    font-size: 14px;
}

.object-list-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.category-list-item {
    padding-left: calc(
            12px + var(--category-level) * 28px
    );
}

.search-form {
    display: flex;
    max-width: 700px;
    gap: 8px;
    margin-bottom: 24px;
}

.search-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font: inherit;
}

.search-form button {
    padding: 10px 18px;
    border: 0;
    border-radius: 4px;
    font: inherit;
    cursor: pointer;
}

.search-info {
    margin-bottom: 24px;
    color: #666;
}

.search-result {
    padding: 18px 0;
    border-bottom: 1px solid #ddd;
}

.search-result h2 {
    margin: 0 0 6px;
    font-size: 21px;
}

.search-result h2 a {
    text-decoration: none;
}

.search-result h2 a:hover {
    text-decoration: underline;
}

.search-result-category {
    margin-bottom: 8px;
    color: #777;
    font-size: 14px;
}

.search-result p {
    margin: 0 0 10px;
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.search-result-tags span {
    padding: 3px 8px;
    background: #eee;
    border-radius: 3px;
    font-size: 13px;
}

.error-page {
    max-width: 700px;
    margin: 80px auto;
    text-align: center;
}

.error-page h1 {
    margin: 0;
    font-size: 96px;
    line-height: 1;
}

.error-page h2 {
    margin: 20px 0 12px;
    font-size: 28px;
}

.error-page p {
    color: #666;
}

.auth-page {
    max-width: 420px;
    margin: 60px auto;
}

@media (max-width: 700px) {
    .object-list-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .object-list-actions {
        width: 100%;
    }

    .category-list-item {
        padding-left: calc(
                12px + var(--category-level) * 20px
        );
    }
}

.trash-list .object-list-actions {
    align-items: center;
}

.trash-list .object-list-actions form {
    margin: 0;
}

.trash-list .object-list-actions .button {
    white-space: nowrap;
}

/* Home page feed and sidebar */
.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr);
    align-items: start;
    gap: 28px;
}

.page-feed,
.page-sidebar {
    min-width: 0;
}

.page-feed > .page-header {
    margin-bottom: 18px;
}

.page-feed > .page-header h1 {
    margin: 0;
    font-size: 28px;
}

.page-count {
    color: #777;
    font-size: 13px;
    white-space: nowrap;
}

.page-card {
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.page-card + .page-card {
    margin-top: 16px;
}

.page-card-title {
    margin: 0 0 8px;
    font-size: 23px;
    line-height: 1.3;
}

.page-card-title a {
    text-decoration: none;
}

.page-card-title a:hover,
.read-more:hover {
    text-decoration: underline;
}

.page-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-bottom: 12px;
    color: #777;
    font-size: 12px;
}

.page-card-excerpt {
    margin: 12px 0;
    overflow-wrap: anywhere;
}

.page-card-excerpt > :first-child {
    margin-top: 0;
}

.page-card-excerpt > :last-child {
    margin-bottom: 0;
}

.page-card-excerpt img {
    max-width: 100%;
    height: auto;
}

.page-card-excerpt pre {
    max-width: 100%;
    padding: 10px 12px;
    overflow-x: auto;
    background: #f5f5f5;
    border-radius: 4px;
}

.page-card-excerpt table {
    max-width: 100%;
    border-collapse: collapse;
}

.page-card-excerpt th,
.page-card-excerpt td {
    padding: 5px 8px;
    border: 1px solid #bbb;
}

.read-more {
    display: inline-block;
    margin-top: 8px;
    font-weight: 600;
    text-decoration: none;
}

.page-restricted {
    margin: 12px 0 0;
    color: #777;
    font-style: italic;
}

.page-sidebar {
    display: grid;
    gap: 20px;
}

.sidebar-section {
    padding: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.sidebar-section h2 {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}

.sidebar-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-left: 22px;
}

.sidebar-item {
    padding-left: 2px;
    overflow-wrap: anywhere;
}

.sidebar-item a {
    font-weight: 600;
    text-decoration: none;
}

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

.sidebar-item-meta,
.sidebar-empty {
    margin-top: 3px;
    color: #777;
    font-size: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.pagination a {
    text-decoration: none;
    font-weight: 600;
}

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

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pagination-number,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
}

.pagination-number {
    border: 1px solid #ddd;
}

.pagination-active {
    color: #fff;
    background: #333;
    border-color: #333;
}

.pagination-ellipsis {
    color: #777;
}

.pagination-disabled {
    color: #777;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 850px) {
    .page-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .page-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (max-width: 560px) {
    .page-card {
        padding: 16px;
    }

    .page-card-title {
        font-size: 20px;
    }

    .page-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-current {
        order: -1;
        width: 100%;
    }
}

.page.page-detail {
    min-width: 0;
    padding: 22px;
    overflow-wrap: anywhere;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Links for category and tag navigation */
.page-card-meta a,
.page-metadata a,
.object-list-title a {
    color: inherit;
    text-decoration: none;
}

.page-card-meta a:hover,
.page-metadata a:hover,
.object-list-title a:hover {
    text-decoration: underline;
}
