/* The calendar (templates/calendar.html) inside the overlay sheet: the
   sheet's own surface and close button; the days as a grid of round
   cells, today ringed, the picked day the ink pill's fill; the months as
   twelve pills. Tokens from tailwind/input.css. */

.cal {
  --cal-ease: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  color: var(--marketing-foreground);
  padding: 1.25rem 1.25rem 1.5rem;
}
@media (min-width: 40rem) {
  .cal { padding: 1.5rem 1.5rem 1.75rem; }
}
.cal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.cal-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.cal-title {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 1.625rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--marketing-foreground);
  cursor: pointer;
  border-radius: 0.375rem;
}
.cal-title svg { color: var(--muted-foreground); transition: translate 200ms var(--cal-ease); }
@media (hover: hover) and (pointer: fine) {
  .cal-title:hover svg { translate: 0 2px; }
}
.cal-title:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.cal-title-year { cursor: default; font-variant-numeric: tabular-nums; }
.cal-nav { display: flex; align-items: center; gap: 0.25rem; }
.cal-step {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--solid-border);
  border-radius: 9999px;
  background: var(--solid-surface);
  color: var(--marketing-foreground);
  cursor: pointer;
  transition: background-color 150ms ease, scale 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 150ms ease;
}
.cal-step:active { scale: 0.94; }
.cal-step:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .cal-step:not(:disabled):hover { background: var(--solid-hover); }
}
.cal-nav .overlay-sheet-close { margin-left: 0.25rem; }

.cal-week,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}
.cal-week {
  margin-bottom: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted-foreground);
}
.cal-days { grid-template-rows: repeat(var(--cal-rows, 6), 2.75rem); }
.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 2.75rem;
  height: 2.75rem;
  margin-inline: auto;
  border: 0;
  border-radius: 9999px;
  background: none;
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--marketing-foreground);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, scale 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.cal-day.is-blank { pointer-events: none; }
.cal-day:disabled { color: color-mix(in oklab, var(--muted-foreground) 55%, transparent); cursor: default; }
.cal-day.is-today::after {
  content: "";
  position: absolute;
  bottom: 0.4375rem;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: var(--marketing-accent);
}
@media (hover: hover) and (pointer: fine) {
  .cal-day:not(:disabled):not(.is-on):hover { background: var(--solid-hover); }
}
.cal-day:not(:disabled):active { scale: 0.92; }
.cal-day:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
/* The picked day wears the ink pill's make. */
.cal-day.is-on {
  background: linear-gradient(180deg, color-mix(in oklab, var(--marketing-foreground) 86%, white), var(--marketing-foreground));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 1px 2px rgb(0 0 0 / 0.12), 0 6px 14px -6px color-mix(in oklab, var(--marketing-foreground) 70%, transparent);
  color: var(--solid-surface);
  font-weight: 600;
}
.cal-day.is-on.is-today::after { background: var(--solid-surface); }
.cal-foot {
  min-height: 1.25rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--muted-foreground);
}

.cal-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.cal-month {
  height: 3rem;
  border: 1px solid var(--solid-border);
  border-radius: 9999px;
  background: var(--solid-surface);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--marketing-foreground);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, scale 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.cal-month:disabled { opacity: 0.35; cursor: default; }
.cal-month:not(:disabled):active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) {
  .cal-month:not(:disabled):not(.is-on):hover { background: var(--solid-hover); }
}
.cal-month.is-on {
  border-color: var(--marketing-foreground);
  background: color-mix(in oklab, var(--marketing-foreground) 8%, var(--solid-surface));
}

/* The design page's frame around it. */
.cal-demo {
  position: relative;
  z-index: 10;
  display: grid;
  gap: 1rem;
  max-width: 36rem;
  margin-inline: auto;
  padding: 4rem 1rem;
}
.cal-demo h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--marketing-foreground);
}
.cal-demo p { font-size: 0.9375rem; color: var(--muted-foreground); }
.cal-demo b { font-family: "JetBrains Mono Variable", monospace; color: var(--marketing-foreground); }

@media (prefers-reduced-motion: reduce) {
  .cal-day, .cal-month, .cal-step, .cal-title svg { transition: none; }
}

/* The months' way back to the days: a step beside the year. */
.cal-head-back { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; }
.cal-back { margin-top: 0.875rem; flex: none; }
