/* The moments cut by hand (app-review-cut*.js): the drop marks, the lifted moment, and the select mode "Group photos". */

/* The gap between two moments: a dashed strip that is there only while a photograph or a moment is carried. It lies over the
   line between two rows and takes no room in the list: in the flow, the strips that appear at the lift pushed every row down by
   their height, so the photograph aimed at was no longer under the finger (positioned against .moments-day-body). */
.moment-gap { display: none; position: absolute; inset-inline: 12px; z-index: 6; transform: translateY(-50%); align-items: center; justify-content: center;
  gap: 8px; min-height: 44px; margin: 0; padding: 6px 12px; border: 2px dashed var(--accent); border-radius: 14px; background: var(--bg, var(--surface));
  color: var(--accent); font-size: .92rem; font-weight: 600; }
.moments-day-body { position: relative; }
.hold-dragging .moment-gap { display: flex; }
.moment-gap[hidden] { display: none; }
.moment-gap.hold-gap { background: color-mix(in srgb, var(--accent) 22%, var(--bg, var(--surface))); border-style: solid; }

/* The centre of a photograph: a ring and a folder (the two become one moment), and the words of what the drop does. */
.moment-cell.hold-onto::before { content: ""; position: absolute; inset: -3px; z-index: 4; border: 3px solid var(--accent); border-radius: 14px; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 18%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.5a2 2 0 0 1 2-2h4l2 2.2h8a2 2 0 0 1 2 2V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / 38% no-repeat; }
.moment-cell.hold-onto::after, .moment-row.hold-into::after, .moment-row.hold-merge::after { content: attr(data-cut-label); position: absolute; z-index: 5; inset-inline-start: 50%; transform: translateX(calc(-50% * var(--flow)));
  bottom: -10px; max-width: 90%; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .78rem; font-weight: 700; white-space: nowrap; pointer-events: none; }

/* A moment's strip as a place to drop into, and a lone photograph's moment as a place to merge onto. */
.moment-row.hold-into, .moment-row.hold-merge { position: relative; outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.moment-row.hold-into::after, .moment-row.hold-merge::after { top: 4px; bottom: auto; }

/* The handle a moment is lifted by: the six dots of a grid tile's grip. */
.moment-lift { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; color: var(--muted); border-radius: 8px; touch-action: pan-y; cursor: grab; }
.moment-lift:focus-visible { outline: 2px solid var(--accent); }
.is-selecting .moment-lift { display: none; }

/* The picture a lifted moment carries: its first photograph with the count of them. */
.cut-stack { position: relative; width: 100%; height: 100%; }
.cut-stack img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cut-count { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 700; text-align: center; }

/* Select mode: "Group photos". */
.moments-select-open { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.moments-select-open[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.cut-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; inset-block-start: 0; z-index: 6; padding: 8px 0; background: var(--bg, var(--surface)); }
.cut-head[hidden] { display: none; }
.cut-head small { flex: 1 1 100%; color: var(--muted); }
.cut-stop { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.cut-count-badge { margin-inline-start: auto; min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-align: center; }

/* A tick on every photograph while the mode is on: the whole photograph answers the tap that it draws. */
.is-selecting .moment-cell::before { content: ""; position: absolute; inset-block-start: 6px; inset-inline-start: 6px; z-index: 3; width: 22px; height: 22px; border-radius: 999px;
  border: 2px solid #fff; background: rgba(0, 0, 0, .35); pointer-events: none; }
.is-selecting .moment-cell.is-cut-selected::before { border-color: var(--accent); background: var(--accent); }
/* The tick itself, over the filled circle: a mask painted in --on-accent, so it flips with --accent between the themes (a
   colour written inside an embedded image cannot). The cell is not dragged while the mode is on, so its ::after is free. */
.is-selecting .moment-cell.is-cut-selected::after { content: ""; position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 4; width: 22px; height: 22px;
  background: var(--on-accent); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 80% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 80% no-repeat; }
.is-selecting .moment-cell.is-cut-selected .moment-photo { outline: 3px solid var(--accent); outline-offset: -3px; }
.is-selecting .moment-pin, .is-selecting .moment-stack { pointer-events: none; opacity: .5; }

.cut-bar { position: sticky; inset-block-end: 12px; z-index: 6; display: flex; gap: 10px; justify-content: center; padding: 8px 0; }
.cut-bar[hidden] { display: none; }
.cut-group, .cut-split { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.cut-group { flex: 1 1 auto; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.cut-group:disabled { opacity: .5; cursor: default; }
.cut-split { background: #14100a; color: #fff; border: 1.5px solid var(--line-strong); }
.cut-split[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { .moment-cell.hold-onto::before { transition: none; } }
