/* ============================================================ 
   THE SCIENCE OF WEIGHT LOSS - MAIN STYLESHEET (v6.1)
   - Dual themes (Science / Burn)
   - Card padding + overflow fixes
   - Popup modal styles
   - A11y focus, motion prefs, container queries
   ============================================================ */

/* -----------------------------
   Color Variables & Themes
----------------------------- */
:root{
  --accent:#0c7a5b;        /* default = science */
  --accent-dark:#09624a;
  --accent-ink:#ffffff;
}

body.theme-science{
  --accent:#0c7a5b;
  --accent-dark:#09624a;
  --accent-ink:#ffffff;
}
body.theme-burn{
  --accent:#c24a1b;
  --accent-dark:#9e3b15;
  --accent-ink:#ffffff;
}

/* -----------------------------
   Base Layout & Typography
----------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin:0;
  padding:0;
  font-family:Arial, Helvetica, sans-serif;
  background:#ffffff;
  color:#111111;
}

.wrap {
  width:min(1100px, 92vw);
  margin-left:auto;
  margin-right:auto;
  max-width:99%;
}

.page-card {
  width:min(1100px, 92vw);     /* <— restore width to keep borders visible */
  margin:24px auto;
  border:1px solid #d6d6d6;
  border-radius:16px;
  background:#ffffff;
  overflow:hidden;
  padding:0 20px;              /* horizontal padding fix */
  container-type:inline-size;  /* enables container queries below */
}

