.img-container {
    width: 100%;
    position: relative;
    overflow: hidden; /* はみ出る部分を隠す */
}
.img-container img {
    border: 1px solid #ccc; /* ボーダーのスタイルを追加 */
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    object-position: center top;
}

.btn-container {
    margin-bottom: 20px;
}
.btn-container .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}
.button-row {
    display: flex;
    flex-wrap: wrap;
}
.dropdown-row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
}
.btn-selected {
    background-color: #007bff;
    color: white;
}
.row {
    margin-left: -5px; /* グリッドの左右の余白をリセット */
    margin-right: -5px;
}
.col-md-2 {
    padding: 5px; /* カラムのパディングを5pxに設定 */
}
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}
.page-item .page-link {
    color: #007bff;
}
.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}
.modal-dialog-centered {
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-lg {
    max-width: 800px;
}
.modal-body {
    display: flex;
    align-items: flex-start; /* 上揃えにする */
}
.modal-body img.original-size {
    border: 1px solid #ccc; /* モーダルの画像にもボーダーを追加 */
    max-width: 360px;
    max-height: auto;
    margin-right: 20px;
}
.modal-body .details {
    display: flex;
    flex-direction: column;
    margin-left: 20px;
}
.search-container {
    margin-bottom: 20px;
}
.details {
    display: flex;
    flex-direction: column;
}

.details dl {
    margin: 0;
}

.details dt,
.details dd {
    margin: 0;
    margin-bottom: 5px; /* 行間を詰める */
}

.details dt {
    font-weight: bold;
    width: 100px; /* 適切な幅を設定して揃える */
}

.d-flex {
    display: flex;
    flex-wrap: nowrap;
}

.d-flex dt {
    flex: 0 0 auto;
}

.d-flex dd {
    flex: 1 1 auto;
    margin-left: 10px; /* dtとの間隔を設定 */
}

.card {
    transition: box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}
.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}
.card img {
    height: 120px;
    object-fit: cover;
    width: 100%;
}
.card-title {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0;
    margin-top: 5px;
    line-height: 1.4;
}
.card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px;
}
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
}
.card-wrapper {
    flex: 1 1 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
    box-sizing: border-box;
}
@media (min-width: 992px) {
    .card-wrapper {
        flex: 1 1 calc(16.666% - 10px);
        max-width: calc(16.666% - 10px);
    }
}

/* スマートフォン用のメディアクエリ */
@media (max-width: 767.98px) {
    .col-md-2 {
        width: 33.3333%; /* 3枚ずつ表示 */
    }
    .modal-body {
        flex-direction: column; /* 縦方向に変更 */
        align-items: center;
    }
    .modal-body img.original-size {
        margin-right: 0;
        margin-bottom: 20px;
        width: 100%;
        max-width: none;
    }
    .modal-body .details {
        margin-left: 0;
    }
}