/* 今後のイベント予定ページ固有。カードの土台は cards.css、月の見出しは theater_history.css と sticky_head.css。 */

#main .ev-month { margin-top:14px; }
#main .ev-list { grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); align-items:stretch; margin-top:8px; }
#main .ev-card { gap:6px; }
/* 種別の札と日付の段をまとめる入れ物。スマホでは入れ物を無いものとして扱い（今までどおりの縦積み）、
   601px以上では左の列になる（下の「1件1行」）。 */
#main .ev-side { display:contents; }
#main .ev-date { font-weight:800; font-size:1.05em; color:#1f2937; }
#main .ev-wd { font-size:.8em; font-weight:700; margin-left:1px; }
#main .ev-time { font-size:.85em; color:#4b5563; }
/* 種別の札: カードの左上の角にぴったり付ける小さな札（日付の上）。カードの余白ぶん外へ出し、左上だけカードの角丸に合わせる */
#main .ev-kind {
    align-self:flex-start; margin:-12px 0 0 -14px;
    font-size:.68em; font-weight:700; line-height:1.5;
    color:#374151; background:#f3f4f6; border:0;
    border-radius:9px 0 8px 0; padding:1px 10px; white-space:nowrap;
}
/* 種別の色はピンク1系統と無彩色だけ（コンサートだけ主役のピンク） */
#main .ev-kind--concert { color:#fff; background:#e0568f; border-color:#e0568f; }
#main .ev-kind--release { color:#b1487c; background:#fdf0f6; border-color:#f3cfe0; }
#main .ev-title { font-weight:bold; font-size:.97em; color:#222; line-height:1.5; }
/* 日付の段: 日付・時刻・会場（会場は小さく、長ければ折り返す） */
#main .ev-when { gap:2px 8px; }
#main .ev-venue { font-size:.8em; color:#374151; }
#main .ev-members { font-size:.88em; line-height:1.75; }
#main .ev-members-note { font-weight:700; color:#1f2937; }
#main .ev-note { font-size:.8em; color:#4b5563; line-height:1.6; }
/* 枠のどこを押しても公式ブログの記事へ。題名のリンクを ::after で枠いっぱいに広げる。
   メンバー名のリンクはその上に出す（メンバーページへ行ける）。 */
#main .ev-card { position:relative; cursor:pointer; }
#main .ev-title a { color:#222 !important; text-decoration:none; }
#main .ev-title a::after { content:""; position:absolute; inset:0; }
#main .ev-card:hover .ev-title a { color:#b1487c !important; text-decoration:underline; }
#main .ev-title a:focus-visible::after { outline:2px solid #b1487c; outline-offset:-2px; border-radius:inherit; }
#main .ev-members a { position:relative; z-index:1; }
/* 読み上げソフト向けの補足（画面には出さない） */
#main .ev-out { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#main .ev-empty { color:#6b7280; margin-top:12px; }
#main .ev-notice {
    display:block; margin-top:8px;
    font-size:.9em; font-weight:600; color:#c0392b;
    background:#fdf3ee; border:1px solid #f3c9b3;
    border-radius:8px; padding:8px 12px; line-height:1.6;
}
#main .ev-notice a { color:#b34700 !important; text-decoration:underline; }

/* テレビ・雑誌の種別チップ（無彩色の濃淡で区別。色は増やさない） */
#main .ev-kind--tv { color:#fff; background:#1f2937; border-color:#1f2937; }
#main .ev-kind--mag { color:#1f2937; background:#fff; border-color:#9ca3af; }

/* 絞り込みの帯: 種別のボタン（同じ幅で一列）＋メンバーのプルダウン。
   スクロール中も固定ヘッダーのすぐ下に残り、月の見出しはさらにその下に貼り付く。
   帯の高さ --ev-bar-h は events.js が実測して入れる（下の値は読み込み前の仮の高さ）。 */
