.masonry-grid {
    column-count: 4;
    column-gap: 5px;
}
.masonry-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 5px;
    break-inside: avoid;
}
.masonry-item.is-hidden {
    display: none;
}

.masonry-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.masonry-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.masonry-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: background 0.3s ease, opacity 0.3s ease;
}
.masonry-thumb:hover .masonry-overlay {
    background: rgba(0, 0, 0, 0.45);
    opacity: 1;
}
.masonry-thumb:hover img {
    transform: scale(1.05);
}
.masonry-read-btn {
    color: #fff;
    border: 1px solid #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}
.masonry-thumb:hover .masonry-read-btn {
    transform: translateY(0);
    opacity: 1;
}

.masonry-title {
    margin: 3px 0 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.masonry-title a {
    color: #333;
    text-decoration: none;
}

.masonry-filters {
    margin-bottom: 20px;
}
.filter-group {
    margin-bottom: 8px;
}
.filter-label {
    font-weight: bold;
    margin-right: 8px;
}
.filter-btn {
    background: #f2f2f2;
    border: none;
    padding: 6px 14px;
    margin: 2px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}
.filter-btn.active {
    background: #333;
    color: #fff;
}

.masonry-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.masonry-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* 切り抜いて比率に収める */
    display: block;
}


@media (max-width: 1024px) { .masonry-grid { column-count: 4; } }
@media (max-width: 768px)  { .masonry-grid { column-count: 2; } }
@media (max-width: 480px)  { .masonry-grid { column-count: 2; } }