#advent-calendar {
  --fir: #23483b;
  --cranberry: #982a3c;
  display: grid;
  gap: clamp(.5rem, 1.1vw, .875rem);
  list-style: none;
  padding: 0;
}

/* Each second row starts with the opposite colour at every grid width. */
@media (width <= 440px) {
  #advent-calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #advent-calendar > :nth-child(even) { --door-face: var(--cranberry); }
}
@media (440px < width <= 1000px) {
  #advent-calendar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #advent-calendar > :is(:nth-child(8n + 2), :nth-child(8n + 4), :nth-child(8n + 5), :nth-child(8n + 7)) {
    --door-face: var(--cranberry);
  }
}
@media (width > 1000px) {
  #advent-calendar { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #advent-calendar > :is(:nth-child(12n + 2), :nth-child(12n + 4), :nth-child(12n + 6),
                         :nth-child(12n + 7), :nth-child(12n + 9), :nth-child(12n + 11)) {
    --door-face: var(--cranberry);
  }
}

#advent-calendar .calendar-day {
  position: relative;
  padding: clamp(1.05rem, 2.4vw, 1.8rem) .35rem;
  text-align: center;
  color: #fff8e9;
  background: var(--door-face, var(--fir));
  border: 1px solid transparent;
}
#advent-calendar .calendar-day::before {
  content: "";
  position: absolute;
  inset: .28rem;
  border: 1px solid var(--door-frame, rgb(244 221 162 / .52));
  pointer-events: none;
}
#advent-calendar .calendar-day span {
  display: block;
  font: 400 clamp(2.35rem, 4.1vw, 3.25rem)/1 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
}
#advent-calendar .calendar-day small {
  display: block;
  margin-top: .45rem;
  font-size: .8125rem;
  line-height: 1.35;
  letter-spacing: 0;
}
#advent-calendar .calendar-day strong {
  display: block;
  margin-top: .55rem;
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

#advent-calendar .is-published {
  --door-frame: #a58243;
  color: #193d32;
  background: #f5e1ac;
  border-color: var(--door-frame);
}
#advent-calendar .is-published a { display: block; color: inherit; text-decoration: none; }
#advent-calendar .is-published a::after { content: ""; position: absolute; inset: 0; }
#advent-calendar .is-published a:focus-visible::after { outline: 3px solid currentColor; outline-offset: 2px; }
#advent-calendar .is-published strong { font-weight: 600; text-decoration: underline; text-underline-offset: .18em; }
#advent-calendar .is-published a:hover strong { text-decoration-thickness: 2px; }

.advent-scenes { margin: 1.25rem 0 2rem; }
.advent-scene { padding: .9rem 0; border-bottom: 1px solid currentColor; scroll-margin-top: 1rem; }
.advent-scene summary { cursor: pointer; font-weight: 600; }
.advent-scene summary:focus-visible, .advent-player a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.advent-scene audio { display: block; width: min(100%, 36rem); margin: .8rem 0; }
.advent-player { --red: #982a3c; margin: 0; padding: 1rem; color: #292325; background: white; font: 1rem/1.45 system-ui, sans-serif; }
.advent-player h1 { margin: 0 0 .8rem; font: 2rem/1.1 Georgia, serif; }
.advent-player a { color: #842639; }

/* Give the released story priority over the unopened doors. */
.advent-scene[open] {
  margin-block: 1rem;
  padding: clamp(1.1rem, 2.5vw, 2rem);
  border: 1px solid #c5c6b5;
  border-inline-start: .3rem solid #982a3c;
  background: #f2efe4;
  color: #193d32;
}
.advent-scene[open] summary { font-size: clamp(1.2rem, 2.2vw, 1.7rem); line-height: 1.25; }
.advent-scene[open] p { max-width: 56ch; margin: .8rem 0 0; }
.advent-scene[open] a { color: #772335; text-underline-offset: .18em; }
