.calendar-container {
  width: 100%;
  box-sizing: border-box;
}

.calendar-switch,
.calendar-month {
  display: none;
}
  
.calendar-switch:checked+.calendar-month {
  display: block;
  border-top: 1px solid #e3e3e3;
}

.calendar-top-bar {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  padding-block: 14px;
}

.calendar-title {
  font-size: 1.7rem;
  font-weight: bold;
  text-align: center;
  flex-grow: 1;
  line-height: 1;
}
.calendar-title span {
  font-size: 2.5rem;
}

.calendar-btn {
  background: #f5f5fd;
  padding: 6px 0;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  border-radius: 9999px;
  font-weight: bold;
  display: flex;
  justify-content: center;
}
.calendar-btn span {
  display: inline-flex;
  align-items: center;
}
.calendar-btn-next span::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-top: solid 2px var(--font-color);
  border-right: solid 2px var(--font-color);
  transform: rotate(45deg);
  margin-left: 3px;
}
.calendar-btn-prev span::before {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-top: solid 2px var(--font-color);
  border-left: solid 2px var(--font-color);
  transform: rotate(-45deg);
  margin-right: 3px;
}

.calendar-grid {
  border-top: 1px solid #e3e3e3;
  width: 100%;
  position: relative;
}

.calendar-header-row {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #214752;
}

.calendar-row {
  display: flex;
  width: 100%;
  position: relative;
  height: 165px;
}
.calendar-row.row4 {
  height: 205px;
}

.calendar-cell {
  width: calc(100% / 7);
  box-sizing: border-box;
  border-bottom: 1px solid #e3e3e3;
  padding: 10px 5px;
  font-family: var(--font-family-en);
  font-weight: bold;
  text-align: center;
  font-size: min(3.8vw, 18px);
}
.calendar-header-row .calendar-cell {
  border-bottom: none;
  font-family: inherit;
}

.calendar-header {
  font-weight: bold;
  min-height: auto;
  padding: 14px 5px;
  font-size: 1.5rem;
}

.cell-sat {
  color: #2196F3;
}

.cell-sun {
  color: #F44336;
}

.calendar-event-bar {
  position: absolute;
  line-height: 1.3;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 4px 6px;
  cursor: pointer;
  box-sizing: border-box;
  z-index: 10;
  min-height: 37px;
  display: flex;
  align-items: center;
}
.calendar-event-bar span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.calendar-event-bar.pos-1 {
  top: 40px;
}
.calendar-event-bar.pos-2 {
  top: 80px;
}
.calendar-event-bar.pos-3 {
  top: 120px;
}
.calendar-event-bar.pos-4 {
  top: 160px;
}

.calendar-event-bar.start-dow-0 {
  left: 2px;
}
.calendar-event-bar.start-dow-1 {
  left: calc(100% / 7 * 1 + 2px);
}
.calendar-event-bar.start-dow-2 {
  left: calc(100% / 7 * 2 + 2px);
}
.calendar-event-bar.start-dow-3 {
  left: calc(100% / 7 * 3 + 2px);
}
.calendar-event-bar.start-dow-4 {
  left: calc(100% / 7 * 4 + 2px);
}
.calendar-event-bar.start-dow-5 {
  left: calc(100% / 7 * 5 + 2px);
}
.calendar-event-bar.start-dow-6 {
  left: calc(100% / 7 * 6 + 2px);
}

.calendar-event-bar.days-1 {
  width: calc(100% / 7 * 1 - 4px);
}
.calendar-event-bar.days-2 {
  width: calc(100% / 7 * 2 - 4px);
}
.calendar-event-bar.days-3 {
  width: calc(100% / 7 * 3 - 4px);
}
.calendar-event-bar.days-4 {
  width: calc(100% / 7 * 4 - 4px);
}
.calendar-event-bar.days-5 {
  width: calc(100% / 7 * 5 - 4px);
}
.calendar-event-bar.days-6 {
  width: calc(100% / 7 * 6 - 4px);
}
.calendar-event-bar.days-7 {
  width: calc(100% / 7 * 7 - 4px);
}

.calendar-event-bar.yellow {
  background-color: #fff2c5;
}
.calendar-event-bar.blue {
  background-color: #cbe7eb;
}
.calendar-event-bar.red {
  background-color: #f7e3e4;
}
.calendar-event-bar.purple {
  background-color: #e4e0f1;
}


