/**
 * Woff Docs Single Page Styles
 * Based on single-page-variation-2.html prototype
 *
 * Note: This file ignores -copy*.css files
 */

/* Top Navigation Bar */
.woff-docs-single-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.woff-docs-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.woff-docs-nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.woff-docs-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #0f172a;
}

.woff-docs-logo-icon {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.woff-docs-logo-text {
    font-weight: 600;
    font-size: 18px;
}

.woff-docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
}

.woff-docs-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.woff-docs-breadcrumb a:hover {
    color: #3b82f6;
}

.woff-docs-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.woff-docs-version-badge {
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.woff-docs-edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.woff-docs-edit-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Main Container */
.woff-docs-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
    background: #f8fafc;
    min-height: calc(100vh - 64px);
    align-items: start;
    overflow: visible;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Define grid areas for main content and sidebar */
.woff-docs-article {
    grid-area: main;
}

.woff-docs-sidebar-wrapper {
    grid-area: sidebar;
}

/* Center-aligned container when sidebar is empty */
.woff-docs-single-container.woff-docs-centered {
    grid-template-columns: 1fr;
    justify-content: center;
    /* Ensure sidebar column maintains space when empty */
    grid-template-areas: "main" "main" "main" "main";
}

/* Center-aligned container when sidebar is empty */
.woff-docs-single-container.woff-docs-centered .woff-docs-article {
    max-width: 800px;
    /* Limit article width for better readability */
    margin: 0 auto;
    /* Center the article */
    transition: all 0.3s ease;
    /* Add transition for smooth layout changes */
}

/* Center-aligned container when sidebar is empty */
.woff-docs-single-container.woff-docs-centered .woff-docs-article {
    max-width: 800px;
    /* Limit article width for better readability */
    margin: 0 auto;
    /* Center the article */
    transition: all 0.3s ease;
    /* Add transition for smooth layout changes */
}

/* Center-aligned container when sidebar is empty */
.woff-docs-single-container.woff-docs-centered .woff-docs-article {
    max-width: 800px;
    /* Limit article width for better readability */
    margin: 0 auto;
    /* Center the article */
    transition: all 0.3s ease;
    /* Add transition for smooth layout changes */
}

/* Center-aligned container when sidebar is empty */
.woff-docs-single-container.woff-docs-centered .woff-docs-article {
    max-width: 800px;
    /* Limit article width for better readability */
    margin: 0 auto;
    /* Center the article */
    transition: all 0.3s ease;
    /* Add transition for smooth layout changes */
}

/* Center-aligned container when sidebar is empty */
.woff-docs-single-container.woff-docs-centered .woff-docs-article {
    max-width: 800px;
    /* Limit article width for better readability */
    margin: 0 auto;
    /* Center the article */
    transition: all 0.3s ease;
    /* Add transition for smooth layout changes */
}

/* Center the article when sidebar is empty */
.woff-docs-single-container.woff-docs-centered .woff-docs-article {
    max-width: 800px;
    /* Limit article width for better readability */
    margin: 0 auto;
    /* Center the article */
}

/* Article Content */
.woff-docs-article {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.woff-docs-article-header {
    padding: 30px;
    border-bottom: 1px solid #f1f5f9;
}

.woff-docs-article-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.woff-docs-category-tag {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woff-docs-reading-time {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.woff-docs-reading-time svg {
    flex-shrink: 0;
}

.woff-docs-search-link {
    margin-bottom: 15px;
}

.woff-docs-search-link a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #6366f1;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.woff-docs-search-link a:hover{
    color: #333;
}
.woff-docs-search-link svg {
    flex-shrink: 0;
}

.woff-docs-article-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #0f172a;
}

.woff-docs-article-meta-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.woff-docs-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.woff-docs-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.woff-docs-author-avatar img {
    border-radius: 50%;
}

.woff-docs-author-details {
    display: flex;
    flex-direction: column;
}

.woff-docs-author-name {
    font-weight: 500;
    color: #0f172a;
    font-size: 14px;
}

.woff-docs-article-date {
    color: #94a3b8;
    font-size: 13px;
}
/* Category Badges */
.woff-docs-article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.woff-docs-category-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.woff-docs-category-badge:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.woff-docs-article-actions {
    /* display: flex; */
    display: none;
    gap: 8px;
}

.woff-docs-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.woff-docs-action-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Table of Contents */
.woff-docs-toc-container {
    padding: 32px 48px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.woff-docs-toc-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.woff-docs-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 24px;
}

.woff-docs-toc-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.woff-docs-toc-number {
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.woff-docs-toc-link {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.woff-docs-toc-link:hover {
    color: #3b82f6;
}

/* Article Content */
.woff-docs-article-content {
    padding: 30px;
    line-height: 1.7;
    color: #64748b;
    font-size: 16px;
}

.woff-docs-article-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 48px;
    color: #0f172a;
    scroll-margin-top: 100px;
}

.woff-docs-article-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 32px;
    color: #0f172a;
    scroll-margin-top: 100px;
}

.woff-docs-article-content p {
    margin-bottom: 16px;
    color: #64748b;
    font-size: 16px;
    line-height: 1.7;
}

.woff-docs-article-content ul,
.woff-docs-article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.woff-docs-article-content li {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 16px;
    line-height: 1.7;
}

/* WordPress Content Styling */
.woff-docs-article-content .wp-block-heading {
    color: #0f172a;
    font-weight: 600;
    margin-bottom: 16px;
}

.woff-docs-article-content .wp-block-paragraph {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: #64748b;
}

.woff-docs-article-content .wp-block-list {
    margin: 16px 0;
    padding-left: 24px;
}

.woff-docs-article-content .wp-block-list li {
    font-size: 16px;
    line-height: 1.7;
    color: #64748b;
}

.woff-docs-article-content .woff-docs-article-reaction .betterdocs-article-reactions {
    margin-top: 0 !important;
    padding: 0 !important;
}

/* Code Blocks */
.woff-docs-code-wrapper {
    position: relative;
    margin: 24px 0;
}

.woff-docs-code-header {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Enhanced copy button styling */
.woff-docs-copy-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid #3b82f6;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    opacity: 0.8;
}

.woff-docs-copy-btn:hover {
    background: #3b82f6;
    color: white;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.woff-docs-copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
    opacity: 1;
}

/* Copy button wrapper for better positioning */
.woff-docs-code-wrapper {
    position: relative;
    margin: 24px 0;
}

.woff-docs-code-wrapper pre {
    margin: 0;
}

/* Code blocks - improved visibility and structure */
.woff-docs-article-content pre,
.woff-docs-article-content code {
    background: #0f172a;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
}

.woff-docs-article-content pre {
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid #e2e8f0;
    padding: 20px;
    position: relative;
    white-space: pre;
    word-wrap: normal;
}

.woff-docs-article-content code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(15, 23, 42, 0.1);
    border-radius: 6px;
    color: #0f172a;
    display: inline;
}

.woff-docs-article-content pre code {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: inherit;
    border-radius: 0;
}

.wp-block-code {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 24px 0;
    position: relative;
    background: #0f172a;
}

.wp-block-code pre {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
}

.woff-docs-code-content pre {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
}

/* Tags */
.woff-docs-article-tags {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #f1f5f9;
}

.woff-docs-article-tags h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #0f172a;
}

