/* ===================================================================
   Calculator pages — tool-like extensions to the core stylesheet.
   Keeps the same colour language, leans more clinical.
   =================================================================== */

/* ============================= PAGE HEADER ============================= */

.calc-header {
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--ink-faint);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--ochre-deep);
  text-decoration: underline;
}
.breadcrumb span { margin: 0 0.5rem; opacity: 0.5; }

.calc-header__tag {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ochre);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.calc-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
.calc-header__lede {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 55ch;
  line-height: 1.55;
}

/* ============================= CALC SHELL ============================= */

.calc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1rem;
}

@media (max-width: 860px) {
  .calc-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================= INPUT PANEL ============================= */

.calc-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 2px;
}

.calc-panel__title {
  font-size: 1.1rem;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

.field {
  margin-bottom: 1.5rem;
}
.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.field .unit {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.field__hint {
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 0.5rem;
  max-width: none;
}

/* Text/number inputs */
.field input[type="number"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1.5px solid var(--rule);
  border-radius: 2px;
  transition: all 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.field input[type="number"]:hover {
  border-color: var(--ink-faint);
}
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--ochre);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(200, 96, 31, 0.12);
}
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Select */
.field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: 'Inter Tight', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1.5px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%231c1917' stroke-width='1.5' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
}
.field select:hover { border-color: var(--ink-faint); }
.field select:focus {
  outline: none;
  border-color: var(--ochre);
  background-color: var(--paper);
  box-shadow: 0 0 0 3px rgba(200, 96, 31, 0.12);
}

/* Segmented control */
.segmented {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-warm);
}
.segmented .seg {
  flex: 1;
  padding: 0.7rem 0.5rem;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.segmented .seg:last-child { border-right: 0; }
.segmented .seg:hover:not(.on) {
  background: var(--paper);
  color: var(--ink);
}
.segmented .seg.on {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* Custom depth input shown conditionally */
#depthCustom {
  margin-top: 0.75rem;
  max-width: 160px;
}

/* Calculate button — prominent */
.btn--calc {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  background: var(--ochre);
  border-color: var(--ochre);
  color: var(--paper);
  border-radius: 2px;
  letter-spacing: 0.02em;
}
.btn--calc:hover {
  background: var(--ochre-deep);
  border-color: var(--ochre-deep);
}

/* ============================= RESULTS PANEL ============================= */

.calc-results {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 2px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.calc-results__empty {
  text-align: center;
  padding: 1rem;
}
.calc-results__emptyText {
  color: rgba(250, 247, 242, 0.65);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 32ch;
  margin: 0 auto;
}
.calc-results__emptyText--err {
  color: #f5a580;
}
.calc-results__emptyText strong {
  color: var(--paper);
  font-style: normal;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
}

/* Actual result card */
.result-card__label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ochre);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.result-card__big {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--paper);
  margin-bottom: 0.5rem;
}
.result-card__sub {
  font-size: 0.95rem;
  color: rgba(250, 247, 242, 0.75);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  max-width: none;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(250, 247, 242, 0.18);
  border-bottom: 1px solid rgba(250, 247, 242, 0.18);
  margin-bottom: 1.25rem;
}
@media (max-width: 520px) {
  .result-grid { grid-template-columns: 1fr; gap: 0.5rem; }
}
.result-stat {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 0.5rem 0.25rem;
}
.result-stat__num {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.1;
}
.result-stat__unit {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.6);
  margin-top: 0.3rem;
}

.result-order {
  margin-bottom: 1rem;
}
.result-order__heading {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.55);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.result-order__main {
  font-size: 0.98rem;
  color: var(--paper);
  line-height: 1.55;
}
.result-order__main strong {
  color: var(--paper);
  font-weight: 700;
}

.result-tip {
  font-size: 0.85rem;
  color: rgba(250, 247, 242, 0.7);
  line-height: 1.55;
  padding: 0.9rem 1rem;
  background: rgba(250, 247, 242, 0.06);
  border-left: 3px solid var(--ochre);
  border-radius: 0 2px 2px 0;
  margin-top: 1rem;
  max-width: none;
}
.result-tip strong { color: var(--paper); }

/* ============================= EXPLAINER & RELATED ============================= */

.calc-explainer {
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

.related-calcs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.related-card {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
  display: block;
}
.related-card:hover {
  border-color: var(--ochre);
  background: var(--ochre-soft);
  transform: translateY(-2px);
}
.related-card__tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.related-card h3 {
  font-size: 1.05rem;
  margin: 0.5rem 0 0.4rem;
}
.related-card p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
  max-width: none;
}
