@charset "UTF-8";

/**
 * ============================================================
 * events.css（イベント共通）
 *
 * 【対象】
 *  - イベント一覧（events.php）: カード / カレンダー / リスト
 *  - イベント詳細（event.php）+ 掲示板（event_board.php）
 *
 * 【方針】
 *  - events.list.js が生成するDOM（#evList + 各クラス）に合わせる
 *  - 同一セレクタの多重定義を排除し、上書き事故を防ぐ
 *  - ヤマカラ風（中央の細カラム）は #evList 側で統一的に制御
 *
 * 【5か条チェック】
 *  1) インラインCSS禁止：OK（本ファイルのみ）
 *  2) セキュリティ：OK（CSSのみ）
 *  3) 監査ログ：不要
 *  4) 冒頭コメント：本ヘッダ
 *  5) 原則全文差し替え：本ファイル
 * ============================================================
 */

/* ============================================================
   1) イベント一覧：共通レイアウト（#evList の幅を統一）
   - card / list / cal のどれでも効くように #evList に付くクラスで指定
============================================================ */

/* 一覧を「中央の細カラム」へ（ヤマカラ風） */
#evList.ev-grid,
#evList.ev-list,
#evList.ev-cal{
  max-width: 920px; /* 好みで 920〜1040 */
  margin: 0 auto;
}

/* ============================================================
   2) カード表示（ev-grid / ev-card）
============================================================ */

/* スマホ：1列 / タブレット：2列 / PC：3列 */
.ev-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px){
  .ev-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px){
  .ev-grid{ grid-template-columns: repeat(3, 1fr); }
}

/* カード本体 */
.ev-card{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;

  display: flex;
  flex-direction: column;

  transition: transform .08s ease, box-shadow .08s ease;
  text-decoration: none;
  color: inherit;
}
.ev-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
}

/* 画像 */
.ev-card .photo{
  aspect-ratio: 4 / 3;
  background: #f5f7fa;
  overflow: hidden;
  width: 100%;
}
.ev-card .photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 本文 */
.ev-card .body{ padding: 12px; }
.ev-card .title{
  font-weight: 700;
  margin: 0 0 6px;
}
.ev-card .meta{
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   3) イベント一覧：フィルタUI（filter-bar / view-toggle）
============================================================ */

.page-title{
  margin: 10px 0 14px;
  line-height: 1.2;
}

/* フィルタバー */
.filter-bar{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.filter-bar input,
.filter-bar select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
}

@media (min-width: 900px){
  .filter-bar{
    grid-template-columns: 1.2fr 1fr 170px 180px 180px auto auto;
    align-items: center;
  }
}

/* クリアボタン（ゴースト） */
.btn--ghost{
  background: transparent;
}
.btn--ghost:hover{
  background: #f7f7f7;
}

/* 表示切替 */
.view-toggle{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.view-toggle .btn.is-active{
  border-color: #cfe3ff;
  background: #eef6ff;
}

/* ============================================================
   4) リスト表示（ev-list / ev-row）
   - events.list.js の buildListRow() の DOM に対応
============================================================ */

.ev-list{
  display: grid;
  gap: 12px;
}

/* 1行（リンク全体） */
.ev-row{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 12px;

  text-decoration: none;
  color: inherit;

  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-areas:
    "thumb main"
    "right right";
  gap: 12px;

  transition: transform .08s ease, box-shadow .08s ease, background-color .08s ease;
}
.ev-row:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
  background: #fff;
}

/* 左：サムネ */
.ev-row__thumb{
  grid-area: thumb;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f7fa;
  border: 1px solid var(--border);
}
.ev-row__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 中央：本文 */
.ev-row__main{
  grid-area: main;
  min-width: 0; /* 省略表示のため */
}

