/* ============================================================================
   Documentation Patterns (Manual-Style)
   ============================================================================ */

/* Main docs section */
.section-docs {
    background: linear-gradient(135deg, rgba(40, 45, 54, 0.95) 0%, rgba(28, 33, 41, 0.98) 100%);
    padding: 0.75rem 2.5rem;
    /* Further reduced from 1.5rem */
    border-top: 2px solid rgba(255, 126, 34, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-right: 320px;
}

/* Docs heading with anchor support */
.docs-heading {
    color: #ff7e22 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem) !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 0.5rem !important;
    /* Reduced from 1rem */
    margin-top: 0 !important;
    padding-left: 0 !important;
    position: relative;
}

.docs-heading::before {
    content: "§";
    position: absolute;
    left: -1.5rem;
    color: rgba(255, 126, 34, 0.3);
    font-weight: 400;
    font-size: 1.2em;
}

/* Intro paragraph */
.docs-intro {
    color: rgba(230, 237, 243, 0.8) !important;
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1rem !important;
    /* Significantly reduced from 2.5rem */
    max-width: 1100px;
}

/* Subheadings */
.docs-subhead {
    color: #e6edf3 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    /* Reduced from 1.5rem */
    margin-top: 0.5rem !important;
    border-bottom: 1px solid rgba(255, 126, 34, 0.1);
    padding-bottom: 0.25rem;
}

/* Tiny headings for lists */
.docs-tiny-head {
    color: #ff7e22 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
}

/* Documentation lists */
.docs-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.docs-list li {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 1rem;
    color: rgba(230, 237, 243, 0.9);
    line-height: 1.6;
}

.docs-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #ff7e22;
    font-size: 1.1em;
}

.docs-list li strong {
    color: #ff7e22;
    font-weight: 600;
}

/* Media block container */
.docs-media-block {
    margin-top: 0.25rem !important;
    /* Ultra-compact */
    margin-bottom: 0.75rem !important;
    gap: 2rem !important;
}

/* Thumbnails Grid */
.docs-image-grid {
    margin-top: 1.5rem !important;
    margin-bottom: 2rem !important;
    gap: 1.5rem !important;
    align-items: stretch !important;
    /* Stretch columns to equal height */
}

.docs-image-grid .wp-block-column {
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
}

.docs-image-grid .docs-image {
    flex: 1;
    /* Make card fill column height */
    display: flex;
    flex-direction: column;
}

.docs-image-grid .docs-image img {
    aspect-ratio: 16 / 10;
    /* Fixed aspect ratio for thumbnails */
    object-fit: cover;
    /* Fill the area without distortion */
    width: 100%;
}

