/* A template as a poster that fills in (views/poster.js). The titles done are
   the only colour on the page; the rest wait in grey, just visible, like the
   foil of a scratch-off map. The count is the one large figure. */

.poster-main > .hub-heading { margin-bottom: 8px; }
.poster-main > .hub-heading p { font-size: 15px; color: var(--ink-3); }

.hub-main > .poster-sum {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px 24px;
  margin: 0 auto 26px;
}
.poster-count { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.poster-figure { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.poster-done { font: 650 clamp(56px, 7vw, 96px)/0.9 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.poster-figure span { font: 500 clamp(17px, 1.6vw, 22px)/1 var(--font-ui); color: var(--ink-2); }
.poster-figure span b { font-family: var(--font-mono); font-weight: 500; }
.poster-word { margin: 0; color: var(--ink-2); font-size: 15px; }
.poster-meter { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 11%, transparent); overflow: hidden; }
.poster-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink); transition: width .9s var(--ease); }
.poster-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.poster-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.poster-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 6px; color: var(--ink-2); font-size: 14px; }
.poster-facts:empty, .poster-note:empty { display: none; }
.poster-note { grid-column: 1 / -1; margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.poster-guest { grid-column: 1 / -1; display: grid; gap: 14px; justify-items: start; }
.poster-sum a.btn { text-decoration: none; }
.poster-guest p { margin: 0; max-width: 52ch; color: var(--ink-2); font-size: 16px; line-height: 1.5; }

/* All / Done / Left: faint panes, the chosen one lighter with an ink ring */
.poster-filter { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--glass-tray, var(--bg-2)); box-shadow: inset 0 0 0 1px var(--rim-soft, var(--line)); }
.poster-filter button {
  min-height: 44px; min-width: 64px; padding: 0 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); font: 500 14.5px/1 var(--font-ui); cursor: pointer;
}
.poster-filter button:hover { color: var(--ink); }
.poster-filter button[aria-pressed='true'] { color: var(--ink); font-weight: 650; background: color-mix(in srgb, var(--ink) 9%, transparent); box-shadow: inset 0 0 0 1.5px var(--ink); }
.poster-filter button:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }

/* the poster itself */
.poster-grid {
  --cell: 92px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr));
  gap: 10px;
  margin: 0 auto 72px;
}
.poster-grid[data-aspect='square'] { --cell: 96px; }
.poster-grid[data-aspect='wide'] { --cell: 150px; }
.poster-tile {
  position: relative; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px;
  background: var(--glass-tray, var(--bg-2)); color: var(--ink);
  transition: filter .5s var(--ease), opacity .5s var(--ease), transform .25s var(--ease);
}
.poster-grid[data-aspect='square'] .poster-tile { aspect-ratio: 1; }
.poster-grid[data-aspect='wide'] .poster-tile { aspect-ratio: 16 / 9; }
.poster-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-grid[data-aspect='wide'] .poster-tile img { object-fit: contain; }
.poster-letter {
  padding: 8px; font: 600 12px/1.25 var(--font-display); text-align: center; overflow-wrap: anywhere;
  color: var(--ink); background: hsl(var(--hue) 30% 22%); width: 100%; height: 100%; display: grid; place-items: center;
}
:root[data-appearance='light'] .poster-letter { background: hsl(var(--hue) 32% 84%); }

/* waiting: grey and quiet; a pointer or focus lifts the foil a little */
.poster-grid:not(.is-open) .poster-tile:not([data-state='done']):not([data-state='doing']) { filter: grayscale(1) contrast(.92); opacity: .34; }
:root[data-appearance='light'] .poster-grid:not(.is-open) .poster-tile:not([data-state='done']):not([data-state='doing']) { opacity: .42; }
.poster-tile:hover, .poster-tile:focus-visible { filter: none !important; opacity: 1 !important; transform: translateY(-2px); z-index: 1; }
.poster-tile:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
.poster-tile[data-state='done'] { box-shadow: 0 10px 18px -12px rgb(var(--shade, 0 0 0) / .7); }
.poster-tile[data-state='done'][data-legend='1']::before {
  content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, #fff4c8, #e9bd4f 50%, #a8761a);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}

/* begun: in colour, with half a bar along the foot */
.poster-tile[data-state='doing']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, #f5f6fa 50%, rgba(5, 6, 9, .55) 50%);
}
/* wanted or dropped stay grey; a small mark in the corner says which */
.poster-tile[data-state='want']::after, .poster-tile[data-state='dropped']::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 2px var(--bg);
}
.poster-tile[data-state='dropped']::after { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 2px var(--bg); }

/* a title just done develops from grey into colour, once */
.poster-tile.is-new { animation: poster-develop 1.4s var(--ease) both; }
@keyframes poster-develop {
  0% { filter: grayscale(1) brightness(.7); opacity: .4; }
  60% { filter: grayscale(0) brightness(1.18); opacity: 1; }
  100% { filter: none; opacity: 1; }
}

@media (max-width: 720px) {
  .hub-main > .poster-sum { grid-template-columns: 1fr; margin-bottom: 20px; }
  .poster-facts { margin: 0; }
  .poster-tools { flex-direction: column; align-items: stretch; }
  .poster-filter { justify-content: space-between; }
  .poster-filter button { flex: 1; }
  .poster-actions > * { flex: 1; justify-content: center; }
  .poster-grid { --cell: 64px; gap: 6px; }
  .poster-grid[data-aspect='square'] { --cell: 68px; }
  .poster-grid[data-aspect='wide'] { --cell: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .poster-tile, .poster-meter i { transition: none; }
  .poster-tile.is-new { animation: none; }
  .poster-tile:hover, .poster-tile:focus-visible { transform: none; }
}

/* "What is left" on one's profile: each catalogue's name opens its poster */
.catalogue-poster { color: inherit; text-decoration: none; }
.catalogue-poster:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.catalogue-poster:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; border-radius: 4px; }
