/* ============================================================
   UCanPoopToo — modernized stylesheet
   Edit the variables in :root to re-skin the whole site.
   Brand colors come straight from the logo (lime green + sky blue).
   ============================================================ */

:root {
  /* --- Brand palette (from the logo) --- */
  --blue:        #1a9bd7;   /* sky blue — primary brand */
  --blue-deep:   #146a92;   /* darker blue for text/links on white (accessible) */
  --blue-soft:   #e6f4fb;   /* tints for section + card backgrounds */
  --green:       #7dba3f;   /* lime green — secondary brand */
  --green-deep:  #57862a;   /* darker green for accessible text */
  --green-soft:  #eef6e1;
  --amber:       #f0a830;   /* warm accent for the notice banner */
  --amber-soft:  #fdf2dc;

  /* --- Neutrals --- */
  --ink:        #16323f;    /* main text */
  --ink-soft:   #51666f;    /* secondary text */
  --bg:         #f6fafc;    /* page background */
  --surface:    #ffffff;    /* cards / header */
  --line:       rgba(20, 49, 61, 0.12);

  /* --- Type --- */
  --font-display: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* --- Shape & rhythm --- */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow:    0 6px 24px rgba(20, 49, 61, 0.08);
  --shadow-sm: 0 2px 8px rgba(20, 49, 61, 0.06);
  --container: 1100px;
  --gap:       clamp(1.5rem, 4vw, 3rem);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.97rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-deep); }
a:hover { color: var(--blue); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
  font-weight: 800;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--tint  { background: var(--blue-soft); }
.section--green { background: var(--green-soft); }
.measure { max-width: none; }
.center { text-align: center; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin: 0 0 0.6rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 800;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.btn--primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--blue-deep); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: #fff; color: var(--blue-deep); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue-deep); transform: translateY(-2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 68px;
}
.nav__logo img { height: 34px; width: auto; }
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 0.5rem; border-radius: var(--radius-sm); color: var(--ink);
}
.nav__menu { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav__menu > li { position: relative; }
.nav__menu a {
  display: block; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 700; font-size: 0.96rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav__menu a:hover, .nav__menu a:focus-visible { background: var(--blue-soft); color: var(--blue-deep); }
.nav__menu .is-cta a { background: var(--green); color: #fff; }
.nav__menu .is-cta a:hover { background: var(--green-deep); color: #fff; }

/* dropdown submenus */
.has-sub > .submenu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0.4rem; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.has-sub > a::after { content: " ▾"; font-size: 0.75em; color: var(--ink-soft); }
.submenu a { font-weight: 600; font-size: 0.92rem; }

/* ---------- Notice banner (medical / discontinued-product) ---------- */
.notice {
  background: var(--amber-soft);
  border-block: 1px solid var(--amber);
}
.notice__inner { display: flex; gap: 0.85rem; align-items: flex-start; padding-block: 0.9rem; }
.notice__icon { flex: none; width: 22px; height: 22px; color: var(--amber); margin-top: 2px; }
.notice p { margin: 0; font-size: 0.9rem; color: #6b4d12; line-height: 1.55; }
.notice a { color: #6b4d12; font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--blue-soft) 0%, #fff 78%);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
.hero__grid { display: grid; gap: var(--gap); align-items: center; grid-template-columns: 1.1fr 0.9fr; }
.hero h1 span { color: var(--blue); }
.hero__lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }
.hero__stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.75rem;
}
.hero__stat .big {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(2.6rem, 2rem + 3vw, 3.8rem);
  color: var(--green-deep); line-height: 1;
}
.hero__stat .label { color: var(--ink-soft); font-weight: 600; margin-top: 0.4rem; }
/* soft friendly curve at the bottom of the hero */
.hero__wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; display: block; color: var(--bg); }

/* ---------- Pull quote ---------- */
.quote {
  border-left: 5px solid var(--green);
  background: var(--green-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 1.75rem;
}
.quote p { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--ink); margin: 0 0 0.4rem; }
.quote cite { color: var(--green-deep); font-style: normal; font-weight: 700; font-size: 0.95rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.card h3 { color: var(--blue-deep); }
.card .stat { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; color: var(--green-deep); }
.card cite { display: block; margin-top: 0.75rem; font-style: normal; font-size: 0.8rem; color: var(--ink-soft); }
.card cite a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.card cite a:hover { color: var(--blue-deep); }

/* link cards (used to route to other pages) */
.linkcard {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.linkcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue); color: var(--ink); }
.linkcard h3 { color: var(--blue-deep); margin-bottom: 0.3rem; }
.linkcard p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cdd9df; padding-block: 2.5rem; margin-top: 2rem; }
.site-footer a { color: #fff; }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; align-items: start; }
.footer__brand img { height: 30px; margin-bottom: 0.75rem; }
.site-footer h4 { color: #fff; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.75rem; }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer__links a { text-decoration: none; font-size: 0.95rem; }
.footer__links a:hover { text-decoration: underline; }
.footer__funding { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1rem; font-size: 0.85rem; }
.footer__funding img { background: #fff; padding: 4px 6px; border-radius: 6px; height: 38px; filter: none; }
.footer__legal { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 2rem; padding-top: 1.25rem; font-size: 0.8rem; color: #9fb2ba; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--blue); color: #fff;
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }

  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem 1.25rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .has-sub > .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0 0 0 0.75rem; min-width: 0;
  }
  .has-sub > a::after { content: ""; }
}

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

/* ============================================================
   Inner-page components (added for the 5 content pages)
   ============================================================ */

/* Page header band */
.page-head {
  position: relative;
  background:
    radial-gradient(90% 120% at 92% -15%, rgba(125,186,63,0.16), transparent 60%),
    linear-gradient(155deg, var(--blue-soft) 0%, #eaf5fb 45%, #ffffff 100%);
  box-shadow: 0 1px 0 var(--line);
}
.page-head .container { position: relative; padding-block: clamp(2.5rem, 5.5vw, 4rem); }
.page-head h1 { margin-bottom: 0.35rem; }
.page-head p { color: var(--ink-soft); max-width: 60ch; margin: 0; }
.page-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}
.page-head .eyebrow {
  display: inline-block; background: var(--green-soft); color: var(--green-deep);
  padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); margin-bottom: 0.85rem;
}

/* readable article column */
.prose { max-width: none; }
.prose p { margin: 0 0 1.15rem; }
.prose h2 { margin-top: 2rem; }
.prose .lead { font-size: 1.15rem; color: var(--ink-soft); }

/* Tips as numbered cards */
.tips { display: grid; gap: 1rem; counter-reset: tip; }
.tip {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.5rem 1.4rem 4.2rem; box-shadow: var(--shadow-sm);
}
.tip::before {
  counter-increment: tip; content: counter(tip);
  position: absolute; left: 1.1rem; top: 1.3rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--green); color: #fff; font-family: var(--font-display); font-weight: 900;
  display: grid; place-items: center; font-size: 1rem;
}
.tip h3 { margin-bottom: 0.3rem; color: var(--blue-deep); }
.tip p { margin: 0; color: var(--ink); }

/* FAQ accordion (native <details>) */
.faq { display: grid; gap: 0.75rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  scroll-margin-top: 84px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 1.3rem;
  font-family: var(--font-display); font-weight: 800; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green-deep); font-size: 1.4rem; font-weight: 700; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--blue-deep); }
