/* Siteseeing Tweaks: thumbnail ratio, scroll reveal, image glitch */

/* Unify thumbnail aspect ratio inside query loops (home / works / blog). */
.wp-block-query .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Scroll reveal for query-loop items. Pre-state applies only when JS is on. */
html.sst-js .sst-reveal {
  opacity: 0;
  transform: translateY(18px);
}
html.sst-js .sst-reveal.sst-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* One-shot glitch when an image enters the viewport. */
@keyframes sst-glitch {
  0%   { transform: translate(0); filter: none; clip-path: inset(0 0 0 0); }
  15%  { transform: translate(-6px, 2px) skewX(-4deg); filter: hue-rotate(40deg) saturate(2); clip-path: inset(12% 0 58% 0); }
  30%  { transform: translate(5px, -2px); filter: invert(0.08) contrast(1.4); clip-path: inset(62% 0 8% 0); }
  45%  { transform: translate(-4px, 1px) skewX(3deg); filter: hue-rotate(-50deg) saturate(2.4); clip-path: inset(32% 0 42% 0); }
  60%  { transform: translate(4px, 0); filter: contrast(1.6) brightness(1.2); clip-path: inset(78% 0 4% 0); }
  80%  { transform: translate(-2px, 0); filter: saturate(1.6); clip-path: inset(6% 0 82% 0); }
  100% { transform: translate(0); filter: none; clip-path: inset(0 0 0 0); }
}
.sst-glitch {
  animation: sst-glitch 0.45s steps(1, end) 1;
}

@media (prefers-reduced-motion: reduce) {
  html.sst-js .sst-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .sst-glitch {
    animation: none;
  }
}
