/* ==========================================================================
   CloserCheck P0.3 signup fixes (DRAFT). Load AFTER styles.css + signup.css.
   Reuses every cc- class from signup.css; adds only:
     .cc-cta / .cc-cta__thumb     header button with guide thumbnail
     .cc-storylink                Share-your-story card shrunk to a text link
     .cc-done(--ok|--confirm)     success + double-opt-in states
     [data-cc-state]              state switch on any form column
     .cc-bhr                      static stand-in for the Beehiiv embed (mockups only;
                                  live pages keep .cc-embed + Beehiiv's iframe)
     .cc-lp*                      the /guide landing page
     .cc-bottom                   bottom #signup section, same promise + form
     .sb-cta                      sponsor-bar call to action
   Tokens only: #07090f #10141f #1e2535 #2f3a55 #e6e9f2 #c6cbe0 #8b93a7
   #22e47a #04140a #22E47A. No new colours. Tap targets >= 44px, inputs 16px.
   ========================================================================== */

.cc-lp,.cc-bottom,.cc-done{
  --cc-green:var(--primary,#22e47a);--cc-on:var(--on-primary,#0A0E15);--cc-purple:var(--accent,#22E47A);
  --cc-line:var(--border-strong,#2f3a55);--cc-text:var(--text,#e6e9f2);--cc-soft:var(--soft,#c6cbe0);--cc-muted:var(--muted,#8b93a7);
  --cc-field:rgba(7,9,15,.72);font-family:Manrope,system-ui,-apple-system,sans-serif}
.cc-lp *,.cc-bottom *,.cc-done *{box-sizing:border-box}

/* ---------- header button: one label + guide thumbnail ---------- */
.cta.cc-cta{min-height:44px;padding:6px 18px 6px 7px;gap:10px;white-space:nowrap}
.cc-cta__thumb{flex:none;display:block;width:30px;height:30px;border-radius:8px;box-shadow:0 0 0 1px rgba(4,20,10,.35)}
.cta.cc-cta:hover{filter:brightness(1.08)}
.cta.cc-cta:focus-visible{outline:2px solid var(--accent,#22E47A);outline-offset:3px}

/* ---------- Share-your-story: card -> text link ---------- */
.cc-storylink{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px 8px;min-height:44px;margin-top:6px;padding:0 4px;font-size:14px;line-height:1.35;color:var(--muted,#8b93a7);text-decoration:none}
.cc-storylink b{color:var(--primary,#22e47a);font-weight:700;white-space:nowrap}
.cc-storylink:hover b{text-decoration:underline;text-underline-offset:3px}
.cc-storylink:focus-visible{outline:2px solid var(--accent,#22E47A);outline-offset:2px;border-radius:8px}

/* ---------- state switch: put data-cc-state on the form column ---------- */
.cc-done{display:none}
[data-cc-state=success] > .cc-done--ok,[data-cc-state=confirm] > .cc-done--confirm{display:grid}
[data-cc-state=success] > :not(.cc-done),[data-cc-state=confirm] > :not(.cc-done){display:none!important}

/* ---------- success + double opt-in ---------- */
.cc-done{grid-template-columns:64px minmax(0,1fr);gap:4px 18px;align-items:start;padding:18px 20px 12px 18px;border-radius:18px;color:var(--cc-text);
  border:1px solid rgba(34,228,122,.38);background:linear-gradient(135deg,rgba(34,228,122,.10),rgba(34,228,122,.03)),rgba(7,9,15,.55);animation:ccdone .35s ease-out}
.cc-done--confirm{border-color:rgba(34,228,122,.5);background:linear-gradient(135deg,rgba(34,228,122,.14),rgba(34,228,122,.03)),rgba(7,9,15,.55)}
@keyframes ccdone{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.cc-done__thumb{position:relative;grid-row:1/span 3;width:56px;margin-top:2px}
.cc-done__thumb img{display:block;width:56px;height:auto;aspect-ratio:1275/1650;object-fit:cover;border-radius:2px 5px 5px 2px;transform:rotate(-4deg);
  box-shadow:2px 2px 0 -1px #d9deea,4px 4px 0 -2px #7d869c,10px 14px 22px -6px rgba(0,0,0,.7)}
.cc-done__badge{position:absolute;right:-10px;bottom:-8px;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--cc-green);color:var(--cc-on);box-shadow:0 0 0 3px #0b0f19,0 0 18px rgba(34,228,122,.6)}
.cc-done--confirm .cc-done__badge{background:var(--cc-purple);color:#fff;box-shadow:0 0 0 3px #0b0f19,0 0 18px rgba(34,228,122,.6)}
.cc-done__badge svg{width:16px;height:16px}
.cc-done__pill{justify-self:start;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#b3a3ff;margin-bottom:2px}
.cc-done__title{margin:0;font-size:19px;line-height:1.25;font-weight:800;letter-spacing:-.02em;color:#fff}
.cc-done__sub{margin:2px 0 0;font-size:14px;line-height:1.45;color:var(--cc-soft)}
.cc-done__sub b{color:#fff;font-weight:600}
.cc-done__link{justify-self:start;display:inline-flex;align-items:center;gap:6px;min-height:44px;font-size:15px;font-weight:700;color:var(--cc-green);text-decoration:none}
.cc-done__link:hover{text-decoration:underline;text-underline-offset:3px}
.cc-done__link:focus-visible{outline:2px solid var(--cc-purple);outline-offset:2px;border-radius:6px}

/* ---------- static Beehiiv-embed stand-in (mockups/handoff demo only) ---------- */
.cc-bhr{display:flex;gap:8px;align-items:center}
.cc-bhr .cc-input{flex:1;min-width:0;height:48px;border:1px solid var(--cc-line,#2f3a55);background:var(--cc-field,rgba(7,9,15,.72));border-radius:999px;padding:0 20px;font:500 16px/1.2 Manrope,system-ui,sans-serif;color:var(--cc-text,#e6e9f2)}
.cc-bhr .cc-input::placeholder{color:#8b93a7;opacity:1}
.cc-bhr .cc-btn{height:48px}

/* ---------- /guide landing page ---------- */
.cc-lp-body{min-height:100vh;display:flex;flex-direction:column;background:
  radial-gradient(42% 60% at 22% 48%,rgba(34,228,122,.13),transparent 70%),radial-gradient(40% 55% at 85% 10%,rgba(34,228,122,.20),transparent 70%),#07090f}
.cc-lp-head{width:100%;max-width:1200px;margin:0 auto;padding:0 32px;height:76px;display:flex;align-items:center}
.cc-lp{flex:1;width:100%;max-width:1200px;margin:0 auto;padding:24px 32px 72px;display:grid;grid-template-columns:minmax(0,440px) minmax(0,560px);justify-content:center;align-items:center;gap:96px;color:var(--cc-text)}
.cc-lp__art{position:relative;display:grid;place-items:center;min-height:520px}
.cc-lp__art:before{content:"";position:absolute;inset:-10%;background:radial-gradient(closest-side,rgba(34,228,122,.25),transparent 72%);pointer-events:none}
.cc-lp .cc-book{--cc-book-w:320px}
.cc-lp__title{margin:16px 0 0;font-size:60px;line-height:1.02;font-weight:900;letter-spacing:-.045em;color:#fff}
.cc-lp__title .cc-hl{white-space:nowrap}
.cc-lp__sub{margin:20px 0 0;font-size:19px;line-height:1.5;color:var(--cc-soft);max-width:30em}
.cc-lp__form{margin-top:32px;max-width:520px}
.cc-lp__form .cc-fine{padding-left:20px}
.cc-lp-foot{padding:0 32px 28px;text-align:center;font-size:13px;color:#6b7390}
.cc-lp-foot a{color:var(--muted,#8b93a7);text-decoration:none;display:inline-block;padding:12px 4px}

/* ---------- bottom #signup section ---------- */
.signup.cc-bottom{grid-template-columns:140px minmax(0,1fr);gap:10px 32px;align-items:center}
.cc-bottom .cc-art{align-self:center}
.cc-bottom .cc-book{--cc-book-w:112px}
.cc-bottom .cc-eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--cc-green)}
.cc-bottom .cc-eyebrow:before{content:"";width:8px;height:8px;border-radius:50%;background:var(--cc-green);box-shadow:0 0 12px var(--cc-green)}
.cc-bottom h2{margin-top:12px}
.cc-bottom .cc-fine{padding-left:20px;font-size:13px;color:var(--cc-muted);margin-top:12px}

/* ---------- sponsor bar: single guide item ---------- */
.sb-cta{font-size:13px;font-weight:700;color:var(--primary,#22e47a);margin-left:2px}
.sb-link:hover .sb-cta{text-decoration:underline}

/* ---------- breakpoints ---------- */
@media (max-width:1024px){
  .cc-lp{grid-template-columns:1fr;gap:20px;justify-items:center;text-align:center;padding-top:8px}
  .cc-lp__art{min-height:0;padding:28px 0 18px}
  .cc-lp .cc-book{--cc-book-w:200px}
  .cc-lp__sub{margin-left:auto;margin-right:auto}
  .cc-lp__form{margin-left:auto;margin-right:auto;text-align:left}
  .signup.cc-bottom{grid-template-columns:96px minmax(0,1fr);gap:24px 28px}
  .cc-bottom .cc-book{--cc-book-w:90px}
  .cc-bottom__form{grid-column:1/-1}
}
@media (max-width:760px){
  .cta.cc-cta{padding:6px 14px 6px 6px;font-size:14px}
  .cc-cta__thumb{width:30px;height:30px}
  .cc-bhr{flex-direction:column;align-items:stretch;gap:10px}
  .cc-bhr .cc-input{height:52px;border-radius:14px;padding:0 16px}
  .cc-bhr .cc-btn{width:100%;height:52px;border-radius:14px;font-size:16px}
  .cc-done{grid-template-columns:52px minmax(0,1fr);gap:4px 16px;padding:16px 16px 10px 14px}
  .cc-done__thumb,.cc-done__thumb img{width:50px}
  .cc-done__title{font-size:18px}
  .cc-done__sub{font-size:15px}
  .cc-lp-head{height:64px;padding:0 20px;justify-content:center}
  .cc-lp{padding:0 20px 36px;gap:14px}
  .cc-lp__art{padding:22px 0 14px}
  .cc-lp .cc-book{--cc-book-w:150px}
  .cc-lp__title{font-size:38px;line-height:1.04;margin-top:12px}
  .cc-lp__sub{font-size:17px;margin-top:14px}
  .cc-lp__form{margin-top:22px;width:100%}
  .cc-lp__form .cc-fine{padding-left:0;text-align:center}
  .cc-lp-foot{padding:0 20px 18px}
  .signup.cc-bottom{grid-template-columns:72px minmax(0,1fr);gap:18px}
  .cc-bottom .cc-book{--cc-book-w:68px}
  .cc-bottom .cc-fine{padding-left:0;text-align:center}
  .cc-storylink{font-size:14px}
}
@media (prefers-reduced-motion:reduce){.cc-done{animation:none}}

/* ---- p03 review pass ---- */
.cc-lp__title,.cc-gift__title,.cc-inline__title,.cc-bottom h2{text-wrap:balance}
.cc-done{text-align:left}
/* tap targets: sponsor-bar links fill the 44px+ bar; logo gets a 44px hit area */
.sponsorbar .sb-link{min-height:44px;display:inline-flex;align-items:center}
header .logo,.cc-lp-head .logo{min-height:44px;display:inline-flex;align-items:center}
@media (max-width:760px){
  .cc-bhr .cc-input{flex:none;width:100%}
}

/* ---- CloserCheck site additions (build.py) ---- */
#picks{scroll-margin-top:96px}
.mcta .cc-cta,.st-thanks .cc-cta{display:inline-flex;align-items:center;gap:10px}

/* Guide card: book | copy column (headline + sub + form stacked). Layout must not
   depend on the Beehiiv iframe size; form is nested inside .cc-bottom__copy. */
.signup.cc-bottom{
  grid-template-columns:140px minmax(0,1fr) !important;
  gap:10px 32px;
  align-items:center;
  padding:32px 36px;
}
.signup.cc-bottom .cc-art{align-self:center}
.signup.cc-bottom .cc-book{--cc-book-w:120px}
.signup.cc-bottom .cc-bottom__copy{min-width:0;display:flex;flex-direction:column;align-items:stretch}
.signup.cc-bottom .cc-bottom__form{max-width:520px;width:100%;margin-top:14px}
.signup.cc-bottom h2{
  margin-top:10px;
  font-size:clamp(24px,2.5vw,34px);
  line-height:1.18;
  letter-spacing:-.03em;
  max-width:none;
  white-space:normal;
  text-wrap:balance;
}
.signup.cc-bottom .cc-bottom__copy > p:not(.cc-eyebrow){
  max-width:42em;
  margin-top:10px;
  font-size:15.5px;
  line-height:1.5;
  color:var(--cc-soft,var(--soft));
}
@media (max-width:1024px){
  .signup.cc-bottom{
    grid-template-columns:96px minmax(0,1fr) !important;
    gap:14px 24px;
  }
  .signup.cc-bottom .cc-book{--cc-book-w:90px}
  .signup.cc-bottom .cc-bottom__form{max-width:none}
}
@media (max-width:760px){
  .signup.cc-bottom{
    grid-template-columns:1fr !important;
    gap:18px;
    padding:24px 20px;
    text-align:left;
  }
  .signup.cc-bottom .cc-art{justify-self:start}
  .signup.cc-bottom .cc-book{--cc-book-w:88px}
  .signup.cc-bottom h2{font-size:26px}
}

/* Beehiiv embed: transparent wrapper. Beehiiv's own input+button show; no square box.
   Form id stays 8f4c9f76-6a72-4a5d-b0f7-baaf3063b0dc. Theme draft sets form bg transparent. */
.cc-embed{
  background:transparent !important;
  border:0 !important;
  border-radius:0;
  padding:0 !important;
  box-sizing:border-box;
  overflow:visible;
  box-shadow:none !important;
  width:100%;
  max-width:520px;
}
.cc-embed:focus-within{border:0;box-shadow:none}
.cc-embed__slot{
  border-radius:0;
  overflow:visible;
  min-height:48px;
  background:transparent;
  width:100%;
}
.cc-embed__slot iframe{
  display:block;
  width:100% !important;
  max-width:100% !important;
  background:transparent !important;
  color-scheme:normal;
  margin:0 !important;
}
/* Hide the slot only when idle (pre-JS empty) or failed (fallback only).
   Must NOT hide during loading: chk() needs iframe.offsetHeight>=30, and
   display:none forces height 0, so every embed timed out at WAIT (4.5s) even
   when Beehiiv had already set data-bhv-sized. Live proof Nov 1 2026. */
.cc-embed[data-state=idle] .cc-embed__slot{display:none}
.cc-embed[data-state=failed] .cc-embed__slot{display:none}
.cc-embed[data-state=idle],
.cc-embed[data-state=loading],
.cc-embed[data-state=failed]{
  display:flex;align-items:center;padding:0;gap:0;
  background:transparent;border:0;box-shadow:none;
}
.cc-embed[data-state=idle] .cc-embed__fallback,
.cc-embed[data-state=loading] .cc-embed__fallback,
.cc-embed[data-state=failed] .cc-embed__fallback{
  width:100%;border-radius:999px;
}
.cc-embed[data-state=challenge]{
  border-radius:18px;padding:8px;overflow:visible;
  background:rgba(7,9,15,.55);border:1px solid var(--cc-line,var(--border-strong,#2f3a55));
}
.cc-embed[data-state=challenge] .cc-embed__slot{overflow:visible;border-radius:12px}
@media (max-width:760px){
  .cc-embed{max-width:none}
  .cc-embed[data-state=idle] .cc-embed__fallback,
  .cc-embed[data-state=loading] .cc-embed__fallback,
  .cc-embed[data-state=failed] .cc-embed__fallback{border-radius:12px}
}

/* Visual polish: calm surfaces, solid accents, one radius, guide card only as a panel */
.cc-hl{
  background:none !important;
  -webkit-background-clip:unset !important;
  background-clip:unset !important;
  -webkit-text-fill-color:currentColor;
  color:#3dce84 !important;
}
.cc-lp-body{
  background:#10141c !important;
}
.cc-lp{
  max-width:1040px;
  gap:64px;
  align-items:center;
}
.cc-lp__art:before,.cc-art:before{content:none}
.cc-lp__title{font-size:48px;line-height:1.12;letter-spacing:-.03em;font-weight:750}
.cc-lp__sub{color:#d5dced}
.cc-book{transform:none}
.cc-book img{box-shadow:0 18px 40px rgba(0,0,0,.35) !important;border-radius:8px}
.cc-book:before,.cc-book:after{content:none}
.cc-btn,.cc-embed__fallback{
  border-radius:12px !important;
  box-shadow:none !important;
  min-height:48px;
}
.cc-btn:hover{transform:none;filter:brightness(1.06)}
.cc-fine,.cc-lp-foot{color:#b4bdd0}
.cc-lp-foot a{color:#d5dced}
.cc-lp-foot a:hover{color:#f4f6fb}
.cc-lp-foot a:focus-visible,.cc-btn:focus-visible,.logo:focus-visible{
  outline:2px solid #c4b5fd;outline-offset:3px;border-radius:12px;
}
.signup.cc-bottom{
  background:#1a2130 !important;
  border:1px solid #2c3548 !important;
  border-radius:16px !important;
  box-shadow:none !important;
}
@media (max-width:760px){
  .cc-lp{padding:8px 20px 40px;gap:8px}
  .cc-lp__title{font-size:32px;line-height:1.16}
  .cc-lp__sub{font-size:16px;line-height:1.5}
  .cc-lp .cc-book{--cc-book-w:132px}
  .cc-btn,.cc-embed__fallback{width:100%}
}
