/* GO-1029 signup slots: the shared card for the three signup synced blocks
   ("Signup / Jobs list", "Signup / Spotlight", "Signup / Mini course") and the
   MedBridge ad block ("Ad / MedBridge").

   The must-use plugin serves this file as a stylesheet (handle
   tncpt-signup-slots, mu-plugins/tncpt-site/sections/signup-slots.php).
   scripts/deploy.mjs deploys it. Until 2026-12 functions.php printed a copy
   inline. The test page (53654, now in the trash) carried a copy in an HTML
   block.

   The card (design "E + F", approved 2026-12-01): a peach note card. Narrow
   card: a mail icon tile on top, then the handwritten line, the heading, a line
   of copy and the form, centered. Wide card: two columns, a tilted slice of the
   Sunday email on the left, the words and the form on the right, left-aligned,
   no icon tile. Two soft circles sit inside the card, behind the content. The
   words, the icon and the slice rows are blocks in the synced block, so an
   editor can change them. This file holds only the look.

   Two designs, the same layout and type, different colors (the A/B test of
   2026-12): peach, the default, and teal, which applies when <html> has
   data-signup-design="teal". The GTM tag "PostHog - Signup Form Events" sets
   that attribute from the PostHog flag signup-card-design, or from
   ?signup_design=teal on the URL for a preview. The teal design only changes
   the tokens below; see "Teal design" at the end of the card rules.

   Narrow or wide is decided by the card's own width, with a container query:
   the card is the query container and its children ask its width. A card whose
   content box is 560px or wider is wide. On a live post that is every viewport
   from 768px up (the post column is 728px at 768, 900px from about 1000 up).
   A browser without container queries (Chrome < 105, Safari < 16, Firefox
   < 110) shows the narrow card everywhere, which is complete on its own.

   Block markup (scripts/signup-blocks.mjs):
     group .tncpt-signup.tncpt-signup--<kind>
       html  .tncpt-signup__icon          the mail glyph tile (narrow only)
       group .tncpt-signup__peek          the email slice (wide only, optional)
         group .tncpt-signup__peek-head   p.tncpt-signup__peek-title, p.tncpt-signup__peek-note
         group .tncpt-signup__peek-row    p.tncpt-signup__peek-job, p.tncpt-signup__tag   (x3)
       group .tncpt-signup__body
         p.tncpt-signup__hand, h3.tncpt-signup__title, p.tncpt-signup__text, the Kit form
   Astra (a classic theme) wraps the children of every core group in
   div.wp-block-group__inner-container. Inside the card that wrapper is
   display:contents, so the rules below lay out the blocks themselves.

   Approach, same as the Find Your Fit results pages (results.css):
   - Everything is scoped under .tncpt-signup (the outer core/group of each
     signup block) or .tncpt-ad. Nothing leaks into the theme.
   - Tokens come from the design system (gnc-tncpt-design/colors_and_type.css,
     tncpt theme) and are copied in as custom properties on the scope class.
   - Selectors are element + class, so they beat Astra rules such as
     `.entry-content h3` and `input[type="email"]:focus`.

   Kit: the convertkit/form block loads Kit's index.js, which injects the form
   markup and a <style> inside the <form> at runtime. That fights this file in
   three ways, so the Kit layer below uses !important on purpose:
   1. Kit writes inline style="" on the input and the button (color,
      border-color, border-radius, font-weight, background-color). Only
      !important beats an inline style.
   2. Kit's layout rules reach specificity (0,6,0), for example
      `.formkit-form[data-uid="…"][min-width~="700"] .formkit-fields[data-stacked="false"] .formkit-field`,
      and Kit's <style> loads after this one. !important makes the result
      independent of source order and of the form's uid.
   3. At a form width of 700px or more Kit adds padding-top:56px to
      [data-style="clean"], and it gives each field and the button a 15px
      bottom margin. Both are reset here.
   Never key a rule on data-uid: the same rules must cover every Kit form.
   The button text is a setting of the Kit form, not of this file. The layout
   fits "Subscribe" and "Send me the jobs".

   Fonts: Nunito (400, 700, 800, 900) and Caveat 700. The plugin loads the
   Nunito weights on every single post that loads this CSS. Change that link
   too when a rule here needs another weight. Caveat 700 comes from the theme's
   own Google Fonts link (Autoptimize combines it), on posts and pages. Without
   it the handwritten lines fall back to a cursive font. */

