/* Albums index page: year/month grouping and album tiles with scattered
 * cover thumbnails. Task 10 wires prep/templates/albums_index.html up to
 * this file and fills in the real layout (two tiles/row collapsing to
 * one/row, per-tile cover scatter offsets fed through custom
 * properties). Scaffolded here in Task 7 alongside the other
 * per-component CSS files so the shared vocabulary/convention is
 * established before any template references it.
 */

.albums-index {
  padding: 1rem;
}

.albums-index__year {
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}

.albums-index__month {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin: 1rem 0 0.5rem;
}

.albums-index__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .albums-index__grid {
    grid-template-columns: 1fr;
  }
}

.album-tile-link {
  display: block;
  border-radius: 0.25rem;
  overflow: hidden;
  background: var(--color-surface);
}

/* Container for a tile's overlapping cover thumbnails. Per-thumbnail
 * scatter (position offset + rotation) is computed deterministically in
 * Python (prep/render.py's _cover_scatter_offset, from the album path),
 * passed through --offset-x/--offset-y/--rotate custom properties on each
 * .cover-thumb's style attribute, and consumed only by the fixed rule
 * below — never a literal CSS property value in the attribute itself
 * (see base.css's header comment / the plan's Solution Overview). */
.album-tile-link__covers {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-bg);
}

.cover-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 55%;
  height: 55%;
  object-fit: cover;
  border: 2px solid var(--color-bg);
  border-radius: 0.2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%) translate(var(--offset-x, 0), var(--offset-y, 0))
    rotate(var(--rotate, 0deg));
}

.cover-thumb:nth-child(1) {
  z-index: 3;
}

.cover-thumb:nth-child(2) {
  z-index: 2;
}

.cover-thumb:nth-child(3) {
  z-index: 1;
}

.album-tile-link__title {
  display: block;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--color-text);
}
