/**
 * Nam Việt — Print stylesheet (Story 3-5).
 *
 * Enqueued site-wide with media="print" via inc/hooks-frontend.php (handle
 * `nv-print`). Goal: any page prints as a clean, ink-friendly document —
 * black text on white, no dark hero/section backgrounds, no interactive
 * chrome (nav, CTA bands, forms, share, pagination), readable links.
 *
 * Scope: only affects @media print. Screen rendering is untouched.
 */

@media print {

  /* ============ PAGE SETUP ============ */
  @page {
    margin: 1.6cm;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Flatten every dark/colored surface so text stays legible on paper.
     Targets the common section/hero/card wrappers used across templates.
     Pseudo-elements are included so hero overlay gradients (e.g.
     `.nv-form-hero::before`) don't print as grey ink bands. */
  body, body *,
  body *::before, body *::after {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    color: #000 !important;
    /* Neutralise scroll-reveal / sticky transforms that hide content. */
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  /* Headings keep weight but print solid black. */
  h1, h2, h3, h4, h5, h6 { color: #000 !important; page-break-after: avoid; }

  /* Links: black, no underline noise; expand real URLs in body content only. */
  a { color: #000 !important; text-decoration: none !important; }

  /* ============ HIDE INTERACTIVE / NON-CONTENT CHROME ============ */
  .skip-link,
  .top-bar,
  .mobile-menu-btn,
  .main-nav, .nav-en,
  .nav-cta, .nav-en-cta,
  .lang-switch, .lang-switcher, [class*="lang-switch"],
  /* CTA bands + their buttons */
  .cta-section, .about-cta, .cons-cta, .rec-cta, .rec-cta-banner,
  .cta-en, .product-cta,
  .btn-primary, .btn-secondary,
  .btn-cta-outline, .btn-cta-secondary,
  /* Share + social */
  .nv-share, .nv-share-btn, .rec-share-btn,
  /* Pagination + filters */
  .pagination, .page-numbers, .nv-news-filter, .nv-filter-bar,
  .product-filter, .filter-group, .sort-control,
  /* Quote step indicator (form is hidden, so the 1-2-3 stepper is moot) */
  .form-steps,
  /* Product gallery thumbnail strip (keep the main image only) */
  .gallery-thumbnails, .thumbnail-strip,
  /* Forms are not useful on paper */
  .gform_wrapper, .gform-footer, .gform_footer,
  .nv-apply-modal, .nv-apply-overlay,
  /* Maps embed */
  iframe,
  /* Generic utility */
  [aria-hidden="true"][class*="arrow"],
  [role="toolbar"] {
    display: none !important;
  }

  /* ============ HEADER: keep brand only ============ */
  .site-header, .header-en {
    position: static !important;
    border-bottom: 1px solid #ccc !important;
    padding: 8px 0 !important;
  }
  .logo-img { max-height: 56px !important; }
  /* Force the dark EN logo variant (light logo is invisible on white). */
  .logo-light { display: none !important; }
  .logo-dark { display: inline-block !important; }

  /* ============ LAYOUT: single column, full width ============ */
  .container { max-width: 100% !important; padding: 0 !important; }
  .rec-content, [class*="-grid"], [class*="__grid"] {
    display: block !important;
  }

  /* ============ MEDIA ============ */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Avoid awkward breaks inside meaningful blocks. */
  article, section, .nv-news-card, .specs-table, tr, figure, blockquote {
    page-break-inside: avoid;
  }

  /* ============ TABLES (product specs) ============ */
  table { border-collapse: collapse !important; width: 100% !important; }
  th, td { border: 1px solid #999 !important; padding: 6px 8px !important; }

  /* ============ FOOTER: flatten to a compact contact block ============ */
  .site-footer, .footer-en {
    border-top: 1px solid #ccc !important;
    padding: 12px 0 !important;
    font-size: 10pt;
  }

  /* ============ EXPAND IN-CONTENT LINK URLs ============ */
  /* Only inside editorial content — avoids cluttering nav/sidebar links.
     Skip fragment + javascript + tel/mailto (already self-describing). */
  .nv-single__content a[href^="http"]::after,
  .rec-section a[href^="http"]::after,
  .entry-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555 !important;
    word-break: break-all;
  }
}
