﻿/**
 * Features page — wiki-style layout, Avalon palette (see betawiki.css).
 */

.features-kb {
    --kb-text: var(--text-main, #6f6551);
    --kb-muted: rgba(111, 101, 81, 0.78);
    --kb-line: rgba(111, 101, 81, 0.12);
    --kb-panel: rgba(255, 255, 255, 0.62);
    --kb-shadow: 0 6px 22px rgba(61, 54, 42, 0.07);

    padding-bottom: 56px;
}

.features-kb__breadcrumbs {
    margin-bottom: 18px;
}

.features-kb__meta {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: var(--kb-muted);
}

.features-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(--kb-shadow);
}

.features-kb__title {
    font-family: 'Angelus Medieval', serif;
    font-size: clamp(1.45rem, 3vw, 2rem);
    color: var(--kb-text);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.features-kb__lead {
    margin: 0;
    max-width: 56ch;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--kb-muted);
}

.features-kb__server-toggle {
    flex-shrink: 0;
}

.features-kb__hero-wrap {
    margin-bottom: 22px;
}

.features-kb__hero-banner {
    width: 100%;
    min-height: 180px;
    border-radius: 14px;
    border: 1px solid rgba(212, 150, 0, 0.22);
    background-color: rgba(111, 101, 81, 0.08);
    background-image:
        linear-gradient(135deg, rgba(111, 101, 81, 0.35) 0%, rgba(212, 150, 0, 0.15) 50%, transparent 100%),
        var(--features-hero-bg, none);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.features-kb__layout.wiki-layout {
    align-items: flex-start;
    gap: 28px;
}

.features-kb__sidebar {
    width: 300px;
    position: sticky;
    top: 92px;
}

.features-kb__nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.features-kb__nav-item {
    display: flex;
    align-items: flex-start;
    gap: 0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.features-kb__nav-item.wiki-nav-sidebar__item {
    padding: 14px 16px;
}

.features-kb__nav-item.active,
.features-kb__nav-item.is-active,
.features-kb__nav-item.wiki-nav-sidebar__item.active {
    background: linear-gradient(135deg, rgba(212, 150, 0, 0.2) 0%, rgba(212, 150, 0, 0.08) 100%);
    border-color: rgba(212, 150, 0, 0.42);
}

.features-kb__nav-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.features-kb__nav-icon.wiki-nav-sidebar__icon {
    margin-top: 2px;
}

.features-kb__main {
    flex: 1;
    min-width: 0;
    max-width: none;
    width: 100%;
}

.features-kb__layout .wiki-with-sidebar.wiki-content {
    max-width: 960px;
}

.features-kb__section-block {
    scroll-margin-top: 110px;
    margin-bottom: 36px;
}

.features-kb__section-head {
    margin-bottom: 16px;
}

.features-kb__section-title {
    font-family: 'Angelus Medieval', serif;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    color: var(--kb-text);
    margin: 0 0 6px;
}

.features-kb__section-sub {
    margin: 0;
    font-size: 0.96rem;
    color: var(--kb-muted);
    line-height: 1.45;
}

/* One column: wiki tables + long HTML need full width; multi-column was crushing layout */
.features-kb__card-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.features-kb__card {
    border-radius: 12px;
    border: 1px solid var(--kb-line);
    background: var(--kb-panel);
    padding: 14px 16px;
    box-shadow: var(--kb-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: features-fade-up 0.45s ease both;
    min-width: 0;
}

.features-kb__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(61, 54, 42, 0.11);
}

.features-kb__card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.features-kb__card-icon {
    display: inline-flex;
    color: rgba(212, 150, 0, 0.92);
    flex-shrink: 0;
}

.features-kb__card-icon .wiki-svg-icon {
    width: 22px;
    height: 22px;
}

.features-kb__card-title {
    font-family: 'Angelus Medieval', serif;
    font-size: 1.05rem;
    margin: 0;
    color: var(--kb-text);
    line-height: 1.25;
}

.features-kb__card-excerpt {
    margin: 0 0 10px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--kb-muted);
}

.features-kb__card-bullets {
    margin: 0 0 10px;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--kb-text);
    line-height: 1.45;
}

.features-kb__details {
    margin-top: 6px;
    border-top: 1px solid rgba(111, 101, 81, 0.1);
    padding-top: 8px;
}

.features-kb__details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary, #d49600);
    list-style: none;
}

.features-kb__details summary::-webkit-details-marker {
    display: none;
}

.features-kb__details-body {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.65;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 0;
}

