/* Mercer Lab Supply: reference stylesheet.
   Every visual value for the site is in this file.
   The reference pages beside it use nothing else. */

:root {
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --paper:   #FFFFFF;
  --ink:     #1A1D21;   /* text */
  --ink-2:   #555C64;   /* secondary text */
  --rule:    #D4D9DF;   /* table and panel borders */
  --rule-2:  #AEB5BD;   /* input borders, heavier dividers */
  --tint:    #F3F5F7;   /* table headers, label cells, utility strip, footer */
  --tint-2:  #E6EAEE;   /* group rows, panel title bars */
  --navy:    #14365C;   /* navigation band, buttons, logo */
  --navy-2:  #0E2440;   /* hover and active on navy */
  --link:    #0B5CAD;   /* links */
  --link-2:  #083F78;   /* link hover */
  --stock:   #1F6B3A;   /* the words "In stock" */
  --warn:    #8A5A00;   /* lead-time and preorder notices, form errors */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/20px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-2); text-decoration: underline; }
p a, .prose a { text-decoration: underline; }
p a.btn { text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, table, figure { margin: 0; padding: 0; }
ul { list-style: none; }
.nowrap { white-space: nowrap; }
.frame { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* ---------- header ---------- */

.util { background: var(--tint); border-bottom: 1px solid var(--rule); font-size: 12px; line-height: 18px; }
.util .frame { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.util .service span + span::before { content: "\00B7"; margin: 0 8px; color: var(--rule-2); }
.util .account a + a { margin-left: 16px; }
.util a { color: var(--ink); }

.mast .frame { display: flex; align-items: center; gap: 40px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--navy); flex: none; }
.logo:hover { color: var(--navy); text-decoration: none; }
.logo-mark { display: block; width: 42px; height: 42px; }
.logo-words { display: block; }
.logo-name { display: block; font-size: 25px; line-height: 25px; font-weight: 700; letter-spacing: 0.07em; }
.logo-sub  { display: block; margin-top: 4px; font-size: 10.5px; line-height: 12px; font-weight: 700; letter-spacing: 0.43em; }

.search { display: flex; flex: 1; max-width: 560px; }
.search input {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px;
  border: 1px solid var(--rule-2); border-right: 0; border-radius: 2px 0 0 2px;
  font: 14px var(--font-sans); color: var(--ink); background: #fff;
}
.search button { height: 38px; padding: 0 18px; border-radius: 0 2px 2px 0; }

.nav { background: var(--navy); }
.nav .frame { position: relative; }
.nav .frame > ul { display: flex; flex-wrap: wrap; }
.nav .frame > ul > li > a { display: block; padding: 10px 14px; color: #fff; font-size: 13px; line-height: 20px; font-weight: 700; }
.nav .frame > ul > li:first-child > a { margin-left: -14px; }
.nav .frame > ul > li > a:hover, .nav .frame > ul > li > a[aria-current],
.nav .frame > ul > li:hover > a, .nav .frame > ul > li:focus-within > a { background: var(--navy-2); text-decoration: none; color: #fff; }

/* the Products menu: three columns, one for each section.  Opens on hover
   and on keyboard focus, with no script */
.nav .menu {
  display: none; position: absolute; left: 10px; top: 100%; z-index: 5;
  grid-template-columns: auto auto auto; column-gap: 32px;
  padding: 12px 14px 14px; background: #fff;
  border: 1px solid var(--rule-2); border-top: 0;
  font-size: 13px; line-height: 18px; white-space: nowrap;
}
.nav li:hover > .menu, .nav li:focus-within > .menu { display: grid; }
.nav .menu h2 { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); font-size: 13px; line-height: 18px; }
.nav .menu li { padding: 2px 0; }

.crumb { border-bottom: 1px solid var(--rule); font-size: 12px; line-height: 18px; color: var(--ink-2); }
.crumb .frame { padding-top: 8px; padding-bottom: 8px; }
.crumb li { display: inline; }
.crumb li + li::before { content: "/"; margin: 0 8px; color: var(--rule-2); }

/* ---------- controls ---------- */

.btn {
  display: inline-block; height: 32px; padding: 0 14px;
  border: 1px solid var(--navy); border-radius: 2px;
  background: var(--navy); color: #fff;
  font: 700 13px/30px var(--font-sans); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); }
.qty {
  width: 52px; height: 32px; padding: 0 6px; text-align: right;
  border: 1px solid var(--rule-2); border-radius: 2px;
  font: 13px var(--font-sans); color: var(--ink);
}
input:focus, button:focus, a:focus { outline: 2px solid var(--link); outline-offset: 1px; }

/* ---------- page furniture ---------- */

main { padding: 24px 0 48px; }
h1 { font-size: 24px; line-height: 30px; font-weight: 700; }
h2 { font-size: 15px; line-height: 20px; font-weight: 700; }
.lede { margin-top: 6px; max-width: 760px; }
.count { margin: 12px 0 8px; font-size: 12px; line-height: 18px; color: var(--ink-2); }

.cols { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 32px; align-items: start; }

.panel { border: 1px solid var(--rule); }
.panel + .panel { margin-top: 16px; }
.panel > h2, .panel > summary {
  padding: 7px 12px; background: var(--tint-2); border-bottom: 1px solid var(--rule);
  font-size: 13px; line-height: 18px; font-weight: 700;
}
.panel > summary { cursor: pointer; }
.panel .body { padding: 10px 12px; font-size: 13px; line-height: 18px; }
.rail li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.rail li span { color: var(--ink-2); }
.rail li[aria-current] a { color: var(--ink); font-weight: 700; }
.rail .tree > li { display: block; padding: 0; }
.rail .tree .sec { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-weight: 700; }
.rail .tree .sec span { font-weight: 400; color: var(--ink-2); }
.rail .tree ul { margin: 1px 0 6px; padding-left: 10px; border-left: 2px solid var(--rule); }
.rail .tree [aria-current] { color: var(--ink); font-weight: 700; }
.rail dt { color: var(--ink-2); font-size: 12px; margin-top: 8px; }
.rail dt:first-child { margin-top: 0; }

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; }
.data { border: 1px solid var(--rule); font-size: 13px; line-height: 18px; }
.data th, .data td { padding: 7px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.data thead th {
  background: var(--tint); border-bottom: 1px solid var(--rule-2);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.data .num { text-align: right; white-space: nowrap; }
.data .group th {
  background: var(--tint-2); font-size: 13px; font-weight: 700; padding: 7px 12px;
}
.data .group th span { font-weight: 400; color: var(--ink-2); margin-left: 6px; white-space: nowrap; }
.data .name { font-size: 14px; font-weight: 700; }
.data .syn, .data .desc, .data .ship { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.data .by-quote { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.data .missing { color: var(--warn); }
.data .cat { white-space: nowrap; font-weight: 700; }
.data .price { font-weight: 700; }
.data .line { display: block; }
.data .c-gate, .data .h-gate { text-align: right; white-space: nowrap; }
.narrow-only { display: none; }

.spec th {
  width: 180px; background: var(--tint); font-weight: 700;
  border-right: 1px solid var(--rule);
}
.spec td { word-break: break-word; }
.spec .seq { font-family: var(--font-mono); font-size: 12px; line-height: 18px; letter-spacing: 0.02em; }
.spec sub { font-size: 10px; line-height: 0; }

.avail { font-size: 12px; line-height: 18px; color: var(--ink-2); }
.avail.in { color: var(--stock); }
.avail.wait { color: var(--warn); }

/* ---------- product page ---------- */

.pid { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink-2); }
.syn-line { margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 32px; align-items: start; margin-top: 20px; }
.buy .data { border: 0; }
.buy .data th, .buy .data td { padding-left: 6px; padding-right: 6px; }
.buy .data th:last-child, .buy .data td:last-child { padding-right: 12px; }
.buy .data th:first-child, .buy .data td:first-child { padding-left: 12px; }
.buy .data td { vertical-align: middle; }
.buy .foot { padding: 10px 12px; font-size: 12px; line-height: 18px; color: var(--ink-2); }
.buy .data tr:last-child td { border-bottom: 1px solid var(--rule); }
.buy .foot.gate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); color: var(--ink); font-size: 13px; }
.fine { margin-top: 8px; font-size: 12px; line-height: 18px; color: var(--ink-2); }
.note { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--rule); background: var(--tint); font-size: 12px; line-height: 18px; }
.more { margin-top: 16px; font-size: 13px; line-height: 20px; }
.more a { text-decoration: none; }
.more a:hover { text-decoration: underline; }
.more a + a::before { content: "\00B7"; margin: 0 8px; color: var(--rule-2); display: inline-block; }

/* ---------- home page ---------- */

.squares { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.square { display: block; aspect-ratio: 1 / 1; padding: 20px; border: 1px solid var(--rule-2); color: var(--ink); }
.square:hover, .square:focus { border-color: var(--navy); color: var(--ink); text-decoration: none; }
.square .word { display: block; font-size: 24px; line-height: 30px; font-weight: 700; color: var(--link); }
.square:hover .word { color: var(--link-2); text-decoration: underline; }
.square .line { display: block; margin-top: 6px; font-size: 14px; line-height: 20px; }

/* ---------- search results, one group for each section ---------- */

.group-title { margin: 20px 0 8px; }
.group-title span { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--ink-2); }

/* ---------- forms ---------- */

.form { max-width: 560px; margin-top: 16px; }
.form fieldset { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.form legend { padding: 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.field { margin-top: 12px; }
.field label, .field .label { display: block; font-size: 13px; line-height: 18px; font-weight: 700; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=url],
.field input[type=date], .field select, .field textarea {
  display: block; width: 100%; height: 32px; margin-top: 3px; padding: 0 8px;
  border: 1px solid var(--rule-2); border-radius: 2px; background: #fff;
  font: 14px var(--font-sans); color: var(--ink);
}
.field textarea { height: 96px; padding: 6px 8px; }
.field input[type=file] { display: block; margin-top: 3px; font: 13px var(--font-sans); }
.field.short input, .field.short select { max-width: 220px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 132px; gap: 12px; }
.hint { display: block; font-size: 12px; line-height: 18px; font-weight: 400; color: var(--ink-2); }
.error { display: block; font-size: 12px; line-height: 18px; color: var(--warn); }
.choice, .field label.choice { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 14px; line-height: 20px; font-weight: 400; }
.choice input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }
.choices { display: flex; gap: 28px; }
.choices .choice { margin-top: 4px; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* the account type picks the questions, with no script */
.type-fields { display: none; }
.form:has(#type-institution:checked) .for-institution,
.form:has(#type-company:checked) .for-company,
.form:has(#type-researcher:checked) .for-researcher { display: block; }

/* ---------- cart and quick order ---------- */

.cart td, .quick td { vertical-align: middle; }
.cart .remove { font-size: 12px; }
.quick input[type=text] {
  width: 100%; max-width: 190px; height: 32px; padding: 0 8px;
  border: 1px solid var(--rule-2); border-radius: 2px; font: 13px var(--font-sans); color: var(--ink);
}
.totals { width: auto; min-width: 300px; margin: 12px 0 0 auto; font-size: 13px; line-height: 18px; }
.totals th { padding: 4px 24px 4px 0; text-align: left; font-weight: 400; }
.totals td { padding: 4px 12px 4px 0; text-align: right; }
.totals .total th, .totals .total td { padding-top: 8px; border-top: 1px solid var(--rule-2); font-size: 14px; font-weight: 700; }

/* ---------- footer ---------- */

footer { background: var(--tint); border-top: 1px solid var(--rule); font-size: 12px; line-height: 18px; }
footer .frame { padding-top: 24px; padding-bottom: 24px; }
.foot-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
footer h2 { font-size: 12px; line-height: 18px; margin-bottom: 6px; }
footer li { padding: 2px 0; }
footer address { font-style: normal; color: var(--ink); }
.legal { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--ink-2); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .frame { padding: 0 14px; }
  .util .service span:nth-child(n+2) { display: none; }
  .mast .frame { flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .search { flex-basis: 100%; max-width: none; }
  .nav .frame { padding: 0 4px; }
  .nav .frame > ul > li > a { padding: 8px 10px; }
  .nav .frame > ul > li:first-child > a { margin-left: 0; }
  .nav li:hover > .menu, .nav li:focus-within > .menu { display: none; }
  .squares { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
  .square { aspect-ratio: auto; padding: 14px 16px; }
  .field-row { grid-template-columns: minmax(0, 1fr) 80px 110px; gap: 8px; }
  main { padding-top: 16px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  aside.rail { display: none; }
  .narrow-only { display: block; margin-top: 12px; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .product .buy { order: -1; }
  .spec th { width: 150px; }
  .spec th, .spec td { padding-left: 8px; padding-right: 8px; }

  /* the pricing table becomes one block per size */
  .buy thead { display: none; }
  .buy .data, .buy .data tbody, .buy .data tr, .buy .data td { display: block; }
  .buy .data tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; align-items: center;
    grid-template-areas: "cat cat price" "size qty add";
    padding: 10px 12px; border-bottom: 1px solid var(--rule);
  }
  .buy .data td, .buy .data td:first-child, .buy .data td:last-child { padding: 0; border: 0; }
  .buy .data tr:last-child td { border: 0; }
  .buy .b-cat { grid-area: cat; } .buy .b-price { grid-area: price; }
  .buy .b-size { grid-area: size; } .buy .b-qty { grid-area: qty; } .buy .b-add { grid-area: add; }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 20px; }

  /* the catalog table becomes a list: one block per product, one line per size */
  .catalog, .catalog thead, .catalog tbody, .catalog tr, .catalog th, .catalog td { display: block; }
  .catalog thead tr, .catalog tbody.rows tr {
    display: grid; grid-template-columns: minmax(0, 1fr) 58px 70px 82px; column-gap: 10px;
  }
  .catalog thead tr { padding: 6px 12px; background: var(--tint); border-bottom: 1px solid var(--rule-2); }
  .catalog thead th { padding: 0; border: 0; background: none; }
  .catalog thead th:nth-child(-n+2) { display: none; }
  .catalog thead th:nth-child(3) { visibility: hidden; }
  .catalog tbody.rows tr {
    grid-template-rows: auto auto 1fr; align-items: start;
    grid-template-areas: "name name name name" "cat size each case" "cas size each case";
    padding: 9px 12px; border-bottom: 1px solid var(--rule);
  }
  .catalog tbody.rows td { padding: 0; border: 0; }
  .catalog .c-name { grid-area: name; margin-bottom: 4px; }
  .catalog .c-cat { grid-area: cat; }
  .catalog .c-cas { grid-area: cas; font-size: 12px; color: var(--ink-2); font-weight: 400; }
  .catalog .c-cas:not(:empty)::before { content: "CAS "; }
  .catalog .c-size { grid-area: size; }
  .catalog .c-each { grid-area: each; }
  .catalog .c-case { grid-area: case; }

  /* supplies: the pack sits under the catalog number, prices at the right */
  .catalog.supply thead tr, .catalog.supply tbody.rows tr { grid-template-columns: minmax(0, 1fr) 70px 82px; }
  .catalog.supply tbody.rows tr { grid-template-areas: "name name name" "cat each case" "pack each case"; }
  .catalog .c-pack { grid-area: pack; text-align: left; }

  /* equipment: catalog number at the left, price at the right */
  .catalog.equip thead tr, .catalog.equip tbody.rows tr { grid-template-columns: minmax(0, 1fr) 96px; }
  .catalog.equip thead th:nth-child(3) { visibility: visible; grid-column: 2; }
  .catalog.equip tbody.rows tr { grid-template-rows: auto auto; grid-template-areas: "name name" "cat each"; }

  /* signed out: sizes at the right, the sign-in line beneath */
  .catalog.gated thead { display: none; }
  .catalog.gated tbody.rows tr {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto;
    grid-template-areas: "name name" "cat size" "cas size" "gate gate";
  }
  .catalog.gated .c-gate { grid-area: gate; text-align: left; margin-top: 6px; }
  .catalog.supply.gated tbody.rows tr {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "cat" "pack" "gate";
  }
  .catalog.equip.gated tbody.rows tr {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "name" "cat" "gate";
  }

  /* the cart and quick order become one block per line */
  .cart thead, .quick thead { display: none; }
  .cart, .cart tbody, .cart tr, .cart td, .quick, .quick tbody, .quick tr, .quick td { display: block; }
  .cart tr, .quick tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
    padding: 10px 12px; border-bottom: 1px solid var(--rule);
  }
  .cart td, .quick td { padding: 0; border: 0; }
  .cart tr { grid-template-areas: "name name" "cat unit" "size total" "qty remove"; }
  .cart.gated tr { grid-template-areas: "name name" "cat cat" "size size" "qty remove"; }
  .cart .k-name { grid-area: name; } .cart .k-cat { grid-area: cat; } .cart .k-size { grid-area: size; text-align: left; }
  .cart .k-unit { grid-area: unit; } .cart .k-total { grid-area: total; } .cart .k-qty { grid-area: qty; text-align: left; }
  .cart .k-remove { grid-area: remove; text-align: right; }
  .cart .k-unit::after { content: " each"; font-weight: 400; color: var(--ink-2); }
  .quick tr { grid-template-areas: "cat qty" "name name" "pack price"; }
  .quick .q-cat { grid-area: cat; } .quick .q-qty { grid-area: qty; } .quick .q-name { grid-area: name; }
  .quick .q-pack { grid-area: pack; text-align: left; } .quick .q-price { grid-area: price; }
  .totals { width: 100%; min-width: 0; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
  .buy .foot.gate { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media print {
  .util, .nav, .search, .rail, .qty, .btn, footer .foot-cols { display: none; }
  .square { aspect-ratio: auto; }
  .cols, .product { display: block; }
  a { color: #000; }
  .data thead th, .spec th, .panel > h2, .data .group th, .note, footer { background: #fff; }
}
