/* ---------- HEADER ---------- */
.resources-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 0 1rem;
    position: relative;
}

.resources-head h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    flex-shrink: 0;
}

/* ПОИСК */
.resources-head > input {
    padding: 0.4rem 1rem;
    min-width: 450px; /* уменьшили */
    border-radius: 20px;
    border: 1px solid #aaa;
    flex-shrink: 0;
}

/* ---------- FILTER ---------- */
.resources-filter {
    position: relative;
}

.resources-filter summary {
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.5rem;
}

.resources-filter ul {
    position: absolute;
    top: 100%;
    right: -50%;
    background: #fff;
    border: 1px solid #ccc;
    padding: 0.5rem;
    margin: 0;
    list-style: none;
    width: 120px;
    z-index: 10;
    display: none;
}

.resources-filter[open] ul {
    display: block;
}

.resources-filter li {
    height: 24px;
}

.checked {
    font-weight: 600;
} 
/* ---------- GRID ---------- */
#resources-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    list-style: none;
    padding: 0;
}

/* ---------- CARD ---------- */
.res-card {
    max-width: 130px;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    border: #aaa solid 1px;
    border-radius: 30px;
    padding: 5px 5px 12px;
}

/* ---------- ICON ---------- */
.res-icon {
    object-fit: cover;   /* Обрезка и сохранение пропорций */
    object-position: center;
    position: relative;
    display: block;
    width: 120px;
    height: 120px;
}

.res-icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .2s ease;
}

.icon-download {
    opacity: 0;
}

.res-card:hover .icon-main {
    opacity: 0;
}

.res-card:hover .icon-download {
    opacity: 1;
}

.res-link:hover .icon-download {
    opacity: 0;
}

.res-link:hover .icon-main {
    opacity: 1;
}

/* ---------- NAME ---------- */
.res-name {
    overflow: hidden;
    white-space: nowrap;
    margin-top: 6px;
}

.res-name span {
    display: inline-block;
    max-width: 100%;
    /* убрали text-overflow, чтобы исчезли 3 точки */
}