.muted { color:#666666; }

/* Robust wrapping to prevent layout bleed */
.page-card, .hero-copy, .band-copy, .panel {
  overflow-wrap:anywhere;
  word-break:break-word; /* fallback */
}

/* -----------------------------
   Header
----------------------------- */
.page-header {
  text-align:center;
  margin:10px 0;
}
.page-header .brand {
  font-size:1.8rem;
  font-weight:bold;
  letter-spacing:0.5px;
}

/* Theme switch (header) */
.theme-switch {
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:center;
  margin-top:6px;
}
.theme-switch .sw {
  font:inherit;
  padding:6px 14px;
  border-radius:8px;
  border:1px solid #d6d6d6;
  background:#ffffff;
  cursor:pointer;
}
.theme-switch .sw.active {
  background:var(--accent);
  color:var(--accent-ink);
  border-color:transparent;
}

/* -----------------------------
   Hero
----------------------------- */
.hero {
  padding:30px 20px;           /* add LR padding to prevent text hugging edge */
  border-bottom:1px solid #e9e9e9;
}

.hero-grid {
  display:grid;
  grid-template-columns:260px 1fr;  /* book image + copy */
  gap:28px;
  align-items:flex-start;      /* keep copy aligned to top */
  max-width:99%;
}

.hero-media img {
  width:100%;
  max-width:260px;
  height:auto;
  border-radius:8px;
  box-shadow:0 8px 18px rgba(0,0,0,0.12);
}

.hero-copy h1 {
  margin:0 0 10px;
  font-size:1.9rem;
  line-height:1.25;
  /* text-transform:uppercase; */
}
.hero-copy {
  padding-inline:2px; /* micro-guard at very narrow widths */
}
.hero-copy p {
  margin-top:0.4rem;
  margin-bottom:1.2rem;
  font-size:1.05rem;
  color:#333333;
}

.hero-ctas {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* Viewport fallback for small screens */
@media (max-width:900px){
  .hero-grid { grid-template-columns:1fr; text-align:center; }
  .hero-media img { margin-inline:auto; max-width:280px; }
}

/* Container query version (card-driven) */
@container (max-width:640px){
  .hero-grid { grid-template-columns:1fr; text-align:center; }
  .hero-media img { margin-inline:auto; }
}

/* -----------------------------
   Story (generic content block)
----------------------------- */
.story {
  padding:18px 20px;
  border-bottom:1px solid #e9e9e9;
}
.story h2 { margin-top:0; }

/* -----------------------------
   Split Row (Discovery + Bonuses)
----------------------------- */
.split-row {
  padding:18px 20px;
  border-bottom:1px solid #e9e9e9;
}

.grid-2 {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
}

@media (max-width:900px){
  .grid-2 { grid-template-columns:1fr; }
}

.panel {
  border:1px solid #e6e6e6;
  border-radius:12px;
  padding:14px;
  background:#fafafa;
}

.diagram {
  height:160px;
  border:1px dashed #cccccc;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#777777;
  margin:10px 0;
}

.checklist {
  margin:10px 0 0 0;
  padding-left:18px;
}
.checklist li { margin:6px 0; }

.bonus-mock {
  height:180px;
  border:1px dashed #cccccc;
  border-radius:8px;
  background:#ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#777777;
}

/* Round badge */
.badge-circle {
  width:140px;
  height:140px;
  border-radius:50%;
  background:var(--accent);
  color:var(--accent-ink);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-weight:bold;
  line-height:1.1;
  box-shadow:0 8px 18px rgba(0,0,0,0.12);
  margin:14px auto 0;
}

/* -----------------------------
   CTA Band
----------------------------- */
.cta-band {
  padding:16px 20px;
  border-bottom:1px solid #e9e9e9;
}

.band-grid {
  display:grid;
  grid-template-columns:1fr 260px;
  gap:16px;
  align-items:center;
}

@media (max-width:700px){
  .band-grid { grid-template-columns:1fr; }
}

.band-copy {
  background:#f3f3f3;
  border:1px solid #e1e1e1;
  border-radius:10px;
  padding:16px;
  font-weight:bold;
  text-align:center;
}

.band-action .btn-block { width:100%; }

/* -----------------------------
   Opt-in (inline form variant)
----------------------------- */
.optin {
  padding:22px 20px;
  border-bottom:1px solid #e9e9e9;
}
.optin form {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
}
.optin input {
  padding:10px;
  border:1px solid #cccccc;
  border-radius:8px;
  font-size:1rem;
}
.optin button {
  padding:10px 20px;
  border:none;
  border-radius:8px;
  background:var(--accent);
  color:var(--accent-ink);
  cursor:pointer;
  font-size:1rem;
}
.optin button:hover { background:var(--accent-dark); }

/* -----------------------------
   FAQ
----------------------------- */
.faq {
  padding:22px 20px;
}
.faq details {
  border:1px solid #e6e6e6;
  border-radius:10px;
  padding:10px 12px;
  margin:8px 0;
}
.faq summary {
  cursor:pointer;
  font-weight:bold;
}

/* -----------------------------
   Footer
----------------------------- */
.site-footer {
  text-align:center;
  padding:25px 0 20px;
  border-top:1px solid #dddddd;
  background:#fafafa;
  font-size:0.9rem;
}
.site-footer a {
  color:var(--accent);
  text-decoration:none;
}
.site-footer a:hover { text-decoration:underline; }
.site-footer p { margin:4px 0; }

/* -----------------------------
   Buttons (Global)
----------------------------- */
.btn {
  display:inline-block;
  padding:12px 18px;
  border-radius:10px;
  text-decoration:none;
  transition:transform 0.12s, box-shadow 0.12s;
  font-weight:bold;
}
.btn:hover {
  transform:translateY(-1px);
  box-shadow:0 8px 16px rgba(0,0,0,0.12);
}
.btn:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.btn-primary {
  background:var(--accent);
  color:var(--accent-ink);
}
.btn-ghost {
  background:#ffffff;
  border:1px solid #c9c9c9; /* slightly darker for contrast */
  color:#111111;
}
.btn-lg { padding:15px 20px; }
.btn-block { display:block; text-align:center; }

/* -----------------------------
   Popup Overlay (Mailchimp modal)
----------------------------- */
.popup-overlay {
  position:fixed;
  top:0; left:0;
  width:100%; height:100%;
  background:rgba(0,0,0,0.75);
  display:none;               /* shown via JS: display:flex */
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.popup-content {
  background:#ffffff;
  color:#111111;
  border-radius:10px;
  padding:25px 30px;
  max-width:480px;
  width:90%;
  box-shadow:0 10px 30px rgba(0,0,0,0.3);
  position:relative;
  text-align:left;
  animation:popupFadeIn 0.25s ease;
}
.popup-close {
  position:absolute;
  top:8px;
  right:12px;
  border:none;
  background:none;
  font-size:28px;
  color:#666666;
  cursor:pointer;
  line-height:1;
}
.popup-close:hover { color:#000000; }
.popup-close:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}

@keyframes popupFadeIn {
  from { opacity:0; transform:scale(0.95); }
  to   { opacity:1; transform:scale(1); }
}

/* Mailchimp form inside popup */
#mc_embed_signup_scroll h1,
#mc_embed_signup_scroll h2 {
  text-align:center;
  margin-bottom:0.6em;
}
#mc_embed_signup_scroll input[type="text"],
#mc_embed_signup_scroll input[type="email"] {
  width:100%;
  padding:10px;
  margin:6px 0;
  border:1px solid #cccccc;
  border-radius:8px;
}
#mc_embed_signup_scroll input[type="submit"] {
  width:100%;
  background:var(--accent);
  color:var(--accent-ink);
  border:none;
  border-radius:8px;
  padding:12px 0;
  font-size:1rem;
  cursor:pointer;
}
#mc_embed_signup_scroll input[type="submit"]:hover {
  background:var(--accent-dark);
}

/* Prevent background scroll when modal open (toggle via JS on <body>) */
body.modal-open { overflow:hidden; }

.testimonial-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.testimonial-card div img {
  display:block;
  margin:0 auto;
}

.bonuses ul {
  list-style: none;       /* hide default bullets */
  padding-left: 0;        /* remove extra spacing */
  margin: 1em 0;
}

.bonuses > ul > li {
  position: relative;
  padding-left: 1.4em;    /* room for checkmark */
  margin-bottom: 10px;
}

.bonuses > ul > li::before {
  content: "\2714";       /* checkmark */
  color: var(--accent);   /* inherits theme color */
  position: absolute;
  left: 0;
  top: 0;
  font-weight: bold;
  line-height: 1.2;
}



/* -----------------------------
   Motion & Theme Preferences
----------------------------- */
@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform:none; box-shadow:none; }
  .popup-content { animation:none; }
}

@media (prefers-color-scheme: dark) {
  /* Optional hook if you ever flip to a dark theme class */
  body.theme-science, body.theme-burn {
    --accent-ink:#0b0b0b;
  }
}
