/* Public-docs site styling. Pairs with resources/views/layouts/docs.blade.php
 * and resources/views/docs/*. Mirrors the .tk-message-html typography
 * pattern from ticketing for the article body. */

.docs-body {
    background: #f7f8fa;
    color: #222;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
}

.docs-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.docs-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111;
    text-decoration: none;
}

.docs-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.docs-search-box {
    position: relative;
    width: 320px;
    max-width: 100%;
}

.docs-search-input {
    width: 100%;
}

.docs-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-height: 480px;
    overflow-y: auto;
    z-index: 110;
}

.docs-search-results-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f1f4;
    color: inherit;
    text-decoration: none;
}

.docs-search-results-item:hover {
    background: #f7f8fa;
}

.docs-search-results-item__title {
    font-weight: 600;
    margin: 0 0 4px;
}

.docs-search-results-item__excerpt {
    color: #666;
    font-size: 0.875rem;
    margin: 0;
}

.docs-search-results-item__category {
    color: #1e87f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-main {
    padding: 32px 0;
    min-height: calc(100vh - 200px);
}

.docs-hero {
    text-align: center;
    padding: 48px 16px;
}

.docs-hero h1 {
    font-size: 2.5rem;
    margin: 0 0 8px;
    color: #111;
}

.docs-hero p {
    color: #555;
    font-size: 1.125rem;
    margin: 0 0 24px;
}

.docs-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.docs-category-card {
    display: block;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

.docs-category-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.docs-category-card h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
}

.docs-category-card .docs-meta {
    color: #888;
    font-size: 0.875rem;
}

.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .docs-layout { grid-template-columns: 1fr; }
}

.docs-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.docs-sidebar h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin: 0 0 12px;
}

.docs-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-sidebar li { margin: 4px 0; }

.docs-sidebar a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    color: #444;
    text-decoration: none;
}

.docs-sidebar a:hover,
.docs-sidebar a.is-active {
    background: #eaf2fb;
    color: #1e87f0;
    text-decoration: none;
}

.docs-breadcrumb {
    font-size: 0.875rem;
    color: #777;
    margin-bottom: 8px;
}

.docs-breadcrumb a { color: #1e87f0; text-decoration: none; }

.docs-article {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px 40px;
}

.docs-article h1 {
    font-size: 2rem;
    margin: 0 0 16px;
}

.docs-article-body {
    line-height: 1.7;
    font-size: 1rem;
}

.docs-article-body h2 { font-size: 1.5rem; margin-top: 32px; }
.docs-article-body h3 { font-size: 1.25rem; margin-top: 24px; }
.docs-article-body h4 { font-size: 1.05rem; margin-top: 20px; }

.docs-article-body code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
}

.docs-article-body pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
}

.docs-article-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.docs-article-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}

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

