@charset "utf-8";
/**
 * EDSS Table Block & Theme Table / Font Stylesheet
 * 
 * 1. LINE Seed JP (Google Fonts) 統合指定
 * 2. テーマ（gakkai-ondemand）テーブルスタイル完全移植（4つの構造課題解消済み）
 * 3. 標準テーブル拡張（core/table）＆高機能テーブル（edss/flexible-table）共通スタイル
 * 4. レスポンシブ補助（横スクロール・1列目固定Sticky・スマホ縦並びスタック）
 * 5. ブロックエディタ（Gutenberg）内プレビュー＆セル操作UIスタイル
 */

/* ==========================================================================
   1. LINE Seed JP (Google Fonts) フォント適用
   ========================================================================== */
html body,
.editor-styles-wrapper {
    font-family: 'LINE Seed JP', 'LINESeedJP', darkmode-off, 'IBM Plex Sans JP', fot-udkakugo-large-pr6n, "Noto Sans JP", 游ゴシック, YuGothic, "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", メイリオ, Meiryo, "ＭＳ Ｐゴシック", sans-serif;
}

html body h1,
html body h2,
html body .page-content h2,
.editor-styles-wrapper h1,
.editor-styles-wrapper h2 {
    font-weight: 600;
}

/* ==========================================================================
   2. テーマ テーブルスタイル移植（角丸12px・立体枠線・シャドウ・見出し装飾）
   ========================================================================== */
body .page-content table,
body .entry-content table,
body .wp-block-table table,
body .wp-block-edss-flexible-table table,
body .acf-fields.-border {
    width: 100%;
    border-radius: 12px;
    border-spacing: 0;
    border: none;
    border-left: 2px solid #ccc;
    border-top: 2px solid #ccc;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin-bottom: .5em;
    box-shadow: 0 3px 4px rgb(0 0 0 / 10%);
    border-collapse: separate;
    overflow: hidden;
}

body .page-content table thead,
body .page-content table tbody,
body .page-content table tfoot,
body .page-content table tr,
body .entry-content table thead,
body .entry-content table tbody,
body .entry-content table tfoot,
body .entry-content table tr,
body .wp-block-table thead,
body .wp-block-table tbody,
body .wp-block-table tfoot,
body .wp-block-table tr,
body .wp-block-edss-flexible-table thead,
body .wp-block-edss-flexible-table tbody,
body .wp-block-edss-flexible-table tfoot,
body .wp-block-edss-flexible-table tr {
    border: none;
}

.page-content table th,
.page-content table td,
.page-content table tr > *,
.entry-content table th,
.entry-content table td,
.entry-content table tr > *,
.wp-block-table table th,
.wp-block-table table td,
.wp-block-table table tr > *,
.wp-block-edss-flexible-table table th,
.wp-block-edss-flexible-table table td,
.wp-block-edss-flexible-table table tr > * {
    padding: 8px;
    border: none;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    vertical-align: top;
}

/* 見出しセル (th) および .yokoh / .tateh の背景・太字 */
.page-content table th,
.page-content table.yokoh tr:nth-child(1) td,
.page-content table.tateh tr td:nth-of-type(1),
.entry-content table th,
.entry-content table.yokoh tr:nth-child(1) td,
.entry-content table.tateh tr td:nth-of-type(1),
.wp-block-table table th,
.wp-block-table.is-edss-col-th-1 table tbody tr > *:nth-child(1),
.wp-block-table.is-edss-col-th-2 table tbody tr > *:nth-child(2),
.wp-block-edss-flexible-table table th,
.acf-fields.-left > .acf-field:before {
    background-color: #f1f1f1;
    font-weight: bold;
}

/* セル内末尾要素の余白リセット */
.page-content table th p:last-child,
.page-content table td p:last-child,
.page-content table td ul,
.page-content table td li:last-child,
.entry-content table th p:last-child,
.entry-content table td p:last-child,
.entry-content table td ul,
.entry-content table td li:last-child,
.wp-block-table table th p:last-child,
.wp-block-table table td p:last-child,
.wp-block-edss-flexible-table table th p:last-child,
.wp-block-edss-flexible-table table td p:last-child {
    margin-bottom: 0;
}

