/* ============================================================
   Series datasheet — spec + certification tables.
   Used in two places from one render: the block injected into a
   series page, and the standalone pages/datasheet-<slug>.html
   which is print-styled for PDF export.
   ============================================================ */

.cat-datasheet { padding: 3.5rem 0; background: var(--bg-alt); border-top: 1px solid var(--border); }
.ds-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; margin-bottom: 2rem;
}
.ds-title { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; margin: 0 0 0.4rem; }
.ds-sub { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; max-width: 62ch; margin: 0; }
.ds-dl { flex: none; white-space: nowrap; }

.ds-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.ds-group__name { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }

/* Certification is the first thing a distributor checks — give it its own band
   rather than burying the approval number in a paragraph. */
.ds-cert {
  display: flex; flex-wrap: wrap; gap: 1.75rem;
  background: var(--accent-soft); border: 1px solid var(--accent-mid);
  border-radius: var(--r-md); padding: 0.85rem 1.1rem; margin-bottom: 1.1rem;
}
.ds-cert__item { display: flex; flex-direction: column; gap: 0.15rem; }
.ds-cert__item span { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ds-cert__item strong { font-family: var(--font-mono); font-size: 0.86rem; color: var(--text); }

.ds-specs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem 1.5rem; margin-bottom: 1.1rem;
}
.ds-spec { display: flex; flex-direction: column; gap: 0.1rem; }
.ds-spec span { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.ds-spec strong { font-size: 0.86rem; font-weight: 500; color: var(--text); }

/* Wide tables scroll inside their own box — the page must never scroll sideways. */
.ds-tablewrap { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ds-table th {
  text-align: left; padding: 0.55rem 0.7rem; white-space: nowrap;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); border-bottom: 2px solid var(--border);
}
.ds-table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--bg-alt); }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-sku code { font-family: var(--font-mono); font-size: 0.84rem; font-weight: 500; color: var(--navy); }
.ds-barcode { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); }
.ds-flag {
  display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.4rem;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #8a5a00; background: #fdf0d5; border-radius: 3px;
}
.ds-rownote td { font-size: 0.78rem; color: var(--text-2); padding-top: 0; border-bottom: 1px solid var(--bg-alt); }

/* Highlight the row for the product being viewed (product detail page). */
.ds-table tr.is-current td { background: var(--accent-soft); }
.ds-table tr.is-current .ds-sku code { font-weight: 700; color: var(--accent); }

@media (max-width: 700px) {
  .ds-head { flex-direction: column; gap: 1rem; }
  .ds-cert { gap: 1rem; }
}

/* ---------- standalone datasheet document ---------- */
.dsdoc { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; background: var(--surface); }
.dsdoc__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 1rem; border-bottom: 3px solid var(--accent); margin-bottom: 1.75rem;
}
.dsdoc__brand { display: flex; flex-direction: column; }
.dsdoc__logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; letter-spacing: 0.02em; color: var(--navy); }
.dsdoc__tag { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.dsdoc__meta { text-align: right; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); line-height: 1.7; }
.dsdoc__title { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; margin: 0 0 0.35rem; }
.dsdoc__sub { font-family: var(--font-serif); font-size: 1.1rem; color: var(--accent); margin: 0 0 0.9rem; }
.dsdoc__intro { font-size: 0.9rem; line-height: 1.7; color: var(--text-2); max-width: 68ch; margin: 0 0 1.75rem; }
.dsdoc__actions { display: flex; gap: 0.6rem; margin-bottom: 2rem; }
.dsdoc__foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-3); line-height: 1.7; }
.dsdoc .ds-group { border-color: var(--border); }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; }
  .no-print, .nav, .psearch { display: none !important; }
  .dsdoc { max-width: none; padding: 0; }
  /* Never split a certification block across a page break — an approval number
     stranded from its table is useless to whoever is checking compliance. */
  .ds-group { break-inside: avoid; page-break-inside: avoid; border: 1px solid #ccc; margin-bottom: 10px; padding: 10px 12px; }
  .ds-cert { background: #f6f6f4; border-color: #ddd; }
  .ds-table { font-size: 9.5pt; }
  .ds-table th, .ds-table td { padding: 3px 6px; }
  .dsdoc__foot { position: fixed; bottom: 0; }
}

/* ---------- one page per product family ---------- */
.dsdoc--page { padding-top: 6rem; }
.ds-crumb { font-size: 0.8rem; color: var(--text-3); margin-bottom: 1.2rem; }
.ds-crumb a { color: var(--text-2); }
.ds-crumb a:hover { color: var(--accent); }

/* Until the approval numbers are confirmed current, say so plainly rather than
   leaving a blank where a compliance claim would sit. */
.ds-certnote {
  background: var(--bg-alt); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); padding: 0.8rem 1rem; margin: 0 0 1.5rem;
  font-size: 0.86rem; color: var(--text-2);
}
.ds-certnote a { color: var(--accent); font-weight: 600; }

.ds-av {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap;
}
.ds-av--stock   { background: rgba(26,188,156,0.14); color: #0d7a63; }
.ds-av--indent  { background: #fdf0d5; color: #8a5a00; }
.ds-av--enquire { background: var(--bg-alt); color: var(--text-3); }
.ds-table tr.av-enquire .ds-sku code { color: var(--text-3); }

.ds-figure { margin: 2rem 0 0; }
.ds-figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff;
}
.ds-figure figcaption {
  font-size: 0.75rem; color: var(--text-3); margin-top: 0.5rem; text-align: center;
}

.ds-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 2rem 0; }
.ds-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.1rem 1.2rem; text-decoration: none; color: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.ds-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ds-card h3 { font-family: var(--font-heading); font-size: 0.96rem; font-weight: 700; margin: 0 0 0.3rem; }
.ds-card__meta { font-size: 0.76rem; color: var(--text-3); }

@media print {
  .ds-crumb, .ds-cards { display: none !important; }
  .dsdoc--page { padding-top: 0; }
  .ds-figure { break-inside: avoid; page-break-inside: avoid; }
}

/* Per-size table headings on cable sheets (render-catalogue.py tables_html). */
.ds-subtitle { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
