/* ==========================================================================
   RIGCALC — calculator-page-only styles
   Loaded alongside base.css by the 10 calculator pages. 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(--chrome);
  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 { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  color: var(--steel-600); margin-bottom: .35rem;
  font-family: var(--font-display);
}
.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(--panel-300);
  border-radius: var(--radius);
  background: var(--panel-100);
  color: var(--ink);
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  background: var(--chrome);
  border-color: var(--steel-600);
}

.unit-toggle { display: flex; justify-content: flex-end; gap: .4rem; margin: -.75rem 0 1.25rem; }
.unit-toggle button {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  padding: .5rem .85rem; border: 1px solid var(--panel-300);
  background: var(--panel-100); color: var(--asphalt-700);
  border-radius: var(--radius); cursor: pointer;
}
.unit-toggle button[aria-pressed="true"] {
  background: var(--asphalt); color: var(--redline-400); border-color: var(--asphalt);
}

.shape-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.shape-tabs button {
  font-family: var(--font-display); font-weight: 600;
  font-size: .8rem; letter-spacing: .02em; text-transform: uppercase;
  padding: .65rem 1rem; border: 1px solid var(--panel-300);
  background: var(--panel-100); color: var(--asphalt-700);
  border-radius: var(--radius); cursor: pointer;
}
.shape-tabs button[aria-pressed="true"] {
  background: var(--asphalt); color: var(--redline-400); border-color: var(--asphalt);
}

/* ------------------------------- results / dataplate --------------------- */
.results-panel {
  position: sticky; top: 20px;
  background: var(--asphalt);
  color: var(--chrome);
  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(--redline-500); }

.stamp {
  border: 2px solid var(--panel-300);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.3rem;
  position: relative;
  margin-bottom: 1rem;
  background: var(--asphalt-700);
}
.stamp::before {
  content: ""; position: absolute; top: 8px; left: 8px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--steel-600); box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset;
}
.stamp::after {
  content: ""; position: absolute; bottom: 8px; right: 8px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--steel-600); box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset;
}
.stamp .tag {
  position: absolute; top: -11px; right: 12px;
  background: var(--redline-600); color: var(--chrome);
  font-family: var(--font-mono); font-weight: 700; font-size: .62rem;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px;
}
.stamp .value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 2.1rem; line-height: 1.1; color: var(--chrome);
}
.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;
  font-family: var(--font-display); font-weight: 600;
}

.result-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px solid var(--asphalt-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(--chrome); 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(--chrome); border: var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; font-family: var(--font-mono); font-size: .88rem;
  color: var(--asphalt-700); margin: 1rem 0 1.5rem; overflow-x: auto;
}
.unit-note {
  font-family: var(--font-mono); font-size: .76rem; color: var(--steel-600);
  margin: -1rem 0 1.5rem;
}
.faq { margin-top: 1.5rem; }
.faq details { border-bottom: var(--border); padding: .9rem 0; }
.faq summary {
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  font-size: .95rem; cursor: pointer; color: var(--asphalt);
}
/* 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 exactly 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 the explanatory section.
   min-height reserves the space up front: without it, an ad arriving after
   first paint pushes that 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 nothing 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; }
}

/* ------------------------------ engagement: calc actions bar -------------- */
.calc-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--asphalt-700);
}
.calc-actions .calc-fav-star { font-size: 1.3rem; color: var(--steel-600); }
.calc-action-btn {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; cursor: pointer;
  background: var(--asphalt-700); color: var(--panel-200);
  border: 1px solid var(--steel-600); border-radius: var(--radius);
  padding: .55rem .8rem;
}
.calc-action-btn:hover { border-color: var(--redline-500); color: var(--chrome); }
.calc-action-btn:disabled { opacity: .7; cursor: default; }
.calc-action-note {
  font-family: var(--font-mono); font-size: .68rem; color: var(--steel-300);
  margin-left: auto;
}

/* ------------------------------ print summary placeholder ----------------- */
.print-summary { display: none; }

/* ------------------------------ reference content ------------------------- */
/* Added with the content pass. Ported from the sibling site and re-pointed at
   this site's own tokens (panel/steel/redline, not concrete/charcoal/safety) —
   the two share a structure, not a palette. */

/* 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(--chrome);
}
.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(--panel-200);
  color: var(--asphalt-700);
}
.ref-table thead th {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .72rem;
  color: var(--ink);
  background: var(--panel-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-example {
  background: var(--chrome);
  border: var(--border);
  border-left: 3px solid var(--redline-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(--asphalt-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(--asphalt-700); }
.support h3 { font-size: 1rem; margin: 1.4rem 0 .6rem; }