/* バリエーション1: .notborder（枠線なし・1列目太字10%幅） */
body .page-content .notborder table,
body .entry-content .notborder table,
body .wp-block-table.notborder table,
body .wp-block-edss-flexible-table.notborder table {
    border: none;
    box-shadow: none;
    border-radius: 0;
}

body .page-content .notborder table tr,
body .page-content .notborder table th,
body .page-content .notborder table td,
body .entry-content .notborder table tr,
body .entry-content .notborder table th,
body .entry-content .notborder table td,
body .wp-block-table.notborder table tr,
body .wp-block-table.notborder table th,
body .wp-block-table.notborder table td,
body .wp-block-edss-flexible-table.notborder table tr,
body .wp-block-edss-flexible-table.notborder table th,
body .wp-block-edss-flexible-table.notborder table td {
    border: none;
    background-color: transparent;
}

body .page-content .notborder table td:nth-of-type(1),
body .page-content .notborder table th:nth-of-type(1),
body .entry-content .notborder table td:nth-of-type(1),
body .entry-content .notborder table th:nth-of-type(1),
body .wp-block-table.notborder table tr > *:nth-child(1),
body .wp-block-edss-flexible-table.notborder table tr > *:nth-child(1) {
    width: 10%;
    white-space: nowrap;
    font-weight: bold;
}

