/* 休診日カレンダー（グラフィカル） */
.holiday-cal {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  font-size: 15px;
  color: #333;
}

.closed-days-calendar-wrap {
  width: 100%;
}

.holiday-cal__banner {
  margin: 0 0 1rem;
  font-weight: 700;
  color: #0046c0;
}

.holiday-cal__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.holiday-cal__sidebar {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.holiday-cal__guide {
  margin: 0 0 0.5rem;
  line-height: 1.65;
  font-size: 0.95rem;
  text-align: left;
}

.holiday-cal__note {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: #c0392b;
  line-height: 1.5;
  text-align: left;
}

.holiday-cal__months {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.holiday-cal__month-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #c5c5c5;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.holiday-cal__month-btn:hover {
  border-color: #0046c0;
}

.holiday-cal__month-btn.is-active {
  background: #0046c0;
  border-color: #0046c0;
  color: #fff;
}

.holiday-cal__month-btn.is-active .holiday-cal__chevron {
  color: #fff;
}

.holiday-cal__chevron {
  font-size: 1.1rem;
  line-height: 1;
  color: #888;
}

.holiday-cal__main {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.holiday-cal__nav {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #888;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.holiday-cal__nav:hover {
  color: #003a9e;
}

.holiday-cal__nav.is-disabled,
.holiday-cal__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.holiday-cal__month-btn.is-hidden {
  display: none !important;
}

.holiday-cal__td.is-empty {
  background: #fafafa;
}

.holiday-cal__panel {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.holiday-cal__card {
  background: #f3efe6;
  border-radius: 12px;
  padding: 0 0 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.holiday-cal__title {
  background: #0046c0;
  color: #fff;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  letter-spacing: 0.05em;
}

.holiday-cal__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  margin: 0;
}

.holiday-cal__th {
  padding: 0.4rem 0.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.holiday-cal__th--0 {
  background: #fde8e0;
  color: #c0392b;
}

.holiday-cal__th--6 {
  background: #e0f4fa;
  color: #2980b9;
}

.holiday-cal__th--1,
.holiday-cal__th--2,
.holiday-cal__th--3,
.holiday-cal__th--4,
.holiday-cal__th--5 {
  background: #ececec;
  color: #333;
}

.holiday-cal__td {
  border: 1px solid #e8e8e8;
  padding: 0.35rem 0.25rem;
  vertical-align: top;
  height: 5rem;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.holiday-cal__td.is-closed {
  height: 6.75rem;
}

.holiday-cal__cell {
  position: relative;
  min-height: 3.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.1rem;
}

.holiday-cal__cell.is-closed-cell {
  justify-content: flex-start;
  padding: 0.25rem 0.1rem 0.15rem;
  gap: 0.15rem;
}

.holiday-cal__date {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  z-index: 1;
}

.holiday-cal__td--wd-0 .holiday-cal__date {
  color: #c0392b;
}

.holiday-cal__td--wd-6 .holiday-cal__date {
  color: #2980b9;
}

.holiday-cal__td.is-muted .holiday-cal__date {
  color: #ccc;
  font-weight: 500;
}

.holiday-cal__date-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid #e74c3c;
  background: #e74c3c;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  margin-bottom: 0.15rem;
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(231, 76, 60, 0.35);
}

.holiday-cal__badge {
  width: min(2.5rem, 88%);
  height: min(2.5rem, 88%);
  max-width: 100%;
  border-radius: 50%;
  background: #e74c3c;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 1;
}

.holiday-cal__badge-label {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.03em;
}

/* doctor-bottom span の上書き（休診カレンダー用） */
.doctor-item .doctor-bottom .holiday-cal span.holiday-cal__badge {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: min(2.5rem, 88%);
  height: min(2.5rem, 88%);
  max-width: 100%;
  margin: 0 auto;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
}

.doctor-item .doctor-bottom .holiday-cal span.holiday-cal__badge-label {
  display: inline !important;
  color: #fff !important;
  font-size: 0.58rem !important;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.doctor-item .doctor-bottom .holiday-cal span.holiday-cal__date-ring {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.75rem !important;
  height: 1.75rem !important;
  font-size: 0.95rem !important;
  font-weight: 700;
  color: #fff !important;
  border: 2px solid #e74c3c !important;
  background: #e74c3c !important;
  margin-bottom: 0.15rem;
  position: static;
  transform: none;
}

.doctor-item .doctor-bottom .holiday-cal .holiday-cal__cell.is-closed-cell {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.closed-days-calendar__loading,
.closed-days-calendar-wrap .closed-days-calendar__loading,
.holiday-cal__error {
  margin: 0;
  color: #666;
}

@media (max-width: 768px) {
  .holiday-cal__sidebar,
  .holiday-cal__main {
    max-width: 100%;
  }

  .holiday-cal__months {
    grid-template-columns: repeat(4, 1fr);
  }

  .holiday-cal__nav {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.4rem;
  }

  .holiday-cal__td {
    height: auto;
    min-height: 2.6rem;
    padding: 0.2rem 0.05rem;
  }

  /* スマホ: 休診日はセル全体を赤背景（丸が隣セルにはみ出さない） */
  .holiday-cal__td.is-closed {
    background: #e74c3c;
    height: auto;
    min-height: 2.85rem;
    vertical-align: middle;
    padding: 0.15rem 0.05rem;
  }

  .holiday-cal__td.is-closed .holiday-cal__cell.is-closed-cell {
    min-height: 0;
    padding: 0.1rem 0.05rem;
    gap: 0.05rem;
    justify-content: center;
  }

  .holiday-cal__td.is-closed .holiday-cal__date-ring,
  .doctor-item .doctor-bottom .holiday-cal .holiday-cal__td.is-closed span.holiday-cal__date-ring {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
    line-height: 1.15 !important;
    text-align: center;
  }

  .holiday-cal__td.is-closed .holiday-cal__badge,
  .doctor-item .doctor-bottom .holiday-cal .holiday-cal__td.is-closed span.holiday-cal__badge {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
  }

  .holiday-cal__td.is-closed .holiday-cal__badge-label,
  .doctor-item .doctor-bottom .holiday-cal .holiday-cal__td.is-closed span.holiday-cal__badge-label {
    font-size: 0.45rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.06em;
    white-space: nowrap;
  }

  .doctor-item .doctor-bottom .holiday-cal .holiday-cal__td.is-closed .holiday-cal__cell.is-closed-cell {
    justify-content: center !important;
    padding: 0.1rem 0.05rem !important;
    gap: 0.05rem !important;
  }
}

/* PC: 休診日の赤丸・文字を大きく（スマホのセル背景スタイルは上書きしない） */
@media (min-width: 769px) {
  .holiday-cal__td {
    height: 5.5rem;
  }

  .holiday-cal__td.is-closed {
    height: 7.75rem;
  }

  .holiday-cal__cell.is-closed-cell {
    gap: 0.25rem;
    padding: 0.35rem 0.15rem 0.2rem;
  }

  .holiday-cal__date-ring {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.2rem;
    border-width: 2px;
    margin-bottom: 0.2rem;
  }

  .holiday-cal__badge {
    width: 4rem;
    height: 4rem;
    max-width: 92%;
  }

  .holiday-cal__badge-label {
    font-size: 0.72rem;
    letter-spacing: -0.02em;
  }

  .doctor-item .doctor-bottom .holiday-cal span.holiday-cal__date-ring {
    width: 2.5rem !important;
    height: 2.5rem !important;
    font-size: 1.2rem !important;
  }

  .doctor-item .doctor-bottom .holiday-cal span.holiday-cal__badge {
    width: 4rem !important;
    height: 4rem !important;
    max-width: 92%;
  }

  .doctor-item .doctor-bottom .holiday-cal span.holiday-cal__badge-label {
    font-size: 0.72rem !important;
  }
}
