/* ==========================================================================
   /tools/weight-gain
   Inherits form/result base from bmi-calculator.css (which inherits from
   school-readiness.css → maternity-bag.css). Only adds tool-specific bits.
   ========================================================================== */
@import url("/assets/css/bmi-calculator.css");

/* ---------- Page & Hero ---------- */
.wg-page {
  background: #f6fbf6 !important;
}

.wg-hero {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(220, 240, 226, 0.78) 100%
    ),
    url("/assets/images/calc-pregnancy-hero.webp") center / cover no-repeat,
    linear-gradient(180deg, #ffffff 0%, #dcf0e2 100%) !important;
  border-bottom-color: #c5e3cf !important;
}

.wg-hero .mb-hero-title span::after {
  background: linear-gradient(
    90deg,
    rgba(78, 205, 196, 0.55),
    rgba(247, 220, 111, 0.4)
  );
}

.wg-eyebrow-short { display: none; }

/* Hide "Пол" legend visually — pill toggle self-explanatory via emojis */
.wg-page .bc-field-gender > .bc-field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Compensate gap so the pill aligns top-of-row with neighbouring fields */
.wg-page .bc-field-gender {
  align-self: flex-end;
}

@media (max-width: 600px) {
  .wg-eyebrow-full  { display: none; }
  .wg-eyebrow-short { display: inline; }
  .wg-hero .mb-hero-eyebrow {
    padding: 5px 12px;
    font-size: 12px;
  }
}

/* ==========================================================================
   FEEDING TYPE — chip group (more compact than segmented control)
   ========================================================================== */
.wg-field-feeding {
  margin-top: 4px;
}

.wg-field-optional {
  font-weight: 500;
  color: var(--dark-text-color);
  font-size: 12.5px;
  margin-left: 4px;
}

.wg-feeding-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wg-feeding-chip {
  position: relative;
  cursor: pointer;
}

.wg-feeding-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wg-feeding-chip span {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #f0f6fb;
  border: 1.5px solid #e1ecf3;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-text-color);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.wg-feeding-chip:hover span {
  border-color: #4ecdc4;
  color: var(--main-bg-color);
}

.wg-feeding-chip input:checked + span {
  background: #4ecdc4;
  border-color: #4ecdc4;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(78, 205, 196, 0.3);
}

.wg-feeding-chip input:focus-visible + span {
  outline: 2px solid var(--gold-color);
  outline-offset: 2px;
}

/* ==========================================================================
   RESULT — three summary cards on top
   ========================================================================== */
.wg-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.wg-result-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #c5e3cf;
  border-radius: 14px;
  text-align: center;
}

.wg-result-card-label {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark-text-color);
}

.wg-result-card-value {
  font-family: "Montserrat", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--main-bg-color);
  line-height: 1;
}

.wg-result-card-sub {
  font-size: 12.5px;
  color: var(--dark-text-color);
}

