/* ============================================================
   夏芸台2026 フロントエンド
   ============================================================ */

a.nsg-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a.nsg-card-link:hover {
    opacity: 0.9;
}

.natsugeidai-container {
    max-width: 1440px;
    margin: 0;
    padding: 0;
    font-family: 'M PLUS U', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.03em;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.natsugeidai-container *,
.natsugeidai-container *::before,
.natsugeidai-container *::after {
    box-sizing: inherit;
}

/* ---- 表示切替ボタン ---------------------------------------- */

.natsugeidai-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: nowrap;
    margin-bottom: 0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    padding: 19px 90px 19px 0;
    box-sizing: border-box;
}

.natsugeidai-view-toggle {
    display: flex;
    gap: 4px;
    height: 38px;
    flex-shrink: 0;
    background: #fff;
    /* padding: 4px; */
    border-radius: 20px;
    border: 1px solid;
}

.nsg-toggle-btn {
    padding: 4px 28px;
    height: 38px;
    border: none;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', 'Hiragino Mincho ProN', serif;
    letter-spacing: -0.02em;
    color: #042db4;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nsg-toggle-btn.nsg-active {
    background: #042db4;
    color: #fff;
    /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); */
    border-radius: 18px 0 0 18px;
}

.natsugeidai-view-toggle.nsg-calendar-active .nsg-toggle-btn.nsg-active {
    border-radius: 0 18px 18px 0;
}

.nsg-toggle-btn:hover:not(.nsg-active) {
    color: #333;
}

/* ---- フィルター ------------------------------------------- */

.nsg-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.nsg-filter-label {
    font-family: 'Noto Serif JP', 'Yu Mincho', '游明朝', 'Hiragino Mincho ProN', serif;
    font-size: 1.4rem;
    color: #042db4;
    text-decoration: underline;
    white-space: nowrap;
    margin-right: 16px;
}

.nsg-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0px 0px;
    border: none;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    font-family: 'M PLUS U', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.04em;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nsg-filter-btn.nsg-active {
    background: none;
    border-color: #1a1a1a;
    color: #fff;
}

.nsg-filter-btn:hover:not(.nsg-active) {
    border-color: #333;
    color: #333;
}

.nsg-filter-img {
    display: block;
    height: 26px;
    width: auto;
}

/* デスクトップ：sp用photo非表示、sp用ボタン非表示 */
.nsg-card-photo-sp {
    display: none;
}
.nsg-card-sp-btn {
    display: none;
}

/* ---- グリッド表示 ----------------------------------------- */

.nsg-lecture-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 980px) {
    .nsg-lecture-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .nsg-lecture-grid { grid-template-columns: 1fr; }
}