/* ---------- Tokens (tncpt theme) ---------- */
.tncpt-signup,
.tncpt-ad {
  --color-teal-50: #E0F4F1;
  --color-teal-700: #0D8378;
  --color-teal-800: #0B6E63;
  --color-peach: #FDEBDA;
  --color-peach-200: #F9D9BD;
  --color-pomegranate-50: #F7DEE5;
  --color-pomegranate-700: #9E2F50;
  --color-charcoal: #2B2B2B;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;

  --bg-card: var(--color-peach);
  --border-card: var(--color-peach-200);
  --card-shadow: none;
  --circle-a: rgba(235, 106, 15, 0.09);        /* top right */
  --circle-b: rgba(16, 162, 148, 0.08);        /* bottom left */
  --bg-surface: #FFFFFF;
  --fg-primary: var(--color-charcoal);         /* text on white: input, email slice */
  --fg-card: var(--color-charcoal);            /* heading and copy: 12.19:1 on peach, 11.12:1 over a circle */
  --fg-muted: var(--color-gray-600);
  --accent-hand: var(--color-pomegranate-700); /* 6.07:1 on peach, 5.54:1 over a circle */
  --cta-bg: var(--color-teal-700);             /* white text 4.63:1 */
  --cta-bg-hover: var(--color-teal-800);       /* white text 6.13:1 */
  --cta-fg: #FFFFFF;
  --input-border: var(--color-gray-500);       /* 4.16:1 against the peach card */
  --icon-bg: var(--bg-surface);
  --icon-shadow: 0 1px 0 var(--border-card);
  --peek-shadow: 0 8px 20px -12px rgba(176, 58, 0, 0.35);
  --focus-ring: var(--color-teal-700);         /* 3.99:1 on peach, past the 3:1 UI floor */

  --font-sans: 'Nunito', 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --radius-card: 24px;
  --radius-tile: 16px;
  --radius-pill: 9999px;
}

/* ---------- Card ---------- */
/* Padding in % of the post column: 26px x 22px on a phone, 32px x 40px in a
   900px column, the mock's two paddings, with no breakpoint. */
div.tncpt-signup {
  container-type: inline-size;
  box-sizing: border-box;
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 28px;
  row-gap: 0;
  position: relative;
  isolation: isolate; /* the circles' z-index -1 stays inside the card */
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin: 2em 0;
  padding: clamp(26px, 3.6%, 32px) clamp(22px, 4.5%, 40px);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  color: var(--fg-card);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}
/* The two soft circles. The card clips them (overflow: hidden). z-index -1
   inside the card's own stacking context (isolation: isolate) paints them over
   the card background and under every child. The card's children cannot be
   lifted with position + z-index instead: Astra's inner container is
   display: contents. */
div.tncpt-signup::before,
div.tncpt-signup::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
div.tncpt-signup::before {
  width: 260px;
  height: 260px;
  top: -120px;
  right: -90px;
  background: var(--circle-a);
}
div.tncpt-signup::after {
  width: 180px;
  height: 180px;
  bottom: -90px;
  left: -70px;
  background: var(--circle-b);
}
div.tncpt-signup *,
div.tncpt-signup *::before,
div.tncpt-signup *::after { box-sizing: border-box; }

div.tncpt-signup div.wp-block-group__inner-container { display: contents; }

