/* ============================================================
   DOCUMENTATION ARTICLE STYLES - InfraPilot
   Professional technical article reading experience
   ============================================================ */

/* Back link in header */
.docs-back-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border-light);
    border-radius: var(--docs-radius);
    color: var(--docs-text-secondary);
    text-decoration: none;
    margin-right: 10px;
    transition: var(--docs-transition);
}

.docs-back-link:hover {
    background: var(--docs-border-light);
    color: var(--docs-text);
}

/* Article grid adjustment */
.docs-article-grid {
    grid-template-columns: 220px minmax(0, 1fr) 180px;
}

/* Breadcrumb */
.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--docs-text-muted);
    margin-bottom: 24px;
}

.docs-breadcrumb a {
    color: var(--docs-text-secondary);
    text-decoration: none;
    transition: var(--docs-transition);
}

.docs-breadcrumb a:hover {
    color: var(--docs-primary);
}

.docs-breadcrumb i {
    font-size: 9px;
    color: var(--docs-border);
}

.docs-breadcrumb span {
    color: var(--docs-text);
    font-weight: 500;
}

/* Article Header */
.docs-article-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--docs-border-light);
}

.docs-article-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    color: var(--docs-primary);
    background: var(--docs-primary-light);
}

/* Tag color variations */
.docs-article-tag[data-tag="Sizing"] {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.docs-article-tag[data-tag="Performance"] {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.docs-article-tag[data-tag="Deployment"] {
    color: #ea580c;
    background: rgba(234, 88, 12, 0.1);
}

.docs-article-tag[data-tag="Providers"] {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
}

.docs-article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--docs-text);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.docs-article-lead {
    font-size: 1.125rem;
    color: var(--docs-text-secondary);
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 24px;
}

.docs-article-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.docs-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--docs-text-muted);
}

.docs-info-item i {
    font-size: 14px;
}

/* Like Button */
.docs-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--docs-text-secondary);
    cursor: pointer;
    transition: var(--docs-transition);
}

.docs-like-btn:hover {
    background: var(--docs-primary-light);
    border-color: var(--docs-primary);
    color: var(--docs-primary);
}

.docs-like-btn.liked {
    background: var(--docs-primary);
    border-color: var(--docs-primary);
    color: white;
}

.docs-like-btn i {
    font-size: 14px;
    transition: transform 200ms;
}

.docs-like-btn.liked i {
    transform: scale(1.1);
}

/* ============================================================
   ARTICLE CONTENT - Typography System
   ============================================================ */

.docs-article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--docs-text);
    max-width: 100%;
}

/* Paragraphs */
.docs-article-content p {
    margin: 1.5em 0;
}

/* Headings */
.docs-article-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--docs-text);
    margin: 3rem 0 1.25rem;
    padding-top: 1rem;
    letter-spacing: -0.02em;
    scroll-margin-top: 100px;
}

.docs-article-content h4:first-child {
    margin-top: 0;
    padding-top: 0;
}

.docs-article-content h5 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--docs-text);
    margin: 2rem 0 1rem;
}

/* Links */
.docs-article-content a {
    color: var(--docs-primary);
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    text-underline-offset: 2px;
    transition: var(--docs-transition);
}

.docs-article-content a:hover {
    text-decoration-color: var(--docs-primary);
}

/* Lists */
.docs-article-content ul,
.docs-article-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.docs-article-content li {
    margin: 0.75em 0;
    line-height: 1.7;
}

.docs-article-content ul li::marker {
    color: var(--docs-primary);
}

/* Code */
.docs-article-content code {
    font-family: var(--docs-font-mono, 'SF Mono', 'Monaco', 'Inconsolata', monospace);
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #d6336c;
    font-weight: 500;
}

/* Code blocks */
.docs-article-content pre {
    background: #0f172a;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 1.75em 0;
    overflow-x: auto;
    border: 1px solid #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.docs-article-content pre code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #f1f5f9 !important;
    font-size: 13px;
    line-height: 1.75;
    font-weight: 400;
    display: block;
    white-space: pre;
}

/* Code block with syntax highlighting hints */
.docs-article-content pre code .comment,
.docs-article-content pre code [class*="comment"] {
    color: #94a3b8 !important;
}

/* Tables */
.docs-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 14px;
}

.docs-article-content th {
    background: var(--docs-sidebar-bg);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--docs-border);
    color: var(--docs-text);
}

.docs-article-content td {
    padding: 12px 16px;
    border: 1px solid var(--docs-border-light);
    color: var(--docs-text-secondary);
}

.docs-article-content tbody tr:hover {
    background: var(--docs-sidebar-bg);
}

/* Blockquote / Callout */
.docs-article-content blockquote {
    margin: 2em 0;
    padding: 16px 20px;
    background: rgba(37, 99, 235, 0.05);
    border-left: 4px solid var(--docs-primary);
    border-radius: 0 var(--docs-radius) var(--docs-radius) 0;
}

.docs-article-content blockquote p {
    margin: 0;
    color: var(--docs-text-secondary);
}

/* Images */
.docs-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--docs-radius);
    margin: 2em 0;
}

/* ============================================================
   ARTICLE FOOTER NAVIGATION
   ============================================================ */

.docs-article-footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--docs-border-light);
}

.docs-footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.docs-nav-prev,
.docs-nav-next {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border-light);
    border-radius: var(--docs-radius);
    text-decoration: none;
    transition: var(--docs-transition);
}

.docs-nav-prev:hover,
.docs-nav-next:hover {
    border-color: var(--docs-primary);
    box-shadow: var(--docs-shadow-sm);
}

.docs-nav-next {
    text-align: right;
    align-items: flex-end;
}

