/* =============================================================================
 *  paceband.css — pace band export UI + print styles
 *  Screen: hides print container; Print: shows only #paceband-print
 * ============================================================================= */

/* ---------- paceband export control group (screen only) ---------- */
.paceband-controls {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1.5px solid var(--moss, #2d4a3e);
  background: var(--paper-2, #ebe0c5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paceband-controls .pb-label {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--moss-2, #3e6452);
  font-family: "SF Mono", ui-monospace, monospace;
  margin-bottom: 2px;
}

.paceband-controls .pb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.paceband-controls .pb-format-group {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--moss, #2d4a3e);
}

.paceband-controls .pb-format-group button {
  background: var(--paper, #f4ebd9);
  border: none;
  border-right: 1px solid var(--moss, #2d4a3e);
  padding: 6px 14px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--moss-2, #3e6452);
  transition: background .12s, color .12s;
}

.paceband-controls .pb-format-group button:last-child {
  border-right: none;
}

.paceband-controls .pb-format-group button.pb-active {
  background: var(--moss, #2d4a3e);
  color: var(--paper, #f4ebd9);
}

.paceband-controls .pb-copies-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--moss-2, #3e6452);
  cursor: default;
}

.paceband-controls .pb-copies-label select {
  background: var(--paper, #f4ebd9);
  border: 1.5px solid var(--moss, #2d4a3e);
  color: var(--moss-2, #3e6452);
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 10px;
  padding: 5px 8px;
  cursor: pointer;
  appearance: auto;
}

.paceband-controls .pb-export-btn {
  background: var(--rust, #a14826);
  color: var(--paper, #f4ebd9);
  border: 1.5px solid var(--rust, #a14826);
  padding: 9px 18px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .15s;
}

.paceband-controls .pb-export-btn:hover {
  opacity: .85;
}

.pb-hint {
  font-size: 12px;
  color: var(--rust, #a14826);
  font-style: italic;
  display: none;
}

.pb-hint.visible {
  display: block;
}

/* ---------- print container hidden on screen ---------- */
#paceband-print {
  display: none;
}

/* =============================================================================
 *  @media print
 *  Hide everything; show only #paceband-print as white A4 strips
 * ============================================================================= */
@media print {
  /* hide entire page */
  body > *:not(#paceband-print) {
    display: none !important;
  }

  /* also hide any injected elements */
  header, nav, footer, .modal {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    background-image: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    color: #000000 !important;
    font-family: "SF Mono", monospace !important;
  }

  #paceband-print {
    display: block !important;
    background: #ffffff !important;
    padding: 8mm !important;
    margin: 0 !important;
  }

  /* lay strips side by side across A4 portrait (usable width ≈ 190mm, each strip 60mm)
   * flex-wrap:wrap lets them tile naturally — 3 per row max on A4 portrait.
   * IMPORTANT: .pb-cut must NOT be width:100% here; it sits inline between strips.
   * For copies=1 there is no cut divider at all. */
  .pb-sheet {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  /* each wristband strip */
  .pb-strip {
    width: 60mm;        /* narrow wristband width */
    min-height: 24mm;
    border: 1pt solid #000000;
    padding: 3mm 3mm 2mm;
    background: #ffffff;
    color: #000000;
    font-family: "SF Mono", monospace;
    page-break-inside: avoid;
    break-inside: avoid;
    display: inline-flex;
    flex-direction: column;
    vertical-align: top;
    margin-right: 4mm;
    margin-bottom: 4mm;
  }

  .pb-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1pt solid #000000;
    padding-bottom: 1.5mm;
    margin-bottom: 1.5mm;
  }

  .pb-title {
    font-size: 8pt;
    font-weight: bold;
    font-family: "Iowan Old Style", Georgia, serif;
    font-style: italic;
  }

  .pb-dist {
    font-size: 7pt;
    color: #555555;
    font-family: "SF Mono", monospace;
  }

  .pb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7pt;
    font-family: "SF Mono", monospace;
  }

  .pb-table th {
    font-size: 6pt;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #555555;
    border-bottom: 0.5pt solid #888888;
    padding: 1mm 1mm;
    text-align: left;
  }

  .pb-table td {
    padding: 1mm 1mm;
    border-bottom: 0.3pt dotted #bbbbbb;
    vertical-align: middle;
  }

  .pb-table td.pb-km {
    font-weight: 600;
    white-space: nowrap;
  }

  .pb-table td.pb-cum {
    font-feature-settings: "tnum";
    font-weight: bold;
  }

  .pb-table td.pb-pace {
    color: #555555;
  }

  .pb-table td.pb-note {
    font-size: 6pt;
    color: #884400;
  }

  .pb-table tr.pb-finish td {
    font-weight: bold;
    background: #e8f4e8;
    border-bottom: 1pt solid #006600;
  }

  .pb-table tr.pb-aid td {
    background: #fff8e8;
  }

  .pb-footer {
    font-size: 5.5pt;
    color: #888888;
    border-top: 0.5pt dotted #aaaaaa;
    margin-top: 1.5mm;
    padding-top: 1mm;
    font-family: "SF Mono", monospace;
    letter-spacing: .1em;
  }

  /* dotted cut-line dividers between strips — inline, NOT full-width so strips tile
   * left-to-right.  A narrow vertical separator sits between adjacent strips. */
  .pb-cut {
    width: 5mm;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 6pt;
    color: #aaaaaa;
    letter-spacing: .2em;
    padding: 0 1mm;
    font-family: "SF Mono", monospace;
    border-left: 0.5pt dashed #cccccc;
    border-right: 0.5pt dashed #cccccc;
    margin-right: 2mm;
    break-inside: avoid;
  }

  /* tape-overlap blank zone — safe area at end of each strip for wrap-and-tape */
  .pb-tab {
    margin-top: 2mm;
    padding: 2mm 1mm 1mm;
    border-top: 1pt dashed #aaaaaa;
    min-height: 15mm;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6pt;
    color: #bbbbbb;
    letter-spacing: .15em;
    text-transform: uppercase;
    font-family: "SF Mono", monospace;
  }

  /* A4 page setup */
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
}