/* Core group layouts can set a max-width and auto margins on children. */
div.tncpt-signup div.wp-block-group {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Narrow card: the icon and the words each take a full row, no slice. */
div.tncpt-signup div.tncpt-signup__body {
  flex: 1 1 100%;
  min-width: 0;
}
div.tncpt-signup div.tncpt-signup__peek { display: none; }

/* ---------- Icon tile ---------- */
div.tncpt-signup div.tncpt-signup__icon {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  background: var(--icon-bg);
  border-radius: var(--radius-tile);
  box-shadow: var(--icon-shadow);
}
div.tncpt-signup div.tncpt-signup__icon svg {
  display: block;
  width: 30px;
  height: 30px;
}

/* ---------- Words ---------- */
div.tncpt-signup p.tncpt-signup__hand {
  margin: 0 0 4px;
  padding: 0;
  font-family: var(--font-hand);
  font-size: 26px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  color: var(--accent-hand);
}

div.tncpt-signup h3.tncpt-signup__title,
div.tncpt-signup h2.tncpt-signup__title {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-family: var(--font-sans);
  font-size: 23px;
  font-weight: 900;
  font-style: normal;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--fg-card);
}

div.tncpt-signup p.tncpt-signup__text {
  margin: 0 0 16px;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg-card);
}

/* The first card design had an eyebrow paragraph. Kept so that markup still
   looks right while this CSS is live and the blocks are not yet updated. */
div.tncpt-signup p.tncpt-signup__eyebrow {
  margin: 0 0 8px;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-hand);
}

/* ---------- Email slice (wide card only) ---------- */
div.tncpt-signup div.tncpt-signup__peek {
  position: relative;
  padding: 12px 14px 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-tile);
  box-shadow: var(--peek-shadow);
  transform: rotate(-1.2deg);
  color: var(--fg-primary); /* dark ink on white in both designs, never the card's text color */
  text-align: left;
}
/* The fade over the last row: the slice reads as part of a longer email. */
div.tncpt-signup div.tncpt-signup__peek::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  border-radius: 0 0 var(--radius-tile) var(--radius-tile);
  background: linear-gradient(rgba(255, 255, 255, 0), #FFFFFF);
  pointer-events: none;
}
div.tncpt-signup div.tncpt-signup__peek-head,
div.tncpt-signup div.tncpt-signup__peek-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
div.tncpt-signup div.tncpt-signup__peek-head {
  align-items: baseline;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid #F1E6DC;
}
div.tncpt-signup div.tncpt-signup__peek-row {
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #F6EFE8;
}
div.tncpt-signup div.tncpt-signup__peek-row:last-child { border-bottom: 0; }
div.tncpt-signup p.tncpt-signup__peek-title {
  margin: 0 !important; /* Astra gives group children auto side margins; in a flex row they center the text */
  padding: 0;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-teal-800); /* 6.13:1 on white */
}
div.tncpt-signup p.tncpt-signup__peek-note {
  margin: 0 !important; /* Astra gives group children auto side margins; in a flex row they center the text */
  padding: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.3;
  color: var(--color-gray-500); /* 4.83:1 on white */
}
div.tncpt-signup p.tncpt-signup__peek-job {
  margin: 0 !important; /* Astra gives group children auto side margins; in a flex row they center the text */
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--fg-primary);
}
div.tncpt-signup p.tncpt-signup__tag {
  flex: 0 0 auto;
  margin: 0 !important; /* Astra gives group children auto side margins; in a flex row they center the text */
  padding: 2px 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--color-teal-800); /* 5.37:1 on teal-50 */
  background: var(--color-teal-50);
  border-radius: var(--radius-pill);
}

/* Kit plugin block wrapper */
div.tncpt-signup .wp-block-convertkit-form,
div.tncpt-signup .convertkit-form {
  margin: 0;
  max-width: none;
}