.docs-article-body th { background: #f7f8fa; }

.docs-article-body blockquote {
    border-left: 4px solid #1e87f0;
    padding: 4px 16px;
    color: #555;
    margin: 16px 0;
}

.docs-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.docs-related {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.docs-shared-banner {
    background: #fff7e6;
    border: 1px solid #ffe1a8;
    color: #8a5a00;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
}

.docs-footer {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 24px 0;
}

/* Article meta line: reading time + last-updated + copy-link button */
.docs-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: -8px 0 20px;
    color: #777;
    font-size: 0.875rem;
}

.docs-article-meta__item i {
    margin-right: 6px;
    color: #999;
}

.docs-copy-link {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #555;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8125rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.docs-copy-link:hover { background: #f7f8fa; color: #1e87f0; border-color: #cfd6dd; }
.docs-copy-link.is-copied { background: #eaf6ec; border-color: #b8e0c0; color: #2c7a3c; }

/* Server-side TOC injected before the article body */
.docs-toc {
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 0 28px;
    font-size: 0.9375rem;
}

.docs-toc h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin: 0 0 10px;
}

.docs-toc ul { list-style: none; padding: 0; margin: 0; }
.docs-toc li { margin: 2px 0; }
.docs-toc li.is-h3 { padding-left: 16px; }

.docs-toc a {
    color: #444;
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1.4;
}

.docs-toc a:hover { background: #eaf2fb; color: #1e87f0; }

/* Prev/next inter-article navigation */
.docs-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.docs-prev-next a {
    display: block;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.docs-prev-next a:hover {
    border-color: #1e87f0;
    color: #1e87f0;
    box-shadow: 0 4px 12px rgba(30, 135, 240, 0.08);
}

.docs-prev-next .label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-prev-next .title { font-weight: 600; margin-top: 4px; }
.docs-prev-next .next { text-align: right; }

@media (max-width: 600px) {
    .docs-prev-next { grid-template-columns: 1fr; }
    .docs-prev-next .next { text-align: left; }
}

/* Search-result highlighting */
mark {
    background: #fff5b1;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* "Was this helpful?" feedback widget */
.docs-feedback {
    margin: 32px 0 0;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.docs-feedback h4 {
    margin: 0 0 12px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.docs-feedback__buttons { display: flex; gap: 8px; }

.docs-feedback__btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #444;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.docs-feedback__btn:hover { background: #f7f8fa; border-color: #cfd6dd; }
.docs-feedback__btn.is-selected { background: #eaf2fb; border-color: #1e87f0; color: #1e87f0; }
.docs-feedback__btn:disabled { cursor: default; opacity: 0.85; }

.docs-feedback__comment { margin-top: 12px; }
.docs-feedback__comment-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.docs-feedback__comment-actions { display: flex; gap: 8px; margin-top: 8px; }
.docs-feedback__submit-comment,
.docs-feedback__skip {
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 0.8125rem;
}
.docs-feedback__submit-comment {
    background: #1e87f0;
    color: #fff;
    border-color: #1e87f0;
}
.docs-feedback__submit-comment:hover { background: #1973c4; border-color: #1973c4; }
.docs-feedback__thanks {
    color: #2c7a3c;
    font-size: 0.9375rem;
    margin-top: 8px;
}

/* Did-you-mean line on the no-results search page */
.docs-did-you-mean {
    margin-top: 8px;
    font-size: 1rem;
}
.docs-did-you-mean a { font-weight: 600; }

/* Popular-search chip strip below the live search dropdown */
.docs-search-results-popular {
    border-top: 1px solid #f0f1f4;
    padding: 8px 16px 12px;
    background: #fafbfc;
}
.docs-search-results-popular__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 6px;
}
.docs-search-results-popular__chip {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #444;
    font-size: 0.8125rem;
    text-decoration: none;
}
.docs-search-results-popular__chip:hover {
    background: #eaf2fb;
    color: #1e87f0;
    border-color: #cfd6dd;
}

/* Article hero image */
.docs-article-hero {
    margin: 0 0 24px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #f4f4f4;
}

.docs-article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Category page article list with thumbnail thumbnails */
.docs-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.docs-row-thumb {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: 6px;
    background: #f4f4f4;
    display: block;
}

.docs-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.docs-row-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .docs-row {
        flex-direction: column;
    }
    .docs-row-thumb {
        width: 100%;
        height: 160px;
    }
}

/* Category card visuals (E4) */
.docs-cat-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.docs-cat-card__hero {
    height: 120px;
    background: #f4f4f4 center/cover no-repeat;
}

.docs-cat-card__icon-bg {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    font-size: 48px;
    color: #999;
}

.docs-cat-card__icon-inline {
    margin-right: 6px;
}

.docs-cat-card__body {
    padding: 16px;
}

.docs-cat-card--icon-only .docs-cat-card__hero {
    display: none;
}

/* Category page header image (E4) */
.docs-cat-header {
    height: 200px;
    background: #f4f4f4 center/cover no-repeat;
    border-radius: 8px;
    margin-bottom: 24px;
}
