/* Card container styling */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); /* カードの幅230pxで複数列 */
    justify-content: center; /* カードを中央揃え */
    width: 100%;
    max-width: 860px; /* 全体の幅を860pxに制限 */
    margin: 0 auto; /* 中央に配置 */
    gap: 20px; /* カード間の隙間 */
    padding: 20px;
}

/* Ensure card has a fixed width of 230px */
.card {
    width: 230px; /* カードの幅を230pxに固定 */
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Image styling within figure */
figure {
    margin: 0;
    padding: 0;
}

.card__image {
    width: 100%;
    height:auto; 
    object-fit: cover; /* 画像の縦横比を保ちながら高さを指定 */
    border-radius: 8px 8px 0 0;
}

/* Content block for title and text */
.card__content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-grow: 1; /* Flex-grow to ensure content takes available space */
}

/* Title styling */
.card__title {
    font-size: clamp(18px, 2vw, 24px); /* Responsive font size */
    margin: 10px 0;
}

/* Text styling */
.card__text {
    font-size: clamp(14px, 1.5vw, 18px); /* Responsive font size */
    color: #555;
    margin-top: auto; /* Ensure the text pushes content up */
}

/* Responsive design */
@media (max-width: 768px) {
    .card-container {
        grid-template-columns: 1fr; /* 1列にする */
    }

    .card {
        width: 100%; /* モバイル表示ではカードの幅を100%にする */
    }
}