/* ---------- Kit form ---------- */
div.tncpt-signup form.formkit-form {
  max-width: 460px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  font-family: var(--font-sans) !important;
}
div.tncpt-signup form.formkit-form [data-style="clean"] {
  padding: 0 !important;
  width: 100% !important;
}
div.tncpt-signup form.formkit-form .formkit-fields {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 10px !important;
  margin: 0 !important;
}
div.tncpt-signup form.formkit-form .formkit-field {
  flex: 1 1 220px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

div.tncpt-signup form.formkit-form input.formkit-input {
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  font-family: var(--font-sans) !important;
  font-size: 16px !important; /* 16px keeps iOS from zooming on focus */
  font-weight: 400 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  color: var(--fg-primary) !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: none !important;
  outline: none;
}
div.tncpt-signup form.formkit-form input.formkit-input::placeholder {
  color: var(--fg-muted) !important;
  opacity: 1 !important;
}
div.tncpt-signup form.formkit-form input.formkit-input:focus {
  border-color: var(--color-teal-700) !important;
  box-shadow: 0 0 0 3px var(--color-teal-50) !important;
  outline: none !important;
}
div.tncpt-signup form.formkit-form input.formkit-input:focus-visible {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
}

/* Narrow card: the button takes its own full row. */
div.tncpt-signup form.formkit-form button.formkit-submit {
  flex: 1 1 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--font-sans) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--cta-fg) !important;
  background: var(--cta-bg) !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
div.tncpt-signup form.formkit-form button.formkit-submit > span {
  display: block !important;
  padding: 12px 26px !important;
  background: none !important;
  color: inherit !important;
  font: inherit !important;
}
div.tncpt-signup form.formkit-form button.formkit-submit:hover,
div.tncpt-signup form.formkit-form button.formkit-submit:focus {
  background: var(--cta-bg-hover) !important;
  color: var(--cta-fg) !important;
}
div.tncpt-signup form.formkit-form button.formkit-submit:hover { transform: translateY(-1px); }
div.tncpt-signup form.formkit-form button.formkit-submit:focus-visible {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
}
@media (prefers-reduced-motion: reduce) {
  div.tncpt-signup form.formkit-form button.formkit-submit { transition: none; }
  div.tncpt-signup form.formkit-form button.formkit-submit:hover { transform: none; }
}

/* Kit's success and error messages. Unverified: the test never submits the form. */
div.tncpt-signup form.formkit-form .formkit-alert {
  margin: 0 0 12px !important;
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-family: var(--font-sans) !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  text-align: inherit !important;
  list-style: none !important;
}
div.tncpt-signup form.formkit-form .formkit-alert:empty { display: none !important; }
div.tncpt-signup form.formkit-form .formkit-alert li { margin: 0 !important; list-style: none !important; }
div.tncpt-signup form.formkit-form .formkit-alert-error {
  background: var(--color-pomegranate-50) !important;
  border: 1px solid var(--color-pomegranate-700) !important;
  color: var(--color-pomegranate-700) !important;
}
div.tncpt-signup form.formkit-form .formkit-alert-success {
  background: var(--color-teal-50) !important;
  border: 1px solid var(--color-teal-700) !important;
  color: var(--color-teal-800) !important;
}

/* "Built with Kit" badge (the mini course form shows it). Turn it off in the
   Kit form's settings to remove it. */
div.tncpt-signup form.formkit-form .formkit-powered-by-convertkit-container {
  justify-content: center !important;
  margin: 12px 0 0 !important;
}
div.tncpt-signup form.formkit-form .formkit-powered-by-convertkit {
  margin: 0 !important;
}

