/* ==========================================================================
   ASTM standards page (astm-standards.html)

   Loads on top of css/pipe-dimensions-page.css, which carries the shared
   technical-reference shell (.pd-* hero, feature strip, section heads, table,
   FAQs, closing strip). Only the ASTM-specific pieces live here.
   ========================================================================== */

/* The ASTM table has nine columns rather than twenty-seven, so it does not
   need the pipe chart's very wide minimum. */
.pd .as-table {
  min-width: 1080px;
}

/* The shared sheet sets a wide min-width for the big reference chart; the
   small tables on this page must opt out or they blow their containers. */
.pd .as-bands,
.pd .as-list {
  min-width: 0;
}

/* ==========================================================================
   Standard picker
   ========================================================================== */

.as-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.as-pick {
  padding: 14px 12px;
  background: #fff;
  border: 1px solid #cad5e1;
  border-radius: 7px;
  text-align: center;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease,
    color 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.25s ease;
}

.as-pick b {
  display: block;
  color: var(--pd-navy);
  font-size: 15px;
  font-weight: 900;
  transition: color 0.25s ease;
}

.as-pick span {
  display: block;
  margin-top: 3px;
  color: var(--pd-muted);
  font-size: 11px;
  line-height: 1.35;
  transition: color 0.25s ease;
}

.as-pick:hover {
  border-color: var(--pd-navy2);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(6, 39, 75, 0.1);
}

.as-pick.is-active {
  background: var(--pd-red);
  border-color: var(--pd-red);
  box-shadow: 0 10px 22px rgba(223, 29, 47, 0.25);
}

.as-pick.is-active b,
.as-pick.is-active span {
  color: #fff;
}

/* ==========================================================================
   Selected standard detail
   ========================================================================== */

.as-detail {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--pd-shadow);
}

/* Grid items default to min-width:auto, so the seven-column band table would
   otherwise force the column wider than its track and push the testing panel
   out of the card. */
.as-detail__main,
.as-detail__side {
  min-width: 0;
}

.as-detail__main {
  padding: 26px;
}

.as-bands-scroll {
  overflow-x: auto;
}

.as-detail__head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pd-line);
}

.pd .as-detail__head h3 {
  margin: 0;
  padding: 0;
  color: var(--pd-navy);
  font-size: 22px;
  font-weight: normal;
  text-transform: none;
  background: none;
  border: 0;
}

.as-detail__head p {
  margin: 5px 0 0;
  color: var(--pd-muted);
  font-size: 13.5px;
}

.as-bands {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.as-bands th {
  padding: 8px 8px;
  background: #eef3f9;
  color: #173b62;
  border: 1px solid #dbe4ee;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.as-bands td {
  padding: 8px;
  border: 1px solid #e6ecf3;
  text-align: center;
}

.as-bands td:first-child {
  color: #0f3155;
  font-weight: 700;
  text-align: left;
}

.as-bands tr:nth-child(even) td {
  background: #f8fafc;
}

.as-detail__note {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fff8e8;
  border: 1px solid #f0dca8;
  border-radius: 6px;
  color: #6d5b2b;
  font-size: 12px;
}

/* --- Testing panel ----------------------------------------------------- */

.as-detail__side {
  padding: 26px;
  background: linear-gradient(160deg, #0b3e73, #06274b);
  color: #fff;
}

.pd .as-detail__side h4 {
  margin: 0 0 16px;
  padding: 0;
  color: #fff;
  font-size: 12px;
  font-weight: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: none;
  border: 0;
}

.as-tests {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.as-tests li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #dbe9f8;
  font-size: 13px;
  line-height: 1.5;
}

.as-tests li i {
  flex: 0 0 auto;
  margin-top: 3px;
  color: #4ec3ff;
  font-size: 11px;
}

/* ==========================================================================
   Reference table — one block per standard
   ========================================================================== */

.pd .as-table td.as-std {
  background: #f2f6fb;
  color: var(--pd-navy);
  font-weight: 900;
  text-align: left;
  vertical-align: middle;
  border-right: 2px solid #b9c8da;
}

.pd .as-table td.as-std span {
  display: block;
  margin-top: 4px;
  color: var(--pd-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

.pd .as-table td.as-testcell {
  border-left: 2px solid #b9c8da;
  color: #4c6178;
  font-size: 11.5px;
  line-height: 1.6;
  text-align: left;
  vertical-align: middle;
}

.pd .as-table tr.is-lit td {
  background: #fff7f8;
}

.pd .as-table tr.is-lit td.as-std {
  background: #ffe9ec;
  color: #b31423;
}

.pd .as-table tbody tr.as-first td {
  border-top: 2px solid #b9c8da;
}

/* ==========================================================================
   EN equivalents and tolerance classes
   ========================================================================== */

.as-ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.as-card {
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(6, 39, 75, 0.07);
}

.as-card__title {
  padding: 13px 18px;
  background: linear-gradient(90deg, #07366a, #06274b);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.as-card__body {
  padding: 18px;
}

.as-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.as-list th {
  padding: 9px 10px;
  background: #eef3f9;
  color: #173b62;
  border: 1px solid #dbe4ee;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.as-list td {
  padding: 10px;
  border: 1px solid #e6ecf3;
  color: #4c6178;
}

.as-list td:first-child {
  width: 108px;
  color: var(--pd-navy);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.as-list tr:nth-child(even) td {
  background: #f8fafc;
}

/* The two tolerance-class tables sit side by side inside one card */
.as-classes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 1000px) {
  .as-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .as-detail {
    grid-template-columns: 1fr;
  }

  .as-ref-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 650px) {
  .as-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .as-detail__main,
  .as-detail__side {
    padding: 18px;
  }

  .as-classes {
    grid-template-columns: 1fr;
  }

  /* Let the band table scroll rather than crush its columns */
  .as-bands-scroll {
    overflow-x: auto;
  }

  .as-bands {
    min-width: 520px;
  }
}

@media print {
  .as-picker,
  .as-detail__side {
    display: none !important;
  }

  .pd .as-table {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .as-pick {
    transition: none !important;
  }

  .as-pick:hover {
    transform: none;
  }
}
