/* ══════════════════════════════════════════════════════════════════════════════
   SETTLEMENTRADAR — PRINT STYLESHEET
   Task #1031427: Desktop QA 11 — Print Stylesheet
   Applies to all pages. Optimised for settlement detail, pricing, about,
   filing confirmation, and guide pages.
   ══════════════════════════════════════════════════════════════════════════════ */

@media print {

  /* ── 1. PAGE SETUP ─────────────────────────────────────────────────────────
     Set paper margins and base typography. */
  @page {
    margin: 0.75in 0.75in 0.75in 0.75in;
    size: letter;
  }

  html, body {
    background: #ffffff !important;
    background-image: none !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    font-size: 12pt !important;
    font-family: 'Georgia', 'Times New Roman', serif !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── 2. HIDE CHROME / UI ELEMENTS ─────────────────────────────────────────
     Navigation, footer, sticky bars, modals, ads, chat widgets, etc. */

  /* Header / Navigation */
  header[role="banner"],
  header.site-header,
  #mainNav,
  .nav-hamburger,
  .nav-mobile-menu,
  .mega-panel,
  .mega-item,
  .nav-header-search,
  .nav-header-search-panel,
  .nav-search-dropdown,
  #navHeaderSearchPanel,
  #returningVisitorBanner,
  #srSwUpdateBanner { display: none !important; }

  /* Announcement / marketing bars */
  .announce-bar,
  #announceBar,
  .sr-pro-nudge-bar,
  .sr-pro-upsell-bar,
  #pastDueBanner { display: none !important; }

  /* Sticky CTAs and filing bars */
  .sticky-filing-bar,
  #stickyFilingBar,
  .sticky-b2b-bar,
  #sr-mobile-cta-bar,
  #sr-sticky-cta,
  .sr-fms-sticky,
  .fms-sticky-bar { display: none !important; }

  /* Scroll-to-top */
  #sr-back-to-top { display: none !important; }

  /* Settlement comparison float bar */
  #compareFloatBar,
  .compare-float-bar,
  #cfbChips { display: none !important; }

  /* Footer — all 3 tiers */
  footer,
  footer.sr-ramsey-footer,
  .site-footer,
  #site-footer,
  .sr-ft-outer,
  .sr-ft-inner,
  .sr-sitewide-share-strip,
  .sr-ft-bottom-section,
  .sr-ft-trust-strip,
  .sr-ft-seo-links,
  .sr-ft-newsletter,
  #sr-footer-ad-unit { display: none !important; }

  /* Chat / Settlement Finder widget */
  #srf-wrap,
  .sr-chat-bubble,
  #sr-chat-bubble,
  .sr-concierge,
  #srConcierge,
  .settlement-concierge,
  [id^="srf-"] { display: none !important; }

  /* Onboarding wizard */
  .onboarding-wizard,
  #onboardingWizard,
  .srOBW { display: none !important; }


  /* Social share buttons */
  .css-share-btn,
  .fs-hero-share-btn,
  .sr-share-btn,
  .share-btn,
  .share-strip,
  .sr-sitewide-share-strip,
  [class*="share-btn"],
  [class*="share-strip"] { display: none !important; }

  /* Exit intent / upsell modals and overlays */
  #exitIntentOverlay,
  #sr-exit-overlay,
  #sr-exit-popup,
  .sr-ep-overlay,
  .sas-overlay,
  .rir-overlay,
  #srProUpsellModal,
  .sr-pro-upsell-modal,
  [class*="exit-intent"],
  [class*="exit_intent"],
  [id*="exit-intent"],
  [class*="modal"][aria-modal="true"],
  [class*="overlay"][role="dialog"] { display: none !important; }

  /* Toast notifications */
  #scoreToast,
  #srSwUpdateBanner,
  .sr-toast,
  [id*="toast"] { display: none !important; }

  /* Cookie banners (third-party + first-party) */
  [id*="cookie"],
  [class*="cookie-banner"],
  [class*="cookie-consent"],
  [class*="gdpr"],
  [id*="gdpr"],
  #cookieBanner,
  .cookie-bar { display: none !important; }

  /* Payout ticker / live feed */
  .payout-ticker,
  #payoutTicker,
  .activity-ticker,
  #activityTicker { display: none !important; }

  /* Promo / urgency banners */
  .fomo-bar,
  .urgency-bar,
  .promo-banner { display: none !important; }

  /* ── 3. RESET BACKGROUNDS / COLORS ────────────────────────────────────────
     Remove navy/dark heroes, gradients, and colored backgrounds. */

  /* Hero sections */
  .rs-hero,
  .sp-hero,
  .sdr-hero,
  .pe-hero-v2,
  .pe-hero,
  .hero-section,
  .hero-compact,
  [class*="-hero"]:not([class*="nav"]) {
    background: #ffffff !important;
    background-image: none !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* Hero headlines / text */
  .rs-hero-headline,
  .rs-hero-subtitle,
  .sp-hero h1,
  .sp-hero h2,
  .sp-hero-headline,
  .sp-hero-sub,
  .pe-hero-headline,
  .sdr-hero-title,
  h1, h2, h3, h4, h5, h6 {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    background: none !important;
    background-clip: unset !important;
    -webkit-background-clip: unset !important;
    text-shadow: none !important;
  }

  /* Sections, cards, containers — strip dark/colored backgrounds */
  .sp-section,
  .rs-section,
  .pe-section,
  [class*="-section"]:not([class*="nav"]),
  .rs-card,
  .sp-card,
  .sdr-card,
  [class*="-card"],
  .feature-card,
  .guide-card {
    background: #ffffff !important;
    background-image: none !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    border-color: #e5e7eb !important;
  }

  /* Settlement detail premium card / hero */
  .sdr-hero-stats,
  .settlement-stats,
  .detail-stats-row,
  .settlement-detail-wrap,
  .sdp-hero,
  .sdp-meta {
    background: #ffffff !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  /* Nav bar strip that stays at top of body */
  body { padding-top: 0 !important; }

  /* ── 4. LINKS — SHOW URLS ──────────────────────────────────────────────────
     Show the href after link text so printed pages are navigable. */

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 80%;
    color: #4b5563;
    -webkit-text-fill-color: #4b5563;
    word-break: break-all;
  }

  /* Don't expand hash links, JS:void links, or empty hrefs */
  a[href^="#"]::after,
  a[href^="javascript"]::after,
  a[href=""]::after { content: "" !important; }

  /* Navigation links — don't show URLs (they're hidden but just in case) */
  header a[href]::after,
  nav a[href]::after,
  footer a[href]::after { content: "" !important; }

  /* ── 5. PAGE BREAKS ────────────────────────────────────────────────────────
     Avoid orphaned cards and split sections. */

  /* Main sections — never break inside */
  .rs-card,
  .sp-card,
  .sdr-card,
  [class*="-card"],
  .guide-card,
  .tool-card,
  .dir-card,
  .prc-card,
  .f-plan,
  .faq-item,
  .rs-section,
  [class*="-section"]:not([class*="nav"]) { page-break-inside: avoid; }

  /* Settlement detail key sections */
  .settlement-detail-section,
  .sdr-section,
  .sdp-section,
  .detail-section { page-break-inside: avoid; }

  /* Tables should not break in the middle of a row */
  table, tr, td, th { page-break-inside: avoid; }

  /* Major section headings — don't orphan heading from its content */
  h2, h3 { page-break-after: avoid; }

  /* ── 6. TYPOGRAPHY ─────────────────────────────────────────────────────────
     Readable font sizing for paper. */

  p, li, td, th, span, label { font-size: 10pt !important; line-height: 1.55 !important; }
  h1 { font-size: 20pt !important; margin-bottom: 0.4rem !important; }
  h2 { font-size: 15pt !important; margin-bottom: 0.3rem !important; }
  h3 { font-size: 13pt !important; margin-bottom: 0.2rem !important; }
  h4, h5, h6 { font-size: 11pt !important; }

  /* ── 7. LAYOUT FIXES ───────────────────────────────────────────────────────
     Ensure content fills the page properly. */

  .container,
  .rs-container,
  .sp-container,
  [class*="-container"],
  [class*="-inner"],
  .page-content,
  #main-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Remove fixed/sticky positioning from anything still visible */
  [style*="position:fixed"],
  [style*="position: fixed"],
  .position-fixed,
  [class*="sticky"]:not(.settlement-content) { position: static !important; }

  /* ── 8. PRINT HEADER — SettlementRadar BRANDING ───────────────────────────
     Inject a small branded header showing URL and date. */

  body::before {
    content: "SettlementRadar  ·  www.settlementradar.com  ·  America's Settlement Platform";
    display: block;
    font-size: 8pt;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6pt;
    margin-bottom: 12pt;
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.02em;
  }

  /* ── 9. IMAGES ─────────────────────────────────────────────────────────────
     Prevent images from overflowing; skip decorative backgrounds. */

  img { max-width: 100% !important; page-break-inside: avoid; }
  img[class*="bg-"],
  img[role="presentation"],
  .hero-bg-img,
  [class*="bg-image"] { display: none !important; }

  /* Settlement/company logos — keep, but constrain */
  .company-logo,
  .settlement-logo,
  img.logo { max-height: 60px !important; width: auto !important; }

} /* end @media print */
