/*
 * mosaic.css — one-page justified-rows mosaic of all works, with a 4px gutter
 * (between tiles and above each row) and a per-tile 1–10 rating control.
 */
.mosaic-wrap {
  padding: 0 4px;            /* 4px frame on the outer left/right edges too */
  box-sizing: border-box;
}

/* toolbar above the mosaic (rating help + bake/copy button) */
.mosaic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  font-size: 13px;
  color: #555;
}
.mosaic-bar .mosaic__hint { opacity: .8; }
.mosaic__bake {
  border: 1px solid rgba(0, 0, 0, .25);
  background: transparent;
  color: #333;
  font: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
}
.mosaic__bake:hover { background: rgba(0, 0, 0, .05); }

/* the mosaic itself: tiles are inline-blocks; JS sets exact w/h per row so each
 * row fills the width edge-to-edge while keeping aspect ratios. The top 4px frame
 * comes from the first row's margin-top via the container padding. */
.mosaic {
  font-size: 0;             /* kill inline-block whitespace */
  padding-top: 4px;         /* 4px above the first line of works */
}
.mosaic__item {
  position: relative;
  display: inline-block;
  vertical-align: top;
  overflow: hidden;
  background: #f1f1f1;       /* placeholder while the image loads */
  cursor: zoom-in;
}
.mosaic__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* exact box is the true aspect ratio, so no cropping */
  display: block;
  opacity: 0;
  transition: opacity .35s ease;
}
.mosaic__item img.is-loaded { opacity: 1; }

/* rating control — small chip, bottom-left of each tile, appears on hover (always
 * visible on touch where there's no hover) */
.mosaic__rate {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, .55);
  border-radius: 16px;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity .18s ease;
  font-size: 13px;
}
.mosaic__item:hover .mosaic__rate,
.mosaic__item[data-current-rating]:not([data-current-rating="0"]) .mosaic__rate {
  opacity: 1;
}
@media (hover: none) { .mosaic__rate { opacity: 1; } }
.mosaic__rate-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mosaic__rate-btn:hover { background: rgba(255, 255, 255, .35); }
.mosaic__rate-val {
  min-width: 20px;
  text-align: center;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* tiles with a rating get a subtle ring so curated ones read at a glance */
.mosaic__item[data-current-rating]:not([data-current-rating="0"]) {
  outline: 2px solid rgba(255, 255, 255, .0);
}

/* Lightbox (mirrors app.css; mosaic ships its own so it works standalone) */
.lb-overlay {
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, .94);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
.lb-overlay.is-open { display: flex; }
.lb-img { max-width: 92vw; max-height: 92vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.25); cursor: zoom-out; }
.lb-overlay button {
  position: absolute; background: none; border: 0; color: #111; cursor: pointer;
  font-family: inherit; line-height: 1; opacity: .55; transition: opacity .2s ease;
}
.lb-overlay button:hover { opacity: 1; }
.lb-close { top: 18px; right: 24px; font-size: 44px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 64px; padding: 0 18px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
body.lb-locked { overflow: hidden; }
@media (max-width: 640px) {
  .lb-close { font-size: 36px; top: 10px; right: 14px; }
  .lb-prev, .lb-next { font-size: 44px; padding: 0 8px; }
}