/* Docs image container - base style only, doesn't force size */
.docs-image {
    border: 1px solid rgba(255, 126, 34, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(45, 51, 61, 0.5);
    transition: all 0.3s ease;

    /* Robust shrink-to-fit border + centering */
    display: table;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    max-width: 100%;
    position: relative;
}

/* Internal containers should not block shrinking */
.docs-image .wp-block-group__inner-container,
.docs-image>div {
    display: table-cell;
    vertical-align: middle;
    width: auto;
    max-width: 100%;
}

.docs-image:hover {
    border-color: rgba(255, 126, 34, 0.5);
    box-shadow: 0 4px 16px rgba(255, 126, 34, 0.15);
}

.docs-image img {
    display: block;
    width: auto;
    /* Natural width to shrink the container */
    max-width: 100%;
    height: auto;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Force uniform grid columns */
.docs-image-grid .docs-image {
    width: 100% !important;
    display: block !important;
}

/* Let side-by-side media hug its content */
.docs-media-block .docs-image {
    width: auto;
    height: auto;
}

.docs-image-grid .docs-image img,
.docs-media-block .docs-image img {
    height: auto;
    object-fit: contain !important;
    /* Never crop screenshots */
    flex-grow: 1;
}

/* In the 3-across grid, we force a uniform cinematic crop to make the UI look organized.
   The user can still see the full image by clicking to zoom. */
.docs-image-grid .cinemaview-zoom img {
    aspect-ratio: 21 / 9 !important;
    object-fit: cover !important;
    /* Fill the placeholder completely */
    width: 100% !important;
}

.docs-image:hover img {
    transform: scale(1.02);
}

.docs-image figcaption {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255, 126, 34, 0.7);
    text-align: center;
    font-style: italic;
}

/* Cinema View modifier */
.cinemaview-zoom {
    border-radius: 4px;
    /* Sharper corners for cinema */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.cinemaview-zoom img {
    filter: brightness(0.9) contrast(1.1);
    transition: all 0.5s ease;
    object-fit: contain !important;
    /* Never crop, show full image */
    height: auto;
}

.cinemaview-zoom:hover img {
    filter: brightness(1.0) contrast(1.0);
    transform: scale(1.01);
}

/* Pro Tip / Note blocks */
.docs-note-tip {
    background: linear-gradient(135deg, rgba(255, 126, 34, 0.08) 0%, rgba(255, 126, 34, 0.05) 100%);
    border-left: 4px solid #ff7e22;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.docs-note-tip .note-icon {
    color: #ff7e22 !important;
    font-size: 1.2rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    font-weight: 600 !important;
}

.docs-note-tip p {
    color: rgba(230, 237, 243, 0.9) !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

.docs-note-tip code {
    background: rgba(0, 0, 0, 0.4);
    color: #ff7e22;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
}

/* ============================================================================
   Docs Callout Box (Pro Tip style but without icons)
   ============================================================================ */

.docs-callout-box {
    background: linear-gradient(90deg, rgba(255, 126, 34, 0.08) 0%, rgba(255, 126, 34, 0.02) 100%);
    border-left: 4px solid #ff7e22;
    border-radius: 4px 12px 12px 4px;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    position: relative;
    overflow: hidden;
}

.docs-callout-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.callout-title {
    color: #ff7e22 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.callout-content {
    color: rgba(230, 237, 243, 0.9) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 0 !important;
}

.docs-callout-box:hover {
    background: linear-gradient(90deg, rgba(255, 126, 34, 0.12) 0%, rgba(255, 126, 34, 0.04) 100%);
    transition: background 0.3s ease;
}

/* Technical Specs Accordion */
.docs-specs-accordion {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2.5rem;
    overflow: hidden;
    /* Prevent scrollbar on hover */
}

.docs-specs-accordion .accordion-title {
    color: rgba(230, 237, 243, 0.9) !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase;
}

/* Specs table */
.specs-table {
    margin: 0 !important;
    overflow: hidden;
    /* Prevent scrollbar on hover */
}

.specs-table table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
}

.specs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(230, 237, 243, 0.8);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.specs-table td:first-child {
    width: 35%;
    color: rgba(255, 126, 34, 0.9);
    font-weight: 600;
}

.specs-table tr:last-child td {
    border-bottom: none;
}

/* ENHANCED HOVER: Более выразительный эффект */
.specs-table tr {
    position: relative;
    transition: all 0.25s ease;
}

.specs-table tr::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #ff7e22;
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.specs-table tr:hover::before {
    transform: scaleY(1);
}

.specs-table tr:hover {
    background: linear-gradient(90deg, rgba(255, 126, 34, 0.12) 0%, rgba(255, 126, 34, 0.05) 50%, transparent 100%);
    transform: translateX(3px);
    /* Reduced shift to prevent scrollbar */
}

.specs-table tr:hover td {
    color: #e6edf3;
}

.specs-table tr:hover td:first-child {
    color: #ff7e22;
    text-shadow: 0 0 8px rgba(255, 126, 34, 0.3);
}

/* ============================================================================
   Documentation Table (with headers)
   ============================================================================ */

.docs-table {
    margin: 2rem 0 !important;
    overflow-x: auto;
}

.docs-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid rgba(255, 126, 34, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

/* Table header */
.docs-table thead {
    background: linear-gradient(135deg, rgba(255, 126, 34, 0.2) 0%, rgba(255, 126, 34, 0.12) 100%);
}

.docs-table thead tr {
    border-bottom: 2px solid rgba(255, 126, 34, 0.4);
}

.docs-table th {
    padding: 1rem 1.25rem;
    color: #ff7e22 !important;
    font-weight: 700;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(255, 126, 34, 0.4);
    background: transparent;
}

.docs-table th:not(:last-child) {
    border-right: 1px solid rgba(255, 126, 34, 0.15);
}

/* Table body */
.docs-table tbody tr {
    transition: all 0.25s ease;
    background: transparent;
}

.docs-table td {
    padding: 0.9rem 1.25rem;
    color: rgba(230, 237, 243, 0.9) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
    font-weight: 400;
}

.docs-table td:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.docs-table tbody tr:last-child td {
    border-bottom: none;
}

/* Hover effect - simple and clean */
.docs-table tbody tr:hover {
    background: rgba(255, 126, 34, 0.08);
}

.docs-table tbody tr:hover td {
    color: #e6edf3 !important;
}

/* Remove special styling for first column */
.docs-table td:first-child {
    font-weight: 400;
    color: rgba(230, 237, 243, 0.9) !important;
}

.docs-table tbody tr:hover td:first-child {
    color: #e6edf3 !important;
}

/* ============================================================================
   Documentation Code Block
   ============================================================================ */

.docs-code {
    background: rgba(13, 17, 23, 0.7) !important;
    border: 1px solid rgba(255, 126, 34, 0.3) !important;
    border-left: 4px solid #ff7e22 !important;
    border-radius: 6px !important;
    padding: 1.5rem !important;
    margin: 1.5rem 0 !important;
    overflow-x: auto;
    position: relative;
}

.docs-code::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 126, 34, 0.03) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 6px;
}

.docs-code code {
    font-family: 'IBM Plex Mono', 'Consolas', 'Monaco', monospace !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: #e6edf3 !important;
    background: transparent !important;
    padding: 0 !important;
    position: relative;
    z-index: 1;
}

/* Syntax highlighting support (if needed) */
.docs-code code .keyword {
    color: #ff7e22;
    font-weight: 600;
}

.docs-code code .string {
    color: #a5d6ff;
}

.docs-code code .comment {
    color: #8b949e;
    font-style: italic;
}

.docs-code code .function {
    color: #d2a8ff;
}

/* Scrollbar styling for code block */
.docs-code::-webkit-scrollbar {
    height: 8px;
}

.docs-code::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.docs-code::-webkit-scrollbar-thumb {
    background: rgba(255, 126, 34, 0.5);
    border-radius: 4px;
}

.docs-code::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 126, 34, 0.7);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .section-docs {
        padding: 0.75rem 1rem;
    }

    .docs-callout-box {
        padding: 1.25rem 1rem;
    }

    .docs-note-tip {
        padding: 1rem;
    }

    .docs-heading {
        font-size: clamp(1.4rem, 7vw, 2.6rem) !important;
    }
}

