/* ==========================================================================
   SI Knowledge Base — scoped styles
   Applies only to: /docs/, /docs-category/*, /docs/[article]/
   ========================================================================== */

/* 5. Hide mega-menu nav and footer link columns on all KB pages */
body.single-docs .fusion-header,
body.post-type-archive-docs .fusion-header,
body.tax-doc_category .fusion-header,
body[class*="single-docs"] .fusion-header,
body.single-docs .fusion-footer-widget-area,
body.post-type-archive-docs .fusion-footer-widget-area,
body.tax-doc_category .fusion-footer-widget-area,
body[class*="single-docs"] .fusion-footer-widget-area {
    display: none !important;
}

/* Fix content overflow on mobile */
@media only screen and (max-width: 800px) {
    body.single-docs .container,
    body.post-type-archive-docs .container,
    body.tax-doc_category .container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* Hide mobile hamburger menu and secondary header right side on KB pages (mobile only) */
@media only screen and (max-width: 1024px) {
    body.single-docs .mob-menu-header-holder,
    body.post-type-archive-docs .mob-menu-header-holder,
    body.tax-doc_category .mob-menu-header-holder,
    body.single-docs .mobmenu-overlay,
    body.post-type-archive-docs .mobmenu-overlay,
    body.tax-doc_category .mobmenu-overlay,
    body.single-docs .fusion-secondary-header .fusion-alignright,
    body.post-type-archive-docs .fusion-secondary-header .fusion-alignright,
    body.tax-doc_category .fusion-secondary-header .fusion-alignright {
        display: none !important;
    }
}

/* Re-enable .noclick links in secondary nav on KB pages */
body.single-docs .fusion-secondary-menu .noclick a,
body.post-type-archive-docs .fusion-secondary-menu .noclick a,
body.tax-doc_category .fusion-secondary-menu .noclick a,
body[class*="single-docs"] .fusion-secondary-menu .noclick a {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* KB page background colors */
body.single-docs .fusion-secondary-header,
body.post-type-archive-docs .fusion-secondary-header,
body.tax-doc_category .fusion-secondary-header,
body.single-docs .fusion-footer-copyright-area,
body.post-type-archive-docs .fusion-footer-copyright-area,
body.tax-doc_category .fusion-footer-copyright-area {
    background-color: #f2f2f2 !important;
}

body.single-docs,
body.post-type-archive-docs,
body.tax-doc_category,
body.single-docs #main,
body.post-type-archive-docs #main,
body.tax-doc_category #main,
body.single-docs #wrapper,
body.post-type-archive-docs #wrapper,
body.tax-doc_category #wrapper,
body.single-docs #boxed-wrapper,
body.post-type-archive-docs #boxed-wrapper,
body.tax-doc_category #boxed-wrapper {
    background-color: #fff !important;
}

/* Breadcrumb: remove truncation on current (last) crumb */
.betterdocs-breadcrumb ul.betterdocs-breadcrumb-list .betterdocs-breadcrumb-item.current span {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
}

/* Remove left padding on update-date span */
.betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list .update-date {
    padding-left: 0 !important;
}

/* 4. Article list hover color */
.betterdocs-title-excerpt-lists .betterdocs-title-excerpt-list:hover {
    background: rgba(58, 134, 255, 0.26) !important;
}

/* Remove top padding reserved for sticky header (hidden on KB pages) */
body.single-docs #main,
body.post-type-archive-docs #main,
body.tax-doc_category #main,
body[class*="single-docs"] #main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Search modal hover + accent color overrides */
#betterdocs-search-modal .betterdocs-search-wrapper .betterdocs-search-details .betterdocs-search-content .betterdocs-search-items-wrapper .betterdocs-search-item-content .betterdocs-search-item-list:hover {
    background-color: rgba(58, 134, 255, 0.06) !important;
}