/* タイトル行（右に★） */
.ev-row__head{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.ev-row__title{
  font-weight: 900;
  line-height: 1.25;
  font-size: 16px;

  display: -webkit-box;
  -webkit-box-orient: vertical;

  /* 互換性のために標準も併記（警告対策） */
  -webkit-line-clamp: 2;
  line-clamp: 2;

  overflow: hidden;
}

/* ★の位置 */
.ev-row__fav{
  flex: 0 0 auto;
  margin-left: 6px;
}

/* メタ（A：日程＋集合＋企画者） */
.ev-row__meta{
  margin-top: 8px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.ev-row__meta-line{
  line-height: 1.45;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 企画者リンク（JS側で a/span に付ける想定） */
.ev-row__organizer-link{
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0,0,0,.25);
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.ev-row__organizer-link:hover{
  background: rgba(0,0,0,.05);
  text-decoration-color: rgba(0,0,0,.55);
}

/* 右：ステータス（スマホは下段、PCは右カラム） */
.ev-row__right{
  grid-area: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* PC以上は「3カラム」に（右カラムは少し細め） */
@media (min-width: 720px){
  .ev-row{
    grid-template-columns: 110px 1fr 150px; /* 右カラムを締める */
    grid-template-areas: "thumb main right";
    align-items: center;
  }
  .ev-row__thumb{
    width: 110px;
    height: 110px;
  }
  .ev-row__right{
    justify-content: flex-end;
  }
}

/* ============================================================
   5) カレンダー表示（ev-cal / cal-*)
============================================================ */

.cal{ display: grid; gap: 10px; }
.cal-head{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cal-title{ font-weight: 800; }

.cal-week{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday{ text-align: center; color: var(--muted); font-size: 12px; }

.cal-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  min-height: 90px;
}
.cal-cell--pad{ border: 0; background: transparent; }
.cal-day{ font-weight: 800; font-size: 13px; margin-bottom: 6px; }

.cal-items{ display: grid; gap: 4px; }
.cal-item{
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #fff;
}
.cal-item:hover{ background: #f7f7f7; }
.cal-more{ font-size: 11px; color: var(--muted); }

/* ============================================================
   6) イベント一覧：募集ステータス表示（EntryOpen連携）
============================================================ */

.ev-status-badge{
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  gap: 2px;
}
.ev-status-main{
  font-weight: 900;
  font-size: 13px;
}
.ev-status-sub{
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* 募集開始前 */
.ev-status-badge--pre{
  background: #f6f7f9;
  border-color: var(--border);
}
.ev-status-badge--pre .ev-status-main{ color: #475569; }

/* 募集終了 */
.ev-status-badge--closed{
  background: #fafafa;
  border-color: var(--border);
}
.ev-status-badge--closed .ev-status-main{ color: var(--muted); }

/* 募集中（空きあり） */
.ev-status-badge--open{
  background: #eef6ff;
  border-color: #cfe3ff;
}
.ev-status-badge--open .ev-status-main{ color: #1d4ed8; }

/* 満席 */
.ev-status-badge--full{
  background: #fff3e6;
  border-color: #ffd8b1;
}
.ev-status-badge--full .ev-status-main{ color: #b45309; }

/* キャンセル待ち */
.ev-status-badge--wait{
  background: #f6f7f9;
  border-color: var(--border);
}
.ev-status-badge--wait .ev-status-main{ color: #334155; }

/* ============================================================
   7) ここから：event.php（イベント詳細）＋掲示板 用
   目的：詳細ページの雰囲気を整える
============================================================ */

/* event.php 全体の2カラム（左：本文 / 右：サイド） */
.ev-detail{
  display: grid;
  gap: 16px;
  align-items: start;
}
@media (min-width: 960px){
  .ev-detail{ grid-template-columns: 1fr 360px; }
}

/* 上部のヒーロー画像（横長・角丸） */
.ev-hero{
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #f5f7fa;
}
.ev-hero img{
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}
@media (min-width: 960px){
  .ev-hero img{ height: 320px; }
}

/* タイトル周り */
.ev-head{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}
.ev-head__title{
  font-size: 28px;
  font-weight: 900;
  margin: 2px 0 8px;
  line-height: 1.25;
}
.ev-head__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 10px;
}
.ev-head__desc{
  margin: 0;
  color: #0f172a;
  line-height: 1.8;
}

/* 左側：各セクションの箱 */
.ev-main-block{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  margin-top: 12px;
}

.ev-section__title{
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 12px;
}

/* イベント情報（表っぽい並び） */
.ev-info{ display: grid; gap: 10px; }
.ev-info-row{
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.ev-info-row:last-child{ border-bottom: 0; }

.ev-info-label{
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.ev-info-value{
  color: #0f172a;
  font-size: 15px;
}

/* 右側：サイドカード（参加ステータス / 参加者 / 編集メニューなど） */
.ev-side-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  margin-top: 12px;
}
.ev-side-card__title{
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 12px;
}

/* 参加ステータスのバッジ */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  background: #fff;
}
.badge--info{ background: #eef6ff; border-color: #cfe3ff; }
.badge--warn{ background: #fff3e6; border-color: #ffd8b1; }
.badge--secondary{ background: #f6f7f9; }

/* 右側ボタンを縦並びに整える（編集メニュー等） */
.ev-side-actions{ display: grid; gap: 10px; }
.ev-side-actions .btn{
  width: 100%;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
}

/* ============================================================
   8) 掲示板（event_board.php）用
============================================================ */

.ev-detail__board h2{
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
}

/* 一覧 */
.board-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.board-item{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}
.board-item__meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 8px;
}
.board-item__author{ font-weight: 900; }
.board-item__date{
  color: var(--muted);
  font-size: 12px;
}
.board-item__body{
  line-height: 1.8;
  white-space: normal;
}

/* 承認/却下ボタン */
.board-item__actions{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* フォーム */
.board-form{
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.board-form h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
}

/* textarea（style.css に無い場合の保険） */
.textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  background: #fff;
}