/*
  calendar.css based on code by Damien Cosset
  https://dev.to/damcosset/write-a-calendar-plugin-with-javascript-kk3

  source_date = "2022-11-04T14:20:09.000Z" file_version = 198;
*/
#calendar {
	--optical-left-border: 0.9em;
  /*background: #fff;*/
  /*border-radius: 4px;*/
  /*color: #222629;*/
  overflow: hidden;
  margin-top: 2em;
  /* max-width: 400px ;*/
  /* n3xt.solutions */
  display: flex;
  flex-wrap: wrap;
  gap: 2em 3em;  /* flex gap */
  font-size: 1.6rem;
  font-size: calc(100vw/22.5);  /* only one column */
  line-height: initial;
}
#calendar * {
  /* disable select  -- kudos to @arungudelli */
  user-select: none; /* supported by Chrome and Opera */
  -webkit-user-select: none; /* Safari */
  -webkit-touch-callout:none; /* iOS Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
}

#calendar.hidden {
  display: none;
}

button {
  border: none;
}

#calendar .month {
  display: inline-block;
  max-width: 18em;
  /* padding-right: 1.3em;  /*center visually, especially on smartphones*/
  margin-left: calc(var(--optical-left-border) *-1); /* remove optical left border  */
}
#calendar .header {
/*  background: #ddd; */
  height: 40px;
  line-height: 40px;
  padding-left:  var(--optical-left-border);
  text-align: left;
}

/*#calendar .header + div {
  border: 1px solid black;
}*/

#calendar .month-label {
  display: inline-block;
  font-weight: bold;
  /* n3xt.solutions */
  letter-spacing: 0.06em;
}

#calendar button {
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 23px;
  font-weight: bold;
  height: 100%;
  padding: 0 15px;
}

#calendar button:first-child {
  float: left;
}

#calendar button:last-child {
  float: right;
}

#calendar .cell {
  /*background: #fff;*/
  /*color: #5d5d5d;*/
  box-sizing: border-box;
  display: inline-block;
  padding: 10px 0;
  padding-right: 0.6em;
  text-align: right;
  width: calc(100% / 7);
  cursor: pointer;
  letter-spacing: 0;
}
#calendar .cell.past,
#calendar .cell.booked,
#calendar .cell.tentative {
	opacity: 0.25;
	transition: opacity 3s ease;
}
#calendar .month:hover .cell.past,
#calendar .month:hover .cell.booked,
#calendar .month:hover .cell.tentative {
	opacity: 0.35;
}
#calendar .cell.wd_5, 
#calendar .cell.wd_6 {
  /* n3xt.solutions */
  font-weight: bold;
}
#calendar .cell:hover,
#calendar .cell.hover {
	opacity: 1 !important;
	transition: none;
}

#calendar .cell:before {
	position: absolute;
	z-index: 1;
	margin-left: 0.5em; /*1.1em;*/
	margin-top: -0.35em;
	padding-top: 0.35em;
	padding-left: 0em;
	padding-right: 0.05em;
	content:  attr(data-day);
	height: 1.45em;
	width:  2em;
	height:  2em;
	background-color: transparent;
	border-radius: 2em;
	color: transparent;
	text-align: center;
	font-weight: bold;
	display: none;
	transition: none;
}
#calendar .cell.past:before,
#calendar .cell.booked:before,
#calendar .cell.tentative:before {
	display: block;
	background-color: red;
	color: white;
	cursor: default;
	visibility: hidden;
}
/*#calendar .cell.tentative:before {
	background-color: #eded33;
}*/
#calendar .cell.past:hover:before,
#calendar .cell.booked:hover:before,
#calendar .cell.tentative:hover:before,
#calendar .cell.past.hover:before,
#calendar .cell.booked.hover:before,
#calendar .cell.tentative.hover:before {
	visibility: visible;
	opacity: 1;
}
#calendar .cell.past.hover.out:before,
#calendar .cell.booked.hover.out:before,
#calendar .cell.tentative.hover.out:before {
    opacity: 0;
    transition: opacity 0.2s ease-in;
}
/*#calendar .cell.extended_duration:after {
  content: "=";
  background-color: red;
  color: transparent;
  position: absolute;
  width: 2.5em;
  z-index: 0;
  margin-left: -0.5em;
  height: 2em;
  margin-top: -0.35em;
}*/
/*#calendar .cell.tentative:before {
  display: block;
  background-color: #eded33;
  color: black;
  cursor: default;
}*/
/*#calendar.grey .cell.booked:before,
#calendar.grey .cell.tentative:before {
    display: block;
    background-color: #dbd7d7;
    color: white;
    cursor: default;
}*/
/*#calendar .cell.tentative.extended_duration:after {
  background-color: #eded33;
}*/
/*#calendar.green .cell:not(.empty):not(.booked):not(.tentative):before {*/
    /* content: "O"; *//*
    display: block;
    background-color: #4caf50;
    color: white;
    cursor: default;
}*/
/*#calendar.green .cell.booked:before,
#calendar.green .cell.tentative:before {
    display: none;
}*/
#calendar .cell:not(.empty):not(.booked):not(.tentative):not(.past):hover:before,
#calendar .cell.hover:not(.empty):not(.booked):not(.tentative):not(.past):before {
  display: block;
  z-index: 100;
  content: "+";
  margin-top: -0.75em;
  margin-left: -0.4em; /*-0.15em;*/
  padding-top: 0.25em;
  color: white;
  background-color: green;
  box-shadow: 5px 5px 16px #00800030;
  border: 1px solid var(--background-color);
  font-size: 2.5em;
  transform: scale(100%);
  opacity: 1;
  transition: opacity 0.2s 0.3s ease-in, transform 0.2s 0.3s ease-in;
}
#calendar .day {
  font-size: 0.8rem;
  padding: 8px 0;
}