/* Change search result doc icon and active tab underline from green to blue */
#betterdocs-search-modal .betterdocs-search-item-list .betterdocs-search-item-icon,
#betterdocs-search-modal .betterdocs-search-item-list .betterdocs-search-item-icon svg,
#betterdocs-search-modal .betterdocs-search-item-list .betterdocs-search-item-icon svg path {
    color: #3a86ff !important;
    fill: #3a86ff !important;
}
.betterdocs-search-wrapper .betterdocs-search-details .betterdocs-search-content .betterdocs-search-info-tab .betterdocs-tab-items.active {
    border-bottom-color: #3a86ff !important;
}
.betterdocs-search-wrapper .betterdocs-search-details .betterdocs-search-content .betterdocs-search-info-tab .betterdocs-tab-items.active span svg path {
    fill: #3a86ff !important;
}

/* ==========================================================================
   Dan's base KB CSS (previously in Appearance → Customize → Additional CSS)
   ========================================================================== */

/* AI Power: Complete AI Pack */
.wpaicg-copy-button, .wpaicg-thumbs-up-button, .wpaicg-thumbs-down-button { opacity: 1 !important; visibility: visible !important; filter: invert(44%) sepia(35%) saturate(1675%) hue-rotate(190deg) brightness(102%) contrast(108%); }

/* Heading sizes */
@media screen {
    main.si-doc h1 { font-size: 1.8rem !important; line-height: 1.25 !important; }
    main.si-doc h2 { font-size: 1.4rem !important; line-height: 1.3 !important; }
    main.si-doc h3 { font-size: 1.15rem !important; line-height: 1.35 !important; }
    main.si-doc h4 { font-size: 1rem !important; line-height: 1.4 !important; }
}

