@charset "UTF-8";

:root {
  --primary-color: #4bc9c1;
  --secondary-color: #e8e8e8;
  --black: #333;
  --gray: #e8e8e8;
  --white: #fff;
  --border-color: #d5d7db;
  --bg-other-month: #f5f5f5;
  --saturday-text: #0059b3;
  --saturday-bg: #e6f2ff;
  --sunday-text: #cc0000;
  --sunday-bg: #ffebeb;
  --today-bg: #fff2a8;
  --toggle-bg: #f3f4f6;
  --toggle-text: #030712;
  --toggle-hover-bg: #f9fafb;
  --toggle-border: #e5e7eb;
  --info-bg: #f5f5f5;
  --info-border: #d6d6d6;
  --info-border-dashed: #bbb;
  --notice-red-bg: #fff1f1;
  --notice-red-border: #e53935;
  --notice-red-text: #b71c1c;
  --notice-orange-bg: #fff7e6;
  --notice-orange-border: #fb8c00;
  --notice-orange-text: #e65100;
  --tel-link-color: #1565c0;
}

.c-calendar {
  max-width: 1000px;
  margin-inline: auto;
}

/*--------------------------------------------------
  calendar controls
--------------------------------------------------*/
.c-calendar-header {
  display: grid;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  grid-template-areas: "buttons date toggle";
  grid-template-columns: auto auto 1fr;
}

.calendar-date {
  font-size: 16px;
  color: var(--black);
  grid-area: date;
}

.nav-buttons {
  grid-area: buttons;
  display: flex;
  gap: 10px;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  cursor: pointer;
  background-color: var(--white);
  transition: all 0.3s ease;
  user-select: none;
  border: 1px solid var(--toggle-border);
  border-radius: 4px;
}

.nav-button:hover {
  background-color: var(--toggle-hover-bg);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-icon {
  width: 18px;
}

.c-calendar-toggle {
  grid-area: toggle;
}

/*--------------------------------------------------
  calendar table
--------------------------------------------------*/
.calendar-month,
.calendar-week {
  overflow-y: auto;
}

.calendar-week {
  display: none;
}

.c-calendar-table {
  border-collapse: collapse;
  border-left: solid 1px var(--border-color);
  border-top: solid 1px var(--border-color);
  width: 100%;
  table-layout: fixed;
}

.c-calendar-table th,
.c-calendar-table td {
  font-size: 14px;
  text-align: center;
  width: calc(100% / 7);
  border-right: solid 1px var(--border-color);
  border-bottom: solid 1px var(--border-color);
}

.c-calendar-table th {
  border-bottom: none;
  padding: 8px 0;
}

.c-calendar-table td .label {
  display: block;
  border-radius: 5px;
  padding: 6px 8px;
  margin-right: 4px;
  margin-bottom: 2px;
  font-size: 11px;
  text-align: left;
  line-height: 1.25;
}

.c-calendar-table td .name {
  mix-blend-mode: color-burn;
}

.c-calendar-table .date {
  padding: 8px 0;
}

.c-calendar-table .schedule {
  vertical-align: top;
  height: 150px;
}

.c-calendar-table .schedule.other-month {
  background-color: var(--bg-other-month);
}

.c-calendar-table .saturday {
  color: var(--saturday-text);
  background-color: var(--saturday-bg);
}

.c-calendar-table .sunday,
.c-calendar-table .holiday {
  color: var(--sunday-text);
  background-color: var(--sunday-bg);
}

.c-calendar-table .today,
.c-calendar-table .today.sunday,
.c-calendar-table .today.saturday,
.c-calendar-table .today.holiday {
  color: inherit;
  background-color: var(--today-bg);
}

/*--------------------------------------------------
  toggle-button
--------------------------------------------------*/
.toggle-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 180px;
  border: 3px solid var(--toggle-bg);
  border-radius: 20px;
  background: var(--toggle-bg);
  cursor: pointer;
  margin-left: auto;
}

.toggle-container::before {
  content: "";
  position: absolute;
  width: 50%;
  height: 100%;
  top: -1px;
  left: 0%;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.toggle-checkbox:checked + .toggle-container::before {
  left: 50%;
}

.toggle-container .label {
  padding: 6px;
  text-align: center;
  z-index: 1;
  font-size: 14px;
}

.toggle-checkbox {
  display: none;
}

.toggle-checkbox + .toggle-container .label:last-child,
.toggle-checkbox:checked + .toggle-container .label:first-child {
  color: var(--toggle-text);
  transition: color 0.3s;
}

/*--------------------------------------------------
  loading
--------------------------------------------------*/
.loading {
  position: relative;
  height: 150px;
}

.loading::before {
  content: "読み込み中";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 40px);
}

.loading::after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border: 5px solid var(--black);
  border-right: 5px solid transparent;
  border-radius: 50%;
  animation: loading 2s linear infinite;
}

@keyframes loading {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
    opacity: 0.3;
  }
}

/*--------------------------------------------------
  info
--------------------------------------------------*/
.reception-info {
  max-width: 720px;
  margin: 20px auto;
  padding: 16px 20px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 8px;
  line-height: 1.8;
  text-align: center;
}

.reception-info .main-time {
  font-size: 18px;
  margin-bottom: 10px;
}

.reception-info .main-time .time {
  font-size: 20px;
  font-weight: 700;
  margin-left: 6px;
}

.reception-info .main-time .reserve {
  font-size: 14px;
  margin-left: 6px;
}

.reception-info .notice {
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0;
  font-size: 15px;
}

.reception-info .ml {
  display: inline-block;
  margin-left: 16px;
}

.reception-info .notice.red {
  background: var(--notice-red-bg);
  border-left: 5px solid var(--notice-red-border);
  color: var(--notice-red-text);
}

.reception-info .notice.orange {
  background: var(--notice-orange-bg);
  border-left: 5px solid var(--notice-orange-border);
  color: var(--notice-orange-text);
}

.reception-info .notice .triangle {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
}

.reception-info .clinic {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--info-border-dashed);
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
}

.reception-info .clinic .name {
  font-size: 16px;
}

.reception-info .clinic .tel {
  font-size: 16px;
  color: var(--tel-link-color);
}

/*--------------------------------------------------
  responsive
--------------------------------------------------*/
@media screen and (max-width: 768px) {
  .c-calendar-header {
    grid-template-areas: "date date" "buttons toggle";
    grid-template-columns: auto;
    gap: 16px 20px;
  }

  .toggle-container {
    margin-left: 0;
  }

  .c-calendar-table {
    width: 720px;
  }

  .c-calendar-table .schedule {
    height: 80px;
  }

  .c-calendar-table th {
    padding: 5px 0 0;
  }

  .c-calendar-table .date {
    padding: 5px 0;
  }

  .toggle-container {
    width: 150px;
    margin-inline: auto;
  }

  .reception-info {
    padding: 10px 16px;
    text-align: left;
  }

  .reception-info .main-time {
    font-size: 16px;
    text-align: center;
  }

  .reception-info .main-time .reserve {
    display: block;
  }
}