.features-kb__details-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Wiki HTML inside cards: block flow + tables (overrides other global table rules) */
.features-kb .wiki-body__content p,
.features-kb .features-kb__details-body p {
    margin: 0 0 12px;
}

.features-kb .wiki-body__content p:last-child,
.features-kb .features-kb__details-body p:last-child {
    margin-bottom: 0;
}

.features-kb .wiki-body__content h2,
.features-kb .wiki-body__content h3,
.features-kb .features-kb__details-body h2,
.features-kb .features-kb__details-body h3 {
    margin: 1.1em 0 0.5em;
    clear: both;
    font-family: 'Angelus Medieval', serif;
    color: var(--kb-text);
}

.features-kb .wiki-body__content h2:first-child,
.features-kb .wiki-body__content h3:first-child,
.features-kb .features-kb__details-body h2:first-child,
.features-kb .features-kb__details-body h3:first-child {
    margin-top: 0;
}

.features-kb .wiki-body__content table,
.features-kb .features-kb__details-body table {
    display: table;
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 12px 0 16px;
    table-layout: auto;
    background: rgba(255, 255, 255, 0.5);
}

.features-kb .wiki-body__content th,
.features-kb .wiki-body__content td,
.features-kb .features-kb__details-body th,
.features-kb .features-kb__details-body td {
    padding: 8px 10px;
    border: 1px solid rgba(111, 101, 81, 0.22);
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.features-kb .wiki-body__content th p,
.features-kb .wiki-body__content td p,
.features-kb .features-kb__details-body th p,
.features-kb .features-kb__details-body td p {
    margin: 0 0 4px;
}

.features-kb .wiki-body__content th p:last-child,
.features-kb .wiki-body__content td p:last-child,
.features-kb .features-kb__details-body th p:last-child,
.features-kb .features-kb__details-body td p:last-child {
    margin-bottom: 0;
}

.features-kb .wiki-body__content pre,
.features-kb .features-kb__details-body pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(111, 101, 81, 0.06);
    border: 1px solid var(--kb-line);
    font-size: 0.85rem;
}

.features-kb .wiki-body__content ul,
.features-kb .wiki-body__content ol,
.features-kb .features-kb__details-body ul,
.features-kb .features-kb__details-body ol {
    margin: 0 0 12px;
    padding-left: 1.25rem;
}

.features-kb__highlight-section {
    margin-top: 8px;
    margin-bottom: 28px;
}

.features-kb__highlight-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.features-kb__highlight-card {
    display: grid;
    grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--kb-line);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--kb-shadow);
}

.features-kb__highlight-visual {
    border-radius: 10px;
    border: 1px solid rgba(212, 150, 0, 0.18);
    min-height: 100px;
    background-size: cover;
    background-position: center;
    background-color: rgba(212, 150, 0, 0.1);
}

.features-kb__highlight-title {
    font-family: 'Angelus Medieval', serif;
    font-size: 1.05rem;
    margin: 0 0 6px;
    color: var(--kb-text);
}

.features-kb__highlight-excerpt {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: var(--kb-muted);
    line-height: 1.45;
}

.features-kb__notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid rgba(212, 150, 0, 0.28);
    background: rgba(212, 150, 0, 0.07);
    color: var(--kb-text);
}

.features-kb__notice .wiki-svg-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: rgba(212, 150, 0, 0.95);
    margin-top: 2px;
}

.features-kb__notice p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
}

.features-kb__empty {
    padding: 24px;
    border-radius: 12px;
    border: 1px dashed rgba(111, 101, 81, 0.35);
    background: rgba(255, 255, 255, 0.65);
    color: var(--kb-muted);
}

.features-kb a:focus-visible,
.features-kb summary:focus-visible {
    outline: 2px solid rgba(212, 150, 0, 0.85);
    outline-offset: 2px;
}

@keyframes features-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .features-kb__layout.wiki-layout {
        flex-direction: column;
    }

    .features-kb__sidebar {
        width: 100%;
        position: static;
    }

    .features-kb__nav-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .features-kb__nav-item.wiki-nav-sidebar__item {
        flex: 0 0 auto;
        min-width: 220px;
        max-width: 300px;
    }

    .features-kb__nav-item .wiki-nav-sidebar__excerpt {
        display: none;
    }

    .features-kb__masthead {
        flex-direction: column;
        align-items: stretch;
    }

    .features-kb__server-toggle {
        width: 100%;
        justify-content: stretch;
    }

    .features-kb__server-toggle .wiki-toggle-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .features-kb__highlight-card {
        grid-template-columns: 1fr;
    }

    .features-kb__highlight-visual {
        min-height: 140px;
    }
}
