/* Shared chrome and calculator styling for the brine pages.
   Everything here is built on the MordanSoft design-system tokens, so these
   pages stay in step with the rest of the site; the shell (topbar, section,
   footer) mirrors /saltcure/calculator/. */

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--surface) 85%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-faint);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--text-primary); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; display: inline-flex; color: var(--text-primary); flex: none; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__name { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.02em; color: var(--text-primary); }
.brand__name b { color: var(--accent-text); font-weight: 600; }
.topbar__tag { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.topbar__right { display: inline-flex; align-items: center; gap: var(--space-4); }
.topbar__links { display: inline-flex; gap: var(--space-4); font-size: var(--text-sm); }
.topbar__links a { color: var(--text-secondary); text-decoration: none; }
.topbar__links a:hover, .topbar__links a[aria-current] { color: var(--accent-text); }

/* ── Page shell ─────────────────────────────────────────── */
.section { padding: var(--section-y) 0; border-bottom: 1px solid var(--border-faint); }
.section:last-of-type { border-bottom: none; }
.section__head { margin-bottom: var(--space-10); display: flex; flex-direction: column; gap: var(--space-3); max-width: 680px; }
.section__title { font-size: var(--text-h1); font-weight: 600; letter-spacing: var(--tracking-tighter); color: var(--text-primary); }
.detail__back { display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-8); font-size: var(--text-sm); }
.detail__blurb { margin: 0; font-size: var(--text-lead); color: var(--text-secondary); line-height: var(--leading-normal); max-width: 60ch; }

.prose { max-width: 68ch; }
.prose h2 { font-size: var(--text-h3); font-weight: 600; color: var(--text-primary);
            letter-spacing: var(--tracking-tighter); margin: var(--space-10) 0 var(--space-4); }
.prose p { font-size: var(--text-base); color: var(--text-secondary);
           line-height: var(--leading-normal); margin: 0 0 var(--space-4); }
.prose ul { margin: 0 0 var(--space-4); padding-left: 1.25rem; color: var(--text-secondary); line-height: var(--leading-normal); }
.prose li { margin-bottom: var(--space-2); }
.prose strong { color: var(--text-primary); }

/* ── Tables ─────────────────────────────────────────────── */
.tbl-scroll { overflow-x: auto; margin: 0 0 var(--space-6); }
table.tbl { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
table.tbl th, table.tbl td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--border-faint); color: var(--text-secondary); }
table.tbl th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase;
               letter-spacing: 0.10em; color: var(--text-muted); }
table.tbl td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }

/* ── Calculator ─────────────────────────────────────────── */
.calc-wrap { display: grid; gap: var(--space-8); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .calc-wrap { grid-template-columns: 1.05fr 1fr; } .calc-out { position: sticky; top: 84px; } }
.calc-col { display: grid; gap: var(--space-3); }
.cc { background: var(--surface-elevated, #fff); border: 1px solid var(--border);
      border-radius: var(--radius-lg, 14px); padding: var(--space-4); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
           text-transform: uppercase; color: var(--text-muted); }
.fld { display: block; margin-top: var(--space-3); }
.fld:first-child { margin-top: 0; }
.fld > span.lbl { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.fld .hint { display: block; font-size: var(--text-xs); color: var(--text-muted);
             line-height: var(--leading-normal); margin-top: 4px; }
.pair { display: grid; grid-template-columns: 1fr 9rem; gap: var(--space-3); align-items: end; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } .pair { grid-template-columns: 1fr 7.5rem; } }
input.ms-input, select.ms-input { width: 100%; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.cell { display: grid; gap: 2px; padding: var(--space-3); border: 1px solid var(--border-faint); border-radius: var(--radius-md, 10px); }
.cell .eyebrow { font-size: 10px; }
.cell b { font: 700 22px var(--font-mono); letter-spacing: -0.02em;
          font-variant-numeric: tabular-nums; color: var(--text-primary); }
.headline { font: 700 30px var(--font-mono); letter-spacing: -0.02em;
            color: var(--text-primary); font-variant-numeric: tabular-nums; }
.headline span { font: 400 13px var(--font-mono); color: var(--text-muted); }

.calc-hint { font-size: var(--text-xs); color: var(--text-muted); line-height: var(--leading-normal); margin: var(--space-3) 0 0; }
.calc-banner { font-size: var(--text-sm); color: var(--text-secondary); background: rgba(128,128,128,.10);
               border-radius: var(--radius-md, 10px); padding: var(--space-3) var(--space-4);
               margin: var(--space-4) 0 0; line-height: var(--leading-normal); }
.calc-alert { border-radius: var(--radius-md, 10px); padding: var(--space-4);
              margin-top: var(--space-4); border: 1px solid; }
.calc-alert b { display: block; margin-bottom: var(--space-2); color: var(--text-primary); }
.calc-alert p { margin: 0; font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--text-secondary); }
.calc-alert--warn { background: rgba(200,150,44,.12); border-color: rgba(200,150,44,.5); }
.calc-alert--bad  { background: rgba(192,39,23,.10);  border-color: rgba(192,39,23,.5); }
.calc-disclaimer { font-size: var(--text-xs); color: var(--text-muted); line-height: var(--leading-normal); margin: var(--space-4) 0 0; }
.calc-cta { margin-top: var(--space-10); }

/* With JavaScript off the tables and the formula still answer the question. */
html:not(.nojs) .nojsonly { display: none; }
html.nojs .jsonly { display: none; }
[hidden] { display: none !important; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--surface-elevated); border-top: 1px solid var(--border); padding: var(--space-12) 0 var(--space-16); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-10); flex-wrap: wrap; }
.footer-brand { display: flex; align-items: flex-start; gap: var(--space-3); }
.footer-brand__mark { width: 32px; height: 32px; flex: none; color: var(--text-primary); }
.footer-brand__mark svg { width: 100%; height: 100%; }
.footer-brand__name { font-weight: 600; font-size: 1rem; letter-spacing: -0.015em; color: var(--text-primary); }
.footer-brand__name b { color: var(--accent-text); font-weight: 600; }
.footer-copy { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-2); }
.footer-legal h4 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
                   text-transform: uppercase; letter-spacing: 0.10em; color: var(--text-muted); margin: 0 0 var(--space-3); }
.footer-legal a { display: block; font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none; padding: var(--space-1) 0; }
.footer-legal a:hover { color: var(--accent-text); text-decoration: none; }

.store-badges { display: inline-flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.store-badge { display: inline-flex; height: 48px; border-radius: 8px; text-decoration: none;
               transition: transform .15s ease, opacity .15s ease; }
.store-badge:hover { transform: translateY(-1px); opacity: .9; }
.store-badge img { height: 100%; width: auto; display: block; }

@media (max-width: 720px) {
  .ms-container { padding-left: var(--space-5); padding-right: var(--space-5); }
  .section { padding: var(--space-12) 0; }
  .section__title { font-size: clamp(1.5rem, 6.5vw, 2rem); }
  .detail__blurb { font-size: 1.0625rem; }
}
@media (max-width: 560px) { .topbar__tag { display: none; } .footer-inner { flex-direction: column; } }
