/* The Executive Report print sheet.
 *
 * A facsimile of the firm's own weekly export ("FIRMWIDE Totals.pdf"), which is
 * an Excel print of a 17x11in landscape page. The four fills below are sampled
 * from that PDF, not chosen: black scope bands, #FFFF66 on the two human-entered
 * rows, #BFBFBF on the column headers, #CCFFFF banding on the money rows. The
 * house muted-earth palette deliberately does not apply here — the whole point
 * of the page is that leadership cannot tell it from the sheet they have been
 * reading for years.
 *
 * Loaded ONLY by the exec_print layout; nothing else on the site links it.
 */

:root {
  color-scheme: light;
}

/* print-color-adjust is inherited, so setting it once at the root carries the
 * fills into the printed page. Without it Chrome drops every background and the
 * sheet prints as a bare grid — the single highest-impact rule in this file. */
html {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html,
body.exec-print {
  margin: 0;
  padding: 0;
  background: #f4f4f2;
  color: #111;
  font-family: Calibri, Carlito, "Segoe UI", Arial, Helvetica, sans-serif;
}

/* ── Screen chrome (never printed) ──────────────────────────────────────────── */

/* A custom element has no default display, so an unstyled turbo-frame is inline
   and the toolbar and sheet inside it lose their block layout. */
turbo-frame {
  display: block;
}

.exec-print-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #dcdad4;
  font-size: 0.875rem;
}

.exec-print-zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exec-print-zone.is-centre {
  justify-content: center;
}

.exec-print-zone.is-end {
  justify-content: flex-end;
}

.exec-print-zone select {
  padding: 0.35rem 0.5rem;
  border: 1px solid #dcdad4;
  border-radius: 6px;
  background: #fff;
  color: #1c1c1a;
  font: inherit;
  font-weight: 600;
}

.exec-print-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #2f2f2c;
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.exec-print-button:hover {
  background: #46463f;
}

/* Secondary weight for Close: one filled button per toolbar, so the action that
   reads as primary is the one you came here to take. */
.exec-print-button.is-quiet {
  border-color: #dcdad4;
  background: #fff;
  color: #57564f;
}

.exec-print-button.is-quiet:hover {
  background: #f4f2ed;
  color: #1c1c1a;
}

/* The sheet does not load Tailwind, so the glyph has no size utility to take. */
.exec-print-glyph {
  width: 1rem;
  height: 1rem;
}

/* ── The sheet ──────────────────────────────────────────────────────────────── */

.exec-sheet {
  padding: 1.5rem;
  overflow-x: auto;
}

.exec-sheet table {
  width: 100%;
  min-width: 1180px;
  background: #fff;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

/* The label column carries the longest string on the page ("PLACEMAKING +
 * MIXED USE"); the workbook gives it a sixth of the width and the twelve months
 * split what is left evenly, which table-layout: fixed does for us. */
.exec-sheet col.col-key {
  width: 15.5%;
}

.exec-sheet col.col-total {
  width: 6.9%;
}

.exec-sheet th,
.exec-sheet td {
  padding: 3px 4px;
  border: 1px solid #000;
  overflow: hidden;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.exec-sheet .key,
.exec-sheet .total {
  font-weight: 700;
}

/* Row labels wrap rather than clip. On the 17x11in page they never need to; on
 * Letter "FTE Capacity" is wider than the Total Fee column it sits in (the
 * workbook prints the baseline labels there, not in the label column) and a
 * clipped "FTE Capacit" is the one thing a reader would notice. */
.exec-sheet td.key {
  white-space: normal;
}

.exec-sheet tr.is-head th {
  background: #bfbfbf;
  font-weight: 700;
}

.exec-sheet tr.is-head td.corner {
  background: #fff;
}

.exec-sheet tr.is-baseline td {
  background: #ffff66;
  font-weight: 700;
}

/* The scope band runs THROUGH the baseline rows (it is one black cell spanning
 * them), so it has to out-specify the row's own fill — a td.scope selector alone
 * loses to tr.is-baseline td and the band prints yellow with invisible white
 * text on it. */
.exec-sheet tr.is-baseline td.scope {
  background: #000;
}

.exec-sheet tr.is-band td {
  background: #ccffff;
}

.exec-sheet td.scope {
  position: relative;
  background: #000;
  color: #fff;
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  /* The one cell allowed to wrap. On the 17x11in page the longest studio name
   * fits on a line; on Letter it does not, and a wrapped name beats a clipped
   * one. Every other cell stays nowrap so the grid keeps its rhythm. */
  overflow: visible;
  white-space: normal;
}

/* Out of flow so it cannot widen the label column, and pinned to the corner the
 * workbook prints it in. */
.exec-sheet td.scope .count {
  position: absolute;
  top: 1px;
  right: 4px;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0;
}

/* ── Print ──────────────────────────────────────────────────────────────────── */

/* Tabloid landscape — the source workbook's own page. Letter landscape also
 * works (the grid is proportional); it just prints denser. */
@page {
  size: 17in 11in;
  margin: 0.75in 0.7in;
}

@media print {
  html,
  body.exec-print {
    background: #fff;
  }

  .exec-print-toolbar {
    display: none;
  }

  .exec-sheet {
    padding: 0;
    overflow: visible;
  }

  /* 8pt with the 3px cell padding puts a row at ~0.22in, which is the source
   * workbook's own row pitch — 44 rows then fill the 17x11in page the way the
   * firm's export does instead of ending two inches short. */
  .exec-sheet table {
    min-width: 0;
    font-size: 8pt;
  }

  /* A scope block is the unit a reader carries in their head, so it never
   * straddles a page. tbody is the block; the row rule is belt-and-braces for
   * engines that ignore break-inside on row groups. */
  .exec-sheet tbody,
  .exec-sheet tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
