/* Mercer Lab Supply: reference stylesheet.
   Every visual value for the site is in this file.
   The two 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 ul { display: flex; flex-wrap: wrap; }
.nav a { display: block; padding: 10px 14px; color: #fff; font-size: 13px; line-height: 20px; font-weight: 700; }
.nav li:first-child a { margin-left: -14px; }
.nav a:hover, .nav a[aria-current] { background: var(--navy-2); text-decoration: none; color: #fff; }

.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 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 { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.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: 190px; 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) 528px; gap: 32px; align-items: start; margin-top: 20px; }
.buy .data { border: 0; }
.buy .data th, .buy .data td { padding-left: 8px; padding-right: 8px; }
.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; }

/* ---------- 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 a { padding: 8px 10px; }
  .nav li:first-child a { margin-left: 0; }
  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; }

  /* 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; }
  .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; }
  .cols, .product { display: block; }
  a { color: #000; }
  .data thead th, .spec th, .panel > h2, .data .group th, .note, footer { background: #fff; }
}
