/* Documentation show page specific styles */

/*
 * Body copy smaller than blog/default prose-lg.
 * TOC (.docs-toc) keeps its own rem sizes and does not shrink with the article.
 */
.prose.docs-article.blog-prose,
.prose.docs-article {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9375rem; /* 15px */
    line-height: 1.65;
}

.prose.docs-article.blog-prose :where(h1, h2, h3, h4, h5, h6, p, a, li, td, th, blockquote),
.prose.docs-article :where(h1, h2, h3, h4, h5, h6, p, a, li, td, th, blockquote) {
    font-family: 'Roboto', sans-serif;
}

@media (min-width: 768px) {
    .prose.docs-article.blog-prose,
    .prose.docs-article {
        font-size: 1rem; /* 16px — was ~1.125rem via prose-lg / text-lg */
        line-height: 1.7;
    }
}

.prose.docs-article .docs-toc {
    font-size: 1rem;
    line-height: 1.5;
}

.prose.docs-article .docs-toc__title {
    font-size: 1.125rem;
    line-height: 1.4;
}

.prose.docs-article .docs-toc__link,
.prose.docs-article #table-of-contents a {
    font-size: 0.875rem;
    line-height: 1.45;
}

/* Headings scale with denser docs body (not TOC title) */
.prose.docs-article h2:not(.docs-toc__title) {
    font-size: 1.375rem;
}

.prose.docs-article h3:not(.docs-toc__title) {
    font-size: 1.2rem;
}

.prose.docs-article h4 {
    font-size: 1.05rem;
}

@media (min-width: 768px) {
    .prose.docs-article h2:not(.docs-toc__title) {
        font-size: 1.5rem;
    }

    .prose.docs-article h3:not(.docs-toc__title) {
        font-size: 1.25rem;
    }

    .prose.docs-article h4 {
        font-size: 1.125rem;
    }
}

/* Responsive images */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Link Tool card — OG preview 1200×630 (не растягивать в flex, не ломать .prose img) */
.prose .help-link-card {
    display: block;
    max-width: 100%;
    overflow: hidden;
}

.prose .help-link-card__row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .prose .help-link-card__row {
        flex-direction: row;
        gap: 1rem;
    }
}

.prose .help-link-card__media {
    flex-shrink: 0;
    width: 100%;
    max-width: 12.5rem;
    margin: 0;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #f3f4f6;
}

@media (min-width: 640px) {
    .prose .help-link-card__media {
        width: 12.5rem;
        max-width: none;
    }
}

.prose .help-link-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
}

.prose .help-link-card__body {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.prose .help-link-card__title {
    margin: 0;
    font-weight: 600;
    color: #111827;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.prose .help-link-card__description {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.prose .help-link-card__url {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #9ca3af;
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Code block improvements */
.prose pre {
    position: relative;
    background: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #2d3748;
}

.prose pre code {
    display: block;
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    border: none;
    border-radius: 0;
    white-space: pre;
    box-decoration-break: initial;
    -webkit-box-decoration-break: initial;
}

.prose .help-code-block pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 1rem;
}

/* Table improvements */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.prose th, .prose td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    text-align: left;
}

.prose th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prose tbody tr:hover {
    background-color: #f7fafc;
}

/* Blockquote improvements */
.prose blockquote {
    border-left: 4px solid #68d391;
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #2d3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 0 0.5rem 0.5rem 0;
    position: relative;
}

.prose blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #68d391;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    line-height: 1;
    opacity: 0.3;
}

/* List improvements — denser than body paragraphs (TipTap wraps items in <p>) */
.prose ul,
.prose ol {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    font-size: inherit;
    line-height: 1.45;
}

.prose li {
    margin-top: 0;
    margin-bottom: 0.2rem;
    color: #4a5568;
    line-height: 1.45;
    font-size: inherit;
}

.prose li > p {
    margin-top: 0;
    margin-bottom: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.prose ul li::marker {
    color: #68d391;
}

.prose ol li::marker {
    color: #68d391;
    font-weight: 600;
}

.prose li > ul,
.prose li > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.95em;
}

/* Checklist styles */
.prose input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: #68d391;
}

/* Link improvements */
.prose a {
    color: #38a169;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.prose a:hover {
    color: #2f855a;
    border-bottom-color: #2f855a;
}

.prose a.cms-callout__btn,
.prose a.cms-button--primary,
.prose a.cms-button--secondary {
    color: #fff;
    border-bottom-color: transparent;
}

.prose a.cms-callout__btn:hover,
.prose a.cms-button--primary:hover,
.prose a.cms-button--secondary:hover {
    color: #fff;
    border-bottom-color: transparent;
}

.prose a.cms-button--outline {
    color: #232b21;
    border: 2px solid #232b21;
    border-bottom-width: 2px;
    border-bottom-color: #232b21;
}

.prose a.cms-button--outline:hover {
    color: #232b21;
    border-color: #232b21;
    border-bottom-color: #232b21;
}

.prose a.cms-button--soft {
    color: #232b21;
    border: 1px solid #e3d8c3;
    border-bottom-width: 1px;
    border-bottom-color: #e3d8c3;
}

.prose a.cms-button--soft:hover {
    color: #232b21;
    border-color: #e3d8c3;
    border-bottom-color: #e3d8c3;
}

/* Header improvements */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #1a202c;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    scroll-margin-top: 2rem;
}

.prose h1 { 
    font-size: 2.25rem; 
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.prose h2 { 
    font-size: 1.875rem; 
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
}

.prose h3 { font-size: 1.5rem; }
.prose h4 { font-size: 1.25rem; }

/* Paragraph improvements */
.prose p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #4a5568;
}

/* Override body paragraph spacing inside list items (after .prose p) */
.prose li > p {
    margin-top: 0;
    margin-bottom: 0;
    line-height: inherit;
    color: inherit;
}

.prose > p,
.prose .cms-media-text__body > p {
    text-indent: 1.5em;
}

.prose li > p,
.prose blockquote > p,
.prose td > p,
.prose th > p,
.prose .cms-callout p,
.prose .cms-alert p,
.prose .cms-faq p {
    text-indent: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* Inline code improvements — только вне <pre>, иначе границы на каждой строке */
.prose :not(pre) > code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #e53e3e;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .prose.docs-article,
    .prose.docs-article.blog-prose {
        font-size: 0.875rem;
    }

    .prose.docs-article .docs-toc {
        font-size: 1rem;
    }

    .prose.docs-article .docs-toc__title {
        font-size: 1.0625rem;
    }

    .prose.docs-article h2:not(.docs-toc__title) { font-size: 1.25rem; }
    .prose.docs-article h3:not(.docs-toc__title) { font-size: 1.1rem; }
    .prose.docs-article h4 { font-size: 1rem; }

    .prose table {
        font-size: 0.75rem;
    }

    .prose th, .prose td {
        padding: 0.5rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .prose {
        color: #000 !important;
    }
    
    .prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
        color: #000 !important;
        page-break-after: avoid;
    }
    
    .prose img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .prose table {
        page-break-inside: avoid;
    }
    
    .prose blockquote {
        page-break-inside: avoid;
    }
}

/* Accessibility improvements */
.prose :focus {
    outline: 2px solid #68d391;
    outline-offset: 2px;
}

/* FAQ accordion: no green focus ring on click */
.prose .cms-faq__q:focus,
.prose .cms-faq__q:focus-visible,
.prose .cms-faq__item:focus,
.prose .cms-faq__item:focus-within {
    outline: none;
    outline-offset: 0;
}

.prose img[alt=""] {
    border: 2px dashed #e2e8f0;
}
