/**
 * Articles pages — Avalon wiki-like styling aligned with betawiki/features.
 */

.articles-kb {
    --akb-text: var(--text-main, #6f6551);
    --akb-muted: rgba(111, 101, 81, 0.78);
    --akb-line: rgba(111, 101, 81, 0.14);
    --akb-panel: rgba(255, 255, 255, 0.62);
    --akb-shadow: 0 6px 22px rgba(61, 54, 42, 0.08);

    padding-bottom: 56px;
}

.articles-kb__breadcrumbs {
    margin-bottom: 18px;
}

.articles-kb__masthead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 20px 22px;
    border-radius: 16px;
    border: 1px solid rgba(212, 150, 0, 0.26);
    background: linear-gradient(
        135deg,
        rgba(212, 150, 0, 0.1) 0%,
        rgba(255, 255, 255, 0.78) 55%,
        rgba(111, 101, 81, 0.04) 100%
    );
    box-shadow: var(--akb-shadow);
}

.articles-kb__title {
    margin: 0 0 8px;
    font-family: 'Angelus Medieval', serif;
    font-size: clamp(1.45rem, 3vw, 2rem);
    color: var(--akb-text);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.articles-kb__lead {
    margin: 0;
    max-width: 56ch;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--akb-muted);
}

.articles-kb__search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.articles-kb__search input {
    width: 340px;
    max-width: 60vw;
}

.articles-kb__section {
    margin-bottom: 28px;
}

.articles-kb__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.articles-kb__section-title {
    margin: 0;
    font-family: 'Angelus Medieval', serif;
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    color: var(--akb-text);
}

.articles-kb__section-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--akb-text);
    border: 1px solid rgba(111, 101, 81, 0.28);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.84rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.66);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.articles-kb__section-btn:hover {
    border-color: rgba(212, 150, 0, 0.5);
    background: rgba(255, 255, 255, 0.82);
    transform: translateY(-1px);
}

.articles-kb__section-btn--active {
    border-color: rgba(212, 150, 0, 0.52);
    background: rgba(212, 150, 0, 0.13);
}

.articles-kb__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.articles-kb__card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    border: 1px solid var(--akb-line);
    background: var(--akb-panel);
    box-shadow: var(--akb-shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.articles-kb__card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 150, 0, 0.42);
    box-shadow: 0 10px 26px rgba(61, 54, 42, 0.12);
}

.articles-kb__card-thumb {
    width: 100%;
    height: 144px;
    object-fit: cover;
    display: block;
    background: rgba(212, 150, 0, 0.08);
}

.articles-kb__card-thumb--fallback {
    background-image: linear-gradient(
        135deg,
        rgba(212, 150, 0, 0.28) 0%,
        rgba(111, 101, 81, 0.2) 50%,
        rgba(111, 101, 81, 0.1) 100%
    );
}

.articles-kb__card-body {
    padding: 12px 14px;
}

.articles-kb__card-title {
    margin: 0 0 6px;
    color: var(--akb-text);
    font-size: 1rem;
    line-height: 1.35;
}

.articles-kb__card-excerpt {
    margin: 0 0 8px;
    color: var(--akb-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.articles-kb__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--akb-muted);
    font-size: 0.8rem;
}

.articles-kb__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.articles-kb__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    border: 1px solid var(--akb-line);
    background: var(--akb-panel);
    box-shadow: var(--akb-shadow);
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
}

.articles-kb__row:hover {
    border-color: rgba(212, 150, 0, 0.42);
}

.articles-kb__row-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(111, 101, 81, 0.22);
    background: rgba(212, 150, 0, 0.08);
}

.articles-kb__row-thumb--fallback {
    background-image: linear-gradient(
        135deg,
        rgba(212, 150, 0, 0.28) 0%,
        rgba(111, 101, 81, 0.2) 50%,
        rgba(111, 101, 81, 0.1) 100%
    );
}

.articles-kb__row-title {
    margin: 0 0 4px;
    color: var(--akb-text);
    font-size: 0.98rem;
}

.articles-kb__row-excerpt {
    margin: 0;
    color: var(--akb-muted);
    font-size: 0.86rem;
}

.articles-kb__empty {
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed rgba(111, 101, 81, 0.36);
    background: rgba(255, 255, 255, 0.62);
    color: var(--akb-muted);
}

#all-articles-list {
    scroll-margin-top: 120px;
}

.article-view {
    padding-bottom: 56px;
}

.article-view__breadcrumbs {
    margin-bottom: 18px;
}

.article-view__head {
    margin-bottom: 14px;
}

.article-view__title {
    margin: 0 0 8px;
    font-family: 'Angelus Medieval', serif;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    color: var(--akb-text, #6f6551);
}

.article-view__meta {
    display: flex;
    gap: 14px;
    color: var(--akb-muted, rgba(111, 101, 81, 0.78));
    font-size: 0.85rem;
}

.article-view__thumb {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--akb-line, rgba(111, 101, 81, 0.14));
    margin-bottom: 14px;
    background: rgba(212, 150, 0, 0.08);
}

.article-view__body {
    border-radius: 12px;
    border: 1px solid var(--akb-line, rgba(111, 101, 81, 0.14));
    background: var(--akb-panel, rgba(255, 255, 255, 0.62));
    box-shadow: var(--akb-shadow, 0 6px 22px rgba(61, 54, 42, 0.08));
    padding: 16px;
    color: var(--akb-text, #6f6551);
    line-height: 1.65;
}

.article-view__body h1,
.article-view__body h2,
.article-view__body h3 {
    font-family: 'Angelus Medieval', serif;
    color: var(--akb-text, #6f6551);
}

.article-view__body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .articles-kb__masthead {
        flex-direction: column;
        align-items: stretch;
    }

    .articles-kb__search input {
        width: 100%;
        max-width: none;
    }

    .articles-kb__cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .articles-kb__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .articles-kb__row {
        flex-direction: column;
        align-items: flex-start;
    }

    .articles-kb__row-thumb {
        width: 100%;
        height: 140px;
    }

    .articles-kb__section-head {
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .articles-kb__cards {
        grid-template-columns: 1fr;
    }
}

