/*
 * PDF Schichtprofil Stylesheet
 * Used for HTML → PDF conversion via Grover
 * A4 Landscape format with Print-CSS
 */

/* A4 Landscape Page Setup */
@page {
  size: A4 landscape;
  margin: 10mm 15mm;
}

/* PDF Body Styling */
body.pdf-view {
  font-family: Arial, sans-serif;
  font-size: 10pt;
  margin: 0;
  padding: 0;
  background: white;
  color: black;
}

/* PDF Header Section */
.pdf-header {
  border-bottom: 2px solid #000;
  padding-bottom: 5mm;
  margin-bottom: 5mm;
}

.pdf-header h1 {
  font-size: 14pt;
  margin: 0 0 3mm 0;
  font-weight: bold;
}

.pdf-header .metadata {
  font-size: 8pt;
  color: #333;
  margin-top: 3mm;
}

.pdf-header-left {
  float: left;
  width: 45%;
}

.pdf-header-right {
  float: right;
  width: 45%;
  text-align: right;
}

.pdf-header::after {
  content: "";
  display: table;
  clear: both;
}

/* Main 3-Column Layout */
.pdf-container {
  display: flex;
  width: 100%;
  height: auto; /* Let content determine height */
  max-height: 250mm; /* Force fit on A4 page (A4 landscape = 297x210mm, usable ~250mm) */
  overflow: visible; /* Allow scale-accurate rendering */
}

/* Column 1: Depth Scale (left side with red line) */
.depth-scale-column {
  width: 50mm;
  position: relative;
  flex-shrink: 0;
  border-right: 1px solid #ccc;
  border-left: 3px solid #FF0000; /* M4: Rote vertikale Linie (GOK-Markierung) */
  padding-left: 2mm; /* Spacing zwischen Linie und Tick-Marks */
}

/* Depth Scale Tick Marks */
.depth-scale-column .tick {
  position: absolute;
  left: 0;
  font-size: 8pt;
  width: 40mm;
  text-align: right;
  padding-right: 3mm;
  font-family: 'Courier New', monospace;
}

.depth-scale-column .gok-marker {
  font-weight: bold;
  color: #000;
}

/* Column 2: Layer Column (middle - will contain patterns in M5) */
.layer-column {
  width: 15mm; /* Narrower for better layout - descriptions fit beside */
  position: relative;
  flex-shrink: 0;
}

/* Layer Box Styling (M5: With PNG Pattern Backgrounds) */
.layer-box {
  border: 1px solid #999; /* Solid border für besseren Kontrast mit Patterns */
  margin-bottom: 0;
  padding: 0.5mm; /* Reduced padding for narrow 15mm column */
  background-color: transparent; /* Transparent für Pattern-Backgrounds */
  font-size: 5pt; /* Smaller text for 15mm width */
  line-height: 1.1;
  page-break-inside: avoid;
  position: relative;
  overflow: hidden; /* Clip overflowing text */
  /* Force background printing in PDF (Grover/Chrome) */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  color-adjust: exact;
}

.layer-box strong {
  font-weight: bold;
  color: #333;
}

/* Column 3: Description Column (right side) */
.description-column {
  width: 95mm; /* Wider - layer column now only 15mm instead of 25mm */
  padding-left: 5mm;
  font-size: 8pt; /* Slightly smaller for compact layout */
  flex-shrink: 0;
}

.description-column .description-item {
  margin-bottom: 0mm; /* No bottom margin - ultra-compact */
  page-break-inside: avoid;
  font-size: 7pt; /* Smaller for compact layout */
  line-height: 1.1; /* Very tight line spacing */
  padding: 0.5mm 0; /* Minimal vertical padding */
}

.description-column .description-item strong {
  font-weight: bold;
}

/* Page Break Control */
.layer-box,
.description-item {
  page-break-inside: avoid;
}

/* Print-specific adjustments */
@media print {
  body.pdf-view {
    background: white;
  }

  .pdf-container {
    page-break-inside: avoid;
  }
}

/* Utility Classes */
.text-bold {
  font-weight: bold;
}

.text-small {
  font-size: 8pt;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Placeholder for M4: Red vertical line (will be added as border-left) */
/* .depth-scale-column { border-left: 3px solid #FF0000; } */

/* Placeholder for M5: Pattern backgrounds (will be added dynamically) */
/* .layer-box { background-image: url("..."); background-size: auto; background-repeat: repeat; } */