/* Color accents per card */
.wg-result-total {
  background: linear-gradient(135deg, #ffffff 0%, #ecf8ef 100%);
}

.wg-result-weekly {
  background: linear-gradient(135deg, #ffffff 0%, #fffbef 100%);
  border-color: #f0e4bd;
}

.wg-result-percentile {
  background: linear-gradient(135deg, #ffffff 0%, #ebf2fa 100%);
  border-color: #cee0ee;
}

/* ==========================================================================
   STATUS BANNER
   ========================================================================== */
.wg-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 14px;
  border-left: 5px solid #4ecdc4;
  margin-bottom: 18px;
}

.wg-status.is-low    { border-left-color: #ff8a3c; background: linear-gradient(135deg, #fff8ef 0%, #fff 100%); }
.wg-status.is-normal { border-left-color: #54d07f; background: linear-gradient(135deg, #ecf8ef 0%, #fff 100%); }
.wg-status.is-high   { border-left-color: #e85d75; background: linear-gradient(135deg, #fff0f3 0%, #fff 100%); }
.wg-status.is-warning{ border-left-color: #ff8a3c; background: linear-gradient(135deg, #fff5e8 0%, #fff 100%); }

.wg-status-emoji {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.wg-status-eyebrow {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark-text-color);
  margin-bottom: 4px;
}

.wg-status-title {
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--main-bg-color);
  line-height: 1.2;
}

.wg-result-text {
  margin: 0 0 22px !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
  color: var(--main-bg-color);
}

/* ==========================================================================
   NORM BAR — visualization of where the user falls in the norm range
   ========================================================================== */
.wg-norm-card {
  padding: 18px 22px;
  background: #fff;
  border: 1px solid #d6e4ee;
  border-radius: 14px;
  margin-bottom: 18px;
}

.wg-norm-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.wg-norm-head strong {
  font-family: "Montserrat", sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--main-bg-color);
}

.wg-norm-range {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1d8a83;
}

.wg-norm-bar {
  position: relative;
  margin: 8px 0 0;
}

.wg-norm-bar-track {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 0;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.wg-norm-bar-zone-low    { background: linear-gradient(90deg, #ff8a3c 0%, #ffb37a 100%); }
.wg-norm-bar-zone-normal { background: linear-gradient(90deg, #54d07f 0%, #a8e8b8 50%, #54d07f 100%); }
.wg-norm-bar-zone-high   { background: linear-gradient(90deg, #ffb37a 0%, #e85d75 100%); }

.wg-norm-bar-min,
.wg-norm-bar-max {
  display: inline-block;
  font-family: "Montserrat", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dark-text-color);
  margin-bottom: 4px;
}

.wg-norm-bar-min { float: left; }
.wg-norm-bar-max { float: right; }

.wg-norm-bar::after {
  content: "";
  display: block;
  clear: both;
}

.wg-norm-marker {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wg-norm-marker-dot {
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid var(--main-bg-color);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.2);
}

.wg-norm-marker-label {
  margin-top: 6px;
  padding: 2px 8px;
  background: var(--main-bg-color);
  color: #fff;
  border-radius: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.wg-norm-note {
  margin: 12px 0 0 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--dark-text-color);
}

/* ==========================================================================
   RECOMMENDATIONS LIST
   ========================================================================== */
.wg-result-recommendations {
  background: #fff;
  border: 1px dashed #c5e3cf;
  border-radius: 14px;
  padding: 18px 22px;
}

.wg-result-recommendations:empty {
  display: none;
}

.wg-result-recommendations h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 14px !important;
  font-weight: 700;
  margin: 0 0 10px !important;
  color: var(--main-bg-color);
}

.wg-result-recommendations ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.wg-result-recommendations li {
  position: relative;
  padding: 6px 0 6px 22px !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  color: var(--main-bg-color);
}

.wg-result-recommendations li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 6px;
  color: #1d8a83;
  font-weight: 800;
}

/* ==========================================================================
   SEO BODY — small norm tables (only on this page, scoped via .wg-page)
   ========================================================================== */
.wg-page .mb-seo table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0 22px;
  background: #fff;
  border: 1px solid #c5e3cf;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(78, 205, 196, 0.06);
  font-family: "Nunito", "Montserrat", sans-serif;
  font-size: 14.5px;
}

.wg-page .mb-seo table thead {
  background: linear-gradient(135deg, #ecf8ef 0%, #dcf0e2 100%);
}

.wg-page .mb-seo table th {
  padding: 12px 18px;
  text-align: left;
  font-family: "Montserrat", sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1d8a83;
  border-bottom: 1.5px solid #c5e3cf;
}

.wg-page .mb-seo table td {
  padding: 12px 18px;
  border-bottom: 1px solid #ecf3ee;
  color: var(--main-bg-color);
  vertical-align: middle;
}

.wg-page .mb-seo table tbody tr:last-child td {
  border-bottom: none;
}

.wg-page .mb-seo table tbody tr:nth-child(even) td {
  background: #fafdfb;
}

.wg-page .mb-seo table tbody tr:hover td {
  background: #f0f9f3;
}

/* First column emphasis (age) */
.wg-page .mb-seo table tbody td:first-child {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--main-bg-color);
  white-space: nowrap;
}

/* Numeric columns: keep digits aligned */
.wg-page .mb-seo table tbody td + td {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 760px) {
  .wg-result-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .wg-result-card {
    padding: 14px 18px;
    text-align: left;
  }
  .wg-result-card-value {
    font-size: 24px;
  }
  .wg-status {
    padding: 14px 18px;
    gap: 12px;
  }
  .wg-status-emoji {
    font-size: 30px;
  }
  .wg-status-title {
    font-size: 16px;
  }
  .wg-norm-card {
    padding: 16px 18px;
  }
  .wg-page .mb-seo table {
    font-size: 13.5px;
  }
  .wg-page .mb-seo table th,
  .wg-page .mb-seo table td {
    padding: 10px 12px;
  }
  .wg-page .mb-seo table th {
    font-size: 11px;
  }
}