@media screen and (min-width: 768px) {

.calendar-top-bar {
  grid-template-columns: 80px 1fr 80px;
  padding-block: 30px;
}

.calendar-title {
  font-size: 1.8rem;
}
.calendar-title span {
  font-size: 3rem;
}

.calendar-btn {
  font-size: 1.8rem;
  transition: opacity 0.3s ease;
}
.calendar-btn:hover {
  opacity: 0.7;
}
.calendar-btn-next span::after {
  width: 5px;
  height: 5px;
  margin-left: 4px;
}
.calendar-btn-prev span::before {
  width: 5px;
  height: 5px;
  margin-right: 4px;
}

.calendar-cell {
  text-align: left;
}
.calendar-header-row .calendar-cell {
  text-align: center;
}

.calendar-row {
  height: 170px !important;
}

.calendar-event-bar {
  height: 22px;
  line-height: 22px;
  font-size: 1.3rem;
}

.calendar-event-bar.pos-1 {
  top: 45px;
}
.calendar-event-bar.pos-2 {
  top: 75px;
}
.calendar-event-bar.pos-3 {
  top: 105px;
}
.calendar-event-bar.pos-4 {
  top: 135px;
}

.calendar-event-bar {
  height: 24px;
  line-height: 24px;
  font-size: 1.3rem;
  font-weight: normal;
  padding: 0 6px;
  overflow: hidden;
  min-height: auto;
  transition: opacity 0.3s ease;
}
.calendar-event-bar span {
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event-bar:hover {
  opacity: 0.7;
}

.calendar-event-bar.start-dow-0 {
  left: 6px;
}
.calendar-event-bar.start-dow-1 {
  left: calc(100% / 7 * 1 + 6px);
}
.calendar-event-bar.start-dow-2 {
  left: calc(100% / 7 * 2 + 6px);
}
.calendar-event-bar.start-dow-3 {
  left: calc(100% / 7 * 3 + 6px);
}
.calendar-event-bar.start-dow-4 {
  left: calc(100% / 7 * 4 + 6px);
}
.calendar-event-bar.start-dow-5 {
  left: calc(100% / 7 * 5 + 6px);
}
.calendar-event-bar.start-dow-6 {
  left: calc(100% / 7 * 6 + 6px);
}

.calendar-event-bar.days-1 {
  width: calc(100% / 7 * 1 - 12px);
}
.calendar-event-bar.days-2 {
  width: calc(100% / 7 * 2 - 12px);
}
.calendar-event-bar.days-3 {
  width: calc(100% / 7 * 3 - 12px);
}
.calendar-event-bar.days-4 {
  width: calc(100% / 7 * 4 - 12px);
}
.calendar-event-bar.days-5 {
  width: calc(100% / 7 * 5 - 12px);
}
.calendar-event-bar.days-6 {
  width: calc(100% / 7 * 6 - 12px);
}
.calendar-event-bar.days-7 {
  width: calc(100% / 7 * 7 - 12px);
}

}



 
.c-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto; 
  -webkit-overflow-scrolling: touch;
  padding: 30px 0;
  box-sizing: border-box;
}

.c-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.c-modal-loading {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
  font-family: var(--font-family-en);
  letter-spacing: 0.1em;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-in-out, visibility 0.15s;
}

.c-modal-loading.is-active {
  opacity: 1;
  visibility: visible;
}

.c-modal-content {
  position: relative;
  background: #fff;
  width: 90%;
  padding: 30px;
  box-sizing: border-box;
  z-index: 10;
  margin: auto; 
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-in-out, visibility 0.25s;
}

.c-modal-content.is-open-content {
  opacity: 1;
  visibility: visible;
}

.c-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 30px;
  background: var(--font-color);
  z-index: 20;
}
.c-modal-close::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transform: rotate(45deg);
  position: absolute;
  top: 50%;
  left: 3px;
}
.c-modal-close::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transform: rotate(-45deg);
  position: absolute;
  top: 50%;
  right: 3px;
}

.c-modal-event-date {
  font-size: 1.3rem;
  font-weight: 500;
  font-family: var(--font-family-en);
}
.c-modal-event-title {
  font-size: 2rem;
  font-weight: 500;
  margin-top: 0.7em;
  line-height: 1.4;
}
.c-modal-event-text {
  font-size: 1.5rem;
  line-height: 1.7;
  margin-top: 1.1em;
  text-align: justify;
}

.c-modal-event-img {
  width: 100%;
  height: auto;
  margin-top: 26px;
}



@media screen and (min-width: 768px) {
.c-modal-content {
  max-width: 750px;
  padding: 70px;
}

.c-modal-close {
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.c-modal-close:hover {
  opacity: 0.7;
}

.c-modal-event-date {
  font-size: 1.5rem;
}

.c-modal-event-title {
  font-size: 2.6rem;
}
.c-modal-event-text {
  font-size: 1.6rem;
}


}
