/* Ledger A - the base styles: page basics, and the small pieces every part of the app uses
   (buttons, icons, colour dots, hints, messages, the small month grid). The design values
   (colours, type, shapes, spacing, sizes, shadows, motion, layers) are NOT here: they live in
   tokens.css. Loaded second, after tokens.css; the other stylesheets build on it (see index.html
   for the order).

   The side columns and top bar are NOT grouped cards: they are part of the
   frame itself, with individual buttons/cards sitting directly on it. */

/* ---------- page basics ---------- */
:root {
  /* The white tick drawn inside the done circle. A picture inside url() can't read a token, so its
     colour is written into the picture: keep it in step with --colour-on-done. */
  --done-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l3 3 5-6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--colour-surface-frame);
  color: var(--colour-text);
  font-family: var(--font-body);
  font-size: var(--font-size-md);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
/* Without this, elements that set their own "display" ignore the hidden attribute. */
[hidden] {
  display: none !important;
}

/* A real list (ul) that looks like plain boxes: no bullets, no default indent or spacing.
   Added next to a block's own class on the ul. */
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- icons and colour dots ---------- */
/* Small flat single-colour icon; takes the text colour. */
.icon {
  width: var(--size-18);
  height: var(--size-18);
  flex: none;
  fill: currentColor;
}
.dot {
  width: var(--size-10);
  height: var(--size-10);
  flex: none;
  border-radius: var(--radius-round);
  /* Text sits a little low inside its line box, so the circle is nudged down to line up
     with the middle of the letters and of the six dots. */
  position: relative;
  top: 2px;
}
.dot--big {
  width: var(--size-16);
  height: var(--size-16);
}

/* ---------- buttons ---------- */
.primary-button,
.secondary-button {
  border: 0;
  border-radius: var(--radius-8);
  padding: var(--space-7) var(--space-12);
  white-space: nowrap;
}
.primary-button {
  background: var(--colour-accent);
  color: var(--colour-text-on-accent);
  font-weight: var(--font-weight-bold);
}
.primary-button:hover {
  background: var(--colour-accent-hover);
}
.secondary-button {
  background: var(--colour-surface-control);
}
.secondary-button:hover {
  background: var(--colour-surface-strong);
}
.delete-button {
  border: 0;
  background: none;
  color: var(--colour-danger);
  border-radius: var(--radius-6);
  padding: var(--space-5) var(--space-8);
}
.delete-button:hover {
  background: var(--colour-danger-soft);
}
/* small round icon button, e.g. the settings gear beside a commitment's name */
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--size-28);
  height: var(--size-28);
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-round);
  background: none;
  color: var(--colour-text-muted);
}
.icon-button:hover {
  background: var(--colour-surface-strong);
  color: var(--colour-text);
}
.icon-button__icon {
  width: var(--size-16);
  height: var(--size-16);
}
.esc-hint {
  margin-left: var(--space-4);
  padding: var(--space-1) var(--space-5);
  border: var(--border-thin) solid var(--colour-line-strong);
  border-radius: var(--radius-4);
  color: var(--colour-text-muted);
  font-size: var(--font-size-xs);
}
.danger-button {
  padding: var(--space-7) var(--space-14);
  border: 0;
  border-radius: var(--radius-8);
  background: var(--colour-danger);
  color: var(--colour-surface-stage);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
}
.danger-button:hover {
  background: var(--colour-danger-hover);
}

/* ---------- hints and messages ---------- */
.hint {
  color: var(--colour-text-muted);
  line-height: var(--line-height-body);
  margin: var(--space-6) 0 var(--space-14);
}
.message {
  margin: var(--space-8) 0;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-8);
  background: var(--colour-danger-soft);
  color: var(--colour-danger-text);
}

/* ---------- the small month grid (right column and the day chooser in forms) ---------- */
/* The month's name above a month grid. */
.month-title {
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-8);
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  text-align: center;
  font-size: var(--font-size-sm);
}
.month-grid__weekday {
  color: var(--colour-text-muted);
  padding: var(--space-2) 0;
}
.month-grid__day {
  background: none;
  border: 0;
  border-radius: var(--radius-6);
  padding: var(--space-4) 0;
}
.month-grid__day:hover {
  background: var(--colour-surface-strong);
}
.month-grid__day--other-month {
  color: var(--colour-text-muted);
  opacity: var(--opacity-55);
}
/* These keep their colour when hovered (the :hover is listed so it doesn't win). */
.month-grid__day--in-week,
.month-grid__day--in-week:hover {
  background: var(--colour-surface-control);
}
.month-grid__day--today,
.month-grid__day--today:hover {
  background: var(--colour-accent);
  color: var(--colour-text-on-accent);
  font-weight: var(--font-weight-bold);
}