.docs-nav-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docs-text-muted);
    margin-bottom: 6px;
}

.docs-nav-label i {
    font-size: 12px;
}

.docs-footer-nav .docs-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--docs-text);
}

/* Article CTA */
.docs-article-cta {
    margin-top: 48px;
}

/* ============================================================
   RELATED ARTICLES
   ============================================================ */

.docs-related {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--docs-border-light);
}

.docs-related-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--docs-text);
    margin-bottom: 24px;
}

.docs-related-title i {
    color: var(--docs-primary);
}

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

.docs-related-card {
    display: block;
    padding: 20px;
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border-light);
    border-radius: var(--docs-radius);
    text-decoration: none;
    transition: var(--docs-transition);
}

.docs-related-card:hover {
    border-color: var(--docs-primary);
    box-shadow: var(--docs-shadow);
    transform: translateY(-2px);
}

.docs-related-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    color: var(--docs-primary);
    background: var(--docs-primary-light);
}

.docs-related-tag[data-tag="Sizing"] {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.docs-related-tag[data-tag="Performance"] {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.docs-related-tag[data-tag="Deployment"] {
    color: #ea580c;
    background: rgba(234, 88, 12, 0.1);
}

.docs-related-tag[data-tag="Providers"] {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
}

.docs-related-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--docs-text);
    margin-bottom: 8px;
}

.docs-related-card p {
    font-size: 13px;
    color: var(--docs-text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.docs-related-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--docs-text-muted);
}

.docs-related-meta i {
    font-size: 12px;
}

/* ============================================================
   TOC STYLES FOR ARTICLE
   ============================================================ */

.docs-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.docs-toc-item {
    display: block;
    font-size: 12px;
    color: var(--docs-text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: var(--docs-transition);
    line-height: 1.4;
}

.docs-toc-item:hover {
    color: var(--docs-text-secondary);
    background: var(--docs-sidebar-bg);
}

.docs-toc-item.active {
    color: var(--docs-primary);
    background: var(--docs-primary-light);
    border-left-color: var(--docs-primary);
    font-weight: 500;
}

.docs-toc-empty {
    font-size: 12px;
    color: var(--docs-text-muted);
    font-style: italic;
}

/* ============================================================
   RESPONSIVE DESIGN FOR ARTICLE
   ============================================================ */

@media (max-width: 1200px) {
    .docs-article-grid {
        grid-template-columns: 220px 1fr;
    }

    .docs-toc {
        display: none;
    }
}

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

    .docs-sidebar {
        display: none;
    }

    .docs-article-title {
        font-size: 2rem;
    }

    .docs-article-content h4 {
        font-size: 1.25rem;
    }

    .docs-footer-nav {
        grid-template-columns: 1fr;
    }

    .docs-nav-next {
        text-align: left;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .docs-breadcrumb {
        font-size: 12px;
        margin-bottom: 24px;
    }

    .docs-article-title {
        font-size: 1.75rem;
    }

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

    .docs-article-info {
        gap: 12px;
    }

    .docs-info-item {
        font-size: 12px;
    }

    .docs-article-content {
        font-size: 15px;
    }

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

    .docs-related-grid {
        grid-template-columns: 1fr;
    }

    .docs-cta-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   ARTICLE CONTENT COMPONENTS (ip-* classes from DB content)
   ============================================================ */

/* Article meta info */
.ip-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--docs-border-light);
}

.ip-updated {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--docs-text-muted);
}

.ip-updated i {
    font-size: 14px;
}

/* Info boxes */
.ip-info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid #0ea5e9;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 1.5em 0;
}

.ip-info-box p {
    margin: 0.5em 0;
    font-size: 14px;
    color: #0c4a6e;
}

.ip-info-box p:first-child {
    margin-top: 0;
}

.ip-info-box p:last-child {
    margin-bottom: 0;
}

/* Feature grid */
.ip-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 1.5em 0;
}

.ip-feature-card {
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border-light);
    border-radius: 8px;
    padding: 20px;
}

.ip-feature-card h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--docs-text);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ip-feature-card p {
    font-size: 13px;
    color: var(--docs-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.ip-feature-card ul {
    margin: 8px 0 0;
    padding-left: 1.25em;
}

.ip-feature-card li {
    font-size: 13px;
    color: var(--docs-text-secondary);
    margin: 4px 0;
}

/* Steps box */
.ip-steps-box {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-left: 4px solid #a855f7;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 1.5em 0;
}

.ip-steps-box p {
    margin: 0.75em 0;
    font-size: 14px;
    color: #581c87;
}

.ip-steps-box p:first-child {
    margin-top: 0;
}

.ip-steps-box p:last-child {
    margin-bottom: 0;
}

/* Links grid */
.ip-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.5em 0;
}

.ip-links-grid a {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border-light);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--docs-text);
    text-decoration: none;
    transition: var(--docs-transition);
}

.ip-links-grid a:hover {
    border-color: var(--docs-primary);
    color: var(--docs-primary);
}

/* CTA buttons */
.ip-cta-small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--docs-primary);
    color: white !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none !important;
    margin: 1.5em 0;
    transition: var(--docs-transition);
}

.ip-cta-small:hover {
    background: var(--docs-primary-dark);
    color: white !important;
}

/* Sources section */
.ip-sources {
    background: var(--docs-sidebar-bg);
    border: 1px solid var(--docs-border-light);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 2em;
}

.ip-sources h6 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--docs-text-muted);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ip-sources h6 i {
    font-size: 14px;
}

.ip-sources p {
    font-size: 12px;
    color: var(--docs-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.ip-sources a {
    color: var(--docs-primary);
}
