/* The price index page (/photo-book-prices, marketingPages/priceIndex.ts).
 * Linked by that page only, after marketing.css, whose theme tokens the
 * table and the inline SVG charts use, so both follow light and dark. */

.pi-table-wrap {
  overflow-x: auto;
  margin: 0 0 32px;
}

.pi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

.pi-table th,
.pi-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.pi-table thead th {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pi-table tbody th {
  font-weight: 600;
  min-width: 9em;
}

.pi-table td:last-child {
  white-space: nowrap;
}

.pi-ours {
  background: var(--page);
}

[data-theme="dark"] .pi-ours {
  background: rgba(255, 255, 255, 0.04);
}

.pi-note,
.pi-was {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.pi-was {
  text-decoration: line-through;
}

.pi-brand {
  margin: 0 0 28px;
}

.pi-brand h3 {
  margin-bottom: 8px;
}

.pi-strip {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 8px;
}

.pi-axis {
  font-size: 11px;
  fill: var(--text-muted);
}

.pi-strip .pi-sale,
.pi-key.pi-sale {
  fill: var(--accent);
  background: var(--accent);
}

.pi-strip .pi-nosale,
.pi-key.pi-nosale {
  fill: var(--border);
  background: var(--border);
}

/* Unknown: an outline only, so it reads apart from the other two without colour. */
.pi-strip .pi-unknown {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1;
}

.pi-key.pi-unknown {
  border: 1px solid var(--text-muted);
}

.pi-legend {
  font-size: 14px;
  color: var(--text-secondary);
}

.pi-key {
  display: inline-block;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  margin: 0 4px 0 12px;
  vertical-align: -2px;
}

.pi-key:first-child {
  margin-left: 0;
}

/* Phones: each company's row becomes a card, every figure labelled. */
@media (max-width: 600px) {
  .pi-table thead {
    display: none;
  }

  .pi-table tr,
  .pi-table th,
  .pi-table td {
    display: block;
  }

  .pi-table tr {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .pi-table th,
  .pi-table td {
    border: 0;
    padding: 4px 8px;
  }

  .pi-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--text-muted);
  }

  .pi-table td:last-child {
    white-space: normal;
  }
}

/* The shoppers' page: one delivered total per company. */
.pi-totals {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}

.pi-totals li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.pi-total__name {
  font-weight: 600;
}

.pi-total__name .pi-note {
  display: block;
}

.pi-total__price {
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.pi-total__price .pi-note {
  font-size: 13px;
  white-space: normal;
}

/* "47% smaller page area", on its own line under the total. */
.pi-total__price .pi-size {
  display: block;
}

/* The data page's day-by-day price charts. */
.pi-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 8px;
}

.pi-chart .pi-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.pi-chart .pi-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.pi-chart .pi-ours-line {
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

/* Hover targets for each day's tooltip, bigger than the line itself. */
.pi-chart .pi-hit {
  fill: transparent;
}

/* Printed (the data page's PDF for press pitches, scripts/price-tracker/pdf.ts):
 * the figures and method only, with each Archive link's address written out
 * so the evidence can be followed from paper. */
@media print {
  .site-nav,
  .marketing-cta,
  .marketing-footer__col {
    display: none;
  }

  .pi-brand,
  .pi-table tr {
    break-inside: avoid;
  }

  .pi-brand a[href^="https://web.archive.org/"]::after {
    content: " (" attr(href) ")";
    font-size: 10px;
    word-break: break-all;
  }
}