/* カード外枠 */
.nsg-card {
    background: #fff;
    border: 1.5px solid #000;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nsg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* タイトルエリア（上部） */
.nsg-card-title-area {
    padding: 14px 14px 0px;
    flex: 1;
}

.nsg-card-title {
    font-size: var(--26px, 1.625rem);
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    color: #fff;
    letter-spacing: -0.03em;
    font-family: "BIZ UDMincho", "YuMincho", "Hiragino Mincho ProN", serif;
    -webkit-font-feature-settings: "palt";
            font-feature-settings: "palt";
    -webkit-transform: scaleY(0.85);
            transform: scaleY(0.85);
    -webkit-transform-origin: top left;
            transform-origin: top left;
}

/* メインエリア（左カラム＋講師写真） */
.nsg-card-main {
    display: flex;
    align-items: stretch;
    flex: 1;
}

.nsg-card-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.nsg-card-table-wrap {
    width: 100%;
}

/* 情報テーブル */
.nsg-card-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.nsg-card-table td {
    padding: 4px 4px;
    vertical-align: middle;
    font-size: 16px;
    border-top: 1px solid #000;
    line-height: 1.45;
    letter-spacing: 0.03em;
    border-right: 1px solid #000;
}

/* カテゴリ行 */
.nsg-td-cat-label {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-color: #000;
    white-space: nowrap;
}

.nsg-cat-label {
    font-size: 13px;
    font-weight: 400;
}

.nsg-td-sub-cats {
    background: #dbdbdb;
    color: #333;
    border-color: #000;
    vertical-align: middle;
}

.nsg-cat-tag {
    display: inline-block;
    vertical-align: middle;
    color: #333;
    font-size: 11px;
    font-weight: 600;
    margin: 0 4px 0 0;
    letter-spacing: 0.02em;
}

.nsg-cat-tag-img {
    display: inline-block;
    vertical-align: middle;
    height: 24px;
    width: auto;
}

/* ボディ行（白背景） */
.nsg-row-body td {
    background: #fff;
    color: #333;
    font-weight: 500;
    border-color: #000;
}

.nsg-row-body .nsg-td-instr,
.nsg-row-body .nsg-td-time,
.nsg-row-body .nsg-td-price,
.nsg-row-body .nsg-td-target-age {
    background: #dbdbdb;
}

/* カテゴリ色背景セル（文字白） */
.nsg-row-body .nsg-td-number,
.nsg-row-body .nsg-td-date {
    color: #fff;
    font-weight: 700;
}

.nsg-td-date {
    white-space: nowrap;
    font-size: 13px;
}

.nsg-td-target-age {
    font-size: 12px;
    padding: 4px 8px;
    color: #555;
}

.nsg-td-instr[data-instr-url] {
    cursor: pointer;
}

.nsg-instr-link {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 講師写真（右カラム） */
.nsg-card-instr-photo {
    width: 40%;
    flex-shrink: 0;
    overflow: hidden;
    border-top: 1px solid #000;
}

.nsg-card-instr-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 講座写真（下部） */
.nsg-card-photo {
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
    border-top: 1px solid #000;
    border-right: 1px solid #000;
}

.nsg-card-photo img {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 4 / 2;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.nsg-card:hover .nsg-card-photo img {
    transform: scale(1.04);
}

.nsg-no-lectures {
    text-align: center;
    color: #aaa;
    padding: 60px 20px;
    font-size: 15px;
}

/* ---- カレンダー表示 --------------------------------------- */

.nsg-cal-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.nsg-cal-title {
    font-size: 22px;
    font-weight: 900;
    margin: 0;
    text-align: center;
    flex: 1;
    letter-spacing: 0.06em;
    color: #1a1a1a;
}

.nsg-cal-btn {
    padding: 9px 18px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    font-family: 'M PLUS U', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    letter-spacing: 0.05em;
    transition: background 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nsg-cal-btn:hover:not(:disabled) {
    background: #555;
}

.nsg-cal-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.nsg-cal-scroll-wrap {
    position: relative;
    display: grid;
    grid-template-columns: 100px 1fr;
}

.nsg-cal-scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92));
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.2s ease;
}

.nsg-cal-scroll-wrap.nsg-at-right::after {
    opacity: 0;
    pointer-events: none;
}

.nsg-cal-scroll {
    border: none;
    background: #fff;
    overflow-x: auto;
    overflow-y: clip;
}

.nsg-cal-wrapper {
    display: flex;
    min-height: 400px;
}

/* 日付ナビ行 */
.nsg-cal-date-nav {
    display: flex;
    align-items: flex-end;
    overflow-x: auto;
    border-bottom: none;
    background: #fff;
    padding: 8px 0 0px 100px;
    margin-bottom: 0;
    scrollbar-width: none;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 9;
    scroll-behavior: smooth;
}
.nsg-cal-date-nav::-webkit-scrollbar { display: none; }

.nsg-cal-date-cell {
    flex-shrink: 0;
    padding: 4px 16px 8px;
    color: #042db4;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 2px;
    opacity: 0.4;
    border-bottom: none;
    transition: opacity 0.15s;
}
.nsg-cal-date-cell:hover {
    opacity: 0.7;
}
.nsg-cal-date-active {
    opacity: 1;
}

.nsg-cal-hd-month {
    font-size: 0.9rem;
}
.nsg-cal-hd-day {
    font-size: 1.3rem;
    font-weight: 400;
}
.nsg-cal-date-active .nsg-cal-hd-day {
    font-size: 2rem;
}
.nsg-cal-hd-dow {
    font-size: 0.75rem;
}
.nsg-cal-date-active .nsg-cal-hd-dow {
    font-size: 1.5rem;
}

.nsg-cal-main {
    display: flex;
}

.nsg-cal-timecol {
    position: relative;
    width: 100px;
    background: #f7f7f7;
    border-right: 1px solid #e0e0e0;
    z-index: 3;
    overflow: hidden;
}

.nsg-cal-hour-label {
    position: absolute;
    right: 6px;
    font-size: 20px;
    font-weight: 400;
    color: #042db4;
    transform: translateY(-50%);
    white-space: nowrap;
    user-select: none;
}

.nsg-cal-hour-label.nsg-first-hour {
    transform: translateY(4px);
}

.nsg-cal-hour-label.nsg-last-hour {
    transform: translateY(-100%);
}

.nsg-cal-half-label {
    position: absolute;
    right: 6px;
    font-size: 10px;
    color: #042db4;
    transform: translateY(-50%);
    white-space: nowrap;
    user-select: none;
}

.nsg-cal-content {
    position: relative;
    flex: 1;
    min-width: 100%;
    z-index: 0;
}

.nsg-cal-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px solid #ececec;
    pointer-events: none;
}

