/**
 * Print layout (loaded with media="print", see php/include/header.php)
 * Only the content is printed, followed by the logo with QR code, address and date of the printout;
 * no sidebar, no shadows, no background colours.
 */
@page {
  margin: 15mm 15mm 18mm;
}

body {
  background: #ffffff;
  color: #000000;
  font-size: 11pt;
}

/* one column: the content, then the logo with the QR code, address and date of the printout */
#wrapper {
  flex-direction: column;
  box-shadow: none;
  max-width: none;
  margin: 0;
}
main {
  order: 1;
}
aside {
  break-inside: avoid;
  margin-top: 10mm;
  order: 2;
  width: auto;
}
/* sidebar: only the logo and the source of the printout stay */
aside > *:not(nav):not(.print-source),
aside nav > *:not(#logo) {
  display: none !important;
}
aside > nav,
aside > .print-source {
  padding: 0;
}
aside #logo {
  display: block;
  margin: 0 0 4mm;
}
aside #logo img {
  height: 18mm;
  width: auto;
}
aside > .print-source {
  align-items: center;
  display: flex;
  gap: 4mm;
}
.print-source .print-qr svg {
  display: block;
  height: 15mm;
  width: 15mm;
}
.print-source .print-text {
  display: flex;
  flex-direction: column;
  font-size: 9pt;
  gap: 1mm;
  word-break: break-all;
}

main {
  background: none;
  min-height: 0;
  padding: 0;
  width: auto;
}

.oversize {
  box-shadow: none;
  margin-left: 0;
  margin-right: 0;
}

/* interactive elements make no sense on paper */
.admin-header,
.admin-actions,
.filter-bar,
.social,
form,
button,
video,
iframe,
.highlights-nav,
.calendar-links,
.highlight-background,
.highlights-track > [aria-hidden="true"] {
  display: none !important;
}

/* page of a press article: the article as printed above the full text, both in full width */
.press-article-body {
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.press-article-pages {
  order: -1;
}
/* low enough to fit on the first page below a two-line title and a long summary */
.press-article-pages img {
  width: auto;
  max-width: 100%;
  max-height: 140mm;
  box-shadow: none;
}

/* page breaks */
h1,
h2,
h3,
h4 {
  break-after: avoid;
  page-break-after: avoid;
}
img,
figure,
blockquote,
.event,
li,
tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* tables (e.g. Vereinsrekorde): no filled areas (toner, printing time), lines instead.
   Long tables run over several pages; the head is repeated on each page. */
table,
table thead,
table tfoot,
table tbody > tr,
table tbody > tr:nth-child(2n) {
  background: none;
  box-shadow: none;
}
/* (table.records: not the wider table of small screens, tables.css) */
table,
table.records {
  width: 100%;
  margin: 0.5em 0 1em;
  font-size: 9pt;
}
table thead {
  display: table-header-group;
  color: var(--color-darkblue);
}
table tfoot {
  color: inherit;
}
table thead :is(td, th) {
  border-bottom: 1px solid var(--color-darkblue);
  font-weight: bold;
}
table tbody td {
  border-bottom: 1px solid var(--color-lightgray);
}
table tfoot td {
  padding-top: 4px;
}
p {
  orphans: 3;
  widows: 3;
}
img {
  max-width: 100%;
}

/* links: black, the target of external ones is printed behind them */
a,
a:link,
a:visited {
  color: inherit;
  text-decoration: underline;
}
main a[href^="http"]:not([href*="lfv-schutterwald.de"])::after {
  content: " (" attr(href) ")";
  font-size: 0.8em;
  word-break: break-all;
}

/* highlights of the news page: no slider on paper, all of them one below the other with title and
   text, without pictures and without the copies for endless turning */
.highlights {
  box-shadow: none;
  overflow: visible;
}
.highlights::before {
  display: none;
}
.highlights-track {
  display: block;
  overflow: visible;
}
.highlight {
  border-left: 1mm solid var(--color-darkblue);
  break-inside: avoid;
  display: block;
  margin: 0 0 4mm;
  min-height: 0;
  padding-left: 3mm;
}
.highlight-layer {
  display: block;
}
.highlight-text {
  background: none;
  padding: 0;
}
.highlight-layer,
.highlight-text,
.highlight-text > * {
  animation: none !important;
}

/* training times (cards of the groups, training.css): no filled areas and shadows, lines instead;
   the icons and the trainer photos stay (the icons are background images, which browsers leave
   out unless asked). One card per line (two side by side in landscape), none split across
   pages; as CSS columns, not as the masonry of the screen (training.css, js/lanes.js). */
main.page ul.training,
main.page ul.training.lanes {
  display: block;
  columns: 1;
  column-gap: 4mm;
}
@media (orientation: landscape) {
  main.page ul.training,
  main.page ul.training.lanes {
    columns: 2;
  }
}
.training.card,
.lanes > .training.card {
  margin-bottom: 4mm;
  border: 0.3mm solid var(--color-lightgray);
  box-shadow: none;
}
.training.card > .training-head {
  background: none;
  border-bottom: 0.3mm solid var(--color-lightgray);
}
.training-line:before {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.training-initials {
  background: none;
  border-color: var(--color-darkblue) !important;
  color: var(--color-darkblue);
}
.training-tile {
  border-color: var(--color-darkblue);
}
.training-tile .day {
  background: none;
  border-bottom: 0.3mm solid var(--color-darkblue);
  color: var(--color-darkblue);
}
.training-tile .time small,
.training-tile .place {
  color: inherit;
}
.training-result:empty {
  display: none;
}

/* gallery list: no arrow */
li.gallery a::after {
  display: none;
}

/* one picture of a gallery (opened in the lightbox): only this picture with its details, not the
   pictures of the whole gallery behind it */
html.lightbox-open #wrapper {
  display: contents;
}
html.lightbox-open body {
  display: flex;
  flex-direction: column;
}
html.lightbox-open main > :not(h1):not(h2) {
  display: none !important;
}
html.lightbox-open .pswp {
  contain: none !important;
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  order: 1;
  position: static !important;
  width: auto !important;
}
.pswp__bg,
.pswp__top-bar,
.pswp__button,
.pswp__item[aria-hidden="true"],
.pswp__img--placeholder,
.lightbox-caption-measure {
  display: none !important;
}
.pswp__scroll-wrap,
.pswp__container,
.pswp__item,
.pswp__zoom-wrap {
  height: auto !important;
  inset: auto !important;
  overflow: visible !important;
  position: static !important;
  transform: none !important;
  width: auto !important;
}
.pswp__img {
  height: auto !important;
  max-height: 200mm !important;
  max-width: 100% !important;
  position: static !important;
  transform: none !important;
  width: auto !important;
}
.lightbox-caption {
  background: none !important;
  color: #000000 !important;
  font-size: 9pt;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  position: static !important;
}