@media (max-width: 1024px) {
    .section-docs {
        padding: 2.5rem 1.5rem;
        margin-right: 0;
        /* Remove sidebar space on tablets/mobile */
    }

    .docs-heading::before {
        display: none;
        /* Hide section symbol on mobile */
    }

    .docs-media-block {
        flex-direction: column-reverse;
        /* Image first on mobile */
    }

    .docs-media-block .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    .specs-table td {
        display: block;
        width: 100% !important;
        padding: 0.5rem;
    }

    .specs-table td:first-child {
        padding-bottom: 0.25rem;
        border-bottom: none;
    }

    .specs-table tr {
        display: block;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .specs-table tr:last-child {
        border-bottom: none;
    }
}

/* ============================================================================
   Table of Contents (TOC) Styles - STICKY SIDEBAR VERSION
   ============================================================================ */

/* Main container - positioned on the right side */
.docs-toc-container {
    position: sticky;
    top: 2rem;
    float: right;
    width: 280px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(35, 41, 51, 0.96) 0%, rgba(24, 28, 36, 0.98) 100%);
    padding: 2rem 1.5rem;
    margin-left: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 126, 34, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

/* Custom scrollbar for sidebar */
.docs-toc-container::-webkit-scrollbar {
    width: 6px;
}

.docs-toc-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.docs-toc-container::-webkit-scrollbar-thumb {
    background: rgba(255, 126, 34, 0.4);
    border-radius: 3px;
}

.docs-toc-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 126, 34, 0.6);
}

.toc-title {
    color: #ff7e22 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    text-align: left !important;
    letter-spacing: -0.02em !important;
}

.toc-intro {
    color: rgba(230, 237, 243, 0.6) !important;
    text-align: left !important;
    margin-bottom: 1.5rem !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 126, 34, 0.15);
}

/* Remove columns layout - make vertical stack */
.toc-grid {
    display: block !important;
    gap: 0 !important;
}

.toc-grid .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.toc-category {
    background: rgba(45, 51, 61, 0.4);
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.5rem;
    transition: none;
}

.toc-category:hover {
    border-color: transparent;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.toc-category-title {
    color: rgba(255, 126, 34, 0.9) !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 126, 34, 0.2);
}

.toc-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.toc-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.toc-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: rgba(255, 126, 34, 0.5);
    font-size: 0.9em;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toc-list li:hover::before {
    color: #ff7e22;
    transform: translateX(2px);
}

