/* Shared print stylesheet for all FeToolKit analytical tools.
   Hides interactive chrome (nav, sliders, buttons) and renders a clean,
   properly branded report: title block with logo + accent bar, readable
   typography, color-coded section headers, and a footer. Each tool's
   existing inline-styled result boxes (light backgrounds, colored borders,
   from the site's light theme) already print reasonably as-is -- this
   sheet focuses on the report structure around them, not overriding their
   individual colors. */
@page {
  margin: 16mm 14mm;
}
@media print {
  html, body { background: #ffffff !important; }
  body[data-page="tools"] { background: #ffffff !important; }

  .site-header, .footer, .back-btn, .print-exclude, details > summary { display: none !important; }
  details { display: block !important; }
  details > div { display: block !important; }
  .section-hero, .section-bar { display: none !important; }
  .research-import { background: #ffffff !important; color: #1e3348 !important; font-size: 12.5pt; line-height: 1.5; }

  h1, h2, h3, h4 { page-break-after: avoid; }
  canvas, svg, img { max-width: 100% !important; page-break-inside: avoid; }
  table { page-break-inside: avoid; border-collapse: collapse; width: 100%; }
  table th, table td { padding: 5pt 8pt !important; }
  /* Compact result/summary grids (small minmax, plain text) get multiple
     columns; wider panel grids (larger minmax) typically hold dropdowns
     and other form controls whose text can't wrap, so they get a single
     full-width column instead -- two columns at print width is still too
     narrow for a long dropdown option to display without being clipped. */
  div[style*="grid-template-columns"] { display: grid !important; gap: 8pt 14pt !important; }
  div[style*="minmax(150px"], div[style*="minmax(160px"] { grid-template-columns: repeat(3, 1fr) !important; }
  div[style*="minmax(260px"], div[style*="minmax(280px"], div[style*="minmax(320px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns"] > div { margin-bottom: 0 !important; page-break-inside: avoid; }
  select { width: 100% !important; max-width: 100% !important; }

  .print-report-only { display: block !important; }
  .print-logo-header { display: flex !important; }

  /* Report title block: logo, tool name, generated timestamp, accent bar */
  .print-report-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 10pt;
    margin-bottom: 14pt;
    border-bottom: 3px solid var(--print-accent, #c26a12);
  }
  .print-report-header .prh-brand { display: flex; align-items: center; gap: 10pt; }
  .print-report-header img { height: 30pt; width: auto; }
  .print-report-header .prh-name { font-family: 'Orbitron', monospace; font-weight: 900; color: #16324f; font-size: 12pt; letter-spacing: 0.5pt; }
  .print-report-header .prh-title { font-family: 'Orbitron', monospace; font-weight: 700; color: var(--print-accent, #c26a12); font-size: 10.5pt; text-transform: uppercase; letter-spacing: 1pt; margin-top: 2pt; }
  .print-report-header .prh-meta { text-align: right; color: #5c7590; font-size: 9pt; line-height: 1.5; }

  /* Report footer, repeated via CSS @page isn't reliable cross-browser, so
     this is placed once at the end of the printable content instead. */
  .print-report-footer {
    display: block !important;
    margin-top: 18pt;
    padding-top: 8pt;
    border-top: 1px solid #d8e2ec;
    color: #8aa0b8;
    font-size: 8.5pt;
    text-align: center;
  }

  a[href]:after { content: none !important; }
  input[type="range"] { display: none !important; }
  button { display: none !important; }
}
.print-report-only { display: none; }
.print-logo-header, .print-report-header, .print-report-footer { display: none; }
.print-logo-header {
  align-items: center;
  gap: 0.6rem;
  border-bottom: 2px solid #c26a12;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}
.print-logo-header img { height: 36px; width: auto; }
.print-logo-header span { font-family: 'Orbitron', monospace; font-weight: 900; color: #16324f; font-size: 1rem; }
