/*
 * Project overrides.
 *
 * Loads after theme.css, so anything here wins. Put your own tweaks in this
 * file rather than editing theme.css — that keeps the ported design system
 * intact and your changes easy to find.
 */

/* ---------------------------------------------------- Skeleton placeholder */
/* Used by hy_image( $id, $alt, $class, $wrap ) when a wrapper class is given. */

.skeleton-placeholder {
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.skeleton-placeholder img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

/*
 * The shimmer is opt-in: custom.js adds .is-loading only to images that have
 * not finished decoding, so with JavaScript unavailable every image still
 * renders.
 */
.skeleton-placeholder.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #eceff1 25%, #f5f7f8 37%, #eceff1 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

.skeleton-placeholder.is-loading img {
    opacity: 0;
}

@keyframes skeleton-loading {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-placeholder.is-loading::after { animation: none; }
}
