/* =========================================================
   BodyMassInsults.com — styles
   Palette: McKinsey navy meets Mayo Clinic blue, on white.
   ========================================================= */

:root {
  --navy:      #0A2540;
  --blue-900:  #062B5B;
  --blue-700:  #0B4DA2;
  --blue-600:  #1366D6;
  --blue-500:  #2E7CF6;
  --blue-100:  #E8F1FC;
  --blue-50:   #F4F8FD;

  --ink:       #11212F;
  --slate:     #46586B;
  --slate-300: #5A6776;
  --line:      #E2E9F1;
  --white:     #FFFFFF;

  --under:  #5E97D6;
  --normal: #2FA56A;
  --over:   #E0A23C;
  --obese:  #D45D5D;

  --radius:    18px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(10,37,64,.06), 0 1px 3px rgba(10,37,64,.08);
  --shadow-md: 0 14px 34px -16px rgba(10,37,64,.28);
  --shadow-lg: 0 36px 64px -28px rgba(10,37,64,.32);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.is-hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; color: var(--blue-600); }
.brand-accent { color: var(--blue-600); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--slate); font-weight: 500; font-size: .95rem; }
.site-nav a:hover { color: var(--navy); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--blue-50) 0%, #fff 100%); padding: 64px 0 28px; }
.hero-inner { text-align: center; max-width: 760px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600;
  color: var(--blue-600); margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.04; letter-spacing: -.02em;
  margin: 0 0 18px; color: var(--navy);
}
.lede { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--slate); margin: 0; }

/* ---------- Calculator layout + ad rails ---------- */
.calc-section { padding: 28px 0 56px; }
.calc-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 132px;
  gap: 24px; align-items: start;
}
.ad-rail { position: sticky; top: 88px; align-self: start; }

/* ===== CALCULATOR-WIDGET ADS (vertical rails + mobile banner) ===== */
.ad-rail-inner,
.ad-banner {
  display: block; position: relative; text-decoration: none;
  border: 1.5px dashed #C4D3E6; border-radius: var(--radius-sm);
  background: var(--blue-50); color: var(--slate);
  transition: border-color .2s, background .2s;
}
.ad-rail-inner:hover,
.ad-banner:hover { border-color: var(--blue-500); background: #fff; }

.ad-label { text-transform: uppercase; letter-spacing: .2em; font-size: .52rem; color: var(--slate-300); }
.ad-headline { font-weight: 700; letter-spacing: .04em; color: var(--blue-700); }
.ad-sub { font-size: .76rem; color: var(--slate); }

/* Vertical skyscraper rail: PLACE + Contact as grouped vertical columns */
.ad-rail-inner {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0;
  min-height: 460px; padding: 28px 10px;
}
.ad-rail-inner .ad-headline { writing-mode: vertical-rl; font-size: 1.05rem; }
.ad-rail-inner .ad-sub { writing-mode: vertical-rl; max-width: 1.2em; margin-left: 10px; }
.ad-rail-inner .ad-label { position: absolute; left: 11px; bottom: 12px; writing-mode: vertical-rl; }

/* ===== ARTICLE BANNER ADS (fully independent of the calculator-widget ads) ===== */
.article-ad {
  position: relative; left: 50%; transform: translateX(-50%);
  width: min(calc(100vw - 36px), 1100px); margin: 42px 0;
}
.article-ad__inner {
  display: block; position: relative; min-height: 120px; padding: 18px 24px;
  border: 1.5px dashed #B7C7DC; border-radius: var(--radius-sm);
  background: var(--blue-50); text-decoration: none;
  transition: border-color .2s, background .2s;
}
.article-ad__inner:hover { border-color: var(--blue-500); background: #fff; }
.article-ad__title { display: block; font-weight: 700; letter-spacing: .04em; color: var(--blue-700); font-size: 1.2rem; }
.article-ad__contact { position: absolute; right: 24px; bottom: 16px; font-size: .85rem; color: var(--slate); }
.article-ad__tag { position: absolute; left: 24px; bottom: 15px; text-transform: uppercase; letter-spacing: .18em; font-size: .6rem; color: var(--slate); }

/* Fallback banner shown below the calculator under 1080px */
.ad-banner { display: none; min-height: 104px; margin-top: 28px; padding: 18px 22px; }
.ad-banner .ad-headline { display: block; font-size: 1.15rem; }
.ad-banner .ad-sub { position: absolute; right: 22px; bottom: 16px; }
.ad-banner .ad-label { position: absolute; left: 22px; bottom: 15px; }

/* ---------- Card ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.calculator { overflow: hidden; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; }
.panel-title {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600;
  color: var(--slate-300); margin: 0 0 18px;
}

/* Input panel */
.calc-input { padding: 34px 34px 30px; border-right: 1px solid var(--line); }

.unit-toggle {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--blue-50); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px;
}
.unit-btn {
  border: 0; background: transparent; color: var(--slate); cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: .9rem; padding: 8px 20px; border-radius: 9px;
  transition: all .18s ease;
}
.unit-btn.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }

