/* Ledger A - the page's frame: the three columns, the left and right columns, the top bar
   (week buttons and the S | M switch), the stage the calendar sits in, and the pages that take
   the calendar's place (Tasks, Commitment settings, one commitment). Loaded after base.css. */

/* ---------- page layout: three columns ---------- */
.app {
  display: grid;
  grid-template-columns: var(--size-230) minmax(0, 1fr) var(--size-200);
  gap: var(--space-14);
  height: 100vh;
  padding: var(--space-14);
}
.app__left,
.app__right {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  min-height: 0;
}
/* The left column's blocks (account, nav options, + Add, quick list) sit a little closer together. */
.app__left {
  gap: var(--space-6);
}
/* A button that looks like a small card sitting on the frame. */
.card-button,
.nav__button {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  width: 100%;
  background: var(--colour-surface-control);
  border: 0;
  border-radius: var(--radius-8);
  padding: var(--space-9) var(--space-12);
  text-align: left;
}
.nav__button {
  background: transparent; /* plain on the frame until hovered */
  padding: var(--space-7) var(--space-12); /* tighter than the Account card, to sit closer to the commitment list */
}
.card-button:hover,
.nav__button:hover {
  background: var(--colour-surface-strong);
}

/* ---------- left column ---------- */
.card-button--account {
  font-weight: var(--font-weight-medium);
}
/* Small circle on the right of the Account button, for a profile picture later. */
.card-button__avatar {
  margin-left: auto;
  width: var(--size-24);
  height: var(--size-24);
  flex: none;
  border-radius: var(--radius-round);
  background: var(--colour-accent);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.add-button {
  background: var(--colour-accent);
  color: var(--colour-text-on-accent);
  border: 0;
  border-radius: var(--radius-8);
  padding: var(--space-10) var(--space-12);
  font-weight: var(--font-weight-bold);
  text-align: center;
}
.add-button:hover {
  background: var(--colour-accent-hover);
}
/* The word "Add" is what sits in the centre; the "+" hangs off its left side. */
.add-button__label {
  position: relative;
}
.add-button__plus {
  position: absolute;
  right: 100%;
  margin-right: var(--space-6);
}
.quick-nav {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space-4) var(--space-12);
  /* The list sits on the frame, so its scrollbar track is the frame's cream; only the thumb shows. */
  scrollbar-color: var(--colour-scrollbar) var(--colour-surface-frame);
  scrollbar-width: thin;
}

/* ---------- right column ---------- */
.mini-month {
  padding: var(--space-2) var(--space-4);
}
.future {
  flex: 1;
  min-height: 0;
  background: var(--colour-surface-control); /* its own panel */
  border-radius: var(--radius-10);
  padding: var(--space-12);
}
.future__placeholder {
  color: var(--colour-text-muted);
  line-height: var(--line-height-body);
}

/* ---------- centre column: the top bar and the stage ---------- */
.app__centre {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  min-width: 0;
  min-height: 0;
}
/* The top bar is part of the frame: no background of its own. */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: 0 var(--space-2);
}
.top-bar__week {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.top-bar__button {
  background: var(--colour-surface-control);
  border: 0;
  border-radius: var(--radius-8);
  padding: var(--space-6) var(--space-12);
}
.top-bar__button:hover {
  background: var(--colour-surface-strong);
}
.top-bar__range {
  margin: 0 0 0 var(--space-10); /* it is an h1: no default heading space */
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-lg);
}
.top-bar__note {
  color: var(--colour-text-muted);
  font-size: var(--font-size-sm);
}
/* The stage: the calendar sits in it like a theatre stage. */
.stage {
  flex: 1;
  min-height: 0;
  background: var(--colour-surface-stage);
  border-radius: var(--radius-10);
  overflow: hidden;
  /* Scrollbars inside the stage: the track matches the calendar colour, only the thumb shows. */
  scrollbar-color: var(--colour-scrollbar) var(--colour-surface-stage);
  scrollbar-width: thin;
}

/* ---------- quality-of-life buttons in the top bar ---------- */
.top-bar__quality-of-life {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  min-width: 0;
}
/* The "S | M" week-start switch: click it and the highlight slides to the other letter.
   js/ui/app/top-bar.js gives the button slide-toggle--sun or slide-toggle--mon. S is the left
   half, M the right. */
.slide-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: var(
    --size-60
  ); /* two halves of 30px, each holding one letter and the 24px highlight circle */
  height: var(--size-30);
  padding: 0;
  border: 0;
  border-radius: var(--radius-15);
  background: var(--colour-surface-control);
}
.slide-toggle:hover {
  background: var(--colour-surface-strong);
}
.slide-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px; /* 3px of space on every side of the circle inside its 30px half */
  width: var(--size-24);
  height: var(--size-24);
  border-radius: var(--radius-round);
  background: var(--colour-accent);
  transition: transform var(--duration-base) var(--ease);
}
.slide-toggle--mon .slide-toggle__thumb {
  transform: translateX(30px); /* one half over */
}
.slide-toggle__option {
  position: relative; /* above the sliding highlight */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--colour-text-muted);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-none);
  transition: color var(--duration-base) var(--ease);
}
/* The letters are drawn by the style sheet, not written in the page: the button's name ("Week
   starts on Monday...") is then the only text a screen reader or voice control meets. */
.slide-toggle__option--sun::before {
  content: "S";
}
.slide-toggle__option--mon::before {
  content: "M";
}
.slide-toggle--sun .slide-toggle__option--sun,
.slide-toggle--mon .slide-toggle__option--mon {
  color: var(--colour-text-on-accent);
}
@media (prefers-reduced-motion: reduce) {
  .slide-toggle__thumb,
  .slide-toggle__option {
    transition: none;
  }
}
/* The placeholder note about future buttons only has room on wide windows. */
@media (max-width: 1250px) {
  .top-bar__note {
    display: none;
  }
}

/* ---------- pages that replace the calendar (Tasks, Commitment settings, one commitment) ---------- */
.stage--page {
  overflow: auto;
  /* Keep room for the scrollbar even when there is none, so the page's content never shifts
     sideways when a long page (an opened schedule windows tab) makes it appear. */
  scrollbar-gutter: stable;
}
.page {
  max-width: var(--size-760);
  margin: 0 auto;
  padding: var(--space-18) var(--space-22) var(--space-40);
}
.page__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-14);
  margin-bottom: var(--space-6);
}
.page__title {
  margin: 0;
  font-size: var(--font-size-2xl);
}