/* バリエーション2: table.horizon / table.horizon.lite（水平罫線テーブル） */
body .page-content table.horizon,
body .entry-content table.horizon,
body .wp-block-table table.horizon,
body .wp-block-edss-flexible-table table.horizon,
body table.horizon {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

body .page-content table.horizon th,
body .entry-content table.horizon th,
body .wp-block-table table.horizon th,
body .wp-block-edss-flexible-table table.horizon th,
body table.horizon th {
    text-align: left;
    color: #046eb8;
    border-left: none;
    border-right: none;
}

body .page-content table.horizon td,
body .entry-content table.horizon td,
body .wp-block-table table.horizon td,
body .wp-block-edss-flexible-table table.horizon td,
body table.horizon td {
    border: none;
}

body .page-content table.horizon.lite th,
body .page-content table.horizon.lite td,
body .entry-content table.horizon.lite th,
body .entry-content table.horizon.lite td,
body .wp-block-table table.horizon.lite th,
body .wp-block-table table.horizon.lite td,
body .wp-block-edss-flexible-table table.horizon.lite th,
body .wp-block-edss-flexible-table table.horizon.lite td,
body table.horizon.lite th,
body table.horizon.lite td {
    background: transparent;
    padding: 1em .5em;
}

body .page-content table.horizon.lite th,
body .entry-content table.horizon.lite th,
body .wp-block-table table.horizon.lite th,
body .wp-block-edss-flexible-table table.horizon.lite th,
body table.horizon.lite th {
    font-weight: 500;
}

/* バリエーション3: table.access（交通アクセス案内表） */
table.access .station {
    vertical-align: middle;
    font-weight: bold;
    text-align: center;
}

table.access .station.a {
    background-color: #d8ecf6;
}

table.access .station.b {
    background-color: #f6ecef;
    border-radius: 0 10px 10px 0 !important;
}

table.access .station.z {
    background-color: #f1f1f1;
}

table.access .arrow {
    text-align: left;
    line-height: 1.3em;
    vertical-align: middle;
    padding-left: 0;
    padding-right: 0;
    background: no-repeat center right url("/wp-content/themes/gakkai-ondemand/images/access_arrow.png");
    border-radius: 0 !important;
}

table.access .arrow .mask {
    background-color: #fff;
    padding-left: 10px;
    padding-right: 5px;
    margin-right: 10px;
    display: inline-block;
}

/* ==========================================================================
   3. セル配置・装飾ユーティリティクラス（インラインスタイル不使用・クラス制御）
   ========================================================================== */
/* テーブル全体の垂直配置一括指定 */
.is-edss-valign-top table th,
.is-edss-valign-top table td {
    vertical-align: top;
}
.is-edss-valign-middle table th,
.is-edss-valign-middle table td {
    vertical-align: middle;
}
.is-edss-valign-bottom table th,
.is-edss-valign-bottom table td {
    vertical-align: bottom;
}

/* セル個別の水平配置 */
.edss-cell-align-left {
    text-align: left !important;
}
.edss-cell-align-center {
    text-align: center !important;
}
.edss-cell-align-right {
    text-align: right !important;
}

/* セル個別の垂直配置 */
.edss-cell-valign-top {
    vertical-align: top !important;
}
.edss-cell-valign-middle {
    vertical-align: middle !important;
}
.edss-cell-valign-bottom {
    vertical-align: bottom !important;
}

/* 折り返し禁止 (nowrap) */
.edss-cell-nowrap {
    white-space: nowrap !important;
}

/* 太字 */
.edss-cell-bold {
    font-weight: bold !important;
}

/* セル個別背景色プリセット（テーマ親和カラー） */
.edss-cell-bg-gray {
    background-color: #f1f1f1 !important;
}
.edss-cell-bg-blue {
    background-color: #d8ecf6 !important;
}
.edss-cell-bg-pink {
    background-color: #f6ecef !important;
}
.edss-cell-bg-yellow {
    background-color: #fef9c3 !important;
}
.edss-cell-bg-green {
    background-color: #dcfce7 !important;
}
.edss-cell-bg-white {
    background-color: #ffffff !important;
}
.edss-cell-bg-dark {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* セル個別文字色プリセット */
.edss-cell-text-red {
    color: #df2a4a !important;
}
.edss-cell-text-blue {
    color: #046eb8 !important;
}
.edss-cell-text-muted {
    color: #666666 !important;
}
.edss-cell-text-white {
    color: #ffffff !important;
}

/* セル列幅プリセットクラス */
.edss-col-w-5 { width: 5%; }
.edss-col-w-10 { width: 10%; }
.edss-col-w-15 { width: 15%; }
.edss-col-w-20 { width: 20%; }
.edss-col-w-25 { width: 25%; }
.edss-col-w-30 { width: 30%; }
.edss-col-w-35 { width: 35%; }
.edss-col-w-40 { width: 40%; }
.edss-col-w-50 { width: 50%; }
.edss-col-w-60 { width: 60%; }
.edss-col-w-70 { width: 70%; }
.edss-col-w-80 { width: 80%; }

/* ==========================================================================
   4. レスポンシブ制御（横スクロール・1列目固定・スマホ縦並び）
   ========================================================================== */
.edss-table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.edss-table-scroll-wrap table {
    min-width: 600px;
}

.edss-table-scroll-hint {
    display: none;
    font-size: 12px;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 6px;
    text-align: center;
    font-weight: bold;
}

/* 1列目固定 (Sticky First Column) */
.is-edss-sticky-col table tr > *:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}
.is-edss-sticky-col table tr > td:first-child {
    background-color: #ffffff;
}
.is-edss-sticky-col table tr > th:first-child {
    background-color: #f1f1f1;
}

@media screen and (max-width: 768px) {
    .edss-table-scroll-hint {
        display: block;
    }
}

@media screen and (max-width: 680px) {
    /* テーマ本来の 680px レスポンシブ仕様（グローバルtd汚染を修正済み） */
    .page-content table th,
    .page-content table td,
    .entry-content table th,
    .entry-content table td,
    .wp-block-table table th,
    .wp-block-table table td,
    .wp-block-edss-flexible-table table th,
    .wp-block-edss-flexible-table table td {
        box-sizing: border-box;
    }

    .page-content .notborder table th,
    .page-content .notborder table td,
    .entry-content .notborder table th,
    .entry-content .notborder table td,
    .wp-block-table.notborder table th,
    .wp-block-table.notborder table td,
    .wp-block-edss-flexible-table.notborder table th,
    .wp-block-edss-flexible-table.notborder table td {
        display: block;
        width: 100% !important;
    }

    .page-content .notborder table td,
    .entry-content .notborder table td,
    .wp-block-table.notborder table td,
    .wp-block-edss-flexible-table.notborder table td {
        padding-bottom: 15px;
    }

    .page-content .notborder table th,
    .page-content .notborder table td:nth-of-type(1),
    .entry-content .notborder table th,
    .entry-content .notborder table td:nth-of-type(1),
    .wp-block-table.notborder table th,
    .wp-block-table.notborder table td:nth-of-type(1),
    .wp-block-edss-flexible-table.notborder table th,
    .wp-block-edss-flexible-table.notborder table td:nth-of-type(1) {
        padding-bottom: 0;
        margin-bottom: -6px;
    }

    /* スマホで縦並び（スタック）表示モード (.is-edss-stack-mobile) */
    .is-edss-stack-mobile table,
    .is-edss-stack-mobile thead,
    .is-edss-stack-mobile tbody,
    .is-edss-stack-mobile tfoot,
    .is-edss-stack-mobile tr,
    .is-edss-stack-mobile th,
    .is-edss-stack-mobile td {
        display: block;
        width: 100% !important;
    }

    .is-edss-stack-mobile table tr {
        border-bottom: 2px solid #ccc;
    }

    .is-edss-stack-mobile table tr:last-child {
        border-bottom: none;
    }

    .is-edss-stack-mobile table th,
    .is-edss-stack-mobile table td {
        border-right: none;
    }
}

/* ==========================================================================
   5. ブロックエディタ（Gutenberg）内専用操作UIスタイル
   ========================================================================== */
.edss-flex-table-editor-wrap {
    margin: 1em 0;
}

.edss-flex-table-toolbar-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.edss-flex-table-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid #e2e8f0;
}

