/*
 * The tablero, stone world. Two lists rather than one grid of equal things, because the page is
 * making a distinction: a tarea has an owner and an estado, a derived card has neither and cannot be
 * given them where it lives.
 *
 * Sizing is scoped here rather than added as global .btn--sm / .input--sm modifiers: a tablero row
 * carries four controls at once and nothing else in the app does, so a global size for it would be a
 * component nobody but this page uses.
 */

.tablero-tabs {
  display: flex;
  gap: .25rem;
  margin: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tablero-tabs__tab {
  flex: none;
  padding: .6rem 1rem;
  font-family: var(--sans);
  font-size: var(--step-0);
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.tablero-tabs__tab:hover { color: var(--ink); }

.tablero-tabs__tab[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--oxblood);
}

.tablero-new {
  background: var(--stone-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.6rem);
  margin-bottom: 1.5rem;
}

.tablero-new__form {
  display: grid;
  gap: .5rem;
  /* One column on a phone, which is the width this is designed at; the fields sit on one line only
     once there is room for all four without any of them shrinking to a stub. */
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .tablero-new__form {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
  }
  /* The labels sit above their own field rather than in a row of their own: with four columns a
     separate label row doubles the height and pairs nothing to anything. */
  .tablero-new__form label { grid-row: 1; }
  .tablero-new__form .input, .tablero-new__form input[type="submit"] { grid-row: 2; }
}

/* auto-fit rather than a fixed count, and min(100%, 280px), for the reason .marco__grid gives: a
   firm with one lawyer gets one full-width column instead of an empty track beside it. */
.tablero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.tablero__columna {
  background: var(--stone-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.tablero__columna h2 {
  font-size: var(--step-0);
  font-family: var(--sans);
  margin: 0 0 .75rem;
}

.tablero__vacia {
  color: var(--muted);
  font-size: var(--step--1);
  margin: 0;
}

.tablero__lista, .tablero-derivado__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.tarea, .derived {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .75rem;
  background: var(--stone);
}

.tarea__head, .derived__head {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  justify-content: space-between;
}

.tarea__title, .derived__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Late is said with a rule down the side rather than with colour alone, so it survives a screen
   that renders the palette differently and a reader who cannot separate the two. The row already
   carries the date it was due, which is the text half of the same statement. */
.tarea[data-atrasada="true"] { border-left: 3px solid var(--oxblood); }

.tarea[data-estado="hecha"] .tarea__title {
  color: var(--muted);
  text-decoration: line-through;
}

.tarea__meta, .derived__meta {
  margin: .4rem 0 .6rem;
  font-size: var(--step--1);
  color: var(--muted);
}

.tarea__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.tarea__reassign { display: flex; gap: .3rem; }

.tarea__actions .btn, .tarea__reassign .input, .tarea__reassign input[type="submit"] {
  font-size: var(--step--1);
  padding: .3rem .6rem;
}

.derived__done {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.derived__convert { display: flex; flex-wrap: wrap; gap: .3rem; }

.derived__convert .input, .derived__convert input[type="submit"] {
  font-size: var(--step--1);
  padding: .3rem .6rem;
}

.tablero-derivado h2 {
  font-size: var(--step-1);
  margin-bottom: .75rem;
}
