/* ============================================================
   MCB Custom Blocks — フロントエンド共通スタイル  v1.1
   プレフィックス: .mcb-  (SWELL競合防止)
   設計: モバイルファースト / タップ操作最優先
   ============================================================ */

:root {
  --mcb-primary:    #2563eb;
  --mcb-primary-dk: #1d4ed8;
  --mcb-accent:     #f59e0b;
  --mcb-danger:     #ef4444;
  --mcb-success:    #10b981;
  --mcb-orange:     #f97316;
  --mcb-text:       #1f2937;
  --mcb-text-sub:   #6b7280;
  --mcb-border:     #e5e7eb;
  --mcb-bg:         #f9fafb;
  --mcb-white:      #ffffff;
  --mcb-radius:     8px;
  --mcb-shadow:     0 2px 8px rgba(0, 0, 0, 0.10);
  --mcb-font:       -apple-system, BlinkMacSystemFont,
                    "Hiragino Kaku Gothic ProN", "Noto Sans JP",
                    "Yu Gothic", sans-serif;
}

/* ============================================================
   1. 見出しブロック
   ============================================================ */
.mcb-heading {
  font-family: var(--mcb-font);
  line-height: 1.4;
  margin: 0 0 1rem;
  color: var(--mcb-text);
  word-break: break-all;
}
.mcb-heading--style1 {
  border-left: 5px solid var(--mcb-primary);
  padding: 0.35em 0.75em;
  background: var(--mcb-bg);
  border-radius: 0 var(--mcb-radius) var(--mcb-radius) 0;
}
.mcb-heading--style2 {
  padding-bottom: 0.4em;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--mcb-primary), var(--mcb-accent)) 1;
}
.mcb-heading--style3 {
  background: linear-gradient(135deg, var(--mcb-primary), #60a5fa);
  color: var(--mcb-white);
  padding: 0.5em 1em;
  border-radius: var(--mcb-radius);
}
.mcb-heading--style4 {
  display: flex;
  align-items: center;
  gap: 0.45em;
}
.mcb-heading--style4::before {
  content: "■";
  color: var(--mcb-primary);
  font-size: 0.65em;
  flex-shrink: 0;
}

/* ============================================================
   2. CTAボタン
   ============================================================ */
.mcb-cta-wrap { text-align: center; margin: 1.5rem 0; }
.mcb-cta-wrap--left  { text-align: left; }
.mcb-cta-wrap--right { text-align: right; }

.mcb-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.85em 2em;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--mcb-font);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.mcb-cta-btn:active { transform: scale(0.96); opacity: 0.88; }
.mcb-cta-btn--primary { background: var(--mcb-primary); color: var(--mcb-white); box-shadow: 0 4px 14px rgba(37,99,235,0.38); }
.mcb-cta-btn--accent  { background: var(--mcb-accent);  color: var(--mcb-white); box-shadow: 0 4px 14px rgba(245,158,11,0.38); }
.mcb-cta-btn--danger  { background: var(--mcb-danger);  color: var(--mcb-white); box-shadow: 0 4px 14px rgba(239,68,68,0.38); }
.mcb-cta-btn--outline { background: transparent; color: var(--mcb-primary); border-color: var(--mcb-primary); }
.mcb-cta-btn--full    { display: flex; width: 100%; }

/* ============================================================
   3. 商品カード
   ============================================================ */
.mcb-product-card {
  border: 1px solid var(--mcb-border);
  border-radius: var(--mcb-radius);
  overflow: hidden;
  background: var(--mcb-white);
  box-shadow: var(--mcb-shadow);
  margin: 1rem 0;
}
.mcb-product-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.mcb-product-card__body { padding: 1rem; }
.mcb-product-card__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--mcb-text); line-height: 1.4; }
.mcb-product-card__desc  { font-size: 0.875rem; color: var(--mcb-text-sub); margin: 0 0 0.75rem; line-height: 1.7; }
.mcb-product-card__price { font-size: 1.3rem; font-weight: 700; color: var(--mcb-danger); margin-bottom: 0.75rem; }
.mcb-product-card__price-note { font-size: 0.75rem; color: var(--mcb-text-sub); margin-left: 0.3em; font-weight: 400; }

/* ============================================================
   4. お知らせ表
   ============================================================ */
