/* web/errands.html and the home page's errands section: what the home and
   technicals styles do not already cover. */

.tasks-meta {
  display: inline-block;
  margin-top: var(--space-md);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  font-weight: 650;
}

.tasks-recording {
  justify-self: center;
  margin: 0;
  text-align: center;
}

.tasks-recording video {
  /* Centred over its caption: videos are blocks site-wide. */
  margin-inline: auto;
  width: min(100%, 20rem);
  height: auto;
  border-radius: var(--radius-lg);
  background: var(--color-ocean-dark);
  box-shadow: var(--shadow-soft);
}

.tasks-recording figcaption {
  margin-top: var(--space-md);
}

.tasks-group h3 {
  margin: var(--space-roomy) 0 var(--space-md);
}

.tasks-cards {
  /* A wrapping row, not a grid: a group of two or five cards still fills
     every row edge to edge (Dan, 2026-10-14: symmetry). */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tasks-card {
  flex: 1 1 min(100%, 20rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-xl);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

/* The compact lists (home) keep their narrower cards. */
.tasks-cards-compact .tasks-card {
  flex-basis: min(100%, 15rem);
}

/* The four featured errands pair up, two to a row, on every page. */
[data-tasks="featured"] .tasks-card {
  flex-basis: min(100%, 26rem);
}

.tasks-card :is(h3, h4) {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* Start here and Skills: the guided sections, set apart from the gallery. */
.tasks-section-ocean {
  background: var(--color-ocean-soft);
}

.tasks-section-ocean h2 {
  max-width: 22ch;
}

/* Two by two: the four are larger than the gallery's cards. */
.tasks-featured .tasks-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

.tasks-featured .tasks-card :is(h3, h4) {
  font-size: 1.3rem;
}

.tasks-why {
  margin: 0;
  font-family: var(--font-reading);
  font-size: 1.05rem;
}

.tasks-featured,
.tasks-skills {
  margin-top: var(--space-xl);
}

/* Four across on a desktop; auto-fit so three skills fill their row. */
.tasks-cards-compact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-md);
}

.tasks-cards-compact .tasks-card {
  padding: var(--space-lg);
}

/* The badge sits on an ocean background here, so it takes the card's. */
.tasks-soon {
  margin: var(--space-sm) 0 0;
}

.tasks-section-ocean .tasks-badge,
.tasks-home .tasks-badge {
  background: var(--color-surface);
}

.tasks-summary {
  margin: 0;
  color: var(--color-ink-muted);
}

/* The ask is a blockquote: type.css styles it like every quoted line. */

.tasks-copy {
  align-self: flex-start;
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-lg);
  border: 1px solid var(--color-ocean);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-ocean);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tasks-copy:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.tasks-badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--color-ocean-soft);
  color: var(--color-ocean-dark);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.tasks-grid-top {
  align-items: start;
}

/* Announced from page load, never display:none, so the first copy is read
   out; the sighted confirmation sits beside the button that was pressed. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tasks-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.tasks-copied {
  color: var(--color-ink-muted);
  font-size: var(--text-small);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 48rem) {
  .tech-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A section's padding is the whole gap below it: no trailing paragraph margin. */
:is(.tasks-home, .tech-section) .page-width > p:last-child {
  margin-bottom: 0;
}

/* The home page's errands section: the featured four and the skills, compact. */
.tasks-home {
  background: var(--color-ocean-soft);
}

/* Its headings and lede take the flowing-column rhythm from type.css: the
   page-width is a .prose column, and the cards sit in their own boxes. */

.tasks-clips-title {
  margin: var(--space-roomy) 0 var(--space-md);
}

.tasks-clips {
  /* A wrapping row like the cards: three clips, or two and one, fill every row. */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tasks-clips > li {
  flex: 1 1 min(100%, 12rem);
  display: flex;
}

.tasks-clip {
  flex: 1 1 auto;
  margin: 0;
  text-align: center;
}

.tasks-clip video {
  /* A block element: centred under its caption, not left in the cell. */
  display: block;
  margin: 0 auto;
  width: min(100%, 14rem);
  height: auto;
  border-radius: var(--radius-lg);
  background: var(--color-ocean-dark);
  box-shadow: var(--shadow-soft);
}

.tasks-clip figcaption {
  margin-top: var(--space-sm);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  font-weight: 650;
}
