.vlp-post-select-modal {
    box-sizing: border-box;
    width: calc(100vw - 32px);
    max-width: 920px;

    .components-modal__content {
        display: flex;
        flex-direction: column;
        padding-bottom: 24px;
    }

    .vlp-post-select {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .vlp-post-select-input {
        display: flex;
        align-items: stretch;
        flex: 0 0 auto;
        gap: 8px;
        flex-wrap: wrap;

        select,
        .vlp-post-select-search {
            height: 36px;
            line-height: 1.4;
            margin: 0;
        }

        .vlp-post-select-search-wrap {
            position: relative;
            flex: 1 1 280px;
            display: flex;
        }

        .vlp-post-select-search {
            flex: 1 1 auto;
            width: 100%;
            max-width: none;
            padding-right: 36px;
        }

        .vlp-post-select-search-spinner {
            position: absolute;
            top: 50%;
            right: 8px;
            transform: translateY(-50%);
            display: inline-flex;
            pointer-events: none;

            .components-spinner {
                margin: 0;
            }
        }
    }

    .vlp-post-select-results {
        flex: 0 0 auto;
        height: 320px;
        margin-top: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
        transition: opacity 0.15s ease;

        &.is-loading {
            opacity: 0.5;
        }
    }

    .vlp-post-select-posts {
        width: 100%;
        max-width: 100%;
        margin-top: 0;
        border-collapse: collapse;
        table-layout: fixed;

        th {
            text-align: left;
            position: sticky;
            top: 0;
            z-index: 1;
            background: #fff;
            border-bottom: 1px solid #e5e5e5;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #50575e;
            white-space: nowrap;
        }

        th,
        td {
            box-sizing: border-box;
            padding: 8px 12px;
            vertical-align: middle;
        }

        td {
            border-bottom: 1px solid #f0f0f0;
        }

        .vlp-post-select-col-thumbnail {
            width: 60px;
            padding-right: 0;

            img,
            .vlp-post-select-thumbnail-placeholder {
                display: block;
                width: 40px;
                height: 40px;
                border-radius: 4px;
                object-fit: cover;
                background: #f0f0f1;
            }

            .vlp-post-select-thumbnail-placeholder {
                border: 1px dashed #dcdcde;
                box-sizing: border-box;
            }
        }

        .vlp-post-select-col-type {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 96px;
            color: #50575e;
        }

        .vlp-post-select-col-date {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 124px;
            color: #50575e;
        }

        .vlp-post-select-col-title {
            width: auto;
            overflow-wrap: anywhere;

            a {
                display: block;
                max-width: 100%;
                overflow-wrap: anywhere;
                white-space: normal;
                vertical-align: middle;
            }
        }

        .vlp-post-select-col-action {
            width: 132px;
            white-space: nowrap;
            text-align: right;
        }

        .vlp-post-select-row {
            &:hover {
                background-color: #f6f7f7;
            }

            &:last-child td {
                border-bottom: none;
            }
        }

        .vlp-post-select-feedback td {
            padding: 32px 12px;
            text-align: center;
            color: #50575e;
        }
    }

    .vlp-post-select-use {
        &.components-button.is-primary {
            padding: 4px 10px;
            height: auto;
            font-size: 12px;
        }
    }

    .vlp-post-select-loading {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
}

@media screen and (max-width: 782px) {
    .vlp-post-select-modal {
        width: calc(100vw - 24px);

        .vlp-post-select {
            min-height: 0;
        }

        .vlp-post-select-results {
            height: auto;
            min-height: 240px;
            max-height: calc(100vh - 280px);
        }

        .vlp-post-select-posts {
            th,
            td {
                padding: 8px;
            }

            .vlp-post-select-col-thumbnail,
            .vlp-post-select-col-date {
                display: none;
            }

            .vlp-post-select-col-type {
                width: 84px;
            }

            .vlp-post-select-col-action {
                width: 112px;
            }
        }
    }
}

@media screen and (max-width: 480px) {
    .vlp-post-select-modal {
        .vlp-post-select-posts {
            .vlp-post-select-col-type {
                display: none;
            }

            .vlp-post-select-col-action {
                width: 108px;
            }
        }
    }
}