.mcb-notice-board {
  border: 1px solid var(--mcb-border);
  border-radius: var(--mcb-radius);
  overflow: hidden;
  margin: 1rem 0;
}
.mcb-notice-board__header {
  background: var(--mcb-primary);
  color: var(--mcb-white);
  padding: 0.7rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--mcb-font);
}
.mcb-notice-board__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--mcb-border);
  min-height: 52px;
}
.mcb-notice-board__item:last-child { border-bottom: none; }
.mcb-notice-board__item:nth-child(even) { background: var(--mcb-bg); }
.mcb-notice-board__item.is-hidden { display: none; }
.mcb-notice-board__date  { font-size: 0.73rem; color: var(--mcb-text-sub); white-space: nowrap; flex-shrink: 0; padding-top: 0.15em; }
.mcb-notice-board__text  { font-size: 0.9rem; line-height: 1.55; color: var(--mcb-text); flex: 1; word-break: break-all; }
.mcb-notice-board__link  { color: var(--mcb-primary); text-decoration: underline; }
.mcb-notice-board__link:hover { opacity: 0.8; }

/* ============================================================
   5. 重要バッジ
   ============================================================ */
.mcb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  margin: 0 0.2em;
  font-family: var(--mcb-font);
  white-space: nowrap;
}
/* 旧来クラス（後方互換） */
.mcb-badge--important { background: var(--mcb-danger);  color: var(--mcb-white); }
.mcb-badge--urgent    { background: var(--mcb-orange);  color: var(--mcb-white); animation: mcb-blink 1.6s ease-in-out infinite; }
.mcb-badge--new       { background: var(--mcb-success); color: var(--mcb-white); }
.mcb-badge--info      { background: var(--mcb-primary); color: var(--mcb-white); }

@keyframes mcb-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ============================================================
   6. FAQアコーディオン
   ============================================================ */
.mcb-faq {
  margin: 1rem 0;
  border: 1px solid var(--mcb-border);
  border-radius: var(--mcb-radius);
  overflow: hidden;
}
.mcb-faq-item { border-bottom: 1px solid var(--mcb-border); }
.mcb-faq-item:last-child { border-bottom: none; }
.mcb-faq-question {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--mcb-white);
  cursor: pointer; min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mcb-faq-question:hover { background: var(--mcb-bg); }
.mcb-faq-q-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; min-width: 28px;
  background: var(--mcb-primary); color: var(--mcb-white);
  border-radius: 50%; font-weight: 700; font-size: 0.85rem;
  font-family: var(--mcb-font);
}
.mcb-faq-question__text { flex: 1; font-size: 0.95rem; font-weight: 600; color: var(--mcb-text); line-height: 1.45; }
.mcb-faq-arrow { width: 22px; height: 22px; min-width: 22px; position: relative; flex-shrink: 0; }
.mcb-faq-arrow::before, .mcb-faq-arrow::after {
  content: ""; position: absolute;
  background: var(--mcb-text-sub); border-radius: 2px;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  transition: transform 0.25s, opacity 0.25s;
}
.mcb-faq-arrow::before { width: 14px; height: 2px; }
.mcb-faq-arrow::after  { width: 2px;  height: 14px; }
.mcb-faq-item.is-open .mcb-faq-arrow::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.mcb-faq-answer { display: none; padding: 0.75rem 1rem 1rem; background: var(--mcb-bg); }
.mcb-faq-item.is-open .mcb-faq-answer { display: block; }
.mcb-faq-a-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; min-width: 26px;
  background: var(--mcb-accent); color: var(--mcb-white);
  border-radius: 50%; font-weight: 700; font-size: 0.8rem;
  float: left; margin: 0.1em 0.6em 0.3em 0;
}
.mcb-faq-answer__text { font-size: 0.9rem; color: var(--mcb-text); line-height: 1.75; overflow: hidden; white-space: pre-line; }
.mcb-faq-detail-link {
  display: block;
  margin-top: 0.6em;
  font-size: 0.85rem;
  color: var(--mcb-primary);
  font-weight: 600;
  text-decoration: underline;
}
.mcb-faq-detail-link:hover { opacity: 0.75; text-decoration: underline; }

/* ============================================================
   7. お知らせ一覧（フィルタ付き）
   ============================================================ */
/* ---- ショートコード全体ラッパー（ボーダーなし） ---- */
.mcb-notice-list { margin: 1rem 0; }

/* ---- フィルターバー: ボーダー箱の外・上部 ---- */
.mcb-notice-list .mcb-notice-list__filter {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0 0 0.75rem;
  margin: 0;
  background: none;
  border: none;
}

/* ---- ボーダー付きコンテナ（ヘッダー + 一覧） ---- */
.mcb-notice-list__board {
  border: 1px solid var(--mcb-border);
  border-radius: var(--mcb-radius);
  overflow: hidden;
}

