/* The macro calculator (/macro-calculator/ and the women's cheat sheet's Calculator tab). Moved out of home.css
   on Nov 16 2026 so the cheat sheet page can load it on its own. */

.calc-page {
  padding-block: clamp(32px, 5vw, 72px) var(--section-pad);
}

.calc-page__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(42px, 5.6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.calc-page__lede {
  margin: 16px 0 0;
  max-width: 34em;
  font-size: 20px;
  color: var(--text-2);
}

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(28px, 4vw, 48px);
}

.calc__form,
.calc__result {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 22px;
}

.calc__form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border: 1px solid var(--line);
  background: var(--white);
}

.calc__group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.calc__label,
.calc__group legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 17px;
  font-weight: 700;
}

.calc__row {
  display: flex;
  gap: 10px;
}

.calc__row > * {
  flex: 1 1 0;
  min-width: 0;
}

/* Segmented buttons (sex, units, goal) */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seg label {
  flex: 1 1 0;
  min-width: 0;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-weight: 600;
  font-size: 17px;
  text-align: center;
  cursor: pointer;
}

.seg input:checked + span {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.seg input:focus-visible + span {
  box-shadow: var(--focus-ring);
}

.calc__input {
  position: relative;
}

.calc__input input,
.calc__select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--charcoal);
  font: inherit;
  font-size: 18px;
  font-weight: 500;
}

.calc__input input {
  padding-right: 44px;
}

.calc__input input:focus,
.calc__select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: var(--focus-ring);
}

.calc__unit {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-4);
  pointer-events: none;
}

.calc__error {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--red-text);
}

.calc__result {
  position: sticky;
  top: 88px;
  background: var(--ink);
  box-shadow: var(--shadow-dark);
  color: var(--white);
}

.calc__result-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
}

.calc__calories {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.calc__calories small {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-text);
}

.calc__bar {
  display: flex;
  height: 14px;
  margin: 22px 0 0;
  overflow: hidden;
  border-radius: 7px;
  background: #333;
}

.calc__bar span {
  display: block;
  height: 100%;
  transition: width 0.3s ease;
}

.calc__bar .is-protein { background: var(--red); }
.calc__bar .is-carbs { background: var(--amber); }
.calc__bar .is-fats { background: var(--orange); }

.calc__macros {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.calc__macros li {
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  border-radius: 14px;
  background: #262626;
  border-top: 4px solid;
}

.calc__macros .is-protein { border-color: var(--red); }
.calc__macros .is-carbs { border-color: var(--amber); }
.calc__macros .is-fats { border-color: var(--orange); }

.calc__macro-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-text);
}

.calc__macro-grams {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.1;
}

.calc__macro-kcal {
  font-size: 15px;
  color: #A8A8A8;
}

.calc__note {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: #A8A8A8;
}

.calc__cta {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--ink-line);
}

.calc__cta p {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--ink-text);
}

.calc-how {
  max-width: 46em;
  margin-top: clamp(40px, 5vw, 72px);
}

.calc-how h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.02em;
}

.calc-how p,
.calc-how li {
  font-size: 18px;
  color: var(--text-2);
}

.calc-how ul {
  padding-left: 22px;
}

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

  .calc__result {
    position: static;
  }
}

@media (max-width: 420px) {
  .calc__macros {
    gap: 6px;
  }

  .calc__macros li {
    padding: 12px 8px;
  }
}

/* Ranges (the women's cheat sheet's Calculator tab): "120–140g" is wider than one number, so a little smaller */
.calc--ranges .calc__macro-grams {
  font-size: clamp(20px, 5.4vw, 26px);
  white-space: nowrap;
}

/* Buyers' cheat sheet page: the coach note in a red box so it's seen (Zara, Nov 16 2026) */
.calc__alert {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--red);
  color: var(--white);
}

.calc__alert p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.calc__alert strong {
  color: var(--white);
}