@media screen and (min-width: 1024px) {
    /* Widen + center the docs page wrapper */
    body.single-docs .fusion-row,
    body.single-docs .fusion-wrapper,
    body.single-docs main.clearfix,
    body.post-type-archive-docs .fusion-row,
    body.post-type-archive-docs .fusion-wrapper,
    body[class*="single-docs"] .fusion-row,
    body[class*="single-docs"] .fusion-wrapper,
    body[class*="single-docs"] main.clearfix {
        max-width: 1500px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Flex layout override */
    .betterdocs-content-wrapper.grid-col-3,
    .betterdocs-content-wrapper {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }

    /* Hide empty left category sidebar */
    .betterdocs-content-wrapper > aside.betterdocs-full-sidebar-left,
    aside.betterdocs-full-sidebar-left,
    .betterdocs-sidebar-layout-7 {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        flex: 0 0 0 !important;
    }

    /* Content area fills wrapper */
    .betterdocs-content-wrapper > .betterdocs-content-area,
    .betterdocs-content-area {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        grid-column: 1 / -1 !important;
    }

    /* Release the inner BetterDocs container width caps */
    .betterdocs-content,
    .betterdocs-entry-content,
    .betterdocs-content-inner-area {
        max-width: 100% !important;
        width: 100% !important;
    }

    main.si-doc {
        padding-right: 240px !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Tables */
    main.si-doc table {
        border-collapse: collapse !important;
        border: 1px solid #c9cfd9 !important;
        table-layout: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 1rem 0 !important;
    }
    main.si-doc table th,
    main.si-doc table td {
        border: 1px solid #c9cfd9 !important;
        padding: 0.5rem 0.75rem !important;
        vertical-align: top !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }
    main.si-doc table th {
        background: #f4f6fa !important;
        font-weight: 600 !important;
        text-align: left !important;
    }
}

/* Enlarge category tiles */
body.post-type-archive-docs .betterdocs-category-folder-img,
body.tax-doc_category .betterdocs-category-folder-img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    border-radius: 16px;
    object-fit: cover;
}
body.post-type-archive-docs .betterdocs-category-icon,
body.post-type-archive-docs .betterdocs-folder-icon,
body.tax-doc_category .betterdocs-category-icon,
body.tax-doc_category .betterdocs-folder-icon {
    width: auto !important;
    height: auto !important;
    line-height: 0;
}

/* Hide the document icon on sub-category pages */
body.term-drapery-current-luxury .betterdocs-entry-title > span:first-child,
body.term-drapery-wolf-drapery .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-docs .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-coupled .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-duo .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-duo-pocket .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-manual .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-open-roll .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-pocket .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-side-channels .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-troubleshooting .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nino .betterdocs-entry-title > span:first-child,
body.term-motorized-projection-screens-3-or-5-motorized .betterdocs-entry-title > span:first-child,
body.term-motorized-projection-screens-short-throw-lift .betterdocs-entry-title > span:first-child,
body.term-motorized-projection-screens-short-throw-motorized .betterdocs-entry-title > span:first-child,
body.term-motorized-projection-screens-solo-3 .betterdocs-entry-title > span:first-child,
body.term-motorized-projection-screens-zero-g .betterdocs-entry-title > span:first-child,
body.term-motorized-projection-screens-zero-g-pro .betterdocs-entry-title > span:first-child,
body.term-indoor-shades-nano-box .betterdocs-entry-title > span:first-child,
body.term-outdoor-shades-kaos .betterdocs-entry-title > span:first-child,
body.term-outdoor-shades-legacy-outdoor .betterdocs-entry-title > span:first-child {
    display: none !important;
}

/* ==========================================================================
   Article-body styles (formerly embedded as <style> per-article via SI-RESPONSIVE-CSS)
   Moved here so they survive WordPress sanitization.
   ========================================================================== */

/* Image caption */
p.image-caption {
    text-align: center;
    font-size: 0.85em;
    font-style: italic;
    color: #555;
    margin: 0.2em auto 1em auto;
    max-width: 92%;
    line-height: 1.4;
}

/* Callout boxes */
blockquote.callout-danger,
blockquote.callout-warning,
blockquote.callout-info,
blockquote.callout-success,
blockquote.callout-note {
    border-left: 4px solid #888;
    background: #f6f7f9;
    padding: 0.7em 1em;
    margin: 1em 0;
    border-radius: 4px;
    color: #333;
}
blockquote.callout-danger  { border-left-color: #d62828; background: #fdecec; }
blockquote.callout-warning { border-left-color: #f9a826; background: #fff7e6; }
blockquote.callout-info    { border-left-color: #0070cc; background: #e6f0fa; }
blockquote.callout-success { border-left-color: #24c947; background: #e8f8ee; }
blockquote.callout-note    { border-left-color: #7c3aed; background: #f3edff; }
blockquote.callout-danger > :first-child,
blockquote.callout-warning > :first-child,
blockquote.callout-info > :first-child,
blockquote.callout-success > :first-child,
blockquote.callout-note > :first-child { margin-top: 0; }
blockquote.callout-danger > :last-child,
blockquote.callout-warning > :last-child,
blockquote.callout-info > :last-child,
blockquote.callout-success > :last-child,
blockquote.callout-note > :last-child { margin-bottom: 0; }

/* Related-variants footer */
footer.si-related-footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #d0d4d9;
}
footer.si-related-footer .related-variants {
    background: #f6f7f9;
    border-left: 3px solid #7c3aed;
    border-radius: 4px;
    padding: 0.7em 1em;
    font-size: 0.9em;
    color: #444;
}

/* Manual page break */
hr.page-break {
    border: 0;
    border-top: 2px dashed #f73b31;
    margin: 1.5em 0;
    height: 0;
    position: relative;
}
hr.page-break::after {
    content: "Page break";
    display: block;
    text-align: center;
    color: #f73b31;
    font-size: 0.75em;
    margin-top: 0.4em;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.05em;
}
@media print {
    hr.page-break {
        page-break-before: always !important;
        break-before: page !important;
        border-top: 0 !important;
        margin: 0 !important;
    }
    hr.page-break::after { display: none !important; }
}

/* Article header */
.si-article-header {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.9em 0;
    margin: 0 0 1.4em 0;
    border-bottom: 2px solid #e6e8eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.si-header-logos {
    display: flex;
    gap: 0.7em;
    align-items: center;
    flex-shrink: 0;
    padding-right: 1em;
    border-right: 1px solid #d0d4d9;
}
.si-article-header .si-header-logos svg,
.si-article-header .si-header-logos img,
.si-article-header .si-header-logos .si-header-logo {
    width: auto !important;
    max-width: 280px !important;
    max-height: 120px !important;
    display: block !important;
    object-fit: contain !important;
}
.si-article-header .si-header-logos svg { height: 32px; }
.si-article-header .si-header-logos img.si-header-logo-combined { max-width: 360px !important; }

/* Ask ATEN CTA */
.si-header-cta { flex-shrink: 0; display: flex; align-items: center; }
.si-header-ask-aten {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 26px;
    background: linear-gradient(135deg, #7c3aed 0%, #3a86ff 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    box-shadow: 0 3px 12px rgba(124,58,237,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}
.si-header-ask-aten:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.50);
    filter: brightness(1.05);
}
.si-header-ask-aten:active { transform: translateY(0); }
.si-header-ask-aten .si-header-arrow { font-size: 1.1em; transition: transform 0.2s; }
.si-header-ask-aten:hover .si-header-arrow { transform: translateX(3px); }

.si-header-text { flex: 1; min-width: 0; }
.si-header-title { margin: 0; font-size: 1.45em; font-weight: 700; color: #111; line-height: 1.2; }
.si-header-meta {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 0.3em;
    display: flex;
    gap: 0.4em;
    align-items: center;
    flex-wrap: wrap;
}
.si-header-dot { color: #cbd0d5; }

@media (max-width: 600px) {
    .si-article-header { flex-direction: column; align-items: flex-start; gap: 0.6em; padding: 0.7em 0; }
    .si-article-header .si-header-logos svg { height: 24px; }
    .si-article-header .si-header-logos img { max-height: 80px !important; max-width: 200px !important; }
    .si-article-header .si-header-logos img.si-header-logo-combined { max-width: 260px !important; }
    .si-header-title { font-size: 1.2em; }
    .si-header-cta { width: 100%; }
    .si-header-ask-aten { width: 100%; justify-content: center; padding: 11px 18px; font-size: 0.9em; }
}

/* Table of contents */
.si-toc {
    background: #f6f7f9;
    border-left: 3px solid #0070cc;
    border-radius: 6px;
    padding: 0.7em 1em;
    margin: 0 0 1.5em 0;
    font-size: 0.92em;
}
.si-toc strong { display: block; margin-bottom: 6px; color: #333; }
.si-toc ul { list-style: none; padding: 0; margin: 0; }
.si-toc li { margin: 2px 0; }
.si-toc li.si-toc-h3 { padding-left: 18px; font-size: 0.95em; }
.si-toc a { color: #0070cc; text-decoration: none; }
.si-toc a:hover { text-decoration: underline; }
.si-toc-toggle {
    display: none;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    color: #0070cc;
}
@media (min-width: 1100px) {
    .si-toc {
        float: right;
        width: 240px;
        margin: 0 0 1em 1.5em;
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}
@media (max-width: 1099px) {
    .si-toc-toggle { display: block; }
    .si-toc-panel { display: none; margin-top: 8px; }
    .si-toc[data-open="1"] .si-toc-panel { display: block; }
}

/* Mobile article body */
@media (max-width: 700px) {
    .si-doc .article-meta { font-size: 0.82em !important; padding: 0.5em 0.7em !important; }
    .si-doc .related-variants { font-size: 0.82em !important; padding: 0.5em 0.7em !important; }
    .si-doc img, .si-doc video, .si-doc iframe, .si-doc figure, .si-doc .si-embed-yt {
        max-width: 100% !important;
        height: auto !important;
    }
    .si-doc table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .si-doc blockquote.callout-danger,
    .si-doc blockquote.callout-warning,
    .si-doc blockquote.callout-info,
    .si-doc blockquote.callout-success { padding: 0.6em 0.8em !important; font-size: 0.95em; }
    .si-doc ul, .si-doc ol { padding-left: 1.4em; }
}

/* Print */
@page { size: Letter; margin: 0.5in 0.6in; }
@media print {
    .si-article-header {
        display: flex;
        align-items: center;
        gap: 0.8em;
        padding: 0.3em 0 0.5em 0;
        margin: 0 0 0.8em 0;
        border-bottom: 1px solid #888;
        page-break-after: avoid;
        break-after: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .si-article-header .si-header-logos { border-right: 1px solid #ccc; padding-right: 0.8em; }
    .si-article-header .si-header-logos svg,
    .si-article-header .si-header-logos .si-header-logo { height: 28px !important; max-height: 36px !important; }
    .si-article-header .si-header-logos img.si-header-logo-combined { max-width: 180px !important; }
    .si-article-header .si-header-title { font-size: 16pt !important; margin: 0 0 0.15em 0; line-height: 1.15; }
    .si-article-header .si-header-meta { color: #555; font-size: 9pt; }
    .si-article-header .si-header-cta { display: none !important; }

    .si-doc {
        color: #000 !important;
        background: #fff !important;
        font-size: 11pt;
        line-height: 1.45;
        font-family: Georgia, 'Times New Roman', serif;
    }
    .si-doc .article-meta,
    .si-doc .si-toc,
    .si-doc .si-img-toolbar,
    .si-doc .si-img-handle,
    .si-doc [data-si-edit-region] { display: none !important; }
    .si-doc h1 { font-size: 20pt; margin: 0.2em 0 0.3em 0; }
    .si-doc h2 { font-size: 14pt; margin: 0.8em 0 0.2em 0; }
    .si-doc h3 { font-size: 12pt; margin: 0.6em 0 0.2em 0; }
    .si-doc h4 { font-size: 11pt; margin: 0.5em 0 0.15em 0; }
    .si-doc img { max-width: 100% !important; height: auto !important; }
    .si-doc a { text-decoration: underline; color: #000 !important; }
    .si-doc a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 0.82em; color: #444; word-break: break-all; }
    .si-doc a[href^="/docs/"]:after, .si-doc a[href^="#"]:after { content: ""; }
    .si-doc .si-embed-yt iframe { display: none !important; }
    .si-doc .si-embed-yt::after { content: "Video: " attr(data-yt-url); display: block; font-family: monospace; font-size: 0.85em; color: #333; }

    .compact-print { font-size: 9.5pt; line-height: 1.3; }
    .compact-print h1 { font-size: 18pt; }
    .compact-print h2 { font-size: 13pt; margin: 0.5em 0 0.2em 0; }
    .compact-print h3 { font-size: 11pt; margin: 0.4em 0 0.15em 0; }
    .compact-print p { margin: 0 0 0.35em 0; }
    .compact-print ul, .compact-print ol { margin: 0.2em 0 0.4em 1em; }
    .compact-print blockquote { padding: 0.2em 0.5em !important; margin: 0.3em 0 !important; }
    .compact-print h2 { page-break-before: auto !important; break-before: auto !important; }
}

/* ==========================================================================
   1. Fix header and footer full-width on landing + single article pages
      Dan's CSS sets max-width:1500px on ALL .fusion-row and .fusion-wrapper
      for post-type-archive-docs and single-docs, which constrains header/footer rows.
      Reset those specifically for header/footer elements. */
body.single-docs #wrapper.fusion-wrapper,
body.post-type-archive-docs #wrapper.fusion-wrapper,
body[class*="single-docs"] #wrapper.fusion-wrapper,
body.single-docs .fusion-secondary-header .fusion-row,
body.post-type-archive-docs .fusion-secondary-header .fusion-row,
body[class*="single-docs"] .fusion-secondary-header .fusion-row,
body.single-docs .fusion-footer .fusion-row,
body.post-type-archive-docs .fusion-footer .fusion-row,
body[class*="single-docs"] .fusion-footer .fusion-row {
    max-width: none !important;
    width: 100% !important;
}
