/* Print Stylesheet (generated based on mobile.css structure)
 * Goal: Provide a clean, readable print layout that mirrors mobile layout proportions
 * while optimizing for paper (A4/Letter) and reducing unnecessary UI elements.
 */

/* Page box & base adjustments */
@page {
  size: A4 portrait; /* Let browser adjust if content wider */
  margin: 15mm;      /* Comfortable reading margin */
}

@media print {
  /* Root variables tuned for print */
  :root {
    --main-padding: 1rem; /* Margins handled by @page */
    --text-width: 100%;
  }

  /* Basic reset for print */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.35;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: auto !important;
    overflow: visible !important;
  }

  body {
    /* font-family: var(--font-body, system-ui, Arial, sans-serif); */
  }

  /* Typography (mirrors mobile scale but in pts for print clarity) */
  .h0 { font-size: 42pt; line-height: 1; }
  h1, .h1 { font-size: 26pt; }
  h2, .h2 { font-size: 22pt; }
  h3, .h3 { font-size: 16pt; }
  h4, .h4 { font-size: 14pt; }
  h5, .h5 { font-size: 13pt; }
  h6, .h6 { font-size: 12pt; }

  .h0, h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { line-height: 1.2; page-break-after: avoid; }

  p, li, figcaption { font-size: 11pt; line-height: 1.4; }
  figcaption { font-style: italic; }

  /* Links: show URL for external links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }
  /* Skip printing long media URLs for anchors that wrap images */
  a:has(img):after { content: "" !important; }

  /* Hide non-essential / interactive UI */
  header.site-header,
  nav,
  footer .social-media,
  .menu-overlay,
  .swiper,
  swiper-container,
  .slideshow-nav,
  .mobile-slideshow-controls,
  .publication-navigation,
  .publication-controls,
  button,
  .button,
  .tag,
  .filter,
  .language-switcher,
  .notification-bar,
  .accessibility-menu,
  .view-navigation,
  .month.navigation,
  .swiper-controls,
  .swiper-button-prev,
  .swiper-button-next,
  .publication-prev-btn,
  .publication-next-btn { display: none !important; }

  /* Layout containers */
  main {/* display: block; */gap: 1rem 0;}

  /* Article width adjustments for print
     - Provide a readable measure (60–80ch) and center on page.
     - Allow full-width blocks (images, banners) to extend slightly. */
  article, .article, article.documenta-content {
    max-width: 80ch; /* Narrower width for print readability */
    width: 100%;
    margin: 0 auto 2rem auto;
    display: flex;
    gap: 1.25rem;
    flex-direction: column;
  }

  /* Paragraph spacing similar to mobile rhythm */
  article p + p,
  article h2 + p,
  article h3 + p,
  article h4 + p,
  article h5 + p,
  article p + ul { margin-top: 0.75rem; }
  article p + :is(h1,h2,h3,h4,h5,h6) { margin-top: 1.5rem; }

  /* Multi-column / grid simplification */
  article .column_2_grid,
  section#retrospektive-director,
  article .column { display: block !important; }

  article .column > * { order: 0 !important; }

  /* Full-width visual elements */
  .block.image figure,
  .block.bigbanner a,
  li.news-article.featured figure,
  .director-image figure,
  section.main-banner div.background-image img {
    margin: 1rem 0;
    width: 100%;
    max-width: 100%;
    page-break-inside: avoid;
  }

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

  figure { break-inside: avoid; page-break-inside: avoid; }

  /* Remove forced aspect ratios for print */
  .block.image img, .director-section img { max-height: none !important; }

  /* Hide elements only meaningful on screen */
  .hide-print { display: none !important; }
  .hide-large, .hide-small { display: initial !important; }

  /* Footer: keep minimal contact / legal info */
  footer { margin-top: 3rem; font-size: 9pt; color: #444; }
  footer address { width: 100% !important; font-style: normal; }

  /* Lists that were grid-based collapse to simple flow */
  ul:is(.news-list, .events-list, .exhibition-list, .jobs-list, .external-downloads-list, .retrospective-list, .publication-list) {
    display: block !important;
    margin: 0; padding: 0; list-style: none;
  }
  ul:is(.news-list, .events-list, .exhibition-list) > li { margin: 0 0 1.25rem 0; page-break-inside: avoid; }

  /* Artist list / long inline lists wrap naturally */
  ul.artist-list, ul.institutions-list { font-size: 9pt; column-count: auto; }

  /* Captions & related blocks */
  article .related { padding: 0; }
  .related h3.article-title { font-size: 12pt; }

  /* Prevent awkward breaks */
  h1, h2, h3, h4, h5, h6 { break-after: avoid-page; }
  p, ul, ol, figure { orphans: 3; widows: 3; }

  /* Accessibility adjustments not needed in print: override bigger font sizes */
  main.accessibility, main.accessibility p { font-size: inherit; line-height: inherit; }

  /* Clean anchor styling */
  a { color: #000; text-decoration: underline; }

  /* Remove language switcher absolute positioning side-effects */
  nav.main-menu ul.language-switcher { position: static; }
  
  
  swiper-container.swiper.artists.overflowing {
      display: block !important;
      /* overflow: unset; */
      /* flex-direction: column !important; */
    }
    
    ::slotted(swiper-slide) {
        position: inherit;
    }
    
    swiper-container.overflowing::part(container) {
        display: flex;
        flex-direction: column;
    }
    
    .swiper-android ::slotted(swiper-slide), .swiper-ios ::slotted(swiper-slide), .swiper-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    swiper-container.artists swiper-slide {
        width: auto;
        height: auto;
    }

    swiper-container::part(wrapper) {
        flex-wrap: wrap;
        /* flex-direction: column; */
        gap: var(--main-padding);
    }
}