/* Compact model marks shared by the homepage AI gallery and the AI subpage. */

/* Cards stay anchored when the pointer enters them. */
#ai-reels .ai-grid .video-card:hover,
#ai-reels .ai-grid .video-card:focus-within,
.ai-page .ai-project:hover,
.ai-page .ai-project:focus-within {
    transform: none !important;
    translate: none !important;
}

/* Homepage: replace verbose badges with a quiet, centered logo row. */
#ai-reels .ai-grid .video-card.has-models .model-badges {
    position: relative !important;
    inset: auto !important;
    z-index: 8 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .65rem !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 3.45rem !important;
    margin: .8rem 0 0 !important;
    padding: .65rem 0 0 !important;
    border-top: 1px solid rgba(95, 118, 145, .24) !important;
    background: transparent !important;
    pointer-events: auto !important;
    overflow: visible !important;
}

#ai-reels .ai-grid .video-card .model-badges::before,
#ai-reels .ai-grid .video-card .model-badge + .model-badge::before {
    content: none !important;
    display: none !important;
}

#ai-reels .ai-grid .video-card .model-badge {
    position: relative !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 2.75rem !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-height: 2.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 1 !important;
    cursor: help;
    overflow: visible !important;
}

#ai-reels .ai-grid .video-card .model-badge > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#ai-reels .ai-grid .video-card .model-badge img {
    display: block !important;
    width: 2.15rem !important;
    height: 2.15rem !important;
    flex: 0 0 2.15rem !important;
    object-fit: contain !important;
    transform: none !important;
    filter: none !important;
}

#ai-reels .ai-grid .video-card .model-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + .5rem);
    z-index: 30;
    width: max-content;
    max-width: min(15rem, 72vw);
    padding: .42rem .6rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .4rem;
    background: #182638;
    color: #fff;
    box-shadow: 0 .45rem 1.35rem rgba(6, 15, 27, .2);
    font: 600 .68rem/1.2 Manrope, Arial, sans-serif;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, .25rem);
    transition: opacity .16s ease, transform .16s ease;
}

#ai-reels .ai-grid .video-card .model-badge:hover::after,
#ai-reels .ai-grid .video-card .model-badge:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

#ai-reels .ai-grid .video-card .model-badge:focus-visible {
    outline: 2px solid #285cc4 !important;
    outline-offset: 3px !important;
}

/* AI subpage: the same centered logo-only treatment. */
.ai-page .ai-project-models {
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    min-height: 3.75rem !important;
    padding-top: .65rem !important;
}

.ai-page .ai-project-models-label {
    display: none !important;
}

.ai-page .ai-project-models-list,
.ai-page .ai-project-models-list.is-multiple {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    align-content: center !important;
    gap: .65rem !important;
    width: 100% !important;
}

.ai-page .ai-project-models a {
    cursor: help;
}

.ai-page .ai-project-models a:hover .ai-logo,
.ai-page .ai-project-models a:focus-visible .ai-logo {
    transform: none !important;
}

.ai-page .ai-project-model-name {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

@media (prefers-reduced-motion: reduce) {
    #ai-reels .ai-grid .video-card .model-badge::after {
        transition: none;
    }
}

/* Some legacy homepage rules are intentionally very specific. Keep this final
   accessibility override stronger so the marks can receive hover and focus. */
html body.light-theme #ai-reels .ai-grid .video-card.has-models .model-badges {
    z-index: 8 !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

html body.light-theme #ai-reels .ai-grid .video-card.has-models .model-badges::before,
html body.light-theme #ai-reels .ai-grid .video-card.has-models .model-badge + .model-badge::before {
    content: none !important;
    display: none !important;
}

html body.light-theme #ai-reels .ai-grid .video-card.has-models .model-badge {
    position: relative !important;
    display: grid !important;
    place-items: center !important;
    pointer-events: auto !important;
    font-size: 0 !important;
}

/* Model attribution was intentionally removed from project cards. */
#ai-reels .model-badges,
.ai-page .ai-project-models {
    display: none !important;
}
