/* ─────────────────────────────────────────────────────────────
   THE FORTNIGHT — /how-we-work/

   Markup: templates/website/_fortnight.html
   Data:   website/engagement.py

   Its own stylesheet, for the reason regtimeline.css and packstack.css
   are: a graphic defined inside how_we_work.css can only ever appear on
   /how-we-work/. Whichever page shows it must link this file —
   `{% block extra_head %}` is not inherited, and a graphic whose
   stylesheet never loads prints as unstyled body text flush to both
   edges, which is what shipped on two region pages on 2026-08-19.
   ───────────────────────────────────────────────────────────── */

.fnight {
  background: #0d1a2e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(56px, 8vw, 88px) 24px;
}

.fnight-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.fnight-title {
  color: #ffffff;
  font-size: clamp(1.625rem, 3.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0 0 14px;
}

.fnight-standfirst {
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(0.95rem, 1.2vw, 1.0625rem);
  line-height: 1.62;
  max-width: 62ch;
  text-wrap: pretty;
  margin: 0 0 clamp(32px, 4.5vw, 48px);
}

/* ── The strip ──────────────────────────────────────────────
   One row, fourteen days. Each phase is as wide as it is long,
   so the shape of the fortnight is legible before a word is
   read: Build is half the picture and has nothing in it for the
   customer to do.
   ───────────────────────────────────────────────────────── */
/* A two-row grid, columns proportional to each phase's length, and the
   phase blocks are `display: contents` so their heading and their day
   cells join the same two rows. Flexbox got this wrong in a way worth
   recording: the narrowest phase wraps its heading onto three lines, and
   in a row of flex columns that pushed its single day cell half a row
   below the other thirteen. Rows are what keep a strip a strip. */
.fnight-track {
  display: grid;
  align-items: end;
  gap: 10px clamp(12px, 1.8vw, 22px);
}

.fnight-phase { display: contents; }

/* Placed explicitly. `display: contents` hands both children straight to
   the grid, and auto-placement then reads them as eight independent cells
   and stacks one phase per row. The column index comes from the loop and
   arrives through a custom property, which crosses `display: contents`
   because custom properties inherit. */
.fnight-rule,
.fnight-phase-head,
.fnight-days {
  grid-column: var(--fnight-col);
  min-width: 0;
}

.fnight-rule {
  grid-row: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.fnight-phase-head { grid-row: 2; }
.fnight-days { grid-row: 3; }

/* The one phase where the customer does nothing gets the quiet
   treatment on the strip too — a rule the eye passes over. */
.fnight-phase:nth-child(2) .fnight-rule {
  background: rgba(255, 255, 255, 0.09);
}

.fnight-phase-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0;
}

.fnight-phase-num {
  color: #f59e0b;
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.fnight-phase-name {
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.fnight-phase-days {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.fnight-days {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fnight-day {
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  /* Starts at 0.25 rather than 0, and that is deliberate: a reveal
     may only enhance something already visible. A renderer that
     never runs the animation still photographs a legible strip. */
  animation: fnight-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fnight-day--yours {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #0a1628;
  font-weight: 800;
}

@keyframes fnight-in {
  from { opacity: 0.25; transform: translateY(7px); }
  to   { opacity: 1;    transform: none; }
}

/* ── What the amber days actually cost you ───────────────── */
.fnight-moments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
  list-style: none;
  margin: clamp(30px, 4vw, 44px) 0 0;
  padding: clamp(26px, 3.4vw, 34px) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.fnight-moment {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fnight-moment-when {
  color: #f59e0b;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fnight-moment-label {
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.fnight-moment-detail {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.875rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* The quiet week reads as quiet: no amber, because nothing here is
   the customer's. */
.fnight-moment--quiet .fnight-moment-when { color: rgba(255, 255, 255, 0.48); }
.fnight-moment--quiet .fnight-moment-label { color: rgba(255, 255, 255, 0.78); }

/* ── Narrow ──────────────────────────────────────────────────
   The proportional strip needs width to mean anything. Below it
   the phases stack and the day cells become a fixed size, which
   keeps the amber days countable at a glance.
   ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .fnight-track {
    display: block;
  }

  .fnight-phase {
    display: block;
    margin-bottom: 26px;
  }

  .fnight-phase-head { margin: 10px 0 12px; }
  .fnight-rule { display: block; }

  .fnight-days { flex-wrap: wrap; }

  .fnight-day {
    flex: 0 0 44px;
    height: 42px;
  }
}

.fnight-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .fnight-day { animation: none; }
}
