/*
 * «Функції» (layout functions) of the department block page: every function
 * at once, each a flat card on a light section (no shadow), two to a row —
 * the name, its points as plain lines, and its number large and faint in the
 * corner as the one ornament; no red on it (the owner's choice). Cards of a row share its height,
 * and an odd last one takes the whole row, so the edges stay even. Loaded
 * only on a page that has the block (enqueue.php); page-department.css comes
 * first.
 */

.dept-fn {
  background-color: var(--color-bg-secondary);
}

.dept-fn__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dept-fn__row {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 30px 32px 30px;
  border: 1px solid rgba(var(--color-ink--rgb), 0.06);
  background-color: var(--color-surface-card);
}

.dept-fn__row::before {
  content: none;
}

/* The number: large, light and behind the words, a mark rather than a label. */
.dept-fn__num {
  position: absolute;
  top: 10px;
  right: 22px;
  color: var(--color-text-heading);
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}

/* An odd last card spans the row, its points side by side so it stays as low as the others. */
.dept-fn__row:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.dept-fn__row:last-child:nth-child(odd) .dept-fn__points {
  columns: 2 18rem;
  column-gap: 48px;
}

.dept-fn__name {
  margin: 0 0 14px;
  padding: 0 64px 0 0;
  color: var(--color-text-heading);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.35;
}

.dept-fn__points {
  position: relative;
  margin: 0;
  padding: 0;
  color: var(--color-text-secondary);
  font-size: 0.9875rem;
  line-height: 1.55;
  list-style: none;
}

.dept-fn__points li {
  margin: 0 0 8px;
  break-inside: avoid;
}

.dept-fn__points li:last-child {
  margin-bottom: 0;
}

.dept-fn__points li::before {
  content: none;
}

/* A phone: one card under another. */
@media (max-width: 768px) {
  .dept-fn__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .dept-fn__row {
    padding: 16px 16px 18px;
  }

  .dept-fn__num {
    top: 8px;
    right: 12px;
    font-size: 2.75rem;
  }

  .dept-fn__name {
    margin-bottom: 8px;
    padding-right: 48px;
    font-size: 1rem;
  }

  .dept-fn__points {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .dept-fn__points li {
    margin-bottom: 5px;
  }

  .dept-fn__row:last-child:nth-child(odd) .dept-fn__points {
    columns: 1;
  }
}
