/* The activities, as an index (components/activity-index.js): a centered
   heading and lede over a grid of hairline rows, each a small square of the
   activity's photograph (the homepage tile's, SIZES_INDEX), its name, and
   under it the tile's one line, which always holds to two lines (Costa,
   2026-11-13; no numbers and no kinds). Read across. A row narrower than
   24.4rem (a phone's, a narrow column's) sets the line under the thumbnail
   and the name, across its whole width; a wider row sets it beside the
   thumbnail. The whole row opens the activity's spread on its own page
   (scripts/components/adventure-spread.js), which the plus at its end says
   (Costa, 2026-11-16: the rows did not look like they opened): the
   homepage tile's sign, drawn as the header's bare circle on the page, there
   at every width, level with the name, the line running on under it.
   The columns, by the count:
     a list that halves (the adventures page's twelve)
       one column on a phone, two from 620px, three from 1450px
     a list of threes that does not halve (the privates page's nine: .threes)
       one column until three fit, then three: never two, where the last row
       would hold a single activity
   From 1450px the list reaches the header's width, as the mosaic does. */

.activity-index-block > h2, .activity-index-block > .lede { text-align: center; }
.activity-index-block > .lede { text-wrap: balance; }
.activity-index {
  list-style: none;
  padding: 0;
  margin: var(--xl) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: clamp(1.5rem, 3vw, 3rem);
}
@media (min-width: 620px) {
  .activity-index:not(.threes) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Three columns once each is as wide as a 320px phone's row (272px), the
   narrowest the words are sized for */
@media (min-width: 920px) {
  .activity-index.threes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1450px) {
  .activity-index { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-inline: calc((100% - var(--full)) / 2); }   /* 100% is the wrap's content width: out to the header's, room for three wide columns */
}
/* One hairline under every row, and one over it drawn as a shadow: between
   two rows the two land on the same pixel, so only the first row of each
   column shows its own, whatever the number of columns */
.activity-index li { margin: 0; border-bottom: var(--hair); box-shadow: 0 -1px 0 var(--border); container-type: inline-size; }   /* a size container: the words are sized from the row's width */
.activity-index a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;   /* the name's row is the name: a thumbnail taller than the words gives its extra to the line's row, so the plus and the line sit level across neighbours */
  align-content: start;
  gap: 0.2rem var(--sm);
  height: 100%;   /* rows side by side share one height: the whole cell is the link */
  padding: 1rem 0;
  color: var(--text);
}
.activity-index a:hover { text-decoration: none; }
.activity-index a:hover .index-name { color: var(--accent); }
.activity-index a:hover .index-plus { border-color: currentColor; }
.activity-index a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.index-plus {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: var(--hair);
  border-radius: var(--pill);
  color: var(--accent);   /* the link color: grey, it read as one more hairline */
  transition: border-color var(--slow) ease;   /* with the name's color */
}
.index-photo { width: 4rem; grid-row: 1 / span 2; margin-top: 0.25rem; }   /* beside the name and its line; the nudge levels its top with the name's capitals */
.index-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.activity-index .index-name {
  margin: 0;
  font-family: var(--display);
  font-weight: var(--light);
  font-size: clamp(1.3rem, 7.7cqw, 2rem);   /* from the row's width: the longest name (The Royal Majestic) holds one line between the thumbnail and the plus, a gap's room from it, a 320px phone's included (8cqw before the plus) */
  line-height: var(--tight);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color var(--slow) ease;
}
.activity-index .index-line { grid-column: 2 / -1; margin: 0; font-size: clamp(0.8rem, 4.6cqw, 0.9rem); line-height: 1.45; color: var(--text-2); text-wrap: balance; }   /* beside the thumbnail: two even lines, never a third (balance keeps the fewest lines the width allows) */
/* A narrow row has no room for two lines beside the thumbnail, so there the
   line runs the row's whole width, under a smaller thumbnail and the name,
   and wraps as plain text does (no balancing: Costa, 2026-11-13, two even
   short lines left everything on the row's left) */
@container (max-width: 24.4rem) {
  .index-photo { grid-row: 1; width: 2.75rem; margin-top: 0; align-self: center; }
  .activity-index .index-name { align-self: center; }
  .activity-index .index-line { grid-column: 1 / -1; margin-top: 0.15rem; text-wrap: pretty; }
  .index-plus { width: 1.75rem; height: 1.75rem; }   /* a smaller circle, as the mosaic's on phones: room for the longest name beside it */
}
