.dynamic-posts-widget-block-editor {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.posts-widget-preview {
    background: white;
    padding: 20px;
    border-radius: 4px;
}

.posts-widget-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.posts-widget-header h3 {
    margin: 0 0 5px 0;
    color: #23282d;
    font-size: 18px;
}

.posts-widget-header .description {
    margin: 0;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.posts-widget-loading {
    text-align: center;
    padding: 40px;
}

.posts-widget-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Grid Layout in Editor */
.posts-widget-list.layout-grid {
    display: grid;
    gap: 20px;
}

.posts-widget-list.layout-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.posts-widget-list.layout-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.posts-widget-list.layout-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Grid Layout Post Items */
.posts-widget-list.layout-grid .post-preview-item {
    flex-direction: column;
}

.posts-widget-list.layout-grid .post-preview-content {
    flex-direction: column;
}

.posts-widget-list.layout-grid .post-preview-image {
    width: 100%;
    height: 150px;
}

.posts-widget-list.layout-grid .drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.posts-widget-list.layout-grid .post-preview-item {
    position: relative;
}

/* List Layout (Default) */
.posts-widget-list.layout-list .post-preview-item {
    display: flex;
    gap: 10px;
}

.post-preview-item {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s ease;
}

.post-preview-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
    background: white;
}

.post-preview-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.drag-handle {
    display: flex;
    align-items: center;
    padding: 0 5px;
    color: #999;
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle span {
    font-size: 20px;
    line-height: 1;
}

.post-preview-content {
    display: flex;
    gap: 15px;
    flex: 1;
}

.post-preview-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 4px;
}

.post-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-preview-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-preview-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    line-height: 1.4;
}

.post-preview-text .post-date,
.post-preview-text .post-author {
    font-size: 12px;
    color: #666;
}

.post-preview-text .post-categories {
    font-size: 11px;
    color: #0073aa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-preview-text p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* Inspector Controls Styling */
.components-panel__body-title button {
    font-weight: 600;
}

.components-base-control__label {
    font-weight: 500;
    margin-bottom: 8px;
}

.components-toggle-control {
    margin-bottom: 16px;
}

.components-range-control {
    margin-bottom: 16px;
}

.components-select-control__input {
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 782px) {
    .post-preview-content {
        flex-direction: column;
    }

    .post-preview-image {
        width: 100%;
        height: 200px;
    }
}