.faq .faq__body { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }
.faq .faq__body p { margin: 0 0 0.8rem; }

/* External resource list */
.reslist { display: grid; gap: 1rem; }
.res {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm);
}
.res h3 { margin: 0; font-size: 1.05rem; color: var(--blue-deep); }
.res p { margin: 0; color: var(--ink-soft); width: 100%; font-size: 0.95rem; }
.res a.ext { font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; }
.res a.ext::after { content: " ↗"; }

/* big call-to-action button row centered under content */
.cta-block { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* current page in nav */
.nav__menu a[aria-current="page"] { background: var(--blue-soft); color: var(--blue-deep); }

/* ============================================================
   "About Encopresis" (home) page specifics
   ============================================================ */
.intro-wrap::after { content: ""; display: block; clear: both; }
.intro-photo {
  float: right; width: min(42%, 340px);
  margin: 0.25rem 0 1rem 1.75rem;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 2.75rem 0; }
.statement {
  text-align: center; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem); color: var(--green-deep);
  margin: 0;
}
.box-title { color: var(--blue-deep); margin: 0 0 0.5rem; }
@media (max-width: 640px) {
  .intro-photo { float: none; width: 100%; margin: 0 0 1.25rem; }
}

/* Hero right column: child photo stacked above the stat box */
.hero__aside { display: grid; gap: 1.25rem; align-content: start; }
.hero__photo {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--blue-soft); aspect-ratio: 2.3 / 1;
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }

/* ============================================================
   Rebuilt blog posts + Tips index
   ============================================================ */
.postlist { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; gap: 0.65rem; }
.postlist li { border: 0; }
.postlist a {
  display: block; position: relative;
  padding: 0.95rem 2.75rem 0.95rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-weight: 700;
  color: var(--blue-deep); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-left-color 0.15s ease;
}
.postlist a::after {
  content: "\2192"; position: absolute; right: 1.15rem; top: 50%;
  transform: translateY(-50%); color: var(--green-deep); font-weight: 800;
  transition: transform 0.15s ease;
}
.postlist a:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-left-color: var(--green); }
.postlist a:hover::after { transform: translate(4px, -50%); }

.post.prose { max-width: none; }
.post audio, .faq__body audio { width: 100%; max-width: 520px; display: block; margin: 1rem 0 1.25rem; }
.post br + audio, .faq__body br + audio { margin-top: 0.75rem; }
.post p:has(audio), .post li:has(audio) { display: flex; flex-direction: column; align-items: flex-start; }
.post .audio-label { display: block; font-weight: 600; margin-top: 0.75rem; }
.post ol li, .post ul li { margin-bottom: 0.6rem; }
.post img { border-radius: var(--radius); margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
.back { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.back a { font-family: var(--font-display); font-weight: 700; text-decoration: none; }

/* Tips dropdown titles behave like links (blue, green on hover); full-contrast body */
details[name="tips"] > summary { color: var(--blue-deep); }
details[name="tips"] > summary:hover { color: var(--green-deep); }
details[name="tips"] .faq__body { color: var(--ink); }
