@charset "utf-8";
/* CSS Document */

.couponbox h4 {
    font-size: 24px;
    font-weight: bold;
    padding: 8px;
    color: #cc2a42;
    margin: 20px 0;
    background-color: #efefef;
}

.couponbox .bigfont {
    font-size: 180%;
    font-weight: bold;
}

.center {
    text-align: center;
}

.eventpage h3 {
    margin-top: 50px;
}

/* --- 修正箇所 --- */
.eventpage,
.eventpage-inner {
    /* 固定幅ではなく最大幅(max-width)に変更し、widthは100%にします */
    width: 100%;
    max-width: 1040px; 
    margin: 0 auto;
    box-sizing: border-box; /* パディングを含めたサイズ計算にする */
}

/* 画像がはみ出さないようにするための必須設定 */
.eventpage img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* ウィンドウ幅が1040px以下の場合に適用するCSS */
@media screen and (max-width: 1040px) {
    .eventpage,
    .eventpage-inner {
        width: 96%; /* 左右に少し余白を持たせる */
    }

    .eventpage {
        padding-bottom: 0;
    }

    .sp-small {
        font-size: 0.9em;
    }
}


/* --- テーブルのはみ出し対策 --- */

@media screen and (max-width: 1040px) {
    /* テーブルの「表」という構造を解除して、普通のブロック要素にする */
    .eventpage-inner table, 
    .eventpage-inner table tbody, 
    .eventpage-inner table tr {
        display: block !important;
        width: 100% !important;
    }

    /* 1行目の「割引率」「クーポンコード」「対象講座」という見出し行を消す */
    .eventpage-inner table tr:first-child {
        display: none !important;
    }

    /* 各セルを縦に並べる */
    .eventpage-inner table th, 
    .eventpage-inner table td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 15px !important;
        border: none !important; /* 一旦枠線を消す */
        border-bottom: 1px solid #ddd !important; /* 下線だけ引く */
        box-sizing: border-box !important;
    }

    /* 各セルのラベルを擬似要素で追加（何の情報か分かるようにする） */
    .eventpage-inner table td:nth-child(1):before {
        content: "【割引率】";
        font-weight: bold;
        color: #cc2a42;
        display: block;
        margin-bottom: 5px;
    }
    
    .eventpage-inner table th:nth-child(2):before {
        content: "【クーポンコード】";
        font-weight: bold;
        color: #cc2a42;
        display: block;
        margin-bottom: 5px;
    }

    .eventpage-inner table td:nth-child(3):before {
        content: "【対象講座】";
        font-weight: bold;
        color: #cc2a42;
        display: block;
        margin-bottom: 5px;
    }

    /* 割引率とクーポンコードのセルの文字を大きく */
    .eventpage-inner table td:nth-child(1),
    .eventpage-inner table th:nth-child(2) {
        font-size: 1.2em;
        font-weight: bold;
        background-color: #fff9f9; /* 少し色をつけて区切る */
    }
}



/* --- クーポンエリア全体の調整 --- */
.coupon-container {
    width: 100%;
    max-width: 1040px;
    margin: 20px auto;
    box-sizing: border-box;
}

.coupon-card {
    border: 2px solid #cc2a42;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

/* 各行の基本構造（PCでは横並び） */
.coupon-row, .coupon-target {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.label {
    background-color: #f4f4f4;
    color: #333;
    font-weight: bold;
    padding: 15px;
    width: 160px; /* 見出しの幅 */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ddd;
}

.value {
    flex-grow: 1;
    padding: 15px;
    text-align: center;
    font-size: 1.2rem;
}

.value.highlight { color: #cc2a42; font-weight: bold; }
.value.code { background: #fff9f9; font-family: monospace; letter-spacing: 1px; }

/* 講座リストのスタイリング */
.course-list {
    flex-grow: 1;
    padding: 20px;
    text-align: left;
}

.course-group {
    margin-bottom: 15px;
}

.group-title {
    font-weight: bold;
    color: #cc2a42;
    margin: 0 0 5px 0;
}

.items {
    margin: 0;
    line-height: 1.6;
    color: #444;
    padding-left: 10px;
    word-break: break-all; /* 長い名称でも強制改行してはみ出しを防ぐ */
}

.note {
    background: #f9f9f9;
    padding: 10px;
    font-size: 0.8rem;
    margin: 0;
    color: #666;
    text-align: center;
}

/* --- スマホ専用：1040px以下の調整 --- */
@media screen and (max-width: 1040px) {
    .coupon-container {
        padding: 0 10px; /* 左右に少し隙間を作る */
    }

    .coupon-row, .coupon-target {
        flex-direction: column; /* 縦並びに変更 */
    }

    .label {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 10px;
    }

    .value {
        width: 100%;
        box-sizing: border-box;
    }

    .course-list {
        padding: 15px;
    }

    .items {
        padding-left: 0;
        font-size: 0.95rem; /* スマホでは少し文字を小さくして読みやすく */
    }
}