/* ---- ヘッダー見出し（notice-board の boardTitle と同様） ---- */
.mcb-notice-list__header {
  background: #2563eb !important;
  color: #ffffff !important;
  padding: 0.7rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--mcb-font);
  letter-spacing: 0.03em;
}

/* ---- notice-board 内のフィルター（従来通り） ---- */
.mcb-notice-board .mcb-notice-list__filter {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
  margin-bottom: 0.9rem; padding: 0.5rem 0;
}

/* ---- フィルターボタン（共通） ---- */
.mcb-filter-btn {
  display: inline-flex; align-items: center;
  padding: 0.4em 1em;
  border: 1.5px solid var(--mcb-border);
  border-radius: 50px;
  font-size: 0.85rem; font-family: var(--mcb-font);
  cursor: pointer; background: var(--mcb-white); color: var(--mcb-text);
  min-height: 38px; min-width: 44px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mcb-filter-btn.is-active,
.mcb-filter-btn:hover { background: var(--mcb-primary); color: var(--mcb-white); border-color: var(--mcb-primary); }

.mcb-notice-list__items { border-top: 1px solid var(--mcb-border); }
.mcb-notice-item {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 0.4rem 0.6rem; padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--mcb-border); min-height: 52px;
}
.mcb-notice-item:last-child { border-bottom: none; }
.mcb-notice-item.is-hidden       { display: none; }
.mcb-notice-item--empty          { color: var(--mcb-text-sub); font-size: 0.875rem; font-style: italic; }
.mcb-notice-item:nth-child(even) { background: var(--mcb-bg); }
.mcb-notice-item__meta  { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; flex-wrap: wrap; }
.mcb-notice-item__date  { font-size: 0.73rem; color: var(--mcb-text-sub); white-space: nowrap; }
.mcb-notice-item__text  { font-size: 0.9rem; color: var(--mcb-text); line-height: 1.55; flex: 1; min-width: 160px; word-break: break-all; text-decoration: none; }
a.mcb-notice-item__text { color: var(--mcb-text); text-decoration: underline; }
a.mcb-notice-item__text:hover { opacity: 0.7; }

/* ============================================================
   8. 時間割 — カラーテーマ対応
   ============================================================ */
