/* LimageCMS v0.2 — F9 Models */
.models-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.model-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.model-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.model-card__avatar {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #e9edf2;
}

.model-card__avatar--placeholder,
.model-header__avatar--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
    background: #e9edf2;
}

.model-card__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 13px 15px 15px;
}

.model-card__body strong {
    color: var(--text);
    font-size: 1rem;
}

.model-card__body small {
    color: var(--muted);
    font-size: .88rem;
}

.model-card:hover {
    box-shadow: 0 5px 18px rgba(20, 31, 45, .1);
}

.model-page {
    min-width: 0;
}

.model-header {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 28px;
}

.model-header__avatar {
    flex: 0 0 132px;
    width: 132px;
    height: 132px;
    object-fit: cover;
    border-radius: 14px;
    background: #e9edf2;
}

.model-header__content {
    min-width: 0;
}

.model-header h1 {
    margin: 0 0 7px;
}

.model-header p {
    margin: 0 0 10px;
    color: var(--muted);
}

.model-header__count {
    color: var(--muted);
    font-size: .92rem;
}

.model-load-status {
    min-height: 24px;
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

.model-load-status.is-error {
    color: #a32929;
}

.model-load-status button {
    margin-left: 8px;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.model-load-sentinel {
    height: 1px;
}

@media (max-width: 960px) {
    .models-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .models-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .model-header {
        align-items: flex-start;
    }

    .model-header__avatar {
        flex-basis: 96px;
        width: 96px;
        height: 96px;
        border-radius: 12px;
    }
}

@media (max-width: 460px) {
    .models-grid {
        grid-template-columns: 1fr;
    }

    .model-header {
        display: block;
    }

    .model-header__avatar {
        margin-bottom: 14px;
    }
}