#calendar .cell.today {
  background-color: blue;
  color: white;
}

#calendar .day {
  color: black;
}

/*#calendar .day:nth-child(6) {

}*/
@media only screen and (pointer: fine) and (min-width: 640px) {
  #calendar {
    font-size: calc(100vw/46); /* two columns */
  }
}
@media only screen and (pointer: fine) and (min-width: 740px) {
  #calendar {
    font-size: 1.7em;
  }
  #calendar .cell:not(.empty):not(.booked):not(.tentative):not(.past):hover:before {
    display: block;
    margin-top: -0.45em;
    margin-left: 0.35em; /*0.4em;*/
    padding-top:  0.2em;
    padding-left: 0em;
    padding-right: 0em;
    font-size: 1.1em;
  }
	#calendar.grey .cell.booked:hover:before,
	#calendar.grey .cell.tentative:hover:before {
		/* on hover, the grey bullets turn white with a diagonal strike thru */
    content: "|";
    font-size: 3.5em;
    font-weight: 500;
    text-align: center;
    padding-left: 0.055em;
    width: 0.55em;
    height: 0.55em;
    line-height: 0em;
    margin-left: 0.15em;
    margin-top: -0.1em;
    background-color: red;
    transform: rotate(41deg);
  }
}
@media only screen and (pointer: coarse) and (min-width: 768px) {
  #calendar {
    font-size: calc(100vw/56); /* two columns */
  }
}
@media only screen and (pointer: fine) and (min-width: 740px) {
  #calendar {
    /*font-size: 1.7em;*/  /* definition above for touch devices */
    font-size: calc(100vw/55);  /* three columns */
  }
	#calendar .header {
    text-align: center;
  }
}
@media only screen and (pointer: coarse) and (min-width: 1024px) {
  #calendar {
    font-size: calc(100vw/55); /* three columns */
  }
}
@media only screen and (pointer: fine) and (min-width: 1024px) {
  #calendar {
    font-size: calc(100vw/84); /* three columns */
  }
}@media only screen and (min-width: 1200px) {
  #calendar {

    /*font-size: 0.8em;*/
    font-size: calc(100vw/77); /* three columns */
    /* month row uses max width, more than regular text columns */
    margin-left:  -15%;
    margin-right: -15%;
    margin-top: 4em;
  }
}
@media (hover: none) {
  /* suppress :hover pseudo class on touchscreen devices -- kudos to Hải Bùi https://stackoverflow.com/a/64553121 */
  #calendar .cell:not(.empty):not(.booked):not(.tentative):not(.hover):not(.past):hover:before,
  #calendar.scrolled .cell:not(.empty):not(.booked):not(.tentative):not(.past):hover:before {
    opacity: 0;
    transform: scale(0%);
  }
}
