
/* Layout et interactions des blocs Notion-like */
.notion-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  align-items: start;
}

@media (min-width: 1024px) {
  .notion-blocks-grid {
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }
}

.notion-block-wrapper {
  grid-column: 1 / -1;
  position: relative;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.notion-block-wrapper[data-block-layout="half"],
.notion-block-wrapper.block-layout-half {
  grid-column: auto;
  min-width: 320px;
}

@media (min-width: 1024px) {
  .notion-block-wrapper[data-block-layout="half"],
  .notion-block-wrapper.block-layout-half {
    min-width: 360px;
  }
}

.notion-block-wrapper[data-block-layout="full"],
.notion-block-wrapper.block-layout-full,
.notion-block-wrapper:not([data-block-layout]) {
  grid-column: 1 / -1;
}

.notion-block-wrapper:hover {
  background-color: rgba(17, 24, 39, 0.02);
}

.dark .notion-block-wrapper:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Drag & Drop Visuals */
.notion-block-wrapper.drag-over-top {
  border-top: 2px solid #3b82f6;
  margin-top: -2px; /* Compensate border */
}

.notion-block-wrapper.drag-over-bottom {
  border-bottom: 2px solid #3b82f6;
  margin-bottom: -2px;
}

.notion-block-wrapper.drag-over-left {
  border-left: 2px solid #3b82f6;
  margin-left: -2px;
}

.notion-block-wrapper.drag-over-right {
  border-right: 2px solid #3b82f6;
  margin-right: -2px;
}

/* Specific styling for full width elements */
.notion-block-wrapper.drag-over-top,
.notion-block-wrapper.drag-over-bottom {
  background-color: rgba(59, 130, 246, 0.03);
}

.dark .notion-block-wrapper.drag-over-top,
.dark .notion-block-wrapper.drag-over-bottom,
.dark .notion-block-wrapper.drag-over-left,
.dark .notion-block-wrapper.drag-over-right {
  border-color: #60a5fa;
  background-color: rgba(59, 130, 246, 0.05);
}

.notion-block-wrapper[data-block-type="inline_database"],
.notion-block-wrapper[data-block-type="table"] {
  grid-column: 1 / -1;
}

/* Drag handle dédié pour le déplacement des blocs */
.block-drag-handle {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  cursor: grab;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.notion-block-wrapper:hover .block-drag-handle,
.notion-block-wrapper:focus-within .block-drag-handle {
  opacity: 1;
}

.block-drag-handle:hover {
  color: #4b5563;
  background: #f9fafb;
  border-color: #e5e7eb;
}

.dark .block-drag-handle:hover {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

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