#main .ev-bar {
    position:sticky; top:var(--sticky-top); z-index:6;
    display:flex; flex-wrap:wrap; gap:6px 8px; align-items:stretch;
    margin:0; padding:6px 0;
    background-color:#fff9f9;   /* body の地色。下を流れるカードが透けないように */
}
#main #ev-top { height:10px; }
/* PCは名前の長さに応じた幅で一列（プルダウンも同じ行）。980px以下は5つを同じ幅にする */
#main .ev-filter {
    flex:1 1 0; min-width:min-content; display:flex;
    background:#fff; border:1px solid #d1d5db; border-radius:8px; overflow:hidden;
}
#main .ev-fbtn {
    font:inherit; font-size:.84em; font-weight:700; line-height:1.3;
    color:#374151; background:#fff; border:0; border-left:1px solid #e5e7eb; border-radius:0;
    flex:1 1 auto; margin:0; padding:7px 5px; cursor:pointer; white-space:nowrap; text-align:center;
}
#main .ev-fbtn:first-child { border-left:0; }
#main .ev-fs { display:none; }
#main .ev-fn { margin-left:5px; font-size:.85em; font-weight:700; color:#6b7280; }
#main .ev-fbtn.is-on { color:#fff; background:#b1487c; }
#main .ev-fbtn.is-on .ev-fn { color:#fbe3ee; }
#main .ev-msel {
    flex:0 0 auto; max-width:100%;
    font:inherit; font-size:.86em; font-weight:700; color:#374151;
    background-color:#fff; border:1px solid #d1d5db; border-radius:8px; padding:6px 8px;
}
#main .ev-msel.is-on { color:#b1487c; border-color:#b1487c; }
#main section.ev-month > h2.item { top:calc(var(--sticky-top) + var(--ev-bar-h, 48px)); }
#main .ev-month { scroll-margin-top:calc(var(--sticky-top) + var(--ev-bar-h, 48px) + 8px); }
@media screen and (max-width:980px) {
    /* 長い名前では5つ並ばないので短い名前にし、件数は名前の下に小さく出す。プルダウンは次の行いっぱい */
    #main .ev-filter { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
    #main .ev-fl { display:none; }
    #main .ev-fs { display:inline; }
    #main .ev-fn { display:block; margin:1px 0 0; font-size:.78em; }
    #main .ev-fbtn { padding:5px 2px; }
    #main .ev-msel { flex:1 1 100%; }
}
#main .ev-card[hidden], #main .ev-month[hidden] { display:none; }

/* もう一方のページ（これから ⇔ 過去）への行き来 */
#main .ev-other { margin:8px 0 0; font-size:.9em; }
#main .ev-other a { color:#b1487c !important; font-weight:700; text-decoration:underline; }
/* 冒頭の説明文の中のリンク（地の文と同じ黒だとリンクに見えないので、色と下線を付ける） */
#main a.ev-lead-link { color:#b1487c !important; font-weight:700; text-decoration:underline; }

/* 種類ごとのカードの色分け（絞り込みボタンの4つのまとまりと同じ分け方）。
   地はごく薄い色、枠と札で種類が分かるようにする。推しカラーの赤・緑は使わない。 */
#main .ev-card--g0 { background:#fdf0f6; border-color:#f0c4d9; }            /* コンサート・イベント: ピンク */
#main .ev-card--g1 { background:#fff8e3; border-color:#ecd9a0; }            /* 握手会・お話し会: クリーム */
#main .ev-card--g2 { background:#edf4fb; border-color:#c5d9ee; }            /* テレビ・ラジオ: 水色 */
#main .ev-card--g3 { background:#f4f0fb; border-color:#d8cdee; }            /* 雑誌・Web: 薄紫 */
#main .ev-card--g0 .ev-kind { color:#fff; background:#e0568f; border-color:#e0568f; }
#main .ev-card--g1 .ev-kind { color:#6b4e00; background:#f8e3a1; border-color:#e2c56a; }
#main .ev-card--g2 .ev-kind { color:#fff; background:#3d6a9c; border-color:#3d6a9c; }
#main .ev-card--g3 .ev-kind { color:#fff; background:#6d58a8; border-color:#6d58a8; }
/* 絞り込みボタンにも同じ色の印を付けて、色の意味が分かるようにする */
#main .ev-fbtn[data-g="0"] .ev-fl::before, #main .ev-fbtn[data-g="0"] .ev-fs::before,
#main .ev-fbtn[data-g="1"] .ev-fl::before, #main .ev-fbtn[data-g="1"] .ev-fs::before,
#main .ev-fbtn[data-g="2"] .ev-fl::before, #main .ev-fbtn[data-g="2"] .ev-fs::before,
#main .ev-fbtn[data-g="3"] .ev-fl::before, #main .ev-fbtn[data-g="3"] .ev-fs::before {
    content:""; display:inline-block; width:.6em; height:.6em; border-radius:50%; margin-right:4px; vertical-align:.05em;
}
#main .ev-fbtn[data-g="0"] span::before { background:#e0568f; }
#main .ev-fbtn[data-g="1"] span::before { background:#e2c56a; }
#main .ev-fbtn[data-g="2"] span::before { background:#3d6a9c; }
#main .ev-fbtn[data-g="3"] span::before { background:#6d58a8; }
#main .ev-fbtn.is-on span::before { box-shadow:0 0 0 1.5px #fff; }

/* 601px以上は1件1行（日付順に上から読めるように、横に並べない）。
   左の列＝種別の札・日付・時刻・会場、右の列＝題名・出演者・補足。 */
@media screen and (min-width:601px) {
    #main .ev-list { grid-template-columns:minmax(0,1fr); gap:8px; }
    #main .ev-card { display:grid; grid-template-columns:200px minmax(0,1fr); column-gap:18px; row-gap:4px; align-content:start; }
    #main .ev-side { display:flex; flex-direction:column; gap:6px; grid-column:1; grid-row:1 / span 3; min-width:0; }
    #main .ev-card > .ev-title, #main .ev-card > .ev-members, #main .ev-card > .ev-note { grid-column:2; min-width:0; }
}

