/* The Capital Coffee Platform v7.3.1 — browser print/PDF image preservation */
@media print {
  @page { size: A4 portrait; margin: 12mm; }

  html,
  body,
  body.tcc-print-compact,
  body.tcc-design-sync {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Do not let entrance animations/lazy visual states hide printable content. */
  body :where(
    [data-aos],
    .aos-init,
    .aos-animate,
    .tcc-reveal,
    .reveal,
    .is-animated,
    .tcc-product-card,
    .tcc-process-grid article,
    .tcc-experience-card,
    .tcc-journal-card,
    .tcc-marketplace-card
  ) {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* Restore homepage hero media that older compact-print rules intentionally hid. */
  body.home .tcc-hero,
  body.tcc-print-compact.home .tcc-hero {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    min-height: 112mm !important;
    height: 112mm !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #062c22 !important;
    color: #fff !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.home .tcc-hero__media,
  body.tcc-print-compact.home .tcc-hero__media {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    background-image: var(--hero-bg) !important;
    background-size: cover !important;
    background-position: var(--hero-bg-position, center) !important;
  }
  body.home .tcc-hero__overlay,
  body.tcc-print-compact.home .tcc-hero__overlay {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(90deg, rgba(3, 25, 19, .86), rgba(3, 25, 19, .28)) !important;
  }
  body.home .tcc-hero__product,
  body.tcc-print-compact.home .tcc-hero__product {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 43% !important;
    max-height: 88% !important;
    filter: none !important;
  }
  body.home .tcc-hero__content,
  body.tcc-print-compact.home .tcc-hero__content {
    position: relative !important;
    z-index: 3 !important;
    width: 58% !important;
    padding: 14mm 0 !important;
  }
  body.home .tcc-hero__content :where(h1, p, small, span),
  body.tcc-print-compact.home .tcc-hero__content :where(h1, p, small, span) {
    color: #fff !important;
    text-shadow: 0 1px 8px rgba(0,0,0,.38) !important;
  }
  body.home .tcc-hero h1,
  body.tcc-print-compact.home .tcc-hero h1 {
    font-size: 29pt !important;
    line-height: 1.02 !important;
  }
  body.home .tcc-hero .tcc-actions { display: none !important; }

  /* Keep real images and card media in the PDF. */
  body :where(
    .tcc-product-card,
    .tcc-product-card__media,
    .tcc-product-card__body,
    .tcc-process-grid,
    .tcc-process-grid article,
    .tcc-experience-grid,
    .tcc-experience-card,
    .tcc-experience-card__media,
    .tcc-experience-card__body,
    .tcc-journal-grid,
    .tcc-journal-card,
    .tcc-journal-card__media,
    .tcc-journal-card__body,
    .tcc-marketplace-grid,
    .tcc-marketplace-card
  ) {
    visibility: visible !important;
  }
  body :where(
    .tcc-product-card img,
    .tcc-experience-card img,
    .tcc-journal-card img,
    .tcc-about__visual img,
    .tcc-process-grid img,
    .tcc-marketplace-card img
  ) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  body .tcc-product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6mm !important;
  }
  body .tcc-process-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5mm !important;
  }
  body .tcc-experience-grid,
  body .tcc-journal-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6mm !important;
  }

  /* Maintain dark section readability instead of printing black text on dark blocks. */
  body :where(.tcc-process, .tcc-process-section, .tcc-process-quality) {
    background: #073b2e !important;
    color: #fff !important;
  }
  body :where(.tcc-process, .tcc-process-section, .tcc-process-quality) :where(h1,h2,h3,p,span,li) {
    color: #fff !important;
  }

  body :where(.tcc-section, .tcc-a-section) {
    min-height: 0 !important;
    padding-block: 10mm !important;
  }
  body :where(.tcc-product-card, .tcc-process-grid article, .tcc-experience-card, .tcc-journal-card, .tcc-marketplace-card) {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Preserve marketplace/footer logos while still hiding navigation-only footer chrome. */
  body :where(.tcc-marketplace, .tcc-marketplace-section, .tcc-marketplace-grid) {
    display: block !important;
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body .tcc-marketplace-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 3mm !important;
  }

  /* Avoid blank pages created by oversized minimum heights. */
  body :where(.tcc-products, .tcc-process, .tcc-experience, .tcc-journal, .tcc-marketplace) {
    min-height: 0 !important;
  }
}

/* v7.3.3 — compact A4 print layout */
@media print {
  @page { size:A4 portrait; margin:9mm; }
  body.home .tcc-hero,
  body.tcc-print-compact.home .tcc-hero{
    min-height:88mm!important;
    height:88mm!important;
  }
  body.home .tcc-hero__content,
  body.tcc-print-compact.home .tcc-hero__content{
    width:60%!important;
    padding:8mm 0!important;
  }
  body.home .tcc-hero h1,
  body.tcc-print-compact.home .tcc-hero h1{font-size:25pt!important}
  body.home .tcc-hero__lead,
  body.tcc-print-compact.home .tcc-hero__lead{font-size:10.5pt!important;line-height:1.45!important;margin-top:4mm!important}

  body :where(.tcc-section,.tcc-a-section){padding-block:5mm!important}
  body :where(.tcc-section-head,.tcc-about-section__head,.tcc-process-section__head,.tcce-section-head,.tccb-section-head){margin-bottom:4mm!important}

  body .tcc-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3.5mm!important}
  body .tcc-product-card__body{padding:4mm!important}
  body .tcc-product-card img{aspect-ratio:1/1!important;object-fit:contain!important}
  body .tcc-product-card h3{font-size:15pt!important;margin-bottom:2mm!important}
  body .tcc-product-card p{font-size:9.5pt!important;line-height:1.4!important;min-height:0!important;margin-bottom:2mm!important}
  body .tcc-product-price{margin:2mm 0!important;font-size:10pt!important}

  body .tcc-process-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3mm!important}
  body .tcc-process-grid article{padding:4mm!important;min-height:0!important}
  body .tcc-process-grid h3{font-size:11pt!important;line-height:1.2!important;margin:1.5mm 0!important;color:#fff!important}
  body .tcc-process-grid p{font-size:9pt!important;line-height:1.35!important;color:#fff!important;margin:0!important}
  body .tcc-process-grid span{color:#d6a04f!important}

  body .tcc-experience-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3.5mm!important}
  body .tcc-experience-card{min-height:62mm!important;height:62mm!important}
  body .tcc-experience-card div{left:4mm!important;right:4mm!important;bottom:4mm!important}
  body .tcc-experience-card h3{font-size:12pt!important;margin-bottom:1mm!important;color:#fff!important}
  body .tcc-experience-card p{font-size:9pt!important;line-height:1.35!important;color:#fff!important}

  body .tcc-journal-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3.5mm!important}
  body .tcc-journal-card__body{padding:4mm!important}
  body .tcc-journal-card h3{font-size:12pt!important}

  body.home .tcc-cta{min-height:52mm!important;padding:8mm 0!important}
  body.home .tcc-cta h2{font-size:25pt!important;line-height:1.05!important}
  body.home .tcc-cta p{font-size:9.5pt!important;margin-bottom:0!important}

  body :where(.tcc-product-card,.tcc-process-grid article,.tcc-experience-card,.tcc-journal-card,.tcc-marketplace-card){
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  body :where(.tcc-products,.tcc-process,.tcc-experience,.tcc-journal,.tcc-marketplace){
    break-inside:auto!important;
    page-break-inside:auto!important;
  }
}
