/**
 * Print Stylesheet
 *
 * Ładowany z media="print" (inc/enqueue.php).
 * Cel: statyczny, kompaktowy nagłówek (logo + nazwa), czysta treść,
 * krótka stopka kontaktowa. Wszystkie elementy fixed/absolute/sticky
 * zostają sprowadzone do normalnego przepływu dokumentu, aby nie
 * nachodziły na treść i nie powtarzały się na każdej stronie.
 *
 * @package ZPKWW2026
 */

/* =====================================================================
   Strona wydruku
   ===================================================================== */

@page {
  size: A4;
  margin: 15mm 15mm 18mm;
}

/* =====================================================================
   Reset bazowy
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box !important;
  background: transparent !important;
  color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  animation: none !important;
  transition: none !important;
}

html,
body {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: #fff !important;
  font-size: 11pt !important;
  line-height: 1.45;
}

/* Tryby WCAG nie powinny wpływać na wydruk */
html.wcag-font-xs body,
html.wcag-font-sm body,
html.wcag-font-lg body,
html.wcag-font-xl body {
  font-size: 11pt !important;
}

/* Wszystko w normalnym przepływie — źródło nachodzenia nagłówka na treść */
.site-header,
.site-header *,
.site-branding,
.site-branding.on-top,
.navigation-top,
.navigation-top-parki,
#colophon,
.sticky-top,
.is-sticky {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  z-index: auto !important;
}

/* =====================================================================
   Elementy ukryte w druku
   ===================================================================== */

#page-preloader,
.page-preloader,
.skip-link,
.custom-header,
.custom-header-media,
.wp-custom-header-video-button,
.wrap-social,
.site-branding-info,
.site-branding-actions,
.search-panel,
.main-navigation,
.menu-toggle,
.mobile-menu-head,
.mobile-menu-search,
.mobile-menu-social,
.mega-menu-panel,
.breadcrumb-toggle,
#primary-sidebar,
#secondary,
#submenu,
.post-navigation,
.page-links,
.comments-area,
.comment-respond,
.wcag-toggle-btn,
.wcag-panel,
.lightbox-overlay,
.logo_UE,
.leaflet-container,
.home-map,
#map,
.footer-3,
.footer-4,
.footer-kontakt > br:first-child,
#cookie-law-info-bar,
#cookie-law-info-again,
.cli-modal,
.cli-modal-backdrop,
.wp-block-cover__background,
.wp-block-column:empty,
.wp-block-embed__wrapper,
iframe,
video,
audio,
form,
button,
#content::before {
  display: none !important;
}

/* Selektory z :has() trzymane osobno — jeden nieobsługiwany selektor
   unieważniłby całą listę powyżej */
.footer-kontakt p:has(a[href*="google"]) {
  display: none !important;
}

/* Kolumna zawierająca wyłącznie osadzony iframe (np. post z Facebooka) */
.wp-block-column:has(> iframe:only-child) {
  display: none !important;
}

/* Pusty kontener treści w bloku "cover" */
.wp-block-cover__inner-container:not(:has(:not(:empty))) {
  display: none !important;
}

/* =====================================================================
   Nagłówek — kompaktowy pasek: logo + nazwa organizacji
   ===================================================================== */

#masthead.site-header {
  display: block !important;
  width: 100% !important;
  margin: 0 0 6mm !important;
  padding: 0 0 3mm !important;
  border-bottom: 1pt solid #000;
  overflow: visible !important;
}

.site-branding {
  display: block !important;
  width: 100% !important;
  opacity: 1 !important;
}