.toc-list li a {
    color: rgba(230, 237, 243, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    transition: all 0.2s ease;
    display: block;
}

.toc-list li a:hover {
    color: #ff7e22;
    text-decoration: none;
    transform: translateX(2px);
}

/* Active link highlighting - current section */
.toc-list li a.active {
    color: #ff7e22;
    font-weight: 600;
    position: relative;
    background: linear-gradient(90deg, rgba(255, 126, 34, 0.15) 0%, transparent 100%);
    padding: 0.25rem 0.5rem;
    margin-left: -0.5rem;
    border-left: 3px solid #ff7e22;
    border-radius: 2px;
}

.toc-list li a.active::before {
    content: "▸";
    position: absolute;
    left: -1rem;
    color: #ff7e22;
    font-size: 1em;
    animation: pulse-arrow 2s ease-in-out infinite;
}

@keyframes pulse-arrow {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(0);
    }

    50% {
        opacity: 1;
        transform: translateX(2px);
    }
}

/* Smooth scroll behavior for anchor links */
html {
    scroll-behavior: smooth;
}

/* Optional: Highlight target section when navigated to */
:target {
    animation: highlight-section 1.5s ease;
    scroll-margin-top: 2rem;
    /* Offset for sticky header if you have one */
}

@keyframes highlight-section {
    0% {
        background: rgba(255, 126, 34, 0.15);
    }

    100% {
        background: transparent;
    }
}

/* Responsive TOC - stack normally on tablets and mobile */
@media (max-width: 1024px) {
    .docs-toc-container {
        position: static;
        float: none;
        width: 100%;
        max-height: none;
        margin-left: 0;
        margin-bottom: 3rem;
        padding: 2rem 1.5rem;
    }

    .toc-title {
        text-align: center !important;
        font-size: 1.4rem !important;
    }

    .toc-intro {
        text-align: center !important;
    }

    /* On tablets, show 2 columns */
    .toc-grid {
        display: flex !important;
        flex-wrap: wrap;
        gap: 1rem !important;
    }

    .toc-grid .wp-block-column {
        flex-basis: calc(50% - 0.5rem) !important;
        width: calc(50% - 0.5rem) !important;
    }
}

@media (max-width: 782px) {

    /* On mobile, single column */
    .toc-grid {
        flex-direction: column;
    }

    .toc-grid .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    .toc-category {
        margin-bottom: 1.5rem;
    }
}

/* ============================================================================
   Image Zoom (Lightbox) Styles
   ============================================================================ */

/* Zoomable cursor hint */
.docs-image img.zoomable {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.docs-image img.zoomable:hover {
    transform: scale(1.01);
}

/* Lightbox Overlay */
.docs-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 12, 16, 0.98);
    /* Slightly darker for better focus */
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    /* Start from top to allow scrolling tall images */
    justify-content: center;
    overflow-y: auto;
    /* Enable vertical scrolling for long reports */
    padding: 4rem 2rem;
    /* Add some breathing room */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: zoom-out;
}

.docs-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Zoom Content Container */
.docs-zoom-content {
    position: relative;
    max-width: min(96vw, 1800px);
    /* Increased from 1000px to allow high-res screenshots to shine */
    margin: auto;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.9);
    border-radius: 4px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.docs-zoom-overlay.active .docs-zoom-content {
    transform: scale(1);
}

.docs-zoom-content img {
    display: block;
    width: auto;
    /* Use natural width */
    height: auto;
    max-width: 100%;
    /* Stay within the 1000px limit */
    object-fit: contain;
}