.nsg-cal-hour-line.nsg-half {
    border-top-style: dashed;
    border-top-color: #f0f0f0;
}

/* カレンダーブロック内のリンクラッパーに高さを継承させる */
.nsg-cal-block a.nsg-card-link {
    display: block;
    height: 100%;
}

/* カレンダーブロック（位置決め専用ラッパー） */
.nsg-cal-block {
    position: absolute;
    border-radius: 0;
    border: 1px solid #000;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.18s;
}

.nsg-cal-block:hover {
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
    z-index: 20;
}

/* カレンダーブロック内の .nsg-card 調整 */
.nsg-cal-block .nsg-card {
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.nsg-cal-block .nsg-card:hover {
    transform: none;
    box-shadow: none;
}

.nsg-cal-block .nsg-card-title-area {
    flex: 0 0 auto;
}

.nsg-cal-block .nsg-card-main {
    flex: 0 0 auto;
    align-items: stretch;
}

.nsg-cal-block .nsg-card-instr-photo {
    overflow: hidden;
}

.nsg-cal-block .nsg-card-instr-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nsg-cal-block .nsg-card-photo {
    flex: 0 0 auto;
}

.nsg-cal-block .nsg-card-photo img {
    aspect-ratio: 4 / 2;
    height: auto;
}

/* photo_2: ブロック幅いっぱい */
.nsg-cal-block .nsg-card-photo-2 {
    width: 100%;
    flex-shrink: 0;
    border-top: 1px solid #000;
    border-right: none;
}

.nsg-cal-block .nsg-card-photo-2 img {
    width: 100%;
    aspect-ratio: 4 / 2;
    object-fit: cover;
    display: block;
    height: auto;
}

.nsg-cal-color-fill {
    flex: 1;
    min-height: 0;
}

/* スペーサー（カテゴリ色・余白を埋める） */
.nsg-cal-bk-spacer {
    flex: 1;
    min-height: 0;
    opacity: 0.25;
}

.nsg-cal-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #bbb;
    font-size: 14px;
}

@media (max-width: 600px) {
    .nsg-cal-title { font-size: 18px; }
    .nsg-cal-btn { padding: 8px 12px; font-size: 12px; }
}

/* ---- フォントweight一括設定 / 文字縦圧縮 ------------------- */
.natsugeidai-container {
    font-weight: 400;
}

.nsg-cal-title,
.nsg-cal-btn,
.nsg-filter-label,
.nsg-filter-option label,
.nsg-cal-empty {
    display: block;
    -webkit-transform: scaleY(0.85);
            transform: scaleY(0.85);
    -webkit-transform-origin: top left;
            transform-origin: top left;
    font-weight: 400;
}

.nsg-toggle-btn {
    font-weight: 400;
}

