/* =========================================================
   Calendar page（月間グリッド）
   - セル・バーは gap / border-radius なし
   ========================================================= */

.iw-cal-wrap {
  margin: 0 10px;
}

.iw-cal-page-title {
  margin: 20px 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.iw-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
}

.iw-cal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.iw-cal-nav {
  text-decoration: none;
  font-weight: 800;
  padding: 10px 14px;
  border: none;
  border-radius: 0;
  background: #2196f3;
  color: #fff;
  font-size: 13px;
}

.iw-cal-nav:hover {
  background: #1976d2;
  color: #fff;
}

.iw-cal-legend {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f6f8fb;
  border: 1px solid #e6eaf0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #333;
}

.iw-cal-legend__line {
  margin: 0;
}

.iw-cal-legend__line+.iw-cal-legend__line {
  margin-top: 2px;
}

.iw-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin: 0;
  border: 1px solid #d0d4dc;
  border-bottom: 0;
}

.iw-cal-week__cell {
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  padding: 8px 4px;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}

.iw-cal-week__cell:last-child {
  border-right: 0;
}

.iw-cal-week__cell--0 {
  background: #f06292;
}

.iw-cal-week__cell--1,
.iw-cal-week__cell--2,
.iw-cal-week__cell--3,
.iw-cal-week__cell--4,
.iw-cal-week__cell--5 {
  background: #8d8d8d;
}

.iw-cal-week__cell--6 {
  background: #4fc3f7;
}

.iw-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1px solid #d0d4dc;
  border-top: 1px solid #d0d4dc;
}

.iw-cal-cell {
  border-right: 1px solid #d0d4dc;
  border-bottom: 1px solid #d0d4dc;
  border-radius: 0;
  min-height: 92px;
  padding: 0;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.iw-cal-cell:nth-child(7n) {
  border-right: 0;
}

.iw-cal-cell--empty {
  background: #fafafa;
}

.iw-cal-day {
  font-weight: 800;
  font-size: 13px;
  padding: 6px 6px 4px;
  line-height: 1.2;
  color: #333;
}

.iw-cal-cell--dow-0 .iw-cal-day {
  color: #e91e63;
}

.iw-cal-cell--dow-6 .iw-cal-day {
  color: #039be5;
}

.iw-cal-tags {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  flex: 1 1 auto;
}

.iw-cal-tag {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 5px 6px;
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
}

.iw-cal-tag:hover {
  filter: brightness(0.95);
}

.iw-cal-tag--oc_event {
  background: #ec407a;
}

.iw-cal-tag--tour_event {
  background: #ff9800;
}

.iw-cal-tag--online_event {
  background: #5c6bc0;
}

.iw-cal-tag--extra_event_1 {
  background: #ab47bc;
}

.iw-cal-tag--extra_event_2 {
  background: #7e57c2;
}

/* モーダル */
.iw-cal-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 80;
}

.iw-cal-modal.is-open {
  display: block;
}

.iw-cal-modal__bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.iw-cal-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  max-height: min(80vh, 620px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
}

.iw-cal-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.iw-cal-modal__title {
  font-weight: 900;
}

.iw-cal-modal__x {
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
}

.iw-cal-item {
  display: block;
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: inherit;
}

.iw-cal-item__title {
  font-weight: 900;
}

.iw-cal-item__btn {
  margin-top: 6px;
  font-weight: 900;
  text-decoration: underline;
}

.iw-cal-item__thumbWrap {
  margin-top: 8px;
}

.iw-cal-item__thumb {
  display: block;
  width: 100%;
  height: auto;
}

.iw-cal-item__time {
  font-weight: 900;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.iw-cal-item__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.iw-cal-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12px;
  line-height: 1.4;
}

.iw-cal-status--closed {
  opacity: 0.75;
}

.iw-cal-status--full {}

.iw-cal-status--open {}

/* カレンダーページ限定：モバイル時の赤背景漏れを防ぐ */
@media (max-width: 830px) {

  body.page-calendar,
  body.page-template-page-calendar-php {
    background: #fff;
  }

  body.page-calendar .iw-bg,
  body.page-calendar .iw-shell,
  body.page-template-page-calendar-php .iw-bg,
  body.page-template-page-calendar-php .iw-shell {
    background: #fff;
  }
}