.mcb-timetable {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 1rem 0; border-radius: var(--mcb-radius);
  border: 1px solid var(--mcb-border);
  /* カラーテーマ変数（デフォルト: 青） */
  --mcb-tt:       #2563eb;
  --mcb-tt-light: #eff6ff;
}
/* カラーテーマ */
.mcb-timetable--green  { --mcb-tt: #059669; --mcb-tt-light: #ecfdf5; }
.mcb-timetable--red    { --mcb-tt: #dc2626; --mcb-tt-light: #fff1f2; }
.mcb-timetable--orange { --mcb-tt: #ea580c; --mcb-tt-light: #fff7ed; }
.mcb-timetable--purple { --mcb-tt: #7c3aed; --mcb-tt-light: #faf5ff; }
.mcb-timetable--gray   { --mcb-tt: #4b5563; --mcb-tt-light: #f3f4f6; }
.mcb-timetable--dark   { --mcb-tt: #1f2937; --mcb-tt-light: #f3f4f6; }

.mcb-timetable table { width: 100%; border-collapse: collapse; min-width: 300px; font-family: var(--mcb-font); }
.mcb-timetable th, .mcb-timetable td {
  border: 1px solid var(--mcb-border); padding: 0.5rem 0.4rem;
  text-align: center; font-size: 0.78rem; vertical-align: middle; line-height: 1.3;
}
.mcb-timetable thead th { background: var(--mcb-tt); color: var(--mcb-white); font-weight: 700; white-space: nowrap; }
.mcb-timetable .mcb-tt-time { background: #f3f4f6; font-weight: 600; white-space: nowrap; font-size: 0.72rem; min-width: 48px; color: var(--mcb-text-sub); }
.mcb-timetable tbody tr:nth-child(even) td { background: var(--mcb-bg); }
.mcb-timetable .mcb-tt-event { background: var(--mcb-tt-light); border-radius: 4px; font-weight: 600; color: var(--mcb-tt); font-size: 0.75rem; }

/* ============================================================
   9. タイムライン — カラーテーマ・フォントサイズ対応
   ============================================================ */
.mcb-timeline {
  margin: 1rem 0;
  padding-left: 1.6rem;
  position: relative;
  /* カラーテーマ変数（デフォルト: 青） */
  --mcb-tl:       #2563eb;
  /* フォントサイズ変数（デフォルト: 普通） */
  --mcb-tl-title: 0.95rem;
  --mcb-tl-body:  0.85rem;
  --mcb-tl-date:  0.73rem;
}
/* カラーテーマ */
.mcb-timeline--green  { --mcb-tl: #059669; }
.mcb-timeline--red    { --mcb-tl: #dc2626; }
.mcb-timeline--orange { --mcb-tl: #ea580c; }
.mcb-timeline--purple { --mcb-tl: #7c3aed; }
.mcb-timeline--dark   { --mcb-tl: #374151; }
/* フォントサイズ */
.mcb-timeline--font-sm { --mcb-tl-title: 0.82rem; --mcb-tl-body: 0.75rem; --mcb-tl-date: 0.65rem; }
.mcb-timeline--font-lg { --mcb-tl-title: 1.1rem;  --mcb-tl-body: 0.95rem; --mcb-tl-date: 0.82rem; }
.mcb-timeline--font-xl { --mcb-tl-title: 1.25rem; --mcb-tl-body: 1.05rem; --mcb-tl-date: 0.9rem;  }

.mcb-timeline::before {
  content: ""; position: absolute; left: 0.65rem; top: 0.35rem; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--mcb-tl), var(--mcb-border));
}
.mcb-timeline-item { position: relative; padding: 0 0 1.4rem 1.2rem; }
.mcb-timeline-item::before {
  content: ""; position: absolute; left: -0.75rem; top: 0.35rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--mcb-tl); border: 2px solid var(--mcb-white);
  box-shadow: 0 0 0 2px var(--mcb-tl);
}
.mcb-timeline-item__date  { font-size: var(--mcb-tl-date);  color: var(--mcb-tl); font-weight: 600; margin-bottom: 0.2rem; font-family: var(--mcb-font); }
.mcb-timeline-item__title { font-size: var(--mcb-tl-title); font-weight: 600; color: var(--mcb-text); line-height: 1.4; margin-bottom: 0.2rem; }
.mcb-timeline-item__body  { font-size: var(--mcb-tl-body);  color: var(--mcb-text-sub); line-height: 1.7; }

/* ============================================================
   10. 表 — カラーテーマ対応
   ============================================================ */
.mcb-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 1rem 0; border-radius: var(--mcb-radius);
  border: 1px solid var(--mcb-border);
}
.mcb-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mcb-font); font-size: 0.875rem;
  /* カラーテーマ変数（デフォルト: 青） */
  --mcb-tb:       #2563eb;
  --mcb-tb-light: #eff6ff;
}
/* カラーテーマ */
.mcb-table--green  { --mcb-tb: #059669; --mcb-tb-light: #ecfdf5; }
.mcb-table--red    { --mcb-tb: #dc2626; --mcb-tb-light: #fff1f2; }
.mcb-table--orange { --mcb-tb: #ea580c; --mcb-tb-light: #fff7ed; }
.mcb-table--purple { --mcb-tb: #7c3aed; --mcb-tb-light: #faf5ff; }
.mcb-table--gray   { --mcb-tb: #4b5563; --mcb-tb-light: #f3f4f6; }
.mcb-table--dark   { --mcb-tb: #1f2937; --mcb-tb-light: #f3f4f6; }

.mcb-table th, .mcb-table td {
  border: 1px solid var(--mcb-border); padding: 0.6rem 0.75rem;
  text-align: left; vertical-align: top; line-height: 1.55; word-break: break-all;
}
.mcb-table thead th  { background: var(--mcb-tb); color: var(--mcb-white); font-weight: 700; white-space: nowrap; }
.mcb-table tbody tr:nth-child(even) td { background: var(--mcb-bg); }
.mcb-table tbody tr:hover td { background: var(--mcb-tb-light); }

/* ============================================================
   11. 汎用カード
   ============================================================ */
.mcb-card { margin: 1rem 0; }
.mcb-card__body { /* padding は inline style で制御 */ }
/* カード内の WordPress コアブロック余白を整える */
.mcb-card__body > *:first-child { margin-top: 0; }
.mcb-card__body > *:last-child  { margin-bottom: 0; }

/* ============================================================
   レスポンシブ（640px以上 = タブレット・PC）
   ============================================================ */
@media (min-width: 640px) {
  .mcb-cta-btn { font-size: 1.05rem; padding: 0.9em 2.4em; }

  .mcb-product-card { display: grid; grid-template-columns: 220px 1fr; }
  .mcb-product-card__img { aspect-ratio: auto; height: 100%; }

  .mcb-timetable th, .mcb-timetable td { font-size: 0.85rem; padding: 0.6rem 0.5rem; }
  .mcb-table th, .mcb-table td { font-size: 0.9rem; }
}
