/* Shared print layout for all eight ICUA patient guides. */
.print-only {
  display: none !important;
}

@page {
  size: A4 portrait;
  margin: 14mm;
}

@media print {
  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #231f20 !important;
    font-size: 10.5pt !important;
    line-height: 1.5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }

  .rv,
  .rv.in {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .nav,
  .lang,
  .skip,
  .btns,
  .guide-tools,
  .reviewbar,
  .original-review,
  .chat-fab,
  .chat-panel,
  .ai-modal,
  .ai-embed,
  tavus-embed,
  .td-stage,
  .td-play,
  .td-bar,
  button,
  iframe {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  main,
  section,
  .wrap,
  .read,
  .grid2,
  .grid2.wide-left {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .wrap {
    padding-inline: 0 !important;
    margin-inline: 0 !important;
  }

  .sec {
    padding-block: 6mm !important;
  }

  .grid2,
  .grid2.wide-left,
  .pl-grid,
  .pl-grid.single,
  .pl-grid.single .pl-step figure,
  .timeline,
  .tl {
    display: block !important;
  }

  .grid2 > * + *,
  .pl-step + .pl-step {
    margin-top: 5mm !important;
  }

  .pl-grid:not(.single) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3mm !important;
    break-inside: avoid-page;
  }

  .pl-grid:not(.single) .pl-step {
    margin-top: 0 !important;
  }

  .figure-panel.plates:has(.pl-grid:not(.single)),
  .study,
  .oneliner,
  .note {
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  .topbar {
    margin-bottom: 4mm;
    border-bottom: 1px solid #bbb;
  }

  .topbar .wrap {
    min-height: 0 !important;
    padding-block: 0 3mm !important;
  }

  .brand img {
    width: auto !important;
    height: 10mm !important;
    max-width: 65mm !important;
  }

  .hero,
  .hero .wrap {
    display: block !important;
    position: static !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 0 6mm !important;
    overflow: visible !important;
    background: #fff !important;
    color: #231f20 !important;
  }

  .hero::before,
  .hero::after {
    content: none !important;
    display: none !important;
  }

  .hero h1,
  .hero .sub,
  .hero .eyebrow,
  .hero p,
  .hero strong,
  .hero a,
  .hero small {
    color: #231f20 !important;
    text-shadow: none !important;
  }

  .hero .sub {
    max-width: none !important;
    font-size: 12pt !important;
    margin-bottom: 4mm !important;
  }

  h1,
  .hero h1 {
    font-size: 28pt !important;
    line-height: 1.12 !important;
  }

  h2 {
    font-size: 17pt !important;
  }

  h3 {
    font-size: 12.5pt !important;
  }

  h4 {
    font-size: 10.5pt !important;
  }

  h1,
  h2,
  h3,
  h4,
  .kicker,
  .pl-h3 {
    break-after: avoid-page;
    page-break-after: avoid;
  }

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

  a {
    color: #175b55 !important;
    overflow-wrap: anywhere;
    text-decoration: underline;
  }

  /* PDF links stay clickable without repeating long tracking URLs in print. */
  a[href^="http"]::after {
    content: none !important;
  }

  img,
  svg {
    max-width: 100% !important;
    height: auto !important;
    max-height: 150mm;
    object-fit: contain !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  svg,
  svg * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hero-figure svg {
    display: block !important;
    width: 100% !important;
    max-height: 120mm;
  }

  figure,
  .figure-panel,
  .pl-wide,
  .portrait,
  .banner,
  .tablewrap,
  .timeline,
  .yt-thumb {
    overflow: visible !important;
    transform: none !important;
    border-radius: 0 !important;
  }

  /* Large multi-figure panels may span pages; individual figures stay together. */
  .figure-panel,
  .pl-grid,
  .grid2,
  .timeline {
    break-inside: auto;
    page-break-inside: auto;
  }

  .pl-step,
  .pl-step figure,
  .pl-wide,
  .hero-figure,
  .portrait,
  .banner,
  .figure-panel.td,
  .figure-key {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .figure-panel,
  .hero-figure {
    padding: 4mm !important;
    margin: 5mm 0 !important;
    border: 1px solid #ccc !important;
  }

  .pl-step img,
  .pl-wide img,
  .portrait img,
  .banner img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 110mm !important;
    aspect-ratio: auto !important;
    margin-inline: auto !important;
  }

  figcaption,
  .pl-step figcaption,
  .pl-wide figcaption,
  .figure-panel figcaption {
    font-size: 9.25pt !important;
    line-height: 1.45 !important;
    color: #3d3d3d !important;
    margin-top: 3mm !important;
  }

  .pl-t,
  .pl-d {
    font-size: inherit !important;
  }

  .print-hero,
  .print-poster {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100mm !important;
    object-fit: contain !important;
    margin: 5mm auto !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .print-hero img,
  .print-poster img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100mm !important;
    object-fit: contain !important;
  }

  .tablewrap {
    width: 100% !important;
    min-width: 0 !important;
    margin: 4mm 0 !important;
    break-inside: auto;
  }

  table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed;
    font-size: 8.75pt !important;
    border-collapse: collapse;
  }

  th,
  td {
    padding: 2mm !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
    color: #231f20 !important;
    background: #fff !important;
    border: 1px solid #bbb !important;
  }

  thead {
    display: table-header-group;
  }

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

  caption {
    color: #3d3d3d !important;
    font-size: 9pt !important;
    padding: 2mm !important;
  }

  .faq details {
    display: block !important;
    break-inside: auto;
  }

  .faq details > :not(summary) {
    display: block !important;
  }

  .faq summary {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .faq summary::after {
    display: none !important;
  }
}