/* Close Button */
.docs-zoom-close {
    position: fixed;
    /* Fixed so it's always available when scrolling */
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    opacity: 0.7;
    transition: all 0.2s;
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.docs-zoom-close:hover {
    opacity: 1;
    color: #ff7e22;
    /* Brand orange */
}

/* ============================================================================
   Landing Page: Phase Sections (Analyze, Visualize, Report)
   ============================================================================ */

.phase-block {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.phase-block .wp-block-columns {
    align-items: center;
    gap: 4rem;
}

/* The underlying large phase text (e.g. 01 ANALYZE) */
.phase-number {
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-size: 15vw;
    font-weight: 900;
    color: rgba(255, 126, 34, 0.03);
    line-height: 1;
    z-index: 0;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

.phase-content {
    position: relative;
    z-index: 1;
}

.phase-title {
    color: #ff7e22 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 3rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.04em !important;
    margin-bottom: 0.5rem !important;
    text-transform: uppercase;
}

.phase-subtitle {
    color: #e6edf3 !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 2rem !important;
    opacity: 0.9;
    text-transform: uppercase;
    display: block;
    border-left: 2px solid #ff7e22;
    padding-left: 1rem;
}

.phase-text {
    color: rgba(230, 237, 243, 0.85) !important;
    font-size: 1.15rem !important;
    line-height: 1.8 !important;
    margin-bottom: 2.5rem !important;
}

/* Ensure images in these blocks have the signature border */
.phase-media .wp-block-image {
    position: relative;
    display: inline-block;
    border: 1px solid rgba(255, 126, 34, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 126, 34, 0.1);
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
}

.phase-media img {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.phase-media:hover img {
    transform: scale(1.02);
}

@media (max-width: 782px) {
    .phase-block {
        padding: 4rem 1.5rem;
    }

    .phase-block .wp-block-columns {
        gap: 2rem;
    }

    .phase-title {
        font-size: 2.2rem !important;
    }
}

/* ============================================================================
   Changelog pattern (changelog-section)
   ============================================================================ */

.changelog-section .display-text {
    margin-bottom: 0.5rem !important;
}

.changelog-section .wp-block-details {
    margin-top: 0.5rem;
    margin-bottom: 0.35rem;
    border: 1px solid rgba(255, 126, 34, 0.22);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.changelog-section .wp-block-details summary {
    cursor: pointer;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #e6edf3;
    padding: 0.85rem 1rem;
    list-style: none;
    border-bottom: 1px solid transparent;
}

.changelog-section .wp-block-details[open] summary {
    border-bottom-color: rgba(255, 126, 34, 0.15);
    color: #ff9a4d;
}

.changelog-section .wp-block-details summary::-webkit-details-marker {
    display: none;
}

.changelog-section .wp-block-details > *:not(summary) {
    padding-left: 1rem;
    padding-right: 1rem;
}

.changelog-section .wp-block-details .docs-tiny-head {
    margin-top: 1rem !important;
}

.changelog-section .wp-block-details .docs-tiny-head:first-of-type {
    margin-top: 0.35rem !important;
}

.changelog-section .wp-block-details .docs-list {
    margin-bottom: 0.75rem !important;
}

.changelog-section .docs-note-tip {
    margin-top: 1.75rem;
}


/* Mobile hotfixes for documentation layout
   Purpose: prevent horizontal overflow, keep zoomed images centered,
   and improve touch comfort on small screens.
*/

/* 1) Global overflow safety for docs section */
.section-docs,
.section-docs * {
    box-sizing: border-box;
}

.section-docs {
    overflow-x: clip;
}

/* 2) Keep media and tables inside viewport */
.docs-media-block,
.docs-image-grid,
.docs-image,
.docs-image img,
.docs-table,
.specs-table,
.docs-code,
.docs-specs-accordion {
    max-width: 100%;
}

/* 3) Prevent hover transforms from pushing content horizontally */
.specs-table tr:hover {
    transform: none;
}

/* 4) Better horizontal handling for wide tables/code */
.docs-table,
.specs-table,
.docs-code {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.docs-table table,
.specs-table table {
    min-width: 640px;
}

/* 5) Lightbox centering fix (was visually drifting right on phones) */
.docs-zoom-overlay {
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.docs-zoom-content {
    width: min(96vw, 1800px);
    max-width: min(96vw, 1800px);
    margin: 0 auto;
}

.docs-zoom-content img {
    width: 100%;
    max-height: calc(100dvh - 40px);
    object-fit: contain;
}

/* 6) Touch targets + wider active reading area on phones */
@media (max-width: 782px) {
    .section-docs {
        margin-right: 0;
        padding: 1rem 0.875rem;
    }

    .docs-heading,
    .docs-intro,
    .docs-subhead,
    .docs-list,
    .docs-note-tip,
    .docs-callout-box,
    .docs-specs-accordion,
    .docs-table,
    .docs-code {
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .docs-list li {
        padding-left: 1.35rem;
    }

    .toc-list li a {
        padding: 0.45rem 0.25rem;
        min-height: 40px;
    }

    .docs-image {
        width: 100% !important;
        display: block !important;
    }

    .docs-image .wp-block-group__inner-container,
    .docs-image > div {
        display: block;
        width: 100%;
    }

    .docs-table table,
    .specs-table table {
        min-width: 560px;
    }
}

/* 7) Extra-small phones */
@media (max-width: 480px) {
    .section-docs {
        padding: 0.875rem 0.75rem;
    }

    .docs-callout-box,
    .docs-note-tip,
    .docs-specs-accordion {
        padding: 1rem;
    }

    .docs-table th,
    .docs-table td,
    .specs-table td {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .docs-table table,
    .specs-table table {
        min-width: 520px;
    }
}
