/* Under-viewed art widget. Colors come from the live theme tokens
   (--text, --accent, --secondary, ...) so it follows every skin automatically. */
.uva {
  margin: 2.5em 0;
}

/* --- caption (title + artist, above the image) --- */
.uva-caption {
  margin-bottom: 0.9em;
}
.uva-in {
  animation: uva-fade 0.5s ease;
}
.uva-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}
/* The title is the link out to the piece. It reuses the site's shared .text-link
   component (class added in JS) so its underline sweeps in left-to-right like
   every other link; the .uva-title h3 supplies the size and weight. */
.uva-title a {
  color: var(--accent);
}
.uva-meta {
  margin: 0.35em 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text50);
}

/* --- square frame + the standalone refresh control beneath it --- */
.uva-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--text10);
  border-radius: var(--border-radius);
  overflow: hidden;
}
.uva-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.uva-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.99);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.uva-image-in {
  opacity: 1;
  transform: none;
}

.uva-controls {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
/* Matches the project CTA buttons (.fc-card-cta): an accent-outline pill that
   fills and lifts on hover. */
.uva-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 15px;
  color: var(--accent);
  background: transparent;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out, transform 0.25s ease-in-out;
}
.uva-refresh svg {
  width: 15px;
  height: 15px;
}
.uva-refresh:hover {
  background-color: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}
.uva-refresh:disabled {
  cursor: default;
  opacity: 0.7;
  transform: none;
}
.uva-refresh.uva-spinning svg {
  animation: uva-spin 0.8s linear infinite;
}

/* --- thumbnail rail (history of what you've seen this visit) --- */
.uva-rail {
  margin-top: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.uva-track {
  display: flex;
  gap: 8px;
  padding: 4px 2px;
}
.uva-thumb {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  background: var(--text10);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.uva-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uva-thumb:hover {
  opacity: 1;
}
.uva-thumb-active {
  opacity: 1;
  border-color: var(--accent);
}

/* --- loading / error states --- */
.uva-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--text15);
  border-top-color: var(--accent);
  animation: uva-spin 0.8s linear infinite;
}
.uva-error {
  text-align: center;
  color: var(--text50);
  padding: 20px;
}
.uva-error p {
  margin: 0 0 12px;
}
.uva-retry {
  font-family: inherit;
  font-size: 14px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--text15);
  border-radius: var(--border-radius);
  padding: 6px 14px;
  cursor: pointer;
}
.uva-retry:hover {
  background: var(--text10);
}

@keyframes uva-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes uva-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Respect reduced-motion: no fades or slides (the loading spinner stays,
   since it communicates status). */
.uva-reduced .uva-image,
.uva-reduced .uva-caption,
.uva-reduced .uva-refresh svg {
  animation: none !important;
  transition: none !important;
}
.uva-reduced .uva-image {
  opacity: 1;
  transform: none;
}