.site-branding > .wrap {
  display: flex !important;
  align-items: center;
  gap: 5mm;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-branding-logo {
  flex: 0 0 auto;
  margin: 0 !important;
}

.site-branding-logo .main-logo-svg,
.site-branding-logo img {
  display: block;
  width: auto !important;
  max-width: 35mm !important;
  height: auto !important;
  max-height: 18mm !important;
}

.site-branding-text {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-branding-text .site-title {
  margin: 0 !important;
  font-size: 13pt !important;
  font-weight: 700;
  line-height: 1.2;
}

.site-branding-text .site-title a {
  text-decoration: none;
}

.site-branding-text .site-description {
  margin: 1mm 0 0 !important;
  font-size: 9pt !important;
}

/* Pasek nawigacji — zostawiamy wyłącznie okruszki jako kontekst strony */
.navigation-top {
  display: block !important;
  width: 100% !important;
  margin: 2mm 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.navigation-top > .wrap {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.breadcrumb-bar,
.breadcrumb-bar .breadcrumbs {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 8.5pt !important;
}

.breadcrumb-bar,
.breadcrumb-bar * {
  text-align: left !important;
  justify-content: flex-start !important;
  justify-self: start !important;
}

.breadcrumb-bar a {
  text-decoration: none;
}

/* =====================================================================
   Treść
   ===================================================================== */

#page,
.site,
.site-content,
#content,
body:not(.home) .site-content,
body:not(.home) #content,
.home .site-content,
.home #content {
  position: static !important;
  display: block !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#content .wrap,
#primary,
.content-area,
#main,
.site-main {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ramka "karty" wpisu (.single-post .site-main) — na ekranie OK, w druku
   kropkowana linia na lewym marginesie, a +2px szerokości ucina prawą krawędź */
#main,
.site-main,
.single-post .site-main,
article {
  display: block !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.entry-header {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 5mm !important;
  padding: 0 !important;
}

.entry-header::before,
.entry-header::after {
  content: none !important;
}

.entry-title {
  margin: 0 0 2mm !important;
  padding: 0 0 2mm !important;
  border-bottom: 0.5pt solid #999 !important;
  font-size: 20pt !important;
  line-height: 1.2;
}

/* Metadane w jednej linii (mobilne reguły motywu układały je w kolumnę) */
.entry-meta,
.entry-meta > span,
.entry-meta .author {
  display: inline !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 8.5pt !important;
  letter-spacing: 0.02em;
}

.entry-meta a {
  text-decoration: none !important;
}

/* Lead — w treści ma has-large-font-size + pogrubienie, w druku za duży */
.entry-content > p.has-large-font-size,
.entry-content > p.has-x-large-font-size {
  font-size: 12.5pt !important;
  line-height: 1.4;
  margin: 0 0 5mm !important;
}

.entry-content p {
  margin: 0 0 3mm !important;
  padding: 0 !important;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 6mm 0 2mm !important;
  padding: 0 !important;
  font-weight: 600 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  break-after: avoid;
  page-break-after: avoid;
  break-inside: avoid;
}

h2 { font-size: 14pt !important; }
h3 { font-size: 12.5pt !important; }
h4 { font-size: 11.5pt !important; }

p,
li,
blockquote {
  orphans: 3;
  widows: 3;
}

img,
svg,
figure,
table,
pre,
blockquote,
.wp-block-image,
.wp-block-gallery {
  break-inside: avoid;
  page-break-inside: avoid;
}

img {
  max-width: 100% !important;
  height: auto !important;
}

.post-thumbnail img {
  max-height: 90mm;
  width: auto !important;
}

/* Bloki obrazków — bez kropkowanej ramki, niższe, wyśrodkowane.
   Niższe zdjęcia = mniej pustych końców stron przy break-inside: avoid */
.wp-block-image,
.entry-content figure {
  border: 0 !important;
  padding: 0 !important;
  margin: 4mm 0 5mm !important;
  text-align: center;
}

.wp-block-image img,
.entry-content figure img {
  display: block;
  width: auto !important;
  max-height: 95mm !important;
  margin: 0 auto !important;
}

figcaption,
.wp-element-caption {
  margin: 1.5mm 0 0 !important;
  padding: 0 !important;
  font-size: 8.5pt !important;
  font-style: italic;
  text-align: center;
}

/* Blok "cover" — w druku zwykły pas zdjęcia, bez min-height i nakładki */
.wp-block-cover {
  display: block !important;
  position: relative !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 0 5mm !important;
  padding: 0 !important;
  overflow: hidden;
  break-inside: avoid;
}

.wp-block-cover__image-background,
.wp-block-cover img {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: 60mm !important;
  max-height: none !important;
  object-fit: cover;
}

.wp-block-cover__inner-container {
  position: static !important;
  width: auto !important;
  padding: 2mm 0 0 !important;
}

/* Kolumny — w druku jedna pod drugą */
.wp-block-columns {
  display: block !important;
  margin: 0 0 3mm !important;
}

.wp-block-column {
  width: auto !important;
  flex-basis: auto !important;
  margin: 0 !important;
}

/* Akordeony — pokaż całą zawartość */
.accordion-content {
  max-height: none !important;
  overflow: visible !important;
  padding: 0 0 3mm !important;
}

/* Animacje wejścia kafli nie mogą zostawić ich niewidocznych */
.recent-posts article,
[class*="animate"],
[class*="fade"] {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Tabele */
table {
  width: 100% !important;
  border-collapse: collapse;
}

th,
td {
  border: 0.5pt solid #666 !important;
  padding: 1.5mm 2mm !important;
}

thead {
  display: table-header-group;
}

/* Linki — adres zewnętrznych linków w treści po tekście */
a {
  text-decoration: underline;
}

.entry-content a[href^="http"]:not([href*="zpkww"])::after {
  content: " (" attr(href) ")";
  font-size: 8.5pt;
  word-break: break-all;
}

.entry-content a[href^="http"]:has(img)::after {
  content: none;
}

/* Tagi pod wpisem — do lewej, drobnym drukiem */
.entry-footer {
  margin: 6mm 0 0 !important;
  padding: 2mm 0 0 !important;
  border-top: 0.5pt solid #999 !important;
  text-align: left !important;
  font-size: 8.5pt !important;
}

.entry-footer a {
  text-decoration: none !important;
}

/* =====================================================================
   Stopka — statyczna, tylko logo + dane kontaktowe
   ===================================================================== */

#colophon,
#colophon.site-footer {
  display: block !important;
  width: auto !important;
  margin: 8mm 0 0 !important;
  padding: 3mm 0 0 !important;
  border-top: 1pt solid #000;
  font-size: 8.5pt !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Ramki bloków stopki z motywu (border-right, mobilne obramowania) */
#colophon * {
  border: 0 !important;
}

#colophon .wrap {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Jeden wiersz: logotypy | dane kontaktowe */
#colophon .footer-all {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8mm;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

#colophon .footer-1,
#colophon .footer-2 {
  display: flex !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#colophon .footer-1 {
  flex: 0 0 auto;
  flex-direction: row !important;
  align-items: center;
  gap: 4mm;
}

#colophon .footer-1 img,
#colophon .footer-1 img:first-of-type {
  width: auto !important;
  max-width: 32mm !important;
  max-height: 12mm !important;
}

#colophon .footer-2,
#colophon .footer-kontakt {
  display: block !important;
  max-width: none !important;
  font-size: 8pt !important;
  line-height: 1.35;
}

#colophon .footer-kontakt p {
  margin: 0 0 1.5mm !important;
}

#colophon .footer-kontakt p:has(a[href*="google"]) {
  display: none !important;
}

#colophon a {
  text-decoration: none !important;
}

#colophon a::after {
  content: none !important;
}