.field-group { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.muted-tag { font-weight: 500; font-size: .78rem; color: var(--slate-300); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input, .input-wrap select {
  width: 100%; font-family: inherit; font-size: 1.05rem; color: var(--ink);
  padding: 13px 46px 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s; -moz-appearance: textfield;
}
.input-wrap select { padding-right: 14px; cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input-wrap input::-webkit-outer-spin-button, .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input:focus, .input-wrap select:focus {
  outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(46,124,246,.14);
}
.input-wrap .suffix { position: absolute; right: 14px; color: var(--slate-300); font-size: .92rem; pointer-events: none; }
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.optional-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.ignore-note { font-size: .82rem; color: var(--slate-300); font-style: italic; margin: 10px 0 0; }

.actions { display: flex; gap: 12px; margin-top: 26px; }
.btn {
  font-family: inherit; font-weight: 600; font-size: .98rem; cursor: pointer;
  padding: 13px 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600)); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(19,102,214,.7); flex: 1;
}
.btn-primary:hover { box-shadow: 0 12px 26px -8px rgba(19,102,214,.8); }
.btn-ghost { background: #fff; color: var(--slate); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--slate-300); color: var(--navy); }
.btn-soft { background: var(--blue-50); color: var(--blue-700); border-color: var(--line); font-size: .9rem; padding: 10px 16px; }
.btn-soft:hover { background: var(--blue-100); }

.privacy-note { margin: 22px 0 0; font-size: .76rem; line-height: 1.4; color: var(--slate-300); }

/* Output panel */
.calc-output { padding: 34px; background: linear-gradient(180deg, #fff 0%, var(--blue-50) 100%); display: flex; flex-direction: column; }

.output-empty { margin: auto 0; text-align: center; padding: 24px 8px; }
.empty-number { font-family: var(--font-serif); font-size: 5rem; line-height: 1; color: #CBD7E6; font-weight: 700; }
.empty-text { color: var(--slate); margin: 18px auto 0; max-width: 320px; }

.output-result { display: flex; flex-direction: column; gap: 18px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .88rem;
  color: #fff; background: #1E7A4D;
}
.result-badge[data-cat="under"] { background: #2F6FB3; }
.result-badge[data-cat="normal"] { background: #1E7A4D; }
.result-badge[data-cat="over"] { background: #9A5B16; }
.result-badge[data-cat="obese"] { background: #B23B3B; }
.result-prime { font-size: .82rem; color: var(--slate-300); }

.result-number { display: flex; align-items: baseline; gap: 10px; }
.result-value { font-family: var(--font-serif); font-size: 4.4rem; line-height: .95; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.result-unit { font-size: 1rem; font-weight: 600; color: var(--slate-300); text-transform: uppercase; letter-spacing: .1em; }

/* Gauge */
.gauge { margin: 4px 0 2px; }
.gauge-track { position: relative; display: flex; height: 12px; border-radius: 999px; overflow: visible; box-shadow: inset 0 0 0 1px rgba(10,37,64,.05); }
.seg { height: 100%; }
.seg:first-child { border-radius: 999px 0 0 999px; }
.seg:last-child { border-radius: 0 999px 999px 0; }
.seg-under  { width: 14%;  background: var(--under); }
.seg-normal { width: 26%;  background: var(--normal); }
.seg-over   { width: 20%;  background: var(--over); }
.seg-obese  { width: 40%;  background: var(--obese); }
.gauge-marker {
  position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--navy); transform: translate(-50%, -50%);
  left: 0; transition: left .5s cubic-bezier(.16,1,.3,1); box-shadow: var(--shadow-sm);
}
.gauge-scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: .72rem; color: var(--slate-300); }

/* Verdict */
.verdict {
  position: relative; margin: 6px 0 0; padding: 22px 22px 22px 26px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue-500);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.verdict p { margin: 0; font-family: var(--font-serif); font-size: 1.14rem; line-height: 1.5; color: var(--navy); }

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.result-footnote { font-size: .86rem; color: var(--slate); margin: 4px 0 0; }
.result-footnote strong { color: var(--ink); }
.safety-note { font-size: .84rem; color: #8A5512; background: #FDF6EA; border: 1px solid #F4E4C4; padding: 12px 14px; border-radius: var(--radius-sm); margin: 4px 0 0; }

/* Shareable roast card + social sharing */
.roast-card { display: flex; flex-direction: column; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-sm); }
.roast-card .result-footnote, .roast-card .safety-note { margin: 0; }
.roast-watermark { margin-top: 2px; font-weight: 700; letter-spacing: .01em; color: var(--blue-600); font-size: .82rem; }

.share-block { margin-top: 4px; }
.share-label { margin: 0 0 12px; font-size: .76rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: var(--slate-300); }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .12s ease, border-color .2s ease; }
.share-btn:hover { transform: translateY(-2px); text-decoration: none; border-color: currentColor; }
.share-fb { color: #1877F2; }
.share-x  { color: #000000; }
.share-li { color: #0A66C2; }
.share-wa { color: #25D366; }
.share-rd { color: #FF4500; }
.save-roast { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; }

/* ---------- Explainer ---------- */
.explainer { padding: 56px 0; background: var(--blue-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.explainer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.explainer-col h2 { font-family: var(--font-serif); font-size: clamp(1.6rem, 3vw, 2.1rem); color: var(--navy); margin: 0 0 14px; letter-spacing: -.01em; }
.explainer-col p { color: var(--slate); margin: 0 0 16px; }
.cat-list, .why-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.cat-list li { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-under { background: var(--under); }
.dot-normal { background: var(--normal); }
.dot-over { background: var(--over); }
.dot-obese { background: var(--obese); }
.why-list li { padding-left: 18px; position: relative; color: var(--slate); }
.why-list li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-500); }
.why-list strong { color: var(--ink); }

/* ---------- Long-form article ---------- */
.longform { padding: 72px 0; }
.article-inner { max-width: 760px; }
.article-header { margin-bottom: 34px; }
.article-header h2 { font-family: var(--font-serif); font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -.02em; color: var(--navy); margin: 8px 0 18px; }
.article-standfirst { font-size: 1.18rem; color: var(--slate); margin: 0; }
.article-byline { margin: 16px 0 0; font-size: .95rem; font-weight: 700; color: var(--slate); }
.article-byline a { color: var(--blue-700); text-decoration: underline; text-underline-offset: 2px; }
.article-byline a:hover { color: var(--blue-600); }

.quick-summary { margin: 28px 0 6px; padding: 22px 26px; background: var(--blue-50); border: 1px solid var(--line); border-left: 4px solid var(--blue-600); border-radius: var(--radius-sm); }
.quick-summary__label { margin: 0 0 12px; font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--blue-700); }
.quick-summary ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.quick-summary li { color: var(--ink); font-size: 1.02rem; line-height: 1.5; }
.quick-summary li strong { color: var(--navy); }
.longform h3 { font-family: var(--font-serif); font-size: clamp(1.7rem, 3.2vw, 2.05rem); color: var(--navy); margin: 48px 0 14px; letter-spacing: -.015em; line-height: 1.16; }
.longform h4 { font-family: var(--font-serif); font-size: clamp(1.35rem, 2.4vw, 1.55rem); color: var(--navy); margin: 34px 0 10px; letter-spacing: -.01em; line-height: 1.22; }
.longform p { color: #2C3E50; margin: 0 0 16px; font-size: 1.05rem; }
.prose-list { color: #2C3E50; padding-left: 22px; margin: 0 0 16px; display: grid; gap: 8px; }
.prose-list li { font-size: 1.05rem; }

.longform blockquote { margin: 20px 0; padding: 14px 22px; background: var(--blue-50); border-left: 4px solid var(--blue-500); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.longform blockquote p { margin: 0; font-size: 1.1rem; color: var(--navy); }
.longform sup { font-size: .66em; line-height: 0; }
.longform sup a { color: var(--blue-600); text-decoration: none; padding: 0 1px; }
.longform sup a:hover { text-decoration: underline; }
.footnotes { margin: 8px 0 0; padding-left: 1.5em; color: var(--slate); font-size: .9rem; line-height: 1.55; }
.footnotes li { margin: 0 0 10px; padding-left: 4px; }
.footnotes li::marker { color: var(--slate-300); }
.footnotes a { color: var(--blue-700); word-break: break-word; }

.table-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.bmi-table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.bmi-table th, .bmi-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.bmi-table thead th { background: var(--navy); color: #fff; font-weight: 600; }
.bmi-table tbody tr:nth-child(even) { background: var(--blue-50); }
.bmi-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { padding: 8px 0 80px; }
.faq-inner { max-width: 760px; }
.faq-inner h2 { font-family: var(--font-serif); font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--navy); margin: 0 0 24px; letter-spacing: -.01em; }
.faq-list { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 18px 20px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--blue-500); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0; padding: 0 20px 20px; color: var(--slate); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #C9D6E5; padding: 48px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px 120px; align-items: start; }
.footer-brand .brand-text { color: #fff; font-weight: 700; font-size: 1.25rem; }
.footer-brand .brand-accent { color: #6BA6FF; }
.footer-tagline { color: #8DA4BF; margin: 8px 0 0; font-size: .95rem; }
.footer-meta p { margin: 0 0 12px; font-size: .92rem; }
.disclaimer { color: #9FB3CB; }
.not-advice { color: #fff; }
.footer-contact { color: #9FB3CB; }
.footer-meta a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.footer-meta a:hover { color: var(--blue-100); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .calc-layout { grid-template-columns: 1fr; }
  .ad-rail { display: none; }
  .ad-banner { display: block; }
}
@media (max-width: 760px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-input { border-right: 0; border-bottom: 1px solid var(--line); }
  .explainer-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .result-value { font-size: 3.6rem; }
}
@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .calc-input, .calc-output { padding: 24px 20px; }
  .optional-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .gauge-marker { transition: none; }
}
