/* ==================================================
   CSS Variables / Theme
   ================================================== */
:root {
    --bg: #0f1217;
    --panel: #151a22;
    --panel2: #11161d;
    --text: #e6e9ef;
    --muted: #a8b0bf;
    --line: rgba(255, 255, 255, .08);
    --focus: rgba(255, 255, 255, .15);
}

:root[data-theme="light"] {
    --bg: #ffffff;
    --panel: #f5f6f8;
    --panel2: #eeeeee;
    --text: #111111;
    --muted: #555555;
    --line: rgba(0, 0, 0, .12);
    --focus: rgba(0, 0, 0, .20);
}

/* 2. 白地（ライトモード） */
:root[data-theme="light"] .grid-tile.is-active {
    background: #eef5ff !important; /* ごく薄い青 */
    border: 2px solid #0066cc !important; /* 濃い青の枠線 */
    box-shadow: none !important; /* 光彩を削除 */
}
:root[data-theme="light"] .grid-tile.is-active span {
    color: #0066cc !important; /* 濃い青 */
    font-weight: bold;
    text-shadow: none !important; /* 影を削除 */
}

/* ==================================================
   Base & Typography (文字サイズ一括制御)
   ================================================== */
* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    /* 標準 (通常16px相当) */
    transition: font-size 0.2s;
    scroll-behavior: smooth;
}

/* クラスに応じてベースの%を書き換える */
html.font-size-small {
    font-size: 85%;
}

html.font-size-large {
    font-size: 125%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    font-size: 1rem;
    /* 100% = 16px相当を継承 */
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 44px;
}

/* ==================================================
   Header (Switch at screen-right, bottom-aligned)
   ================================================== */
.header {
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    padding: 0;
}

.header__brand-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    width: 100% !important;
    padding-bottom: 6px;
}

