/*
  The preview-and-print pages: the A4 sheet on the left, the print panel on the right.
  On paper only the sheet is printed, at its real size (210 x 297 mm), on one page.
*/
@page {
  size: A4;
  margin: 0;
}

.nz-print-page {
  padding-top: 48px;
  padding-bottom: 96px;
}

.nz-print-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
  align-items: flex-start;
}

.nz-print-sheet {
  flex: 0 1 var(--nz-sheet-width-laptop);
  width: var(--nz-sheet-width-laptop);
  max-width: 100%;
}

.nz-print-panel {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 360px;
  margin-left: auto;
  position: sticky;
  top: calc(var(--nz-topbar-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 8px;
}

.nz-print-panel .nz-h2 {
  margin: 14px 0;
  font-size: 2.5rem;
}

.nz-print-panel p {
  margin: 0;
}

.nz-print-modes {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nz-print-modes legend {
  padding: 0 0 12px;
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-bold);
}

.nz-print-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* "Copy the link to this board" and its hint, under the two buttons. */
.nz-print-share .nz-hint {
  margin: 4px 0 0;
}

.nz-print-tip {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--nz-radius-card);
  background: var(--nz-terracotta-light);
  font-size: var(--nz-text-small);
  line-height: 1.5;
}

.nz-print-tip svg {
  flex: none;
  margin-top: 2px;
  color: var(--nz-terracotta-dark);
}

.nz-print-panel .nz-hint {
  font-size: var(--nz-text-caption);
  line-height: 1.5;
}

/* Missions and ideas: a box for every text on the sheet. The panel is long then,
   so it scrolls with the page instead of staying in place. */
.nz-print-panel:has(.nz-sheet-editor:not([hidden])) {
  position: static;
}

.nz-sheet-editor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--nz-space-3);
}

.nz-sheet-editor[hidden] {
  display: none;
}

.nz-edit-title {
  margin: 0;
  font-family: var(--nz-font-display);
  font-weight: var(--nz-weight-display);
  font-size: var(--nz-text-h3);
  line-height: 1.2;
}

.nz-edit-fields {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: var(--nz-space-4);
}

.nz-edit-item {
  margin: 0;
  padding: var(--nz-space-4);
  border: none;
  border-radius: var(--nz-radius-card);
  background: var(--nz-color-surface-quiet);
  display: flex;
  flex-direction: column;
  gap: var(--nz-space-3);
}

.nz-edit-item legend {
  float: left;
  padding: 0;
  font-size: var(--nz-text-label);
  font-weight: var(--nz-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nz-edit-field {
  display: flex;
  flex-direction: column;
  gap: var(--nz-space-1);
}

@media (max-width: 859px) {
  .nz-print-page {
    padding-top: 24px;
    padding-bottom: 48px;
  }

  .nz-print-layout {
    flex-direction: column;
    gap: 32px;
  }

  .nz-print-sheet {
    width: 100%;
  }

  .nz-print-panel {
    position: static;
    max-width: none;
    margin-left: 0;
    order: -1;
  }
}

@media print {
  body {
    background: var(--nz-white);
  }

  .nz-topbar,
  .nz-print-panel,
  .nz-footer {
    display: none;
  }

  .nz-print-page,
  .nz-print-layout,
  .nz-print-sheet {
    display: block;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* The sheet at its real size, the only thing on the page. */
  .nz-print-sheet .nz-sheet-frame {
    width: var(--nz-page-width);
    height: var(--nz-page-height);
    aspect-ratio: auto;
    box-shadow: none;
    break-after: page;
  }

  .nz-print-sheet .nz-sheet-frame:last-child {
    break-after: auto;
  }

  .nz-print-sheet .nz-sheet {
    transform: none;
  }
}