.edss-flex-table-toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
}

.edss-flex-table-editor-wrap table th.is-edss-cell-selected,
.edss-flex-table-editor-wrap table td.is-edss-cell-selected {
    outline: 2px solid #2563eb !important;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 9999px rgba(37, 99, 235, 0.08);
}

.edss-flex-table-editor-wrap table th.is-edss-cell-in-range,
.edss-flex-table-editor-wrap table td.is-edss-cell-in-range {
    outline: 2px dashed #3b82f6 !important;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 9999px rgba(59, 130, 246, 0.12);
}

.edss-cell-tag-badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    margin-right: 4px;
    vertical-align: middle;
    user-select: none;
}

.edss-cell-tag-badge.is-th {
    background: #dbeafe;
    color: #1d4ed8;
}

.edss-flex-table-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    padding: 0 4px;
}

.edss-color-swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 12px;
}

.edss-color-swatch-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.edss-color-swatch-btn.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.edss-color-swatch-gray { background-color: #f1f1f1; }
.edss-color-swatch-blue { background-color: #d8ecf6; }
.edss-color-swatch-pink { background-color: #f6ecef; }
.edss-color-swatch-yellow { background-color: #fef9c3; }
.edss-color-swatch-green { background-color: #dcfce7; }
.edss-color-swatch-white { background-color: #ffffff; }
.edss-color-swatch-dark { background-color: #334155; }

.edss-text-swatch-red { background-color: #df2a4a; }
.edss-text-swatch-blue { background-color: #046eb8; }
.edss-text-swatch-muted { background-color: #666666; }
.edss-text-swatch-white { background-color: #ffffff; }

.edss-import-textarea {
    width: 100%;
    min-height: 160px;
    font-family: monospace;
    font-size: 12px;
    margin-top: 8px;
    margin-bottom: 12px;
}
