/* Two-colour printed wall calendar: teal drum for type and rules, coral drum for weekends and marks.
   Coral is always multiplied over what is under it, so marks overprint instead of covering. */
.dp {
  --paper: #f0e9d6;
  --teal: #0a6c74;
  --coral: #ff5a4a;
  position: relative;
  box-sizing: border-box;
  width: 540px;
  height: 540px;
  padding: 22px 25px;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
  color: var(--teal);
  font-family: "Bodoni Moda Variable", serif;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* paper tooth: speckles the ink the way a soy-ink drum does */
.dp::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='270' height='270'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.96 0 0 0 0 0.86 0 0 0 -2.6 1.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
}

.dp-head {
  position: relative;
  height: 124px;
}

.dp-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding-top: 8px;
  font-weight: 400;
  line-height: 1;
}

.dp-month {
  margin-left: -5px;
  font-size: 112px;
  letter-spacing: -0.04em;
}

.dp-year {
  /* pull the trailing tracking back so the last figure sits on the grid edge */
  margin-right: -0.06em;
  font-size: 16px;
  letter-spacing: 0.06em;
}

.dp-nav {
  position: absolute;
  top: 3px;
  right: 0;
  display: flex;
}

.dp-step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 0 0 -1px;
  padding: 0;
  border: 1px solid var(--teal);
  border-radius: 0;
  background: none;
  color: inherit;
  transition: background-color 120ms;
}

.dp-step:hover {
  background: color-mix(in srgb, var(--coral) 30%, transparent);
}

.dp-step:focus-visible {
  outline: 1px solid var(--teal);
  outline-offset: 2px;
}

.dp-arrow {
  width: 18px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.dp-arrow[data-flip] {
  transform: scaleX(-1);
}

.dp-grid {
  width: 490px;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.dp-grid tr {
  border-top: 1px solid var(--teal);
}

.dp-weekday {
  height: 31px;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 31px;
  text-align: center;
}

.dp-weekday abbr {
  text-decoration: none;
}

.dp-day {
  position: relative;
  height: 67px;
  padding: 0;
  outline: 0;
  font-size: 36px;
  font-variation-settings: "opsz" 22;
  line-height: 67px;
  text-align: center;
}

.dp [data-weekend] {
  color: var(--coral);
}

.dp-day[data-outside] .dp-num {
  opacity: 0.34;
}

/* today: a hairline box off the teal drum */
.dp-day[data-today] {
  background: linear-gradient(var(--teal), var(--teal)) 7px 6px / 56px 1px no-repeat,
    linear-gradient(var(--teal), var(--teal)) 7px 61px / 56px 1px no-repeat,
    linear-gradient(var(--teal), var(--teal)) 7px 6px / 1px 56px no-repeat,
    linear-gradient(var(--teal), var(--teal)) 62px 6px / 1px 56px no-repeat;
}

/* hover: a 45° halftone tint; selected: the same block printed solid */
.dp-day::before,
.dp-day::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  width: 56px;
  height: 56px;
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
}

.dp-day::before {
  background-image: radial-gradient(circle, var(--coral) 0 1.6px, transparent 2px),
    radial-gradient(circle, var(--coral) 0 1.6px, transparent 2px);
  background-position: 0 0, 4px 4px;
  background-size: 8px 8px;
  transition: opacity 140ms ease-out;
}

.dp-day:hover::before {
  opacity: 1;
}

.dp-day::after {
  background: var(--coral);
  transform: translate(1px, -1px) scale(1.16);
  /* leaving: fade in place, then reset the stamp scale once it is invisible */
  transition: opacity 220ms ease-out, transform 0s 220ms;
}

.dp-day[data-selected]::after {
  opacity: 0.94;
  transform: translate(1px, -1px);
  transition: opacity 220ms ease-out, transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

.dp-day[data-selected]::before {
  opacity: 0;
}

.dp-day[data-selected] .dp-num {
  color: var(--teal);
}

.dp-day:focus-visible {
  outline: 1px solid var(--teal);
  outline-offset: -3px;
}
