/* pattern-archiveband.css — the blog index archive band.
   Loaded by the render_block className convention for .valencia-archiveband.

   Band 3 of the option C build: the section head over the shipping
   qlist rows. The rows are pattern-qlist.css; the head is
   valencia-rw-head, which loads itself by its own class. This sheet
   spaces the band and nothing else.

   Parent-qualified for the same reason as the card band: core prints
   `:root :where(.is-layout-constrained) > * { margin-block-start: 24px }`
   into global-styles-inline-css AFTER the theme's sheets, so a bare
   margin here computes to 24px with no warning. */
.valencia-content > .wp-block-group.valencia-archiveband {
  margin-block-start: var(--wp--preset--spacing--xxl);
}

.valencia-archiveband > .valencia-rw-head {
  margin-block-end: var(--wp--preset--spacing--lg);
}

/* Cancel `alignwide` below the wide breakpoint. theme.json's wideSize is
   min(1120px, 100% - 2*md), so at phone width the band would resolve
   NARROWER than its own rows. Same trap the card band and the
   single-post hero hit; see the 3.22.0 README.

   (0,3,0) to beat core's own `.wp-container-* > .alignwide` at (0,2,0). */
@media (max-width: 781px) {
  .valencia-content > .wp-block-group.alignwide.valencia-archiveband {
    max-width: none;
    margin-inline: 0;
  }
}

/* Year bands.

   Inserted by valencia_archive_year_bands() in functions.php, which is
   the only way to get them: core/post-template renders one identical
   subtree per post, so "when the year changes" cannot be expressed in
   block markup. The filter owns the band only; the ROW above it stays
   editable in the Site Editor.

   DESIGN NOTE — why the year is large and bare. At caption size with a
   trailing hairline it used the same visual recipe as the section-label
   chips above the list and the #category at the end of every row, so it
   competed with the rows rather than ranking above them. A grouping
   header has to differ from its items in KIND, not degree. The number
   carries it instead: at display size it reads as a milestone you scan
   for, which lets the rule and the chip framing go entirely. Three
   parts became one.

   The band is an <li> among the post <li>s so it inherits the list's
   own flow, but it is not a qlist-row and must not take the row grid. */
.valencia-qlist-year {
  list-style: none;
  display: block;

  /* PADDING, not margin. The band is an <li> inside core's post-template
     list layout, which zeroes child margins from global-styles-inline-css
     — printed after this sheet, so a margin here computes to 0 with no
     warning (measured: gapAbove 0, gapBelow 0). Padding is untouched by
     that rule.

     Asymmetric, roughly 3:1. The year opens the posts beneath it and
     closes the ones above, so it should sit near what it introduces and
     far from what it ends. A row occupies ~63px, so the space above has
     to clear that to read as a break in TIME rather than just another
     row gap — the earlier 40px did not. */
  padding-block: var(--wp--preset--spacing--xxl) var(--wp--preset--spacing--sm);

  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--x-large);
  font-weight: 800;
  line-height: 1;
  /* Tight, because bold display numerals at this size read loose with
     the body's default tracking. */
  letter-spacing: -0.02em;
  color: var(--wp--preset--color--contrast);
}

/* The first band opens the list, so it needs no space above it. */
.valencia-qlist-year:first-child { padding-block-start: 0; }

/* pattern-qlist.css puts a top rule on the list so the first ROW is
   closed on both sides. Here the list opens with a year band instead,
   so that rule draws a line between the section label and the year with
   nothing above it to close — visible as a hairline under "The archive".

   Suppressed only when a band is actually first: :has() keeps the rule
   for every other use of this pattern (404, year pages), where the list
   still opens on a row. (0,3,0), which clears the (0,2,0) source. */
.valencia-archiveband .valencia-qlist .wp-block-post-template:has(> .valencia-qlist-year:first-child) {
  border-top: 0;
}
