/* ── Calculator Pages ─────────────────────────────────────────────────────── */
/* Uses CSS variables from style.css: --bg, --surface, --text, --text-2,     */
/* --text-3, --border, --accent, --accent-h, --sans, --max-w, --px           */

/* ── Layout ── */
.calc-page {
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 8vw, 5rem);
}
.calc-page .wrap {
  max-width: 740px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}
.breadcrumb a {
  color: var(--text-3);
}
.breadcrumb a:hover {
  color: var(--text);
}
.breadcrumb .sep {
  margin: 0 0.35rem;
}

/* ── Page Title ── */
.calc-page h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

/* ── Answer Box ── */
.answer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.answer-big {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.answer-context {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-top: 0.35rem;
}
.answer-details {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.answer-details strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Inline CTA (above the fold) ── */
.inline-cta {
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.inline-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--accent);
  font-weight: 500;
}
.inline-cta a:hover {
  color: var(--accent-h);
}
.inline-cta .arrow {
  transition: transform 0.2s;
}
.inline-cta a:hover .arrow {
  transform: translateX(2px);
}

/* ── Intro text ── */
.calc-intro {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 2.5rem;
}
.calc-intro strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Section Headings ── */
.calc-page h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 2rem;
}
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.calc-table th,
.calc-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.calc-table th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--bg);
  white-space: nowrap;
}
.calc-table .cal-highlight {
  font-weight: 700;
  color: var(--accent);
}

/* ── Methodology Card ── */
.methodology {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0;
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.75;
}
.methodology strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}
.methodology code {
  background: var(--bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* ── CTA Box ── */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 2.5rem 0;
}
.cta-box h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.cta-box p {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.cta-box .app-store-btn {
  display: inline-flex;
}

/* ── Related Links ── */
.related {
  margin: 2.5rem 0;
}
.related h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}
.related h3:first-child {
  margin-top: 0;
}
.link-grid {
  display: flex;
  flex-direction: column;
}
.link-grid a {
  display: block;
  padding: 0.45rem 0;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
}
.link-grid a:last-child {
  border-bottom: none;
}

/* ── Hub Pages ── */
.hub-intro {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 2.5rem;
}
.hub-intro a {
  font-weight: 500;
}

.hub-section {
  margin-bottom: 2.5rem;
}
.hub-section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* ── Hub link grid with calorie preview ── */
.hub-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
}
.hub-links a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.hub-links a:hover {
  border-color: var(--accent);
}
.hub-links .cal-preview {
  color: var(--text-3);
  font-size: 0.75rem;
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* ── Sticky Mobile App Banner ── */
.sticky-banner {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .answer-details {
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
  }
  .hub-links {
    grid-template-columns: 1fr;
  }
  .sticky-banner {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--text);
    color: #fff;
    padding: 0.75rem 1rem;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  }
  .sticky-banner.hidden {
    display: none;
  }
  .sticky-banner-text {
    flex: 1;
    min-width: 0;
  }
  .sticky-banner-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
  }
  .sticky-banner-sub {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.3;
  }
  .sticky-banner-get {
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
  }
  .sticky-banner-get:hover {
    color: #fff;
  }
  .sticky-banner-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem;
    cursor: pointer;
  }
  .sticky-banner-close:hover {
    color: #fff;
  }
  /* Add bottom padding to body so footer isn't hidden behind banner */
  body:has(.sticky-banner:not(.hidden)) footer {
    padding-bottom: 4rem;
  }
}
