/* ==========================================================================
   FRONTLINE21 — A DAY.
   The calendar cell: number, title, discipline, mark. Cut out of wall.css on
   8 September 2026 so the homepage's three-day teaser and the 21 Days page
   share one definition. Loaded before wall.css on 21-days.html and before
   home.css on index.html.
   ========================================================================== */

/* A day. The number is the thing you read first, then the title, then the
   discipline in words, so the five day cycle is legible without the colour of
   the mark. */
.day {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  column-gap: 12px;
  min-height: 100%;
  padding: 16px 16px 15px;
  color: var(--paper);
  transition: background var(--dur-fast) var(--ease-out);
}

@media (min-width: 620px) {
  .day {
    min-height: clamp(128px, 11vw, 176px);
    padding: clamp(14px, 1.4vw, 22px) clamp(14px, 1.4vw, 22px) clamp(12px, 1.2vw, 18px);
  }
}

.day:hover,
.day:focus-visible {
  background: var(--ink-raised);
}

.day:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  box-shadow: none;
}

/* The red rule marks the day that is open, or was last opened: a signal in the
   interface rather than a wash. */
.day::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--f21-red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-mid) var(--ease-out);
}

.day[aria-current='true']::before {
  transform: scaleX(1);
}

.day__n {
  grid-column: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--f21-red-hi);
  font-variant-numeric: tabular-nums;
}

.day[aria-current='true'] .day__n {
  color: var(--paper);
}

.day__title {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: var(--stack-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--paper);
  text-wrap: balance;
}

@media (min-width: 1200px) {
  .day__title { font-size: 12.5px; }
}

.day__value {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.day__marks {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: 3px;
  align-items: flex-start;
  padding-top: 3px;
}

/* The small shield, the discipline's colour. The five colours are the
   measured fringe colours of the films and the brand red; the words beside
   them carry the meaning, the colour only keeps the cycle visible at a glance. */
.day__mark {
  display: block;
  width: 9px;
  height: 11px;
  background: var(--paper-mute);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 50% 100%, 0 74%);
}

.day__mark--moral-courage { background: var(--f21-red); }
.day__mark--servant-leadership { background: #8d5f62; }
.day__mark--self-control { background: #6c9c79; }
.day__mark--brotherhood { background: #9c657f; }
.day__mark--stewardship { background: var(--paper-faint); }
.day__mark--all-five { background: var(--paper); }

/* Day 21 stands across the whole rank: all five, in one line. */
.day--wide {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: baseline;
  column-gap: clamp(16px, 2vw, 32px);
  min-height: 0;
}

.day--wide .day__n { grid-column: 1; grid-row: 1; }
.day--wide .day__title { grid-column: 2; grid-row: 1; margin-top: 0; align-self: baseline; }
.day--wide .day__value { grid-column: 2; grid-row: 2; }
.day--wide .day__marks { grid-column: 3; grid-row: 1; align-self: center; padding-top: 0; }