.woff-docs-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.woff-docs-tag {
    background: #f8fafc;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.woff-docs-tag:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Article Footer */
.woff-docs-article-footer {
    padding: 32px 48px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.woff-docs-footer-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.woff-docs-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.woff-docs-rating-label {
    font-size: 14px;
    color: #64748b;
}

.woff-docs-stars {
    display: flex;
    gap: 4px;
}

.woff-docs-star {
    font-size: 18px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.woff-docs-star:hover,
.woff-docs-star.active {
    color: #fbbf24;
}

.woff-docs-contribute-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.woff-docs-contribute-btn:hover {
    background: #2563eb;
}

/* Right Sidebar Wrapper */
.woff-docs-sidebar-wrapper {
    grid-column: 2;
    width: 320px;
    min-height: 100px;
    /* Ensure minimum height to prevent layout shift */
    flex-shrink: 0;
    /* Prevent shrinking when content is empty */
    max-width: 320px;
    /* Ensure consistent width */
    box-sizing: border-box;
    /* Include padding and border in width calculation */
}

/* Right Sidebar */
.woff-docs-sidebar {
    position: sticky;
    top: 88px;
    height: fit-content;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    align-self: flex-start;
    will-change: transform;
    z-index: 100;
    backface-visibility: hidden;
    transform: translateZ(0);
    width: 100%;
}

.woff-docs-sidebar-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 24px;
}

.woff-docs-sidebar-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 16px;
}

/* Page Navigation at Bottom */
.woff-docs-page-navigation {
    margin-top: 32px;
}

.woff-docs-nav-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 16px;
}

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

