/*
 * The year-in-review page (scripts/templates/year-page.mjs, #448). It reuses status.css for the
 * header, the stat tiles and the bar lists; this file adds the contribution calendar and the
 * lists of repositories and posts.
 */

@layer sections {
  /* --- Contribution calendar: a column per week, Sunday at the top. Five steps of the accent
         colour; the same numbers are in the "By month" list for anyone who cannot see them. --- */
  .year-cal {
    display: grid;
    grid-template-rows: repeat(7, var(--year-cell));
    grid-auto-columns: var(--year-cell);
    grid-auto-flow: column;
    gap: var(--space-1);
    overflow-x: auto;
    padding-block-end: var(--space-2);

    --year-cell: 0.75rem;
  }

  .year-cal__day {
    display: inline-block;
    inline-size: var(--year-cell, 0.75rem);
    block-size: var(--year-cell, 0.75rem);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    vertical-align: middle;
  }

  .year-cal__day[data-level='1'] {
    background: color-mix(in srgb, var(--accent) 30%, var(--surface-sunken));
  }

  .year-cal__day[data-level='2'] {
    background: color-mix(in srgb, var(--accent) 55%, var(--surface-sunken));
  }

  .year-cal__day[data-level='3'] {
    background: color-mix(in srgb, var(--accent) 78%, var(--surface-sunken));
  }

  .year-cal__day[data-level='4'] {
    background: var(--accent);
  }

  .year-cal__legend {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    justify-content: flex-end;
    margin: var(--space-2) 0 0;
    color: var(--muted);
    font-size: var(--font-size-xs);
  }

  /* --- Started this year, written this year --- */
  .year-started,
  .year-posts {
    display: grid;
    gap: var(--space-3);
    max-width: 46rem;
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: var(--line-height-normal);
  }

  .year-started__desc,
  .year-posts__date {
    color: var(--muted);
    font-size: var(--font-size-sm);
  }

  .year-started__desc::before {
    content: '· ';
  }

  .year-source {
    margin-top: var(--space-12);
  }
}
