/* ============================================================
   event-calendar.css  v2.0
   テーマフォルダ直下に設置: wp-content/themes/hello-elementor/
   ============================================================ */

/* ---------- ラッパー ---------- */
.ec-wrap {
  position: relative;
  font-family: 'Noto Sans JP', sans-serif;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

/* ---------- ヘッダー（月ナビ） ---------- */
.ec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ec-month-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.02em;
  margin: 0;
}

.ec-nav-btn {
  background: none;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ec-nav-btn:hover {
  background: #f4f4f4;
  border-color: #aaa;
}

/* ---------- テーブル ---------- */
.ec-table-wrap {
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
}

.ec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ec-table tr {
  border-bottom: 1px solid #ebebeb;
}

.ec-table tr:last-child {
  border-bottom: none;
}

/* ---------- 日付セル ---------- */
.ec-day-cell {
  width: 72px;
  min-width: 72px;
  padding: 0 8px;
  vertical-align: middle;
  background: #f8f8f8;
  border-right: 1px solid #e0e0e0;
  user-select: none;
}

.ec-day-inner {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ec-day-num {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: #1a1a1a;
}

.ec-day-week {
  font-size: 0.68rem;
  color: #999;
}

/* 土・日・今日 */
.ec-day-cell.ec-sat .ec-day-num,
.ec-day-cell.ec-sat .ec-day-week { color: #1a56db; }

.ec-day-cell.ec-sun .ec-day-num,
.ec-day-cell.ec-sun .ec-day-week { color: #c81e1e; }

.ec-table tr.ec-today .ec-day-cell {
  background: #eff6ff;
}

.ec-table tr.ec-today .ec-day-num {
  color: #1a56db;
}

/* ---------- バーエリアセル ---------- */
.ec-bars-cell {
  padding: 0;
  vertical-align: stretch;
  position: relative;
  height: 36px;
}

.ec-bars-inner {
  position: absolute;
  inset: 0;
}

/* ---------- 縦バー ---------- */
.ec-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 11px;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}

.ec-bar:hover {
  opacity: 0.78;
  filter: brightness(0.95);
}

/* 開始日: 上端を丸く */
.ec-bar.ec-bar-start {
  border-radius: 6px 6px 0 0;
  top: 4px;
}

/* 終了日: 下端を丸く */
.ec-bar.ec-bar-end {
  border-radius: 0 0 6px 6px;
  bottom: 4px;
}

/* 1日のみ: 上下とも丸く */
.ec-bar.ec-bar-start.ec-bar-end {
  border-radius: 6px;
  top: 4px;
  bottom: 4px;
}

/* 中間日: 上下フラット＆隙間なし */
.ec-bar.ec-bar-mid {
  top: 0;
  bottom: 0;
  border-radius: 0;
}

/* ---------- イベントラベル ---------- */
.ec-event-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  line-height: 1.2;
}

.ec-extra-badge {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: #888;
}

.ec-event-label--click {
  pointer-events: auto;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.ec-event-label--click:hover {
  opacity: 0.75;
}

/* ---------- モーダル ---------- */
.ec-modal-bg {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
}

.ec-modal-bg.ec-open {
  display: flex;
}

.ec-modal {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px 22px;
  width: 300px;
  max-width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

.ec-modal-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ec-modal-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ec-modal-meta {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.9;
}

.ec-modal-desc {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.7;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ebebeb;
}

.ec-modal-link {
  display: block;
  margin-top: 12px;
  font-size: 0.78rem;
  color: #1a56db;
  text-decoration: none;
}

.ec-modal-link:hover {
  text-decoration: underline;
}

.ec-modal-link.ec-hidden {
  display: none;
}

.ec-modal-close {
  margin-top: 14px;
  width: 100%;
  background: none;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 7px 0;
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}

.ec-modal-close:hover {
  background: #f4f4f4;
}

/* ---------- ローディング ---------- */
.ec-loading {
  text-align: center;
  padding: 32px 0;
  color: #999;
  font-size: 0.85rem;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 480px) {
  .ec-day-cell {
    width: 58px;
    min-width: 58px;
  }

  .ec-day-num {
    font-size: 0.88rem;
  }

  .ec-event-label {
    font-size: 0.65rem;
  }

  .ec-month-title {
    font-size: 1.05rem;
  }
}
