/* ============================================================
   fn-print-save.css — Print-to-PDF + Save-to-Browser UI styles
   Phase A + B: PR feat/print-pdf-save-localStorage-sitewide-2026-05-29
   Loaded by ALL calc pages (classic-arch + new-arch).
   New-arch pages already load fn-styles.css which includes these rules;
   this file is the standalone load for classic-arch calcs.
   ============================================================ */

/* --- Print button (screen only) --- */
.fn-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2E5266;
  color: #FFFCF4;
  border: 0;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin: 14px 0 4px;
  letter-spacing: 0.02em;
  transition: background 0.15s;
  font-family: "Inter", sans-serif;
}
.fn-print-btn:hover { background: #1F4A5E; }
.fn-print-btn:active { transform: translateY(1px); }

/* --- Save note microcopy (screen only) --- */
.fn-save-note {
  font-size: 12px;
  color: #4A4438;
  margin: 4px 0 12px;
  line-height: 1.5;
}
.fn-save-restored-hint {
  display: none;
  font-weight: 700;
  color: #0E9A8C;
  margin-left: 4px;
}
.fn-save-clear-btn {
  background: transparent;
  color: #2E5266;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  margin-left: 8px;
}
.fn-save-clear-btn:hover { color: #C75D2F; }

/* ============================================================
   @MEDIA PRINT — clean PDF output
   Hides: nav, ads, sidebar, related pills, footer, all .no-print.
   Keeps: hero (stripped), calc inputs+values, result box,
          methodology, sources, byline, last-reviewed stamp.
   ============================================================ */
@media print {
  /* --- Hide non-content elements --- */
  header,
  .fn-nav,
  nav,
  footer,
  .fn-footer,
  .ad-slot,
  .ad-slot-post-calc,
  .affiliate-cta,
  .fn-related,
  .fn-sidebar,
  .no-print,
  .fn-print-btn,
  .fn-save-note,
  .fn-save-clear-btn,
  .calc-btn,
  .fn-btn,
  .mode-toggle,
  #fn-theme-toggle,
  .fn-nav__links,
  [class*="ad-slot"],
  [data-slot] {
    display: none !important;
  }

  /* --- Page setup --- */
  @page {
    margin: 0.5in;
  }

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

  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 13pt;
  }

  /* --- Show result even if still hidden --- */
  .result,
  .fn-result-section,
  .fn-result-visible {
    display: block !important;
  }

  /* --- Result box print style --- */
  .result,
  .fn-result-section {
    border: 2px solid #2E5266 !important;
    padding: 14px 18px !important;
    margin: 18px 0 !important;
    border-radius: 6px !important;
    background: #F5F9FC !important;
  }

  /* --- Byline separator --- */
  .fn-editorial-byline,
  .fn-byline {
    border-bottom: 1px solid #aaa;
    padding-bottom: 6px;
    margin-bottom: 10px;
  }

  /* --- Expand URLs for print --- */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #555;
    word-break: break-all;
  }
  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: "";
  }

  /* --- Page break helpers --- */
  h2, h3 { page-break-after: avoid; }
  .fn-result-section, .result { page-break-inside: avoid; }

  /* --- FigureNerd print watermark --- */
  body::after {
    content: "FigureNerd.com — Free calculator. Not financial advice.";
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #999;
    margin-top: 32pt;
    border-top: 1px solid #ddd;
    padding-top: 8pt;
  }
}