/* ---------- Teal design ---------- */
/* Applies when <html> has data-signup-design="teal" (see the header). Only
   colors change: the tokens, the border and the Kit badge. Type sizes and
   layout are the peach card's. The email slice keeps dark ink on white
   (--fg-primary), so the card's white text never reaches it. Never on .tncpt-ad.

   Contrast (WCAG). Stops alone: white 4.63:1 on #0D8378, 5.46:1 on #0B7484,
   6.45:1 on #00658F; #FFD3B4 3.36, 3.96 and 4.67:1. Computed over the real
   gradient and circles where the text sits (narrow card 320 to 346px wide,
   wide card 728 and 900px):
   - heading and copy, white: 4.62:1 or more.
   - handwritten line, #FFD3B4: 3.27:1 or more. It is 26px bold, large text,
     so it passes the 3:1 large-text floor, not 4.5:1.
   - button text #0B6E63 on peach 5.28:1, on the peach-200 hover 4.58:1.
   - input border and focus ring, white: 4.0:1 or more (3:1 floor). */
html[data-signup-design="teal"] div.tncpt-signup {
  --bg-card: linear-gradient(120deg, #0D8378 0%, #0B7484 55%, #00658F 100%);
  --card-shadow: 0 18px 40px -22px rgba(0, 101, 143, 0.7);
  --circle-a: rgba(255, 255, 255, 0.08);
  --circle-b: rgba(253, 235, 218, 0.10);
  --fg-card: #FFFFFF;
  --accent-hand: #FFD3B4;
  --cta-bg: var(--color-peach);
  --cta-bg-hover: var(--color-peach-200);
  --cta-fg: var(--color-teal-800);
  --input-border: #FFFFFF;
  --icon-bg: var(--color-peach);
  --icon-shadow: none;
  --peek-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.45);
  --focus-ring: #FFFFFF;
  border: 0;
}
/* Kit's "Built with Kit" badge (the dark variant) is a dark logo on a
   transparent background, which nearly vanishes on the gradient. A white pill,
   Kit's own default look for the badge. */
html[data-signup-design="teal"] div.tncpt-signup form.formkit-form .formkit-powered-by-convertkit {
  background-color: #FFFFFF !important;
  border-radius: 9px !important;
  width: 157px !important;
}

/* ---------- Wide card: slice left, words right, no icon tile ---------- */
/* A card with no slice (the mini course) shows its words at full width. */
@container (min-width: 560px) {
  div.tncpt-signup div.tncpt-signup__icon { display: none; }
  div.tncpt-signup div.tncpt-signup__peek {
    display: block;
    flex: 0 1 46%;
    min-width: 0;
  }
  div.tncpt-signup div.tncpt-signup__body {
    flex: 1 1 0;
    text-align: left;
  }
  /* One row: the inputs shrink, the button keeps its label on one line. When
     even the inputs' min-width does not fit, the button wraps to the next row. */
  div.tncpt-signup form.formkit-form { margin: 0 !important; max-width: 640px !important; }
  div.tncpt-signup form.formkit-form .formkit-fields { justify-content: flex-start !important; }
  div.tncpt-signup form.formkit-form .formkit-field { flex: 1 1 0 !important; min-width: 140px !important; }
  div.tncpt-signup form.formkit-form button.formkit-submit { flex: 0 0 auto !important; white-space: nowrap !important; }
  div.tncpt-signup form.formkit-form .formkit-powered-by-convertkit-container {
    justify-content: flex-start !important;
  }
}

/* ---------- Ad / MedBridge: centered, no card, a "Sponsored" label ---------- */
/* The block is a <picture>: the 640x200 banner on phones, the 1400x200 banner
   from 768px up. They are two crops, not two sizes of one image, so the cap
   changes with them: 640px (natural width) on phones, 700px (the wide banner at
   2x) from 768px up, as Ad Inserter showed it. */
div.tncpt-ad {
  clear: both;
  max-width: 640px;
  margin: 34px auto 30px;
  text-align: center;
}
@media (min-width: 768px) {
  div.tncpt-ad { max-width: 700px; }
}
div.tncpt-ad p.tncpt-ad__label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-gray-500); /* 4.83:1 on white */
}
div.tncpt-ad picture {
  display: block;
}
div.tncpt-ad a {
  display: block;
  line-height: 0;
  border: 0;
  text-decoration: none;
}
div.tncpt-ad img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
div.tncpt-ad a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
