/* weight-calculator.css - /tools/weight-calculator/ only.
 *
 * Nothing here styles a <table>. The site has ONE table look, in the block
 * marked `table system` in pages.css and mirrored in tables.css, and
 * docs/check-tables.mjs fails a page that styles tables on its own - which is
 * how .tech-table once set three tables a tenth smaller than the rest while
 * being invisible to any search of CSS/. The formulas table on this page is a
 * plain `.table .table-bordered` and inherits that system untouched.
 *
 * Every colour reads a token from header.css. Do not hardcode the navy: it was
 * declared in four places with two different values once already, and pages
 * rendered the off-brand shade depending on <link> order. */

.wc-intro {
  max-width: 68ch;
  margin: 0 0 28px;
  color: var(--text-color);
  font-size: 1.02rem;
  line-height: 1.65;
}

/* Form left, results right. The results column is sticky on a wide screen so
   the number stays in view while a long shape like a rectangular tube pushes
   its four dimension fields down the page. */
.wc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .wc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.wc-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
}

.wc-panel h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--heading-color);
}

.wc-panel-hint {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Fields */

.wc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.wc-field label,
.wc-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.01em;
}

.wc-field input,
.wc-field select,
.wc-row input,
.wc-row select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  color: var(--text-color);
  background: #fff;
  border: 1px solid #c9d3da;
  border-radius: 6px;
}

.wc-field input:focus,
.wc-field select:focus,
.wc-row input:focus,
.wc-row select:focus {
  outline: 2px solid var(--secondary-cta);
  outline-offset: 1px;
  border-color: var(--secondary-cta);
}

/* The dimension inputs. Two up on desktop, one up on a phone - four fields
   side by side in a 360px viewport gives each of them about 70px. */
.wc-dimensions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

@media (max-width: 480px) {
  .wc-dimensions {
    grid-template-columns: minmax(0, 1fr);
  }
}

.wc-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.wc-row > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

/* The line under the material picker saying how many of the 172 materials the
   filter is currently showing. It is the feedback that makes the filter
   trustworthy: without it a short list looks like a short catalogue. */
.wc-match-count {
  margin: 2px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.wc-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 4px;
}

.wc-fieldset legend {
  float: none;
  width: auto;
  padding: 0;
  margin: 20px 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.wc-fieldset:first-of-type legend {
  margin-top: 0;
}

/* Density and its provenance.
 *
 * The source line is the honest half of this calculator: a figure read off a
 * Special Metals bulletin and a nominal handbook value are different kinds of
 * claim, and a visitor sizing a pressure part deserves to know which one they
 * just used. The three variants are colour-coded but never colour-ONLY - each
 * opens with a bold word saying the same thing, because roughly 1 in 12 men
 * cannot separate the green from the amber. */
.wc-density-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.wc-provenance {
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  border-radius: 6px;
  border-left: 3px solid var(--grey-color);
  background: var(--light-color);
  color: var(--text-color);
}

.wc-provenance-mill {
  border-left-color: #1e7a45;
  background: #f0f7f2;
}

.wc-provenance-nominal {
  border-left-color: var(--secondary-color);
  background: #fdf5ec;
}

.wc-provenance-missing,
.wc-provenance-custom {
  border-left-color: var(--primary-color);
  background: #eef3f7;
}

.wc-reset {
  background: none;
  border: 0;
  padding: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary-cta);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

/* Results */

.wc-results {
  position: sticky;
  top: 24px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 10px;
  padding: 24px;
}

@media (max-width: 900px) {
  .wc-results {
    position: static;
  }
}

/* Headings inside a navy panel read --heading-color, which is navy - 1.05:1 on
   this background. header.css already flips the token for dark panels; this
   does the same for the results card. */
.wc-results,
.wc-results h2 {
  --heading-color: #fff;
}

.wc-results-empty {
  background: var(--light-color);
  color: var(--text-muted);
  border: 1px dashed #c9d3da;
}

.wc-placeholder {
  margin: 0;
  padding: 28px 0;
  text-align: center;
  font-size: 0.95rem;
}

.wc-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.wc-headline-value {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.wc-headline-unit {
  font-size: 1.25rem;
  font-weight: 600;
  opacity: 0.85;
}

.wc-headline-sub {
  flex-basis: 100%;
  font-size: 0.85rem;
  opacity: 0.75;
}

.wc-breakdown {
  margin: 0;
}

.wc-breakdown > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.wc-breakdown > div:last-child {
  border-bottom: 0;
}

.wc-breakdown dt {
  font-size: 0.86rem;
  font-weight: 400;
  opacity: 0.8;
}

.wc-breakdown dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: right;
}

.wc-cost dd {
  color: #ffd9a8;
}

.wc-theoretical {
  margin: 16px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  /* Explicit light colour, not opacity: pages.css sets a dark colour on every
     <p>, which beats the white inherited from .wc-results and left this line
     near-invisible on the navy card. */
  color: rgba(255, 255, 255, 0.82);
}

.wc-quote {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 13px 18px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  /* --secondary-cta, not --secondary-color: white on the brand orange measures
     2.85:1 and fails AA. This is the darkened fill. */
  background: var(--secondary-cta);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

.wc-quote:hover,
.wc-quote:focus {
  background: var(--secondary-cta-dark);
}

/* The two enquiry paths off a result, stacked. The margin that .wc-quote
   carried on its own moves here so the gap between the buttons stays even. */
.wc-cta {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc-cta .wc-quote {
  margin-top: 0;
}

/* WhatsApp is the lighter-commitment path - a lot of the buyers here quote over
   WhatsApp rather than fill a form. Dark WhatsApp green so white text clears AA;
   the brand #25D366 does not. */
.wc-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #075e54;
  text-decoration: none;
}

.wc-whatsapp:hover,
.wc-whatsapp:focus {
  background: #053f39;
}

.wc-whatsapp .icon {
  width: 1.1em;
  height: 1.1em;
}

/* The house slot under the results card. Kept as its own block so the layout
   already has a home for a promotion without a redesign. */
.wc-aside {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--light-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-color);
}

.wc-aside h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--heading-color);
}

.wc-aside p {
  margin: 0 0 8px;
}

.wc-aside p:last-child {
  margin-bottom: 0;
}

/* Reference sections below the fold */

.wc-notes {
  max-width: 78ch;
}

.wc-notes h2 {
  margin: 36px 0 10px;
  font-size: 1.3rem;
  color: var(--heading-color);
}

.wc-notes h3 {
  margin: 24px 0 8px;
  font-size: 1.02rem;
  color: var(--heading-color);
}

.wc-notes p,
.wc-notes li {
  line-height: 1.7;
  color: var(--text-color);
}

.wc-notes ul {
  padding-left: 20px;
}

.wc-notes li {
  margin-bottom: 8px;
}

.wc-formula {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.92em;
  background: var(--light-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 6px;
}

.wc-callout {
  margin: 20px 0;
  padding: 16px 18px;
  background: #fdf5ec;
  border-left: 4px solid var(--secondary-color);
  border-radius: 0 6px 6px 0;
}

.wc-callout p:last-child {
  margin-bottom: 0;
}
