/* Vista de recursos de proyecto: rejilla de tarjetas con portada 3:2 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--gap);
    margin-top: 1em;
}

.resource-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--slim-main-dark-extra-trans);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.resource-card:hover {
    box-shadow: 0 6px 18px rgba(39, 40, 41, 0.12);
    transform: translateY(-2px);
}

.resource-card.dragging {
    opacity: 0.5;
}

.resource-card-cover {
    position: relative;
    aspect-ratio: 3 / 2;
    background: var(--slim-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.resource-card-nocover {
    font-size: 3rem;
    color: var(--slim-main-lighter);
}

.resource-card-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(39, 40, 41, 0.65);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resource-card:hover .resource-card-remove {
    opacity: 1;
}

.resource-card-remove .material-symbols-outlined {
    font-size: 1rem;
}

.resource-card-body {
    padding: 0.75rem 0.9rem;
}

.resource-card-title {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--slim-main-dark);
    overflow-wrap: anywhere;
}

.resource-card-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.resource-card-warning {
    margin: 0.4rem 0 0;
    font-size: 0.72rem;
    color: var(--slim-alert-button);
}

.resource-card-children {
    list-style: none;
    margin: 0;
    padding: 0.9rem 0.75rem;
    border-top: 1px solid var(--slim-main-dark-extra-trans);
}

.resource-card-children li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 -0.4rem;
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--slim-main-light);
    transition: background 0.15s ease, color 0.15s ease;
}

.resource-card-children li:hover {
    background: var(--slim-gray);
    color: var(--slim-standard-button);
}

/* Mientras el ratón está sobre una fila, la tarjeta no se eleva: si no, su propio
   hover se come el feedback de la fila y parece que la lista no responde. */
.resource-card:has(.resource-card-children li:hover) {
    transform: none;
    box-shadow: none;
}

.resource-card-children .material-symbols-outlined {
    font-size: 1rem;
}

.resource-child-name {
    flex: 1;
    overflow-wrap: anywhere;
}

.resource-child-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: none;
    padding: 0;
    color: var(--slim-main-light);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.resource-card-children li:hover .resource-child-remove {
    opacity: 1;
}

.resource-child-remove:hover {
    background: rgba(220, 53, 69, 0.12);
    color: var(--slim-alert-button);
    opacity: 1;
}

.resource-child-add {
    color: var(--slim-standard-button);
    font-weight: 600;
}

.resource-card-add {
    align-items: center;
    justify-content: center;
    min-height: 160px;
    border-style: dashed;
    color: var(--slim-main-light);
}

.resource-card-add .material-symbols-outlined {
    font-size: 2.5rem;
}

/* Previsualización de la portada dentro del panel lateral */
.resource-cover-preview {
    margin-top: 0.75rem;
}

.resource-cover-preview img {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.resource-current-file {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}
