:root {
  --sdp-selected: #005fcc;
  --sdp-selected-invert: #ffffff;
  --sdp-prev-month: #888888;
  --sdp-next-month: #888888;
  --sdp-disabled: #1010104d;
  --sdp-disabled-invert: #ffffff;
  --sdp-background: #ffffff;
  --sdp-border: #dddddd;
  --sdp-shadow: 0deg 0% 50%;
  --sdp-icon: #4a4a4acc;
  --sdp-nav-button-background: #f5f5f5;
  --sdp-nav-button-background-hover: #eeeeee;
  --sdp-days-of-week: #4a4a4a;
}

@keyframes fadeIn {
  from {
    transform: translateY(-40px) scale(0.75);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(-40px) scale(0.75);
    opacity: 0;
  }
}

[data-controller="datepicker"] {
  position: relative;
}
.sdp-cal {
  z-index: 1;
  position: absolute;
  margin-top: 5px;
  box-sizing: border-box;
  width: fit-content;
  border: 1px solid var(--sdp-border);
  border-radius: 5px;
  padding: 15px;
  background: var(--sdp-background);
  box-shadow: 0 1.25em 1.25em -0.9375em hsl(var(--sdp-shadow) / 0.3);
}
.sdp-cal.fade-in {
  animation: fadeIn 0.1s ease-out;
}
.sdp-cal.fade-out {
  animation: fadeOut 0.1s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .sdp-cal.fade-in, .sdp-cal.fade-out {
    animation: none;
  }
}
.sdp-cal button {
  border: none;
  background: none;
  padding: 0;
}

.sdp-nav {
  margin-bottom: 1.2em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sdp-nav-dropdowns, .sdp-nav-buttons {
  display: flex;
}
.sdp-nav-dropdowns select {
  -moz-appearance: none;
  -webkit-appearance: none;
  background: var(--sdp-background);
  color: currentColor;
  padding: 1px 12px 1px 1px;
  border: 1px solid transparent;
  font-size: 1.1em;
  font-weight: 500;
  cursor: pointer;
}
.sdp-nav-dropdowns > div {
  display: flex;
  align-items: center;
}
.sdp-nav-dropdowns > div::after {
  content: " ";
  border: 2px solid var(--sdp-icon);
  border-top: 0;
  border-right: 0;
  width: 0.3em;
  height: 0.3em;
  transform: translateY(-1px) rotate(-45deg);
  right: 10px;
  position: relative;
}
.sdp-nav-buttons button {
  display: flex;
  place-content: center;
  place-items: center;
  border-radius: 50%;
  width: 1.5em;
  height: 1.5em;
  color: var(--sdp-icon);
  background-color: var(--sdp-nav-button-background);
  cursor: pointer;
}
.sdp-nav-buttons button:hover {
  background-color: var(--sdp-nav-button-background-hover);
}
.sdp-nav-buttons svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  width: 0.75em;
  height: 0.75em;
}
.sdp-goto-today {
  margin-left: 0.3em;
  margin-right: 0.3em;
}

.sdp-days-of-week, .sdp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  place-items: center;
  gap: 0.3em;
}
.sdp-days-of-week {
  margin-bottom: 0.7em;
}
.sdp-days-of-week div {
  text-transform: uppercase;
  font-size: 0.8em;
  color: var(--sdp-days-of-week);
  font-weight: 600;
}

.sdp-days button {
  width: 4.5ch;
  height: 4.5ch;
  border-radius: 50%;
  background-color: transparent;
}
.sdp-days button:not([aria-disabled]) {
  color: currentColor;
  cursor: pointer;
}
.sdp-days button[aria-disabled] {
  color: var(--sdp-disabled);
}

.sdp-days button:not([aria-disabled]).sdp-selected {
  background-color: var(--sdp-selected);
  color: var(--sdp-selected-invert);
}
.sdp-days button[aria-disabled].sdp-selected {
  background-color: var(--sdp-disabled);
  color: var(--sdp-disabled-invert);
}

.sdp-days button:not([aria-disabled]).sdp-today {
  border: 1px solid var(--sdp-selected);
}
.sdp-days button[aria-disabled].sdp-today {
  border: 1px solid var(--sdp-disabled);
}

/* Ideally we would use outline and outline-offset for the :hover and :focus
 * styles.  But Safari's outline doesn't follow the border-radius; it is square.
 * https://bugs.webkit.org/show_bug.cgi?id=231433
 * https://bugs.webkit.org/show_bug.cgi?id=20807
 */
.sdp-days button:hover,
.sdp-days button:focus {
  outline: none;
}

.sdp-days button:not([aria-disabled]):hover,
.sdp-days button:not([aria-disabled]):focus {
  border: 2px solid var(--sdp-selected);
}
.sdp-days button[aria-disabled]:hover,
.sdp-days button[aria-disabled]:focus {
  border: 2px solid var(--sdp-disabled);
}

.sdp-days button:not([aria-disabled]).sdp-selected:hover,
.sdp-days button:not([aria-disabled]).sdp-selected:focus {
  border: 2px solid var(--sdp-selected-invert);
  box-shadow: 0 0 0 2px var(--sdp-selected);
}
.sdp-days button[aria-disabled].sdp-selected:hover,
.sdp-days button[aria-disabled].sdp-selected:focus {
  border: 2px solid var(--sdp-disabled-invert);
  box-shadow: 0 0 0 2px var(--sdp-disabled);
}

.sdp-days button:not([aria-disabled]).sdp-today:hover,
.sdp-days button:not([aria-disabled]).sdp-today:focus {
  border: 2px solid var(--sdp-selected);
}
.sdp-days button[aria-disabled].sdp-today:hover,
.sdp-days button[aria-disabled].sdp-today:focus {
  border: 2px solid var(--sdp-disabled);
}

.sdp-days button:not([aria-disabled]).sdp-prev-month {
  color: var(--sdp-prev-month);
}
.sdp-days button:not([aria-disabled]).sdp-next-month {
  color: var(--sdp-next-month);
}
.sdp-days button[aria-disabled].sdp-prev-month,
.sdp-days button[aria-disabled].sdp-next-month {
  color: var(--sdp-disabled);
}
