@charset "UTF-8";

/* =========================================================
   schedule.css（common.css を前提に “足りない分だけ” 追加）
   ========================================================= */

/* トップのカレンダーリンク */
.top-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin: 8px 0 16px;
}
.top-links a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-brown);
  box-shadow: 0 2px 6px rgba(88,66,50,0.06);
}
.top-links a:hover{
  background: #fff7ef;
}

/* フィルターのレイアウト */
.filters-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px){
  .filters-grid{
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.field label{
  display:block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--brand-brown);
  font-size: 0.95rem;
}

/* 月のクイックボタン列（commonのbuttonスタイルを使う） */
.month-quick{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-bottom: 10px;
}

/* チップ（団体・月） */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #fff;
  cursor:pointer;
  user-select:none;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(88,66,50,0.06);
  transition: transform 0.08s ease, background 0.18s ease;
}
.chip:hover{
  background: #fff7ef;
  transform: translateY(-1px);
}
.chip:active{
  transform: translateY(0);
}
.chip .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand-border);
}

/* ONの見た目：JS側で background を色指定する想定（団体チップ） */
.chip[aria-pressed="true"]{
  color: #fff;
  border-color: transparent;
}
.chip[aria-pressed="true"] .dot{
  background: rgba(255,255,255,0.92);
}

/* 種類トグル */
.toggles{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}
.toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #fff;
  cursor:pointer;
  user-select:none;
  box-shadow: 0 1px 3px rgba(88,66,50,0.06);
}
.toggle[aria-pressed="true"]{
  background: var(--brand-brown);
  color:#fff;
  border-color: var(--brand-brown);
}

/* ステータス */
.status{
  margin-top: 10px;
  font-size: 0.85rem;
  color: #8c7054;
}

/* テーブル */
.table-wrap{
  overflow-x:auto;
}
.schedule-table{
  width:100%;
  border-collapse: collapse;
}
.schedule-table th{
  background: #fff7ef;
  color: var(--brand-brown);
}
.schedule-table th,
.schedule-table td{
  border: 1px solid #e8d7c6;
  padding: 10px;
  vertical-align: top;
}
.schedule-table td small{
  color:#8c7054;
}
.empty{
  text-align:center;
  padding: 18px;
  color:#8c7054;
}

/* 団体色ストリップ（1列目の左に色バー） */
.schedule-table tr[data-org] td:first-child{
  position: relative;
  padding-left: 14px;
}
.schedule-table tr[data-org] td:first-child::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:6px;
  background: var(--org-color, var(--brand-border));
}
/* =========================================
   schedule-table（最小構成）
   - 表のまま
   - 横スクロール
   - 開始日時列 sticky
   - タイトルだけ最大2行（スマホ）
   ========================================= */

/* 横スクロールは wrap が担当 */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* sticky 安定のため collapse をやめる */
.schedule-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;   /* 列幅を安定させる */
  min-width: 860px;      /* 横スクロール前提の最低幅（好みで調整） */
}

/* 列幅（お好みで微調整OK） */
.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1){ width: 112px; } /* 開始日時 */
.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2){ width: 86px; }  /* 団体 */
.schedule-table th:nth-child(5),
.schedule-table td:nth-child(5){ width: 74px; }  /* 種類 */
.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4){ width: 120px; } /* 場所（少し広め推奨） */
/* タイトル(3)は残り */

/* 文字がはみ出すのを抑える */
.schedule-table td{
  overflow: hidden;
}

/* 開始日時・団体・場所・種類は1行 */
.schedule-table td:nth-child(1),
.schedule-table td:nth-child(2),
.schedule-table td:nth-child(4),
.schedule-table td:nth-child(5){
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* 1列目 sticky（thead + tbody） */
.schedule-table thead th:first-child,
.schedule-table tbody td:first-child{
  position: sticky;
  left: 0;
  background: #fff; /* 透け防止 */
  z-index: 3;
  border-right: 1px solid #e8d7c6;
  box-shadow: 6px 0 10px rgba(0,0,0,0.06);
}

/* ヘッダーはさらに前 */
.schedule-table thead th{
  background: #fff7ef;
}
.schedule-table thead th:first-child{
  z-index: 5;
  background: #fff7ef;
}

@media (max-width: 768px){
  .schedule-table th, .schedule-table td{
    padding: 6px 8px;
    font-size: 0.9rem;
  }

  /* タイトル列：タイトル＋説明を縦に */
  .schedule-table td:nth-child(3){
    white-space: normal;
  }

  /* タイトル本文：最大2行 */
  .schedule-table td:nth-child(3) > :not(small){
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 説明(small)：タイトルの下に小さく、最大1行（2行にしたければ1→2） */
  .schedule-table td:nth-child(3) small{
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    line-height: 1.25;
    color: #8c7054;
    opacity: 0.65;

    display: -webkit-box;
    -webkit-line-clamp: 1;     /* ← 2行にしたいなら 2 */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ===== フィルター：アコーディオン ===== */
.filter-accordion{
  margin: 10px 0 16px;
}
.filter-summary{
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fff;
  color: var(--brand-brown);
}
.filter-summary::-webkit-details-marker{ display:none; }
.filter-sub{
  font-size: 0.85rem;
  color: #8c7054;
}
.filter-accordion[open] .filter-summary{
  border-color: #e8d7c6;
}

/* 点線枠はフィルターだけに使う */
.filter-frame{
  margin-top: 10px;
}

/* ===== トップリンク：Google風 ===== */
.gcal-link{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-brown);
  text-decoration: none;
}
.gcal-link:hover{ background:#fff7ef; }

.g-badge{
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  background: conic-gradient(#4285F4 0 25%, #DB4437 0 50%, #F4B400 0 75%, #0F9D58 0 100%);
}

/* ===== 表：縮める + sticky ===== */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 既存の最小構成に合わせて：1列目をもう少し細く */
.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1){ width: 92px; }   /* 開始 */

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2){ width: 48px; }   /* 団体（略称1文字） */

/* 団体セル：中央寄せ */
.org-cell{
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* 日曜/土曜：セルの色味を少しだけ */
.dow-sun{ color: #C62828; font-weight: 700; }
.dow-sat{ color: #1565C0; font-weight: 700; }

.schedule-table{ border-collapse: separate !important; }
.schedule-table thead th:first-child,
.schedule-table tbody td:first-child{
  position: sticky !important;
  left: 0 !important;
}