/**
 * 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 .indicators {
  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 (their pictures are backgrounds, which are not printed) */
#highlights {
  box-shadow: none;
  height: auto;
  overflow: visible;
}
#highlights .highlight {
  border-left: 1mm solid var(--color-darkblue);
  box-shadow: none;
  break-inside: avoid;
  height: auto;
  margin: 0 0 4mm;
  padding-left: 3mm;
  position: static;
}
#highlights .highlight h2,
#highlights .highlight section {
  background: none;
  box-shadow: none;
  display: block;
  max-width: none;
  padding: 0;
  position: static;
}
#highlights .highlight section a.more {
  float: none;
  margin: 0;
}

/* 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.glightbox-open #wrapper {
  display: contents;
}
html.glightbox-open body {
  display: flex;
  flex-direction: column;
}
html.glightbox-open main > :not(h1):not(h2) {
  display: none !important;
}
html.glightbox-open .glightbox-container {
  height: auto !important;
  order: 1;
  position: static !important;
  width: auto !important;
}
.glightbox-container .goverlay,
.glightbox-container .gloader,
.glightbox-container .gnext,
.glightbox-container .gprev,
.glightbox-container .gclose,
.glightbox-container .gslide:not(.current) {
  display: none !important;
}
.glightbox-container .gcontainer,
.glightbox-container .gslider,
.glightbox-container .gslide.current,
.glightbox-container .gslide-inner-content,
.glightbox-container .ginner-container {
  height: auto !important;
  max-height: none !important;
  max-width: none !important;
  opacity: 1 !important;
  position: static !important;
  transform: none !important;
  width: auto !important;
}
.glightbox-container .gslide-image img {
  height: auto !important;
  max-height: 200mm !important;
  max-width: 100% !important;
  width: auto !important;
}
.glightbox-container .gslide-description {
  background: none !important;
  color: #000000 !important;
  font-size: 9pt;
  max-width: none !important;
  position: static !important;
}