.header__text-group {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.theme-switch-header {
    flex: 0 0 auto;
    margin-left: auto;
    line-height: 1;
}

.brand__title {
    margin: 0 !important;
    padding: 0;
    font-size: 1.5rem;
    /* remに統一 */
    font-weight: 900;
    line-height: 1.2;
}

.brand__sub {
    margin: 2px 0 0 0 !important;
    padding: 0;
    font-size: 0.875rem;
    /* remに統一 */
    color: var(--muted);
    line-height: 1.2;
}

/* --- スイッチ：自作画像への切り替え --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-icon-img {
    display: block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    font-size: 0;
    color: transparent;
}

.theme-icon-img {
    background-image: url('white.png') !important;
}

:root[data-theme="light"] .theme-icon-img {
    background-image: url('black.png') !important;
}

/* --- 文字サイズ切替ボタンのデザイン --- */
.font-size-controls {
    display: flex;
    align-items: center;
    background: var(--line);
    border-radius: 6px;
    padding: 2px;
    margin-left: 10px;
    margin-right: 3px;
}

.size-btn {
    background: none;
    border: none;
    color: var(--text);
    padding: 4px 10px;
    font-size: 12px;
    /* 拡大時もボタン内は固定 */
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.5;
    transition: 0.2s;
}

.size-btn:hover {
    opacity: 1;
}

.size-btn.is-active {
    background: var(--panel);
    opacity: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ==================================================
   Main Layout (Hero & Grid Nav)
   ================================================== */
.event-hero-hub {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.event-kv-area {
    width: 100%;
    max-width: 800px;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
}

.kv-main-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ナビゲーション全体の幅を固定 (縮小を禁止する) */
.event-grid-nav {
    flex: 0 0 280px !important; /* 横幅を280pxで完全に固定 */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.grid-tile {
    aspect-ratio: 1 / 1;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    transition: background 0.2s;
}

.grid-tile:hover {
    background: var(--focus);
}

.grid-tile span {
    font-size: 0.875rem;
    /* remに統一 */
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* ==================================================
   Section & Table
   ================================================== */
.section__title {
    margin: 40px 0 16px;
    padding: 0.625rem 1rem;
    /* remに統一 */
    font-size: 1.125rem;
    /* remに統一 */
    font-weight: 800;
    line-height: 1.4;
    border-radius: 6px;
    background: #1e2530;
    color: #4da3ff;
    border-left: 6px solid #4da3ff;
}

:root[data-theme="light"] .section__title {
    background: #eef5ff;
    color: #0066cc;
    border-left-color: #0066cc;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent !important;
}

.info-table th,
.info-table td {
    border: 1px solid var(--line);
    padding: 14px 10px;         /* 左右の余白を少しだけ削る */
    text-align: left;
    background: transparent !important;
    line-height: 1.5 !important;
    word-break: break-all;      /* 枠を突き破らないように改行を許可 */
}

/* --- 標準の2列テーブル（概要など）: 200pxで揃える --- */
.info-table th,
.info-table td:first-child {
    width: 200px;
    min-width: 200px;
    font-weight: 600;
    background: rgba(255, 255, 255, .05) !important;
}

/* --- 委託ページなどの多カラム用: 固定幅を解除する --- */
.info-table.is-consign th,
.info-table.is-consign td:first-child {
    width: auto !important;
    min-width: 0 !important;
}

:root[data-theme="light"] .info-table th,
:root[data-theme="light"] .info-table td:first-child {
    background: rgba(0, 0, 0, .04) !important;
}

/* ==================================================
   Mobile Responsive Adjustment (900px以下)
   ================================================== */
@media (max-width: 900px) {

    /* 1. 本文とナビの並びを縦にする */
    .event-hero-hub {
        flex-direction: column;
        gap: 0;
    }

    /* 2. 本文の横にあるナビを【完全に消す】 */
    /* これでスマホ時に中途半端な位置にナビが出るのを防ぎます */
    .event-hero-hub>.event-grid-nav {
        display: none !important;
    }

    /* 3. 三本線ボタンを【強制表示】 */
    .menu-trigger {
        display: flex !important;
        z-index: 1100;
        margin-left: 3px;
    }

    /* 4. スマホ用サイドメニュー（三本線を押した時に出るやつ） */
    /* body.nav-open 時に JS で制御するための設定 */
    body.nav-open .event-grid-nav {
        display: flex !important;
        /* JSでbodyにnav-openがついたら出す */
        position: fixed !important;
        top: 0;
        right: 0 !important;
        width: 280px;
        height: 100vh;
        background: var(--panel) !important;
        border-left: 1px solid var(--line);
        flex-direction: column !important;
        padding: 80px 20px 20px !important;
        z-index: 1000;
        transition: right 0.3s ease;
    }

    /* タイルのスマホ用調整 */
    .grid-tile {
        aspect-ratio: auto !important;
        width: 100% !important;
        min-height: 50px;
        margin-bottom: 8px;
    }

    .info-table th,
    .info-table td:first-child {
        width: auto !important;
        min-width: 0 !important;
    }
}

/* ==================================================
   Others (Maps, Buttons, Links)
   ================================================== */
iframe {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 8px;
}

.event-kv-area p,
.note {
    line-height: 1.6 !important;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 0.9375rem;
    /* remに統一 */
    color: var(--text);
    clear: both;
    display: block;
}

.muted {
    color: var(--muted);
    font-size: 0.9em;
}

.page-title {
    margin: 0 0 25px 0 !important;
    padding: 0;
    font-size: 1.5rem;
    /* remに統一 */
    font-weight: 900;
    line-height: 1.2;
    color: var(--text);
    background: transparent !important;
    border-left: none !important;
}

.form-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80px;
    margin: 32px 0;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 800;
    transition: all 0.2s ease;
    background: #007bff;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.form-cta-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.form-cta-button span {
    font-size: 1.125rem;
    /* remに統一 */
    text-align: center;
    line-height: 1.4;
}

.note a,
.info-table td a {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.2s;
}

.note a:hover,
.info-table td a:hover {
    color: var(--accent-hover);
    /* 後述のホバー色変数などを想定 */
    text-decoration: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0px;
}

.menu-trigger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001;
}

.menu-trigger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text) !important;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

body.nav-open .menu-trigger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

body.nav-open .menu-trigger span:nth-child(2) {
    opacity: 0;
}

body.nav-open .menu-trigger span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* 1. 黒地（ダークモード） */
.grid-tile.is-active {
    background: #2c3440 !important; /* 背景より一段明るいグレー */
    border: 2px solid #4da3ff !important; /* 青い枠線 */
    cursor: default;
}
.grid-tile.is-active span {
    color: #ffffff !important; /* 純白 */
    font-weight: bold;
    text-shadow: none !important; /* 影を削除 */
}

/* ==================================================
   Footer (event.cssと統一)
================================================== */

.site-footer {
    margin-top: 60px;
    border-top: 1px solid var(--line);
    padding: 24px 0;
    font-size: 13px;
    color: var(--muted);
    position: relative;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--accent-open);
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-footer__nav {
    display: flex;
    gap: 15px;
}

.site-footer__nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}

.site-footer__nav a:hover {
    opacity: 0.7;
}

:root[data-theme="light"] .badge {
    background: #f1f3f5;
    color: #333;
    border: 1px solid rgba(0,0,0,.15);
}

:root[data-theme="light"] .badge.is-open {
    background: #fff4e5;
    color: #cc7a00;
    border-color: #ffb84d;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.site-footer__brand {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
}

.site-footer__copy {
    line-height: 1.6;
}

@media (max-width: 768px) {

    .site-footer__inner {
        flex-direction: column;
        gap: 24px;
        text-align: center;
        align-items: center;
    }

    .site-footer__nav {
        flex-direction: column;
        gap: 12px;
    }

    .site-footer__nav a {
        font-size: 1rem;
    }
}


/* 箇条書きリスト全体の調整 */
.note-list {
    margin: 10px 0 20px 20px;
    padding: 0;
    list-style-type: disc; /* 標準的な黒丸 */
}

/* 各項目（行）の調整 */
.note-list li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-color); /* 変数を使っている場合 */
}

/* もし「※」などの記号を先頭にしたい場合用のカスタム */
.note-list.is-kome {
    list-style-type: none;
    margin-left: 0;
}

.note-list.is-kome li::before {
    content: "※";
    margin-right: 5px;
}

/* ボタンの並び */
.dl-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 15px 0;
}

/* 共通ボタンデザイン */
.btn-dl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none !important;
    transition: 0.2s;
    border: 2px solid #007bff;
    background: #fff;
    color: #007bff !important;
}

/* ホバー時 */
.btn-dl:hover {
    background: #007bff;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

/* 水平線のデザイン */
.content-hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 40px 0;
}

/* 締切日の強調表示 */
.deadline-text {
    font-size: 1.3rem; /* サイズアップ */
    font-weight: bold;  /* 太字 */
    display: inline-block;
    padding: 5px 0;
    color: #ffa600; /* 赤系の色で強調 */
}