@charset "utf-8";

/* ==========================================================================
   イベントCMS用の上書きCSS
   event-common.css / responsive.css の "後" に読み込んでください。

   やっていること
   1. グリッドの位置指定を解除して、表示する項目だけが順に詰まるようにする
   2. 色をCSS変数にして、イベントごとに管理画面から変えられるようにする

   このファイルがあれば、イベントごとの event.scss は不要です。
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. 自動フロー化
   共通CSSの .infoItem01〜06 は grid-row / grid-column が決め打ちなので、
   項目を1つ隠すとそこに穴が空きます。
   .isAuto を付けたときだけ位置指定を解除して、上から順に流し込みます。
   -------------------------------------------------------------------------- */

.eventInfo.isAuto {
  grid-template-rows: none;
  grid-auto-rows: minmax(40vh, auto);
  align-items: stretch;
}

.eventInfo.isAuto > li {
  grid-row: auto;
  grid-column: auto;
}

/* 管理画面で「全幅」を選んだ項目 */
.eventInfo.isAuto > li.isWide {
  grid-column: 1 / -1;
}

/* 地図だけは高さの取り方が特殊なので、自動行でも比率を保つ */
.eventInfo.isAuto > li.infoItem06 {
  padding-top: 0;
  min-height: 40vh;
}

.eventInfo.isAuto > li.infoItem06 iframe {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 40vh;
  border-radius: 20px;
}

/* 自由記述ブロック */
.eventInfo.isAuto > li.infoItem07 {
  position: relative;
}

.eventInfo.isAuto > li.infoItem07 .freeText {
  margin: 8% 5%;
  line-height: 1.8;
  font-size: 18px;
}

.eventInfo.isAuto > li.infoItem07 .freeText p {
  margin-bottom: 1em;
}


/* --------------------------------------------------------------------------
   2. 色テーマ
   変数は detail.php が <ul class="eventInfo isAuto" style="--ev-h3:..."> の
   形で流し込みます。指定が無いときは共通CSSと同じ色に戻ります。
   -------------------------------------------------------------------------- */

.eventInfo .h3 {
  background-color: var(--ev-h3, #168227);
}

.eventInfo .recWord th {
  background-color: var(--ev-th, #168227);
}

.eventInfo .tdOn {
  background-color: var(--ev-on, #87bc4f);
  opacity: 1;
}

.eventInfo .tdOff {
  background-color: var(--ev-off, #87bc4f);
  opacity: var(--ev-off-opacity, 0.3);
}

.eventInfo .infoItem04 {
  background-color: var(--ev-apply, hwb(33 33% 0%));
}

.eventInfo .infoItem07 {
  background-color: var(--ev-free, transparent);
}

/* 曜日を囲む丸 */
.eventInfo .infoItem01 .dateText .dateWord3-1 .dateWord3-3::after {
  background-color: var(--ev-circle, hwb(33 33% 0%));
}


/* --------------------------------------------------------------------------
   3. 項目が1つだけのときの見え方を整える
   -------------------------------------------------------------------------- */

.eventInfo.isAuto:has(> li:only-child) > li {
  grid-column: 1 / -1;
}


/* --------------------------------------------------------------------------
   4. スマホ
   共通のresponsive.cssが572px以下で display:block にしているので、
   ここでは自動行の指定だけ打ち消します。
   -------------------------------------------------------------------------- */

@media screen and (max-width: 572px) {
  .eventInfo.isAuto {
    grid-auto-rows: auto;
  }

  .eventInfo.isAuto > li.infoItem06,
  .eventInfo.isAuto > li.infoItem06 iframe {
    min-height: 55vw;
  }
}

/* --------------------------------------------------------------------------
   5. 複数開催日のリスト
   1回だけのイベントでは出ません。2回以上あるときだけ日程一覧が並びます。
   過ぎた回は自動でグレーになり、「終了」が付きます。
   -------------------------------------------------------------------------- */

.eventInfo .infoItem01 .dateList {
  margin: 18px 0 0 0;
  padding: 0;
  list-style: none;
  font-family: "Kosugi Maru", sans-serif;
}

.eventInfo .infoItem01 .dateList li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 17px;
  line-height: 1.5;
  padding: 7px 4px;
  border-bottom: 1px dotted #ccc;
}

.eventInfo .infoItem01 .dateList li:last-child {
  border-bottom: none;
}

.eventInfo .infoItem01 .dateListLabel {
  flex: none;
  min-width: 4.5em;
  text-align: center;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  background-color: var(--ev-h3, #168227);
}

/* これから開催される回 */
.eventInfo .infoItem01 .dateList li.isNext {
  font-weight: bold;
}

/* 終わった回 */
.eventInfo .infoItem01 .dateList li.isPast {
  color: #999;
}

.eventInfo .infoItem01 .dateList li.isPast .dateListLabel {
  background-color: #bbb;
}

.eventInfo .infoItem01 .dateListEnd {
  font-size: 12px;
  color: #fff;
  background: #aaa;
  border-radius: 3px;
  padding: 2px 7px;
}

/* すべての回が終わったイベントに出す帯 */
.eventFinished {
  background: #6b7785;
  color: #fff;
  text-align: center;
  font-weight: bold;
  border-radius: 8px;
  padding: 14px;
  margin: 0 auto 30px auto;
  max-width: 70%;
}

@media screen and (max-width: 572px) {
  .eventInfo .infoItem01 .dateList li { font-size: 15px; }
  .eventFinished { max-width: 100%; }
}
