.thumbnailButton { all: unset; display: block; cursor: pointer; /* thumbnails have square corners, a rounded ring would leave the art's corners outside it */ &:focus-visible { outline: var(--focus-ring); outline-offset: 2px; } } .thumbnail { cursor: pointer; transition: all 0.2s ease; &:hover { scale: 1.025; } } .lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; outline: none; overflow: hidden; } .lightboxBody { width: 100%; height: 100%; display: grid; place-items: center; padding: var(--s-4); cursor: zoom-out; } .lightboxFigure { --lightbox-max-width: calc(100vw - 2 * var(--s-4)); --lightbox-max-height: calc(100dvh - 2 * var(--s-4)); position: relative; margin: 0; max-width: var(--lightbox-max-width); max-height: var(--lightbox-max-height); border-radius: var(--radius-box); overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); animation: lightbox-zoom-in 200ms ease-out; @media (prefers-reduced-motion: reduce) { animation: none; } } .lightboxFigureSized { aspect-ratio: var(--aspect-ratio); width: min( var(--lightbox-max-width), calc(var(--lightbox-max-height) * var(--aspect-ratio)) ); } /* nothing to look at, so the details take over the figure instead of floating over the image */ .lightboxFigureFailed { display: flex; flex-direction: column; width: min(var(--lightbox-max-width), 22rem); background-color: rgba(0, 0, 0, 0.6); .lightboxInfo { position: static; opacity: 1; padding-block-start: var(--s-3); background: none; } } .lightboxFailed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); min-height: 10rem; padding: var(--s-4); color: rgba(255, 255, 255, 0.7); font-size: var(--font-sm); text-align: center; } .lightboxPlaceholder { display: block; width: 100%; height: auto; max-width: var(--lightbox-max-width); max-height: var(--lightbox-max-height); object-fit: contain; } .lightboxImg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 250ms ease-out; } .lightboxImgSettled { opacity: 1; } .lightboxInfo { position: absolute; inset-inline: 0; inset-block-end: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-1); padding: var(--s-8) var(--s-4) var(--s-3); background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent); text-align: center; transition: opacity 200ms ease-out; @media (hover: hover) { opacity: 0; .lightboxFigure:hover &, .lightboxFigure:focus-within & { opacity: 1; } } } .lightboxInfoHidden { opacity: 0; } .lightboxDate { font-size: var(--font-2xs); color: rgba(255, 255, 255, 0.7); } .lightboxDescription { font-size: var(--font-sm); text-wrap: balance; } .tagsContainer { display: flex; gap: var(--s-1) var(--s-2); justify-content: center; flex-wrap: wrap; } .dialogTag { background-color: #fff; border-radius: var(--radius-box); color: #000; font-size: var(--font-2xs); padding-inline: var(--s-1); } .dialogTagUser { background-color: var(--color-fill-accent); color: var(--color-fg-on-accent); } @keyframes lightbox-zoom-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }