/* ==========================================================================
   JOBSITE CALCULATORS — calculator-page-only styles
   Loaded alongside base.css by the 11 calculator pages and projects.html
   (which reuses .calc-card/.result-line/.results-empty/.btn-ghost at
   runtime via projects.js). Not loaded on the homepage or static pages.
   ========================================================================== */

/* -------------------------------- calc layout --------------------------- */
.calc-layout {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 860px) {
  .calc-layout { grid-template-columns: 1fr; }
}

.calc-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.field-row.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 520px) { .field-row, .field-row.two, .cost-fields { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--steel-600); margin-bottom: .35rem;
}
.field .hint { font-size: .74rem; color: var(--steel-600); margin-top: .3rem; }

input[type="number"], input[type="text"], select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: .65rem .7rem;
  border: 1px solid var(--concrete-300);
  border-radius: var(--radius);
  background: var(--concrete-100);
  color: var(--ink);
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  background: var(--paper);
  border-color: var(--steel-600);
}

.shape-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.shape-tabs button {
  font-family: var(--font-display);
  font-size: .78rem; letter-spacing: .03em; text-transform: uppercase;
  padding: .65rem 1rem; border: 1px solid var(--concrete-300);
  background: var(--concrete-100); color: var(--charcoal-700);
  border-radius: var(--radius); cursor: pointer;
}
.shape-tabs button[aria-pressed="true"] {
  background: var(--charcoal); color: var(--safety-500); border-color: var(--charcoal);
}

/* ------------------------------- results / stamp ------------------------ */
.results-panel {
  position: sticky; top: 20px;
  background: var(--charcoal);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}
.results-panel .eyebrow { color: var(--steel-300); }
.results-panel .eyebrow::before { background: var(--safety-500); }

.stamp {
  border: 2px solid var(--safety-500);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.3rem;
  position: relative;
  margin-bottom: 1rem;
}
.stamp .tag {
  position: absolute; top: -11px; right: 12px;
  background: var(--safety-500); color: var(--charcoal);
  font-family: var(--font-mono); font-weight: 700; font-size: .62rem;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px; transform: rotate(-2deg);
}
.stamp .value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 2.1rem; line-height: 1.1; color: var(--paper);
}
.stamp .unit { font-size: 1.1rem; color: var(--steel-300); margin-left: .3rem; }
.stamp .label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--steel-300); margin-top: .3rem;
}

.result-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px solid var(--charcoal-700);
  font-family: var(--font-mono); font-size: .88rem;
}
.result-line:last-child { border-bottom: none; }
.result-line .k { color: var(--steel-300); }
.result-line .v { color: var(--paper); font-weight: 600; }

.results-empty {
  color: var(--steel-300); font-size: .88rem; font-family: var(--font-mono);
}

/* ------------------------------- support content ------------------------- */
.support {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: var(--border);
}
.support h2 { margin-bottom: .8rem; }
.formula-box {
  background: var(--paper); border: var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; font-family: var(--font-mono); font-size: .88rem;
  color: var(--charcoal-700); margin: 1rem 0 1.5rem; overflow-x: auto;
}
/* Reference tables in the support prose. These carry the trade data that makes
   each calculator's page unlike every other one's — pitch multipliers, span
   limits, coverage rates, waste factors. Google flagged /calculators/roofing as
   a near-duplicate of a sibling calculator; tables are the content that cannot
   be copy-pasted between them.

   Always wrapped in .table-scroll: a multi-column table has to scroll inside
   its own box on a phone, never widen the page body. */
.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--paper);
}
.ref-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: .86rem;
}
.ref-table th,
.ref-table td {
  padding: .55rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--concrete-200);
  color: var(--charcoal-700);
}
.ref-table thead th {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .72rem;
  color: var(--charcoal);
  background: var(--concrete-200);
  border-bottom: var(--border);
}
.ref-table tbody tr:last-child td { border-bottom: none; }
/* Numeric columns read far better monospaced and right-aligned when the reader
   is comparing values down a column, which is the whole point of these tables. */
.ref-table .num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

/* Worked examples: one real job, with the arithmetic shown. The safety-yellow
   left rule marks it as the thing to read if you read nothing else. */
.worked-example {
  background: var(--paper);
  border: var(--border);
  border-left: 3px solid var(--safety-500);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1rem 0 1.5rem;
}
.worked-example ol { margin: 0 0 .8rem 1.1rem; padding: 0; }
.worked-example li {
  font-family: var(--font-mono);
  font-size: .84rem;
  margin-bottom: .35rem;
  color: var(--charcoal-700);
}
.worked-example p:last-child { margin-bottom: 0; }

.support ul, .support ol { margin: 0 0 1.4rem 1.1rem; padding: 0; }
.support li { margin-bottom: .55rem; color: var(--charcoal-700); }
.support h3 {
  font-size: 1rem;
  margin: 1.4rem 0 .6rem;
}

.faq { margin-top: 1.5rem; }
.faq details {
  border-bottom: var(--border); padding: .9rem 0;
}
.faq summary {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  font-size: .92rem; cursor: pointer; color: var(--charcoal);
}
/* The question is an <h3> so search engines and AI answer engines can see the
   page's structure (build-i18n.js step 9c wraps it). It must not *look* like
   a heading — these rules make it render byte-for-byte as the plain <summary>
   text did before, inheriting every property set on .faq summary above. */
.faq summary h3 {
  display: inline; margin: 0; padding: 0;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.faq p { margin-top: .6rem; }

/* ------------------------- ad slot --------------------------------------- */
/* The hand-placed unit between the results panel and "How this calculator
   works". min-height reserves the space up front: without it, an ad that
   arrives after first paint pushes the explanatory section down mid-read,
   which is both a bad experience and a Cumulative Layout Shift penalty.
   The reserve is deliberately modest — a slot that stays visibly empty when
   no ad fills is worse than a small settle. */
.ad-slot {
  margin: 2rem 0 0;
  min-height: 100px;
  text-align: center;
}
.ad-slot-label {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .65rem;
  color: var(--steel-300);
  margin-bottom: .35rem;
}
.ad-slot .adsbygoogle { display: block; }
@media (min-width: 700px) {
  .ad-slot { min-height: 130px; }
}

/* ------------------------- results actions / recents / cost -------------- */
.results-actions-bar {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: 1.1rem; padding-top: 1.1rem;
  border-top: 1px solid var(--charcoal-700);
}
.results-actions-bar .btn-ghost {
  width: auto; flex: 1 1 auto; margin-top: 0;
  border-color: var(--steel-600); color: var(--concrete-100);
}
.results-actions-bar .btn-ghost:hover { border-color: var(--safety-500); color: var(--safety-500); }
.results-actions-bar select[data-action="add-to-project"] {
  flex: 1 1 100%; width: auto; margin-top: 0;
  background: var(--charcoal-700); color: var(--paper); border: 1px solid var(--steel-600);
  font-family: var(--font-mono); font-size: .78rem; padding: .5rem .6rem; border-radius: var(--radius);
}
.results-actions-bar select[data-action="add-to-project"]:disabled { opacity: .5; }
.results-actions-bar select[data-action="add-to-project"]:not(:disabled):focus {
  border-color: var(--safety-500); outline: none;
}

.cost-panel {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--charcoal-700);
}
.cost-panel .cost-heading {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em;
  font-size: .78rem; color: var(--steel-300); margin: 0 0 .6rem;
}
.cost-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: .3rem; }
.cost-fields label { font-size: .74rem; color: var(--steel-300); display: block; }
.cost-fields input {
  margin-top: .3rem; width: 100%; font-family: var(--font-mono); font-size: .9rem;
  padding: .45rem .5rem; border-radius: var(--radius); border: 1px solid var(--steel-600);
  background: var(--charcoal-700); color: var(--paper);
}
.cost-fields input::placeholder { color: var(--steel-300); opacity: .8; }
.cost-fields input:focus {
  border-color: var(--safety-500); background: var(--charcoal); outline: none;
}
.cost-panel .hint { color: var(--steel-300); font-size: .7rem; margin-top: .5rem; }

.recents-strip {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--charcoal-700);
}
.recents-strip .recents-heading {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em;
  font-size: .78rem; color: var(--steel-300); margin: 0 0 .5rem;
}
.recents-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.recents-list a {
  display: block; font-family: var(--font-mono); font-size: .78rem;
  color: var(--concrete-200); text-decoration: none; padding: .35rem 0;
}
.recents-list a:hover { color: var(--safety-500); }
