@import url('../common/color.css');

/* グリッドコンテナのスタイル */
.card-group-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: flex-start;  /* アイテムを中央に配置 */
    margin: 8px;
}

/* 各カードの表示スタイル */
.card-item {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 450px;  /* 各カードの幅を固定 */
    padding: 20px;
    box-shadow: 0 2px 5px var(--box-shadow-color);
    flex-grow: 0;
    font-size: 0.9em;  /* フォントサイズを小さめに設定 */
}

/* カーソルが乗ったときの影効果 */
.card-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); /* 影を強調 */
    transform: translateY(-3px); /* 少し持ち上げる */
    transition: all 0.2s ease-in-out; /* スムーズな変化を追加 */
}

.card-name {
    line-height: 1.5;
}

/* カードのヘッダースタイル（画像と情報の横並び） */
.card-header {
    display: flex;
    align-items: flex-start; /* 上端に合わせる */
    gap: 10px;
}

/* カード情報のスタイル */
.card-info {
    flex-grow: 1;
    line-height: 0.8; /* 行間を狭くする */
    vertical-align: top; /* カード情報を上に配置 */
}

/* カード名のスタイル */
.card-info h3 {
    font-size: 1em;  /* フォントサイズを小さめに設定（必要に応じて調整） */
}

/* カード画像のスタイル */
.card-thumbnail {
    display: block; /* 親要素との間の余白を防ぐ */
    max-width: 150px;  /* 画像の幅を適切に小さく設定 */
    height: auto;  /* 自動で高さを調整 */
    object-fit: contain;  /* 画像の比率を保ちながら指定した領域に収める */
    border-radius: 8px;
}

/* リンクのスタイル */
.link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9em;  /* フォントサイズを小さめに設定 */
}

.link:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}

.pagination {
    margin-bottom: 20px;
}

/* フィルタとソートの行を整える */
.filter-sort-form {
    display: flex;
    flex-direction: column; /* 各フィルタ行を縦並びに配置 */
    gap: 8px; /* 各フィルタ行の間に余白を追加 */
    width: 100%; /* フォーム全体の幅 */
    box-sizing: border-box; /* パディングを幅に含める */
}

/* 言語フィルタとソートドロップダウンのスタイル */
.filter-sort-form label {
    font-weight: bold;
    margin-right: 5px;
}

.filter-sort-form select {
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-bg-color);
    color: var(--text-color);
}

/* ドロップダウンのホバー効果 */
.filter-sort-form select:hover {
    border-color: var(--link-hover-color);
}

/* フォームの間隔 */
.filter-sort-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ラベルと選択項目を整列 */
.filter-sort-row label {
    margin-right: 10px;
    font-weight: bold;
}

.filter-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.filter-row label {
    flex: 0 0 25%; /* ラベルの幅を固定 */
    font-size: 12px; /* ラベルの文字サイズを調整 */
    text-align: right; /* ラベルを右寄せ */
    margin-right: 8px; /* ラベルと入力欄の間に余白を追加 */
}

.filter-row select {
    flex: 0 0 55%; /* 選択項目の幅を55%に固定 */
    padding: 5px;
    font-size: 12px;
    box-sizing: border-box; /* パディングを含めてサイズ計算 */
}

@media screen and (min-width: 768px){
    .filter-sort-form {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap; /* 画面幅が足りない場合に折り返す */
        gap: 10px; /* フィルター間のスペースを狭くする */
    }

    .filter-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: auto;
        flex-wrap: nowrap; /* フィルター項目が折り返されるのを防ぐ */
    }

    .filter-row label {
        flex: 0 0 auto; /* 幅を固定せず、適度に伸縮 */
        min-width: 80px; /* 最小幅を確保 */
        max-width: 120px; /* 最大幅を設定 */
        text-align: right;
        white-space: nowrap; /* 改行を防ぐ */
    }

    .filter-row select {
        flex: 1 1 auto; /* 残りのスペースを適度に使用 */
        min-width: 120px; /* 選択ボックスの最小幅を確保 */
        max-width: 200px; /* 最大幅を設定 */
    }
}

/* foil effect for card image */
.foil-effect {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: auto;
    height: auto;
    border-radius: 8px;
    z-index: 0;
    flex-shrink: 0; /* 親要素内で縮小を防ぐ */
}

.foil-effect::before {
    content: "";
    height: 100%;
    width: 100%;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(45deg, rgba(255, 0, 0, 0.4), rgba(255, 165, 0, 0.4), rgba(255, 255, 0, 0.4), rgba(0, 255, 0, 0.4), rgba(0, 0, 255, 0.4), rgba(75, 0, 130, 0.4), rgba(238, 130, 238, 0.4));
    opacity: 0.75;
    background-size: 200% 200%;
    pointer-events: none;
    z-index: 1;
}

.foil-effect::after {
    content: "";
    height: 100%;
    width: 30px;
    border-radius: 8px;
    position: absolute;
    top: -180px;
    left: 0;
    background-color: #fff;
    opacity: 0;
    transform: rotate(45deg);
    animation: reflection 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes reflection {
    0% { transform: scale(0) rotate(45deg); opacity: 0; }
    80% { transform: scale(0) rotate(45deg); opacity: 0.5; }
    81% { transform: scale(4) rotate(45deg); opacity: 0.8; }
    100% { transform: scale(50) rotate(45deg); opacity: 0; }
}