/*
 * Print and "Save as PDF" on A4, aiming for two pages: the title and the input summary, the key
 * dates kept with the table, then the rate hold, the lead times used, the disclaimer, the sources
 * with readable addresses in small type, and the site address. No form controls, no
 * accessibility statement (it is about the web page). Loaded with media="print" after styles.css,
 * so these rules win on paper.
 */
/* Side margins are 2mm smaller than the text inset below, so the text width stays the same. */
@page {
  size: A4;
  margin: 14mm 11mm;
}

:root {
  font-size: 10pt;
  line-height: 1.4;
}

/* 2mm inset, so the first letter of a right-aligned line is not clipped at the printable edge. */
.page-header,
main,
.page-footer {
  max-width: none;
  padding-inline: 2mm;
}

.page-header > *,
.page-footer > * {
  max-width: none;
}

.page-header {
  padding-block: 0 0.25rem;
}

h1 {
  font-size: 1.6rem;
  margin-block-end: 0.25rem;
}

h2 {
  margin-block: 0.75rem 0.4rem;
}

h3 {
  margin-block: 0.75rem 0.3rem;
}

/* Only what belongs on paper. */
#planner-form,
.actions,
.privacy-note,
.intro,
.noscript,
#status,
.accessibility {
  display: none;
}

.print-only {
  display: block;
}

.result {
  border: 0;
  margin: 0;
}

.print-only dl {
  display: grid;
  gap: 0.1rem 1rem;
  grid-template-columns: max-content 1fr;
  margin: 0 0 0.5rem;
}

.print-only dt {
  color: var(--muted);
}

.print-only dd {
  margin: 0;
}

/* Keep the summary, the key dates and any warning together with the table. */
#print-summary,
.key-dates,
#result-warnings {
  break-after: avoid;
}

.table-wrap {
  break-before: avoid;
  overflow: visible;
}

/* Backgrounds often do not print: borders keep the groups visible. */
.key-dates,
.warning {
  background: none;
  border: 1px solid var(--ink);
}

.key-dates {
  break-inside: avoid;
  margin-block-end: 0.75rem;
  padding: 0.6rem 0.9rem 0.75rem;
}

.key-dates h3 {
  margin-block-end: 0.4rem;
}

#key-dates {
  gap: 0.5rem 1.5rem;
}

.key-date-value {
  font-size: 1.1rem;
}

.warning {
  padding: 0.4rem 0.75rem;
}

.late-badge {
  background: none;
  border: 1px solid var(--ink);
  color: var(--ink);
}

table {
  font-size: 0.95rem;
}

th,
td {
  padding: 0.35rem 0.4rem;
}

tr {
  break-inside: avoid;
}

thead {
  display: table-header-group;
}

a {
  color: var(--ink);
}

.page-footer {
  border-block-start: 1px solid var(--rule);
  font-size: 8.5pt;
  margin-block-start: 0.75rem;
  padding-block: 0.5rem 0;
}

.page-footer h2 {
  font-size: 9pt;
  margin-block: 0.4rem 0.2rem;
}

/* Sources as readable addresses in small type, one source per line. */
.sources li {
  margin-block-end: 0.15rem;
}

.print-url {
  display: inline;
  unicode-bidi: isolate;
  font-size: 7.5pt;
  margin-inline-start: 0.35em;
  overflow-wrap: anywhere;
}

.print-site {
  color: var(--ink);
  font-weight: 600;
  margin-block-start: 0.5rem;
}
