/* Klartext frontend styles — theme-agnostic with sensible defaults */

.klartext-search-box {
    margin-bottom: 25px;
}

.klartext-search-box .search-group {
    display: flex;
    gap: 10px;
}

.klartext-search-box .form-control {
    flex: 1;
}

.klartext-search-form {
    margin-bottom: 20px;
}

.klartext-search-form .search-group {
    display: flex;
    gap: 10px;
}

.klartext-search-form .form-control {
    flex: 1;
}

.klartext-search-summary {
    color: #666;
    margin-bottom: 15px;
}

.klartext-search-meta {
    color: #888;
    font-size: 0.85em;
    margin: 5px 0;
}


.klartext-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.klartext-category-card {
    margin-bottom: 0;
}

.klartext-category-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25em;
}

.klartext-category-title a {
    text-decoration: none;
}

.klartext-category-description {
    color: #666;
    margin-bottom: 15px;
}

.klartext-article-snippets {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.klartext-article-snippets li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.klartext-article-snippets li:last-child {
    border-bottom: none;
}

.klartext-empty {
    color: #999;
    font-size: 0.9em;
    margin: 10px 0 15px;
}

.klartext-subheading {
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.1em;
}

/* Article layout: main + TOC sidebar */
.klartext-article-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 30px;
    align-items: start;
}

.klartext-article-main {
    min-width: 0;
}

.klartext-toc-sidebar {
    position: sticky;
    top: 20px;
}

.klartext-toc-inner {
    padding: 15px 18px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.klartext-toc-title {
    margin: 0 0 10px 0;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
}

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

.klartext-toc li {
    padding: 3px 0;
    font-size: 0.92em;
}

.klartext-toc a {
    text-decoration: none;
    color: inherit;
}

.klartext-toc a:hover {
    text-decoration: underline;
}

.klartext-toc-level-3 {
    padding-left: 1em !important;
}

.klartext-toc-level-4 {
    padding-left: 2em !important;
}

/* Article body typography */
.klartext-article-title {
    margin-top: 0;
    margin-bottom: 10px;
}

.klartext-article-meta {
    color: #777;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.klartext-meta-item {
    margin-right: 15px;
}

.klartext-meta-item a {
    color: inherit;
}

.klartext-article-body {
    line-height: 1.6;
}

.klartext-article-body h2,
.klartext-article-body h3,
.klartext-article-body h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.klartext-article-body pre {
    margin: 1em 0;
    overflow-x: auto;
}

.klartext-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.klartext-article-body th,
.klartext-article-body td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.klartext-article-body th {
    background: #f5f5f5;
    font-weight: 600;
}

.klartext-article-body blockquote {
    margin: 1em 0;
    padding: 10px 20px;
    border-left: 4px solid #ccc;
    background: #fafafa;
    color: #555;
}

.klartext-article-body img {
    max-width: 100%;
    height: auto;
}

.klartext-permalink {
    margin-left: 0.5em;
    color: #aaa;
    text-decoration: none;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.15s;
}

.klartext-article-body h2:hover .klartext-permalink,
.klartext-article-body h3:hover .klartext-permalink,
.klartext-article-body h4:hover .klartext-permalink {
    opacity: 1;
}

/* Mobile: stack TOC under article */
@media (max-width: 768px) {
    .klartext-article-layout {
        grid-template-columns: 1fr;
    }

    .klartext-toc-sidebar {
        position: static;
    }
}

/* Voting widget — "Was this helpful?" at the bottom of an article */
.klartext-voting {
    margin-top: 32px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #f7f7f7;
    text-align: center;
}

.klartext-voting-prompt {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.klartext-voting-buttons {
    display: inline-flex;
    gap: 12px;
}

.klartext-voting-buttons .klartext-vote-btn {
    min-width: 110px;
}

.klartext-voting-buttons .klartext-vote-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.klartext-voting-stats {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

.klartext-voting-thanks {
    margin: 0;
    color: #555;
}

.klartext-voting-error {
    margin: 10px 0 0 0;
    color: #c00;
}

/* Breadcrumb — module-rendered, theme-independent navigation */
.klartext-breadcrumb {
    margin-bottom: 16px;
}

.klartext-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
}

.klartext-breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.klartext-breadcrumb li + li::before {
    content: "›";
    margin: 0 6px 0 2px;
    color: #999;
}

.klartext-breadcrumb a {
    color: #337ab7;
    text-decoration: none;
}

.klartext-breadcrumb a:hover {
    text-decoration: underline;
}

.klartext-breadcrumb [aria-current="page"] {
    color: #555;
}
