/* T19 — Homepage Visual System.
   Layout infrastructure for the six approved homepage visuals: responsive
   figure wrappers with reserved aspect-ratio (prevents layout shift while the
   real image loads). Asset URLs remain owned by the PHP delivery contract.
   Consumes only design-system tokens. */

.homepage-visual {
    display: block;
    margin: 0;
    min-inline-size: 0;
}

.homepage-visual__frame {
    display: block;
    position: relative;
    inline-size: 100%;
    /* Safe fallback; approved per-slot ratios are selected by fixed classes. */
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-12);
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-line);
}

.homepage-visual--ratio-16-9 .homepage-visual__frame {
    aspect-ratio: 16 / 9;
}

.homepage-visual--ratio-16-5 .homepage-visual__frame {
    aspect-ratio: 16 / 5;
}

.homepage-visual--ratio-3-2 .homepage-visual__frame {
    aspect-ratio: 3 / 2;
}

.homepage-visual--ratio-4-3 .homepage-visual__frame {
    aspect-ratio: 4 / 3;
}

.homepage-visual--ratio-3-4 .homepage-visual__frame {
    aspect-ratio: 3 / 4;
}

.homepage-visual__media {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
}

.homepage-visual__caption {
    margin-block: var(--space-8) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-14);
    line-height: var(--line-height-body);
    overflow-wrap: anywhere;
}

/* Match each art-directed mobile source with its own intrinsic framing. The
   breakpoints intentionally mirror the media queries in the T19 contract. */
@media (max-width: 40rem) {
    .homepage-visual--mobile-ratio-4-3 .homepage-visual__frame {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 48rem) {
    .homepage-visual--mobile-ratio-3-4 .homepage-visual__frame {
        aspect-ratio: 3 / 4;
    }
}

/* Static imagery only: no motion is required to understand any visual. This
   guard keeps the system safe if a future enhancement adds a transition. */
@media (prefers-reduced-motion: reduce) {
    .homepage-visual,
    .homepage-visual * {
        animation: none !important;
        transition: none !important;
    }
}