.woff-docs-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.woff-docs-nav-link:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.woff-docs-nav-link.prev {
    justify-content: flex-start;
}

.woff-docs-nav-link.next {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

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

.woff-docs-nav-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.woff-docs-nav-title {
    font-weight: 600;
    color: #0f172a;
}

.woff-docs-nav-icon {
    font-size: 16px;
    color: #3b82f6;
    flex-shrink: 0;
}

.woff-docs-nav-link:hover .woff-docs-nav-icon {
    transform: scale(1.1);
}

.woff-docs-toc-sidebar {
    max-height: 400px;
    overflow-y: auto;
}

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

.woff-docs-toc-sidebar-item {
    margin-bottom: 8px;
}

.woff-docs-toc-sidebar-link {
    display: block;
    padding: 8px 12px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.woff-docs-toc-sidebar-link:hover {
    background: #f8fafc;
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.woff-docs-toc-sidebar-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
    font-weight: 500;
}

/* Disclaimer */
.woff-docs-disclaimer {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #6c757d;
    margin-bottom: 10px;
}

.woff-docs-disclaimer strong {
    font-weight: 600;
    color: #495057;
}

.woff-docs-disclaimer-info {
    border-left: 4px solid #17a2b8;
}

.woff-docs-disclaimer-warning {
    border-left: 4px solid #ffc107;
    background: #fffbeb;
    color: #856404;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.woff-docs-disclaimer-warning p,
.woff-docs-disclaimer-warning div{
    margin: 0 !important;
}

.woff-docs-disclaimer-error {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.woff-docs-disclaimer-success {
    border-left: 4px solid #28a745;
    background: #d1ecf1;
    color: #155724;
}

.woff-docs-disclaimer a {
    color: #667eea;
    text-decoration: none;
}

.woff-docs-disclaimer a:hover {
    text-decoration: underline;
}

/* Prevent layout shift when disclaimer is hidden */
#woff-docs-disclaimer-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#woff-docs-disclaimer-section[style*="display: none"] {
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.woff-docs-disclaimer-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .woff-docs-single-container {
        grid-template-columns: 1fr;
        padding: 24px 16px;
        gap: 24px;
    }

    .woff-docs-article-header {
        padding: 32px 24px;
    }

    .woff-docs-article-title {
        font-size: 28px;
    }

    .woff-docs-article-content {
        padding: 32px 24px;
    }

    .woff-docs-toc-container {
        padding: 24px;
    }

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

    .woff-docs-sidebar-wrapper {
        grid-column: 1;
        width: 100%;
    }

    .woff-docs-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        width: 100%;
    }

    .woff-docs-article-footer {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
    }

    .woff-docs-footer-left {
        width: 100%;
        justify-content: space-between;
    }

    .woff-docs-breadcrumb {
        display: none;
    }

    .woff-docs-nav-left {
        gap: 16px;
    }

    .woff-docs-nav-links {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .woff-docs-nav-link {
        padding: 12px;
    }

    .woff-docs-nav-icon {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {

    .woff-docs-single-header,
    .woff-docs-sidebar,
    .woff-docs-article-footer {
        display: none;
    }

    .woff-docs-single-container {
        grid-template-columns: 1fr;
        max-width: none;
        padding: 0;
        background: white;
    }

    .woff-docs-article {
        border: none;
        border-radius: 0;
    }

    .woff-docs-article-header,
    .woff-docs-article-content {
        padding: 0;
    }

    .woff-docs-toc-container {
        display: none;
    }
}

/* Focus and Accessibility */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

a:focus,
button:focus {
    border-radius: 4px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: #0f172a;
}

/* WordPress Block Editor Fixes */
.woff-docs-article-content .wp-block-group {
    margin-bottom: 24px;
}

.woff-docs-article-content .wp-block-group>* {
    margin-bottom: 16px;
}

.woff-docs-article-content .wp-block-group>*:last-child {
    margin-bottom: 0;
}