/* Print styles for TreasureMap - optimized for field use */
@media print {
  /* Hide map and interactive elements */
  #map,
  .leaflet-container,
  .leaflet-control-container,
  .leaflet-pane,
  .leaflet-map-pane,
  .leaflet-tile-pane,
  .leaflet-overlay-pane,
  .leaflet-shadow-pane,
  .leaflet-marker-pane,
  .leaflet-popup-pane,
  .leaflet-control-zoom,
  .leaflet-control-attribution {
    display: none !important;
  }

  /* Hide sidebar and filters */
  #sidebar,
  .sidebar,
  #filters,
  .filters,
  .filter-btn,
  .category-filters,
  .era-filters {
    display: none !important;
  }

  /* Hide modals and overlays */
  #siteModal,
  .modal,
  .modal-overlay,
  .site-modal,
  #legalModal,
  #cookieBanner {
    display: none !important;
  }

  /* Hide header elements except title */
  header .actions,
  header .filters,
  header button:not(.print-only) {
    display: none !important;
  }

  /* Show and optimize site list */
  #siteList,
  .site-list,
  #results,
  .results-container {
    display: block !important;
    width: 100% !important;
    position: static !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* Ensure site list is visible */
  .site-list-container {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Style site items for print */
  .site-item,
  .result-item,
  .site-card {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }

  /* Hide images in site list to save ink */
  .site-item img,
  .result-item img,
  .site-thumb {
    display: none !important;
  }

  /* Show coordinates and details */
  .site-coords,
  .coordinates,
  .lat-lon {
    display: inline !important;
    font-family: monospace;
    font-size: 10pt;
  }

  /* Optimize text for print */
  body {
    font-size: 11pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }

  h1 {
    font-size: 18pt;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 14pt;
    margin-top: 15px;
    margin-bottom: 8px;
  }

  h3 {
    font-size: 12pt;
  }

  /* Show priority and category clearly */
  .site-priority,
  .priority-badge,
  .cat-badge {
    display: inline-block !important;
    padding: 2px 6px;
    border: 1px solid #000;
    margin-right: 5px;
  }

  /* Ensure links show their URLs */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Hide footer */
  footer,
  .footer {
    display: none !important;
  }

  /* Print header with site count */
  .print-header {
    display: block !important;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
  }

  .print-header h1 {
    font-size: 20pt;
    margin: 0;
  }

  .print-header .subtitle {
    font-size: 12pt;
    color: #333;
    margin-top: 5px;
  }

  /* Compact layout for field use */
  .site-description {
    font-size: 10pt;
    max-height: none;
    overflow: visible;
  }

  .site-meta {
    font-size: 9pt;
  }

  /* Page breaks */
  .page-break {
    page-break-before: always;
  }

  /* Hide decorative elements */
  .decoration,
  .ornament,
  .divider {
    display: none !important;
  }

  /* Show print-only elements */
  .print-only {
    display: block !important;
  }

  /* Compact table styles */
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  th, td {
    border: 1px solid #000;
    padding: 4px 6px;
    text-align: left;
  }

  th {
    background: #eee;
  }

  /* Hide map legend */
  .legend,
  .map-legend {
    display: none !important;
  }

  /* Ensure proper color contrast for black and white printing */
  * {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}

/* Screen-only elements (hidden in print) */
@media screen {
  .print-only {
    display: none !important;
  }
}
