@charset "UTF-8";

/* =========================================
   検索フィルターセクション
   ========================================= */
.filter-section {
    background: #f4f4f4;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
}

.filter-item label {
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap; /* ラベルの折り返し防止 */
}

.filter-item select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 240px; /* PCでの少し広めの幅 */
    font-size: 16px; /* スマホでズームされないサイズ */
    background-color: #fff;
    cursor: pointer;
}

.filter-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s, background-color 0.2s;
}

.filter-btn:hover {
    opacity: 0.8;
}

/* 検索結果件数 */
.filter-count-text {
    margin-top: 15px;
    font-size: 0.9em;
    text-align: right; /* PCでは右寄せ */
}

/* =========================================
   事例一覧グリッドレイアウト
   ========================================= */
.jirei-grid {
    display: grid;
    /* 画面幅に合わせて自動折り返し（最小幅280px） */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* 非表示用クラス（JS制御用） */
.hidden {
    display: none !important;
}

/* =========================================
   事例カードデザイン
   ========================================= */
.jirei-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%; /* グリッド内で高さを揃える */
}

/* ホバー時の挙動（PCのみ適用推奨） */
@media (hover: hover) {
    .jirei-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        border: solid 2px var(--main-color);
    }
}

.jirei-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 画像エリア */
.jirei-card-img-wrapper {
    width: 100%;
    height: 180px;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.jirei-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.jirei-card:hover .jirei-card-img {
    transform: scale(1.05); /* ホバーで少し拡大 */
}

/* テキストエリア */
.jirei-card-body {
    padding: 15px;
    flex-grow: 1; /* 下部まで伸ばす */
    display: flex;
    flex-direction: column;
}

.jirei-card-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 12px;
    line-height: 1.5;
    color: #333;
}

.jirei-card-tags {
    margin-top: auto; /* 最下部に固定 */
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.jirei-tag {
    display: inline-block;
    background: #f5f5f5;
    color: #666;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #eee;
}

/* =========================================
   レスポンシブ対応（スマホ・タブレット）
   ========================================= */
@media screen and (max-width: 768px) {
    /* フィルターエリア */
    .filter-section {
        padding: 15px;
    }

    .filter-group {
        flex-direction: column; /* 縦並びにする */
        align-items: stretch;   /* 横幅いっぱいに広げる */
        gap: 15px;
    }

    .filter-item {
        flex-direction: column; /* ラベルを上に */
        align-items: flex-start;
        width: 100%;
    }

    .filter-item label {
        margin-bottom: 5px;
        font-size: 0.9rem;
    }

    .filter-item select {
        width: 100%; /* 幅100% */
        min-width: 0; /* min-widthリセット */
    }

    .filter-btn {
        width: 100%; /* ボタンも幅一杯に */
        padding: 12px;
    }

    .filter-count-text {
        text-align: left; /* スマホでは左寄せが見やすい */
    }

    /* グリッドレイアウト */
    .jirei-grid {
        gap: 15px;
        /* スマホでは1カラムになっても見やすいよう調整 */
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    
    /* 480px以上なら2列維持などの微調整も可能だが、
       基本はgrid-template-columnsの設定にお任せでOK */
}

/* さらに小さい画面（かなり狭いスマホ）向けの微調整 */
@media screen and (min-width: 480px) and (max-width: 768px) {
    .jirei-grid {
        /* タブレット縦や大きめスマホなら2列確保 */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}