.nsg-cell-text {
    display: inline-block;
    zoom: 0.85;
    font-weight: 400;
}

.nsg-td-instr,
.nsg-td-instr a,
.nsg-td-time,
.nsg-td-price,
.nsg-td-date,
.nsg-td-number,
.nsg-td-target-age {
    display: table-cell;
    font-weight: 400;
}

.nsg-td-instr {
    text-align: center;
}

.nsg-card-table td {
    font-weight: 400;
}

.nsg-cat-label,
.nsg-cat-tag,
.nsg-toggle-btn,
.nsg-cal-btn,
.nsg-filter-option label {
    display: inline-block;
}

@media (max-width: 600px) {
    /* 詳しく見るボタン */
    .nsg-card {
        border-radius: 0 0 8px 8px;
    }
    .nsg-card-sp-btn {
        display: block;
        padding: 12px;
        color: #fff;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.05em;
        border-top: 1px solid #000;
        cursor: pointer;
    }
    a.nsg-card-link:hover .nsg-card-sp-btn {
        opacity: 0.85;
    }

    /* カードレイアウト：テーブルをフル幅、写真を横並び */
    .nsg-card-main {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .nsg-card-left {
        width: 100%;
        flex: 0 0 100%;
        order: 1;
    }
    /* カレンダーブロック内のcard-mainもモバイルレイアウトに */
    .nsg-cal-block .nsg-card-main {
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .nsg-cal-block .nsg-card-photo img {
        aspect-ratio: 4 / 4;
    }
    .nsg-card-table td {
        padding: 4px 4px;
        vertical-align: middle;
        font-size: 14px;
        border-top: 1px solid #000;
        line-height: 1.45;
        letter-spacing: 0.03em;
        border-right: 1px solid #000;
    }

    /* pc用photoを非表示 */
    .nsg-card-photo-pc {
        display: none !important;
    }
    /* sp用photoと講師写真を同じ行に横並び */
    .nsg-card-photo-sp {
        display: block;
        width: 50%;
        order: 2;
        flex-shrink: 0;
        overflow: hidden;
        border-top: 1px solid #000;
    }
    .nsg-card-photo-sp img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        display: block;
        height: auto;
    }
    .nsg-card-instr-photo {
        width: 50%;
        order: 2;
        flex-shrink: 0;
        border-top: 1px solid #000;
        border-left: 1px solid #000;
    }
    .nsg-card-instr-photo img {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .natsugeidai-controls {
        gap: 12px;
        flex-wrap: wrap;
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
        width: calc(100% + 20px);
        box-sizing: border-box;
    }
    .natsugeidai-view-toggle {
        width: 100%;
    }
    .nsg-toggle-btn {
        flex: 1;
    }
    /* フィルター：ラベル中央・ボタンは下に展開 */
    .nsg-filter-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    .nsg-filter-label {
        cursor: pointer;
        width: 100%;
        text-align: center;
        margin-right: 0;
    }
    .nsg-filter-row .nsg-filter-btn {
        display: none;
    }
    .nsg-filter-row.nsg-filter-open .nsg-filter-btn {
        display: inline-flex;
    }
    /* 開いた時はボタンを横並びで中央寄せ */
    .nsg-filter-row.nsg-filter-open {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .nsg-filter-row.nsg-filter-open .nsg-filter-label {
        width: 100%;
        text-align: center;
    }
    /* ラベルにトグル矢印 */
    .nsg-filter-label::after {
        content: ' \25BC';
        font-size: 0.7em;
    }
    .nsg-filter-row.nsg-filter-open .nsg-filter-label::after {
        content: ' \25B2';
    }
    .nsg-cal-scroll-wrap::after {
        width: 30px;
    }
    .nsg-cal-scroll-wrap {
        grid-template-columns: 64px 1fr;
    }
    .nsg-cal-timecol {
        width: 64px;
    }
    .nsg-cal-hour-label {
        font-size: 16px;
    }
    .nsg-cal-half-label {
        font-size: 10px;
    }
    .nsg-cal-date-nav {
        padding-left: 64px;
    }
}
