/* ========================================
   全体
======================================== */
body {
    font-family: sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
}

.events-main {
    padding: 20px;
}

/* ========================================
   ページタイトル
======================================== */
.events-main>h1 {
    color: #000;
    text-align: center;
    margin: 20px 0 40px;
}

/* 白いコンテナ全体 */
.events-panel {
    max-width: 1200px;
    width: 100%;
    margin: 80px auto 100px;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* ページタイトル */
.events-panel>h1 {
    text-align: center;
    margin: 0 0 40px;
}

/* 企画一覧コンテナ */
#eventsContainer {
    width: 100%;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}

/* ========================================
   ジャンルセクション
======================================== */
.genre-section {
    margin: 0 0 50px;
    text-align: center;
}

.genre-section:last-child {
    margin-bottom: 0;
}

/* ジャンル見出し */
.genre-title {
    font-size: 2rem;
    margin: 0 0 30px;
    padding-bottom: 10px;
    position: relative;
    display: inline-block;
    color: #333;
}

.genre-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: #ff6b6b;
}

/* 企画カード一覧 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 350px));
    justify-content: center;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* 企画カード */
.card {
    width: 100%;
    min-width: 0;
    aspect-ratio: 3 / 4;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
}

/* カード内の画像 */
.card .slide-container {
    flex: 0 0 70%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.card .slide-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* カード内のタイトル */
.card .info {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.card .info h3 {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   モーダル背景
======================================== */
/* モーダル背景 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 80px 5% 12px;
    box-sizing: border-box;
}

/* モーダル本体 */
.modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    text-align: center;
    overflow-y: auto;
    box-sizing: border-box;
}

/* モーダルタイトル */
#modalTitle {
    margin: 10px 0;
    font-size: 1.3em;
    text-align: center;
}

/* 閉じるボタン */
.close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}

/* ========================================
   モーダル内の画像
======================================== */
.modal .slide-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.modal .slide-track {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal .slide-track img {
    width: 100%;
    height: 45vh;
    padding: 4px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* ========================================
   モーダル内の企画情報テーブル
======================================== */
#modalInfoTable table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    table-layout: fixed;
}

#modalInfoTable th,
#modalInfoTable td {
    padding: 8px;
    border: 1px solid #ccc;
    text-align: left;
    vertical-align: top;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

#modalInfoTable th {
    width: 15%;
    background: #f0f0f0;
}

#modalInfoTable td {
    width: 85%;
}

/* ========================================
   ジャンル絞り込みボタン
======================================== */
.genre-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 0 40px;
}

.genre-filter {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: #fff;
    color: #333;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

/* マウスを乗せたとき */
.genre-filter:hover {
    background: #f5f5f5;
    border-color: #ff6b6b;
}

/* 選択中のボタン */
.genre-filter.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* キーボード操作時 */
.genre-filter:focus-visible {
    outline: 2px solid #333;
    outline-offset: 3px;
}

/* ========================================
   スマートフォン対応
======================================== */
@media (max-width: 600px) {
    .events-main {
        padding: 12px;
    }

    .events-panel {
        padding: 24px 16px;
    }

    .events-panel>h1 {
        margin-bottom: 28px;
    }

    #eventsContainer {
        padding: 24px 16px;
        width: 100%;
    }

    .genre-section {
        margin-bottom: 36px;
    }

    .genre-title {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 0;
    }

    .card .info h3 {
        font-size: 0.9rem;
    }

    .modal .slide-track img {
        height: 25vh;
        max-height: 200px;
    }

    .modal-content {
        max-width: 95%;
        padding: 16px;
    }

    #modalInfoTable th,
    #modalInfoTable td {
        padding: 6px;
        font-size: 0.85em;
    }

    .genre-filters {
        gap: 8px;
        margin-bottom: 30px;
    }

    .genre-filter {
        padding: 9px 13px;
        font-size: 0.82rem;
    }
}