/* =====================================================
   schedule-calendar.css  ― TOPページ月間カレンダー
   14: #pcycle-cal-wrap に ID統一
   18: 過去イベントの塗り潰しを削除
   21: グループカラー変数（--group-primary 等）対応
   ===================================================== */

/* ラッパー */
#pcycle-cal-wrap {
  background: var(--group-white, #fff);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  margin-bottom: 16px;
}

/* ヘッダー（月ナビ） */
.pcal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--group-primary, #FF6B9D);
  padding: 12px 16px;
}
.pcal-title {
  font-family: var(--group-font-en, 'Playfair Display', serif);
  font-size: 16px;
  color: #fff;
  letter-spacing: .04em;
  font-weight: 700;
}
.pcal-nav {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.pcal-nav:hover { background: rgba(255,255,255,.35); }

/* テーブル */
.pcal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.pcal-th {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 6px 2px;
  background: color-mix(in srgb, var(--group-primary, #FF6B9D) 12%, white);
  color: var(--group-text, #3D2040);
}
.pcal-th.pcal-sun { color: #e53e3e; }
.pcal-th.pcal-sat { color: #3182ce; }

/* セル */
.pcal-cell {
  vertical-align: top;
  border: 1px solid var(--group-border, #F4C6DB);
  padding: 4px 3px 3px;
  aspect-ratio: 1 / 1;
  min-height: unset;
  font-size: 0;
  overflow: hidden;
}
.pcal-cell.pcal-empty { background: #fafafa; }
.pcal-cell.pcal-today .pcal-day-num {
  background: var(--group-primary, #FF6B9D);
  color: #fff;
  border-radius: 50%;
}
.pcal-cell.pcal-sun .pcal-day-num { color: #e53e3e; }
.pcal-cell.pcal-sat .pcal-day-num { color: #3182ce; }

/* 18: 過去セルは塗り潰しなし（薄く表示するだけ） */
.pcal-cell.pcal-past { opacity: .55; }

.pcal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

/* イベントバー */
.pcal-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.pcal-event-item {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--group-primary, #FF6B9D);
  border-radius: 3px;
  padding: 1px 4px;
  cursor: pointer;
  transition: opacity .15s;
  overflow: hidden;
}
.pcal-event-item:hover { opacity: .8; }

/* 18: 過去イベントは塗り潰しなし・ボーダーのみ */
.pcal-event-item.pcal-event-past {
  background: transparent !important;
  border: 1px solid var(--group-primary, #FF6B9D);
}
.pcal-event-item.pcal-event-past .pcal-event-label {
  color: var(--group-primary, #FF6B9D);
}
.pcal-event-item.pcal-event-past .pcal-event-dot {
  background: var(--group-primary, #FF6B9D);
}

.pcal-event-dot { width: 5px; height: 5px; background: rgba(255,255,255,.7); border-radius: 50%; flex-shrink: 0; }
.pcal-event-label { font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }

/* ローディング・エラー */
.pcal-loading, .pcal-error {
  text-align: center;
  padding: 40px 16px;
  font-size: 13px;
  color: #aaa;
}

/* ===== モーダル ===== */
#pcycle-cal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  z-index: 1999;
  cursor: pointer;
}
#pcycle-cal-overlay[hidden] { display: none; }

#pcycle-cal-modal {
  position: fixed; inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
#pcycle-cal-modal[hidden] { display: none; }
#pcycle-cal-modal:not([hidden]) { display: flex; }

.pcal-modal-inner {
  position: relative;
  background: var(--group-white, #fff);
  border-radius: 16px;
  max-width: 480px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pcal-in .35s cubic-bezier(.25,.8,.25,1);
  border-top: 5px solid var(--group-primary, #FF6B9D);
  pointer-events: auto;
}
@keyframes pcal-in {
  from { opacity: 0; transform: translateY(30px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pcal-modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none;
  font-size: 40px; line-height: 1;
  color: #bbb; cursor: pointer;
  transition: color .2s;
}
.pcal-modal-close:hover { color: var(--group-primary, #FF6B9D); }
.pcal-modal-body { padding: 24px 24px 28px; }
.pcal-modal-title { font-size: clamp(15px,3vw,19px); font-weight: 800; color: var(--group-text, #3D2040); line-height: 1.5; margin-bottom: 10px; padding-right: 24px; }
.pcal-modal-date  { font-size: 13px; color: var(--group-primary, #FF6B9D); font-weight: 700; margin-bottom: 6px; }
.pcal-modal-venue { font-size: 13px; color: var(--group-text, #3D2040); margin-bottom: 12px; }
.pcal-modal-desc  { font-size: 13px; line-height: 1.7; color: #444; white-space: pre-wrap; word-break: break-word; margin-bottom: 16px; border-top: 1px solid var(--group-border, #F4C6DB); padding-top: 12px; }
.pcal-modal-link  { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #fff; background: var(--group-primary, #FF6B9D); padding: 10px 20px; border-radius: 40px; text-decoration: none; transition: opacity .2s; }
.pcal-modal-link:hover { opacity: .85; }
.pcal-modal-img   { width: 100%; max-height: 300px; object-fit: contain; display: block; }

/* パピプペポ上書き */
body.page-template-template-papipupepo .pcal-header,
body.page-template-template-papipupepo .pcal-event-item { background: #e91e8c; }
body.page-template-template-papipupepo .pcal-cell.pcal-today .pcal-day-num { background: #e91e8c; }

/* KACHIDOKI 上書き（リデザイン版） */
body.page-template-template-kachidoki .pcal-header { background: #E8559A; }
body.page-template-template-kachidoki .pcal-event-item { background: rgba(232,85,154,.75); }
body.page-template-template-kachidoki .pcal-cell.pcal-today .pcal-day-num { background: #E8559A; }
body.page-template-template-kachidoki #pcycle-cal-wrap { background: #1e0e1a; }
body.page-template-template-kachidoki .pcal-cell { border-color: rgba(232,85,154,.12); background: #1e0e1a; }
body.page-template-template-kachidoki .pcal-cell.pcal-empty { background: #160b12; }
body.page-template-template-kachidoki .pcal-day-num { color: #f8e6f0; }
body.page-template-template-kachidoki .pcal-th { background: rgba(232,85,154,.12); color: #c49ab5; }

/* TASTYROSE カレンダー */
body.page-template-template-tastyrose .pcal-header { background: #1a1a1a; border-bottom: 1px solid rgba(215,205,131,.3); }
body.page-template-template-tastyrose .pcal-title { color: #D7CD83; }
body.page-template-template-tastyrose .pcal-event-item { background: rgba(215,205,131,.75); }
body.page-template-template-tastyrose .pcal-event-label { color: #000; }
body.page-template-template-tastyrose .pcal-event-dot { background: rgba(0,0,0,.5); }
body.page-template-template-tastyrose .pcal-cell.pcal-today .pcal-day-num { background: #D7CD83; color: #000; }
body.page-template-template-tastyrose #pcycle-cal-wrap { background: #0a0a0a; }
body.page-template-template-tastyrose .pcal-cell { border-color: rgba(215,205,131,.1); background: #0a0a0a; }
body.page-template-template-tastyrose .pcal-cell.pcal-empty { background: #080808; }
body.page-template-template-tastyrose .pcal-day-num { color: #f0f0f0; }
body.page-template-template-tastyrose .pcal-th { background: rgba(215,205,131,.08); color: #888; }
body.page-template-template-tastyrose .pcal-modal-inner { background: #111; border-top-color: #D7CD83; }
body.page-template-template-tastyrose .pcal-modal-title { color: #f0f0f0; }
body.page-template-template-tastyrose .pcal-modal-date { color: #D7CD83; }
body.page-template-template-tastyrose .pcal-modal-venue { color: #ccc; }
body.page-template-template-tastyrose .pcal-modal-desc { color: #bbb; border-top-color: rgba(215,205,131,.2); }
body.page-template-template-tastyrose .pcal-modal-link { background: #D7CD83; color: #000; }

/* SP */
@media (max-width: 480px) {
  .pcal-event-label { font-size: 9px; }
  .pcal-day-num { width: 18px; height: 18px; font-size: 11px; }
  .pcal-cell { min-height: 42px; padding: 2px; }
}
