/* style.css - Contains all styles for the WT Resizable Columns plugin, including layout, handles, toggles, and responsive adjustments. */

/* Container Override */
.wprc-app-columns {
    display: flex !important;
    height: 100vh;
    margin: 0 !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    position: relative;
}

/* FLUID COLUMNS (Main Content) */
.wprc-app-columns .wprc-col-fluid {
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0% !important;
    min-width: 0 !important;
    transition: width 0.2s ease, flex-basis 0.2s ease;
}

/* =========================================
   SIDEBAR COLUMNS - BASE STYLES
========================================= */
.wprc-app-columns .wprc-col-sidebar {
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: width 0.2s ease, flex-basis 0.2s ease;
}

/* FIXED MODE (Default - takes up space in layout) */
.wprc-app-columns .wprc-sidebar-fixed {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    position: relative;
}

/* OVERLAY MODE (Floats over main content, out of flex flow) */
.wprc-app-columns .wprc-sidebar-overlay {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    z-index: 50;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

/* Position left overlay sidebar */
.wprc-app-columns > .wprc-col-sidebar.wprc-sidebar-overlay:first-of-type {
    left: 0;
}

/* Position right overlay sidebar */
.wprc-app-columns > .wprc-col-sidebar.wprc-sidebar-overlay:last-of-type {
    right: 0;
}

/* When overlay is open, ensure it sits above content */
.wprc-app-columns .wprc-col-sidebar.wprc-sidebar-overlay:not(.wprc-is-collapsed) {
    z-index: 100;
}

/* =========================================
   HANDLE COLUMNS - FOLLOW SIDEBAR MODE
========================================= */
.wprc-app-columns .wprc-col-handle {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    cursor: col-resize;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

/* If next sibling is overlay, handle becomes absolute too */
.wprc-app-columns .wprc-col-handle + .wprc-col-sidebar.wprc-sidebar-overlay {
    position: absolute !important;
}

/* Handle that precedes an overlay sidebar */
.wprc-app-columns .wprc-col-sidebar.wprc-sidebar-overlay + .wprc-col-handle {
    position: absolute !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    width: 8px !important;
    z-index: 101;
}

/* Position handle for left overlay */
.wprc-app-columns .wprc-col-sidebar.wprc-sidebar-overlay:first-of-type + .wprc-col-handle {
    left: 280px;
    top: 0;
    height: 100%;
}

/* Position handle for right overlay */
.wprc-app-columns .wprc-col-sidebar.wprc-sidebar-overlay:last-of-type {
    right: 0;
}

.wprc-app-columns .wprc-col-sidebar.wprc-sidebar-overlay:last-of-type + .wprc-col-handle {
    right: 280px;
    top: 0;
    height: 100%;
}

/* When overlay sidebar is collapsed, adjust handle position */
.wprc-app-columns .wprc-col-sidebar.wprc-sidebar-overlay.wprc-is-collapsed + .wprc-col-handle {
    left: 0 !important;
    right: 0 !important;
    width: 8px;
}

/* THE TOGGLE ACTION BLOCK (The Clickable Area) */
.wprc-toggle-action {
    cursor: pointer;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    pointer-events: auto;
    z-index: 10;
}

/* If toggle is for previous (left sidebar), position on the left */
.wprc-toggle-action[data-toggle-target="previous"] {
    left: 0px;
}

/* If toggle is for next (right sidebar), position on the right */
.wprc-toggle-action[data-toggle-target="next"] {
    right: 0px;
}

/* IMPORTANT: Ensure icons/images inside don't block the click */
.wprc-toggle-action * {
    pointer-events: none !important;
}

/* =========================================
   INVISIBLE HIT RADIUS FOR THE HANDLE
========================================= */
.wprc-app-columns .wprc-col-handle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -4px;
    right: -4px;
    cursor: col-resize;
    z-index: 5;
}

/* Disable transition while dragging */
body.wprc-is-dragging .wp-block-column {
    transition: none !important;
}

/* Protect text highlighting while dragging */
body.wprc-is-dragging {
    user-select: none;
    -webkit-user-select: none;
    cursor: col-resize;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES (Optional)
========================================= */
@media (max-width: 768px) {
    /* Force overlay mode on mobile for better UX */
    .wprc-app-columns .wprc-sidebar-fixed {
        position: absolute !important;
        flex-basis: 0 !important;
        width: 0px !important;
        height: 100% !important;
        z-index: 50;
    }

    /* Position mobile fixed-to-overlay left sidebar */
    .wprc-app-columns > .wprc-col-sidebar.wprc-sidebar-fixed:first-of-type {
        left: 0;
    }

    /* Position mobile fixed-to-overlay right sidebar */
    .wprc-app-columns > .wprc-col-sidebar.wprc-sidebar-fixed:last-of-type {
        right: 0;
    }

    /* Hide handles on mobile */
    .wprc-app-columns .wprc-col-handle {
        display: none;
    }
}