﻿/* ===== Recent Horses modal shell =====
   Global because the Blazorise modal renders outside scoped CSS; applied via :has(.recent-horses). Breakpoint: md (768px). */

@media (min-width: 768px) {

    /* Constrain modal vertical span so it never runs off the top or bottom of the screen */
    .modal-dialog:has(.recent-horses) {
        max-height: calc(100vh - 3.5rem);
        margin-top: 1.75rem;
        margin-bottom: 1.75rem;
        display: flex;
        align-items: stretch;
    }

    /* modal-content fills the dialog and clips rounded corners; overflow:hidden forces .modal-body to size
           to the remaining space so .recent-horses-body becomes the scroll container. */
    .modal-content:has(.recent-horses) {
        max-height: calc(100vh - 3.5rem);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* Strip default modal body padding — the component owns its own padding.
       min-height: 0 + flex: 1 1 auto are critical for the scroll chain to work. */
    .modal-body:has(.recent-horses) {
        padding: 0;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* The component root must fill the modal body and not introduce its own
       scrollbar — the actual scrolling happens on .recent-horses-body inside. */
    .modal-body .recent-horses {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }
}
