/* public/task/style.css — DROP-IN OVERWRITE
   TaskLink-specific overrides
   --------------------------------------
   Most styling lives in /assets/ui.css.
   This file is intentionally lightweight,
   matching the design pattern for Slot/Vote/Sheet/List/Note.

   Spec: TaskLink — Shared Task Tool (V1), v2026-01-25C
*/

/* Keep textareas sane (creator/admin have subtitle + seed tasks textareas) */
.section-card textarea {
  resize: vertical;
}

/* ----------------------------------------------------------
   TASK (participant/activity page) UI hooks
   ----------------------------------------------------------
   NOTE:
   - The participant HTML/JS for tasklink will own the DOM.
   - We predefine stable, non-invasive classes/IDs here.
   - These rules are safe if unused (no drift).
*/

/* Main task surface (optional container) */
.taskWrap {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--ring);
  background: var(--card);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

/* Add row (input + controls) */
.taskAddRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--ring);
  background: var(--card);
}

.taskAddRow input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
}

/* Optional filter controls aligned to the right on wide screens */
.taskControls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

/* Segmented buttons (All/Open/Done) if participant UI uses them */
.taskSeg {
  display: inline-flex;
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.taskSeg button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  cursor: pointer;
  width: auto;
}

.taskSeg button:hover {
  background: var(--card-soft);
  color: var(--text);
}

.taskSeg button.isActive {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Hide done toggle (checkbox + label) */
.taskToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  color: var(--muted);
  white-space: nowrap;
}

.taskToggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Tasks list */
.taskItems {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each task row: checkbox + text + actions */
.taskItem {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center; /* checkbox vertical centering parity */
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--ring);
  background: var(--card);
}

.taskItem:first-child {
  border-top: none;
}

.taskItem:hover {
  background: var(--card-soft);
}

/* Checkbox alignment (explicit, parity posture) */
.taskItem input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Task text (read-only span/div) */
.taskText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 1rem; /* ensures empty state parity uses body size */
}

/* Inline edit input (if used) */
.taskTextInput {
  width: 100% !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-family: var(--font-sans) !important;
  font-size: 1rem !important;
}

.taskTextInput:focus {
  outline: none !important;
  border-color: var(--ring) !important;
  background: var(--accent-soft) !important;
  box-shadow: inset 0 0 0 1px var(--accent) !important;
}

/* Done state */
.taskItem.isDone .taskText,
.taskItem.isDone .taskTextInput {
  color: var(--muted);
  text-decoration: line-through;
}

/* Meta pills row (owner/due/priority) */
.taskMeta {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.taskPill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--ring);
  background: var(--card);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

/* Priority emphasis (subtle; no “overdue” logic) */
.taskPill.priority-high {
  border-color: rgba(185, 28, 28, 0.25);
  background: rgba(185, 28, 28, 0.06);
  color: #7f1d1d;
}

.taskPill.priority-med {
  border-color: rgba(180, 83, 9, 0.25);
  background: rgba(180, 83, 9, 0.06);
  color: #7c2d12;
}

.taskPill.priority-low {
  border-color: rgba(21, 128, 61, 0.22);
  background: rgba(21, 128, 61, 0.06);
  color: #14532d;
}

/* Action buttons cluster (e.g., “…” menu) */
.taskActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.taskActionBtn {
  width: auto;
  padding-inline: 10px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--ring);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.taskActionBtn:hover {
  background: var(--card-soft);
  color: var(--text);
}

/* Delete action (subtle red on hover) */
.taskActionBtn.isDanger:hover {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Optional empty state */
.taskEmpty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 1rem; /* parity with list items + “No tasks yet.” requirement */
}

/* ----------------------------------------------------------
   PREVIEW (creator/admin pages)
   ---------------------------------------------------------- */

.previewWrap img {
  border-radius: var(--radius);
  max-width: 100%;
  display: block;
}

.previewWrap {
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

/* ----------------------------------------------------------
   PARITY WITH SLOT/VOTE/SHEET CREATE+ADMIN PAGES
   Tighten vertical rhythm without changing global UI
----------------------------------------------------------- */

/* Condense extra vertical gaps inside forms only (create + admin) */
form > * + * {
  margin-top: 8px;
}

/* Reduce spacing BELOW the page header */
main > .page-header {
  padding-bottom: 4px !important;
  margin-bottom: 4px !important;
}

/* Reduce spacing ABOVE all section cards (Live preview, Details, etc.) */
main > .section-card {
  margin-top: 6px !important;
  padding-top: 10px !important;
}

/* Reduce spacing ABOVE the title inside each card (<h2>) */
.section-card > h2:first-child {
  margin-top: 2px !important;
}

/* Mobile tightening */
@media (max-width: 768px) {
  main > .page-header {
    padding-bottom: 2px !important;
    margin-bottom: 2px !important;
  }

  main > .section-card {
    margin-top: 4px !important;
    padding-top: 8px !important;
  }

  .section-card > h2:first-child {
    margin-top: 0 !important;
  }

  .taskItem {
    grid-template-columns: 28px 1fr auto;
    gap: 8px;
    padding: 10px 10px;
  }

  .taskActions {
    gap: 6px;
  }

  .taskActionBtn {
    height: 32px;
    padding-inline: 8px;
  }
}