.topic-image-container {
    width: 100%;
    height: 200px;
    border: 2px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-image {
    transition: transform 0.3s ease;
}

.topic-image.portrait {
    height: 100%;
    width: auto;
    object-fit: cover;
}

.topic-image.landscape {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.topic-link:hover .topic-image {
    transform: scale(1.05);
}

/* PC（大画面） */
@media (min-width: 1200px) {
    .topic-image-container {
        height: 250px;
    }
}

/* タブレット */
@media (max-width: 1199px) and (min-width: 769px) {
    .topic-image-container {
        height: 200px;
    }
}

/* スマホ */
@media (max-width: 768px) {
    .topic-image-container {
        height: 150px;
    }

    /* スマホでは縦長画像も横長画像も同じ扱い */
    .topic-image.portrait,
    .topic-image.landscape {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