/* スマホは行間とカード内の隙間を詰める（1画面に入る件数を増やす）。押す場所になるメンバー名の行だけは少し広めに残す */
@media screen and (max-width:600px) {
    #main .ev-list { gap:8px; }
    #main .ev-card { gap:1px; padding-bottom:9px; font-size:.93em; }
    #main .ev-when { line-height:1.25; }      /* 日付の段と題名を近づける */
    #main .ev-title { line-height:1.35; }
    #main .ev-members { line-height:1.5; }
    #main .ev-note { line-height:1.4; }
}

/* ---- カレンダー表示（これからの予定）----
   日付を縦に並べ、左に日付と曜日、右にその日の予定をまとめて入れる。予定の無い日はごく細い行。
   土曜は薄い青、日曜は薄いピンクで日付の地を色づける（推しカラーの赤・緑は使わない）。 */
#main .ev-cal { margin-top:8px; border-top:1px solid #e5e7eb; }
#main .ev-day { display:grid; grid-template-columns:44px minmax(0,1fr); border-bottom:1px solid #e5e7eb; }
#main .ev-day[hidden] { display:none; }
#main .ev-dayhead {
    display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
    padding:8px 0; background:#f3f4f6; color:#1f2937; line-height:1.15;
}
#main .ev-dnum { font-weight:800; font-size:1.2em; }
#main .ev-dwd { font-size:.72em; font-weight:700; color:#4b5563; }
#main .ev-day--sat .ev-dayhead { background:#e3eefa; }
#main .ev-day--sun .ev-dayhead { background:#fde6f0; }
#main .ev-daybody { margin:0; padding:6px 0 6px 8px; }
/* 日付は左の列に出ているので、カードの中の日付は出さない（時刻と会場だけ残す） */
#main .ev-cal .ev-date { display:none; }
/* 予定の無い日: 日付と曜日を小さく横に並べただけの、ごく細い行 */
#main .ev-day--empty .ev-dayhead { flex-direction:row; justify-content:center; gap:2px; padding:0; font-size:.66em; line-height:1.45; color:#6b7280; }
#main .ev-day--empty .ev-dnum { font-size:1em; font-weight:700; }
#main .ev-day--empty .ev-dwd { font-size:1em; font-weight:400; color:#6b7280; }
@media screen and (min-width:601px) {
    #main .ev-day { grid-template-columns:56px minmax(0,1fr); }
    #main .ev-cal .ev-card { grid-template-columns:150px minmax(0,1fr); }   /* 日付が無いぶん左の列を狭くする */
}
/* スマホのカレンダー表示: 時刻と会場を、左上の種別の札の横に並べる（1件あたり1行ぶん詰めて、1画面に入る件数を増やす）。
   札はカードの上の縁に付いているので、段ごと上の縁まで引き上げ、時刻は札と同じ高さの行にして上下の中心をそろえる。
   会場が札の横に入りきらないときは次の行へ送り、カードの左端（題名と同じ位置）から書く。 */
@media screen and (max-width:600px) {
    #main .ev-cal .ev-side { display:flex; flex-wrap:wrap; align-items:flex-start; gap:2px 8px; min-width:0; margin-top:-12px; }
    #main .ev-cal .ev-kind { flex:0 0 auto; margin-top:0; }
    #main .ev-cal .ev-when { display:contents; }
    #main .ev-cal .ev-time { line-height:17px; white-space:nowrap; }
    #main .ev-cal .ev-venue { min-width:0; max-width:100%; line-height:17px; }
}

/* 劇場公演の細い1行（カレンダー表示）。予定の無い日の行と同じ小さな字で、開演時刻と公演名だけ。
   押すと、その公演の出演メンバーがポップアップで出る（stage_dates_modal.js）。ボタンの見た目は消して1行の箱にする。 */
#main .ev-th {
    display:flex; align-items:baseline; gap:5px; min-width:0; width:100%; margin:0;
    font:inherit; font-size:.66em; line-height:1.45; font-weight:600; color:#374151; text-align:left;
    background:#fff; border:1px solid #e5e7eb; border-radius:4px; padding:0 6px; cursor:pointer;
}
#main .ev-th[hidden] { display:none; }
#main .ev-th:hover, #main .ev-th:focus-visible { color:#b1487c; border-color:#b1487c; }
#main .ev-th-k { flex:0 0 auto; font-weight:700; color:#6b7280; }
#main .ev-th-t { flex:0 0 auto; font-variant-numeric:tabular-nums; }
#main .ev-th-n { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#main .ev-th-sup { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#b1487c; }
/* 劇場公演だけの日: 行は細いまま、右の列に細い行を縦に積む */
#main .ev-thinbody { display:flex; flex-direction:column; gap:1px; padding:1px 0 1px 8px; min-width:0; }
#main .ev-day--thin .ev-dayhead { align-self:stretch; align-items:flex-start; padding-top:1px; }
/* 絞り込みでその日のカードが隠れ、劇場公演の行だけ残ったとき、行が日付の列の高さまで引き伸ばされないようにする */
#main .ev-daybody { align-content:start; }
#main .ev-daybody > .ev-th { align-self:start; }
