/* ── The advent calendars' page (task 267, Pages/Lists/Advent): only where its blocks stand – the band, the cards, the table,
   the value, the series are components (ui-hero, SetCard, ui-table, ui-stat, ui-navlist, ui-disclosure, ui-phone-row). ── */
.advent {
  width: min(1376px, 100%);
  margin: 0 auto;
}

/* Figma's row: five cards for a year of five or fewer, six for six (AdventModel.Columns); narrower, as many as fit. */
.advent-cards {
  display: grid;
  grid-template-columns: repeat(var(--advent-columns, 5), minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 0;
}

/* Every card of a block takes the four rows of «Kup ↗» – one without an offer too – so a row of cards is one height. */
.advent-cards > .set-card--catalog {
  grid-row: span 4;
}

.advent-section {
  margin-top: var(--space-7);
}

.advent-h2 {
  margin: 0 0 var(--space-4);
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.35;
}

.advent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.advent-more,
.advent-more:hover {
  flex: none;
  color: var(--accent-text);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
}

/* Hover answers (web-design-guidelines, 05.12.2026): it read the same as at rest. */
.advent-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.advent-panel {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  background: var(--surface-1);
}

.advent-value__chart {
  position: relative;
  height: 260px;
  margin-top: var(--space-4);
}

/* The median's key (Figma's phone frame: a 16 px dash and «Mediana 155 zł» at the plot's top right) – ≤ 900 px only; from 901
   px the chart labels its line itself (advent-value-chart.js reads the same 900). */
.advent-value__key {
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.35;
  pointer-events: none;
}

.advent-value__dash {
  width: 16px;
  border-top: 1px dashed var(--text-muted);
}

.advent-value__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* Figma: the three figures one height (90) whatever their lines. */
.advent-value__stats > .ui-stat {
  min-height: 90px;
}

.advent-table__group th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.advent-table__name {
  font-weight: 400;
}

.advent-table__name a {
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.advent-series {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.advent-series__panel {
  min-height: 100%;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  background: var(--surface-1);
}

.advent-series__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-1) var(--space-2) var(--space-2);
}

.advent-series__head h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
}

.advent-series__head span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.advent-series__more > summary {
  padding: 0 var(--space-2);
}

.advent-when-open,
.advent-series__more[open] .advent-when-closed {
  display: none;
}

.advent-series__more[open] .advent-when-open {
  display: inline;
}

.advent-empty {
  max-width: 560px;
  margin: var(--space-6) auto;
  border-radius: var(--radius-3);
  background: var(--surface-1);
}

.advent-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.advent-rows {
  margin: 0;
  padding: var(--space-1) 0;
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}

.advent-rows__year {
  margin: var(--space-4) 0 var(--space-2);
}

@media (max-width: 1200px) {
  .advent-cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .advent-series {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .advent-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .advent-section {
    margin-top: var(--space-6);
  }

  .advent-h2 {
    font-size: var(--text-lg);
  }

  .advent-panel {
    padding: var(--space-4);
  }

  .advent-value__chart {
    height: 190px;
  }

  .advent-value__key {
    display: flex;
  }

  .advent-more {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
  }

  /* A year of an odd count: its last card the row's width, not alone beside a hole (design review 05.12.2026); its photo
     twice as wide as a card's and as tall (8 / 3 = two 4 / 3 side by side), the picture the same size, centred. */
  .advent-cards > .set-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .advent-cards > .set-card:last-child:nth-child(odd) .set-card__media {
    aspect-ratio: 8 / 3;
  }

  .advent-value__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .advent-value__stats > .ui-stat:nth-child(3) {
    grid-column: 1 / -1;
  }

  .advent-series {
    display: block;
    overflow: hidden;
    border-radius: var(--radius-3);
    background: var(--surface-1);
    box-shadow: var(--shadow-1);
  }

  .advent-series__fold .advent-series__list {
    padding: 0 var(--space-2) var(--space-2);
  }
}
