/* Entries placed on the week grid, including drag-to-move states. */

/* JS sets --start / --dur (minutes) and --col / --cols (overlap layout);
   all geometry is derived here from --hour-height. */
.event {
  position: absolute;
  top: calc(var(--hour-height) * var(--start) / 60);
  height: max(calc(var(--hour-height) * var(--dur) / 60 - 2px), 16px);
  left: calc(100% * var(--col) / var(--cols) + 2px);
  width: calc(100% / var(--cols) - 4px);
  padding: 3px 6px 3px 8px;
  font-size: 0.8rem;
  line-height: 1.25;
  overflow: hidden;
  color: var(--text);
  /* light wash of the ink colour, solid bar on the left like a pen stroke */
  background: color-mix(in srgb, var(--c) var(--event-wash), var(--sheet));
  border-left: 4px solid color-mix(in srgb, var(--c) var(--event-bar), var(--text));
  cursor: pointer;
}
.event:hover {
  background: color-mix(in srgb, var(--c) var(--event-wash-hover), var(--sheet));
  z-index: 5;
}
.event .title {
  font-weight: 700;
  /* tint the title toward the entry colour but keep it readable */
  color: color-mix(in srgb, var(--c) var(--event-title), var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event .time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-soft);
}
.event.priority-high .title::before {
  content: "★ ";
  color: var(--secondary);
}

/* drag to move (see js/views/drag-move.js) */
.event.movable { cursor: grab; touch-action: none; user-select: none; }
.event.dragging {
  z-index: 20;
  cursor: grabbing;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--accent) 45%, transparent);
}
.event.drag-ghost { opacity: 0.35; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

/* Small screens (keep the breakpoint in sync across files) */
@media (max-width: 760px) {
  .event .time { display: none; }
}
