/*
 * Clean Code Playbook: homepage + widget components (reference implementation)
 * Requires tokens.css. All selectors are .ccp-* so they cannot leak into Katen.
 * Breakpoint: 768px (phone below, desktop above). Mobile-first.
 */

/* ---------- Shared ---------- */
.ccp-eyebrow {
  font-family: var(--ccp-font-head); font-size: 13px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ccp-accent);
}
.ccp-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.ccp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--ccp-radius-s);
  background: var(--ccp-sky); color: var(--ccp-navy);
  font-family: var(--ccp-font-head); font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; transition: background-color .15s ease;
}
.ccp-btn:hover { background: var(--ccp-sky-hover); color: var(--ccp-navy); }
.ccp-btn:focus-visible, .ccp-input:focus-visible, .ccp-chip:focus-visible {
  outline: 3px solid var(--ccp-sky); outline-offset: 2px;
}

/* ---------- Menu badge: "Free Book NEW" ---------- */
.ccp-nav-badge {
  margin-left: 8px; padding: 1px 7px; border-radius: var(--ccp-radius-pill);
  background: var(--ccp-sky); color: var(--ccp-navy);
  font-size: 10px; font-weight: 600; letter-spacing: .04em; vertical-align: middle;
}
/* Alternative without HTML in the menu label: add CSS class `ccp-menu-new` to the menu item in Appearance > Menus. */
.menu-item.ccp-menu-new > a::after {
  content: "NEW"; margin-left: 8px; padding: 1px 7px; border-radius: var(--ccp-radius-pill);
  background: var(--ccp-sky); color: var(--ccp-navy);
  font-size: 10px; font-weight: 600; letter-spacing: .04em; vertical-align: middle;
}

/* ---------- Intro band (full width) ---------- */
/* Full-bleed: strip Elementor padding on the homepage Welcome section that holds [ccp_home_top]. */
.elementor-element-f35f671 > .elementor-container {
  max-width: none;
  width: 100%;
}
.elementor-element-f35f671 .elementor-column-gap-default > .elementor-column > .elementor-element-populated,
.elementor-element-f35f671 .elementor-widget-wrap {
  padding: 0;
}
.elementor-section-full_width .ccp-intro,
.elementor-section-stretched .ccp-intro {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}
.ccp-intro {
  box-sizing: border-box;
  /* Transparent so the sticky island header can float over page content. */
  background-color: transparent;
  background-image: none;
  border-top: none; border-bottom: none;
  padding: 44px 16px 40px;
}
.ccp-intro__inner {
  max-width: 900px; margin: 0 auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.ccp-intro__title {
  margin: 0; font-family: var(--ccp-font-head); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 50px); line-height: 1.12; letter-spacing: -.01em;
  color: var(--ccp-heading);
}
.ccp-intro__lede {
  margin: 0; max-width: 680px; font-family: var(--ccp-font-body);
  font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; color: var(--ccp-text);
}
.ccp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ccp-chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--ccp-chip-border); border-radius: var(--ccp-radius-pill);
  color: var(--ccp-chip-text); text-decoration: none;
  font-family: var(--ccp-font-head); font-size: 14px;
}
.ccp-chip:hover { border-color: var(--ccp-accent); color: var(--ccp-heading); }
@media (min-width: 768px) {
  .ccp-intro { padding: 64px 24px 60px; }
  .ccp-intro__inner { gap: 22px; }
}

/* ---------- Book banner (navy in both modes) ---------- */
/* Banner is in a full-bleed Elementor section; Recent Posts / post list sit in a
   widget-wrap with 10px gap. Use the same 10px so navy card, heading, and posts
   share one left edge on mobile. */
.ccp-wrap {
  max-width: var(--ccp-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 10px;
  padding-right: 10px;
  box-sizing: border-box;
}
.ccp-banner {
  position: relative; width: 100%; margin: 72px 0 0;
  background: var(--ccp-navy); border: 1px solid var(--ccp-navy-line);
  border-radius: 16px; padding: 150px 20px 24px; box-sizing: border-box;
  color: var(--ccp-on-navy-muted); font-family: var(--ccp-font-body);
}
/* Beat Elementor's `.elementor img { box-shadow: none }` */
.elementor .ccp-banner img.ccp-banner__cover,
.ccp-banner__cover {
  position: absolute; left: 50%; top: -44px; width: 120px; height: auto; aspect-ratio: 5 / 8;
  transform: translateX(-50%) rotate(-4deg);
  border-radius: 4px 10px 10px 4px;
  box-shadow: var(--ccp-shadow-cover);
}
.ccp-banner .ccp-eyebrow { color: var(--ccp-sky); font-size: 12px; letter-spacing: .06em; }
.ccp-banner__title {
  margin: 4px 0 6px; font-family: var(--ccp-font-head); font-weight: 700; font-size: 24px; color: var(--ccp-on-navy);
}
.ccp-banner__text { margin: 0 0 16px; max-width: 640px; font-size: 16px; line-height: 1.6; color: var(--ccp-on-navy-muted); }
.ccp-banner__more { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--ccp-on-navy-link); }
.ccp-banner__more:hover { color: #ffffff; }
.ccp-banner__consent { margin: 10px 0 0; font-size: 12px; color: var(--ccp-on-navy-subtle); }
.ccp-banner__consent a { color: var(--ccp-on-navy-link); }
@media (min-width: 768px) {
  .ccp-banner { margin-top: 60px; padding: 30px 40px 48px 230px; min-height: 200px; }
  .elementor .ccp-banner img.ccp-banner__cover,
  .ccp-banner__cover { left: 44px; top: -30px; width: 150px; transform: rotate(-4deg); }
  .ccp-banner__title { font-size: 26px; }
  .ccp-banner__text { font-size: 17px; }
}

/* ---------- Email form (used in banner, book page, post CTA) ---------- */
.ccp-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.ccp-input {
  flex: 1 1 auto; min-width: 0; height: 48px; box-sizing: border-box; padding: 0 16px;
  border-radius: var(--ccp-radius-s); font-size: 16px; font-family: var(--ccp-font-body);
  border: 1px solid var(--ccp-navy-border); background: var(--ccp-navy-raised); color: #ffffff;
}
.ccp-input::placeholder { color: var(--ccp-placeholder); }
@media (min-width: 768px) { .ccp-form { flex-direction: row; } }

/* ---------- Posts band (dotted, mirrors .ccp-intro) — head + full post list ---------- */
/* Full-bleed head section ([ccp_posts_head]). */
.elementor-element-51260d67 > .elementor-container {
  max-width: none;
  width: 100%;
}
.elementor-element-51260d67 .elementor-column-gap-default > .elementor-column > .elementor-element-populated,
.elementor-element-51260d67 .elementor-widget-wrap {
  padding: 0;
}
.elementor-section-full_width .ccp-posts-band,
.elementor-section-stretched .ccp-posts-band {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}
/* Site-wide dotted band on the canvas (html).
   Match dark-mode-toggle's html.dark specificity (#142030 !important). */
html,
html.dark {
  background-color: var(--ccp-band-bg) !important;
  background-image: radial-gradient(var(--ccp-band-dot) 1px, transparent 1px) !important;
  background-size: 22px 22px !important;
}
body,
html.dark body,
body.dark {
  background-color: transparent !important;
  background-image: none !important;
}
/* Full-bleed band fill on the Elementor sections (boxed containers stay content-width). */
.home .elementor-element-51260d67,
.home .elementor-element-e269bc9 {
  box-sizing: border-box;
  background-color: transparent;
  background-image: none;
  border-top: none;
  border-bottom: none;
}
.ccp-posts-band {
  /* Page paints the fill; keep spacing on the shortcode. */
  background: none;
  border: none;
  /* Horizontal padding lives on .ccp-posts-head (10px) to match .ccp-wrap / banner. */
  padding: 24px 0;
  margin: 56px 0 0;
}
.home .elementor-element-e269bc9 {
  padding-bottom: 40px;
}
/* Drop card chrome; keep list aligned with .ccp-posts-head / .ccp-wrap. */
.home .elementor-element-e269bc9 .padding-30.rounded.bordered {
  max-width: var(--ccp-content-max);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: 10px !important;
  padding-right: 10px !important;
  border: none;
}
.home .elementor-element-e269bc9 .padding-30 .row {
  margin-left: 0;
  margin-right: 0;
}
.home .elementor-element-e269bc9 .post-item {
  padding-left: 0;
  padding-right: 0;
}
.ccp-posts-head {
  max-width: var(--ccp-content-max);
  margin: 0 auto;
  padding-left: 10px;
  padding-right: 10px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ccp-posts-head__title { margin: 0; font-family: var(--ccp-font-head); font-weight: 700; font-size: 28px; color: var(--ccp-heading); }
.ccp-posts-head__search { flex: 1 1 100%; }
.ccp-posts-head__search .kps-search { margin-bottom: 0; }
@media (min-width: 768px) {
  /* Gap after banner lives on the section (outside the head row), not as empty band padding. */
  .home .elementor-element-51260d67 { margin-top: 28px; }
  .ccp-posts-band { padding: 28px 0; margin-top: 0; }
  .home .elementor-element-e269bc9 { padding-bottom: 48px; }
  .home .elementor-element-e269bc9 .padding-30.rounded.bordered {
    padding-top: 24px !important;
  }
  .ccp-posts-head__search { flex: 0 1 400px; }
}
/* The existing search shortcode is placed inside .ccp-posts-head__search; restyle only its outer box here if needed. */

/* ---------- Optional: end-of-post CTA (Option C) ---------- */
.ccp-post-cta {
  display: flex; flex-direction: column; gap: 18px; align-items: flex-start;
  margin: 40px 0; padding: 22px; border: 1px solid var(--ccp-border); border-radius: var(--ccp-radius-m);
  background: var(--ccp-surface); color: var(--ccp-text);
}
.ccp-post-cta__cover { width: 84px; height: auto; aspect-ratio: 5 / 8; border-radius: 3px 7px 7px 3px; box-shadow: 0 10px 22px rgba(10, 34, 80, .3); }
.ccp-post-cta__lead { margin: 4px 0 12px; font-family: var(--ccp-font-head); font-weight: 600; font-size: 17px; line-height: 1.4; color: var(--ccp-heading); }
.ccp-post-cta .ccp-input { background: var(--ccp-input-bg); border-color: var(--ccp-input-border); color: var(--ccp-heading); }
.ccp-post-cta .ccp-btn { background: var(--ccp-heading); color: var(--ccp-bg); }
html.dark .ccp-post-cta .ccp-btn, body.dark .ccp-post-cta .ccp-btn { background: var(--ccp-sky); color: var(--ccp-navy); }
@media (min-width: 768px) { .ccp-post-cta { flex-direction: row; align-items: center; gap: 24px; padding: 24px 26px; } }

@media (prefers-reduced-motion: reduce) { .ccp-btn { transition: none; } }

/* Noptin form inside CCP banners/CTAs */
.ccp-banner .noptin-form,
.ccp-book .noptin-form,
.ccp-form.noptin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
}
.ccp-banner .noptin-form-fields,
.ccp-book .noptin-form-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
@media (min-width: 768px) {
  .ccp-banner .noptin-form-fields,
  .ccp-book .ccp-form-row .noptin-form-fields {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .ccp-banner .noptin-form-field-email,
  .ccp-book .ccp-form-row .noptin-form-field-email {
    flex: 1 1 260px;
  }
  .ccp-banner .noptin-form-field-submit,
  .ccp-book .ccp-form-row .noptin-form-field-submit {
    flex: 0 0 auto;
  }
}
.ccp-banner .noptin-form-field,
.ccp-book .ccp-hero .noptin-form-field,
.ccp-book .ccp-final .noptin-form-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  padding: 0 16px;
  border-radius: var(--ccp-radius-s);
  font-size: 16px;
  font-family: var(--ccp-font-body);
  border: 1px solid var(--ccp-navy-border);
  background: var(--ccp-navy-raised);
  color: #ffffff;
}
.ccp-banner .noptin-form-field::placeholder,
.ccp-book .ccp-hero .noptin-form-field::placeholder,
.ccp-book .ccp-final .noptin-form-field::placeholder {
  color: rgba(180, 200, 220, 0.45);
  opacity: 1;
}
/* Placeholder hint only while empty — typed text stays solid white. */
.ccp-banner .noptin-form-field:not(:placeholder-shown),
.ccp-book .ccp-hero .noptin-form-field:not(:placeholder-shown),
.ccp-book .ccp-final .noptin-form-field:not(:placeholder-shown) {
  color: #ffffff;
}
.ccp-banner .noptin-form-submit,
.ccp-book .ccp-hero .noptin-form-submit,
.ccp-book .ccp-final .noptin-form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--ccp-radius-s);
  background: var(--ccp-sky);
  color: var(--ccp-navy);
  font-family: var(--ccp-font-head);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.ccp-banner .noptin-form-submit:hover,
.ccp-book .ccp-hero .noptin-form-submit:hover,
.ccp-book .ccp-final .noptin-form-submit:hover {
  background: var(--ccp-sky-hover);
  color: var(--ccp-navy);
}
.ccp-banner .noptin-form-submit:disabled,
.ccp-book .ccp-hero .noptin-form-submit:disabled,
.ccp-book .ccp-final .noptin-form-submit:disabled,
.ccp-post-cta .noptin-form-submit:disabled,
.ccp-dl-page .noptin-form-submit:disabled,
.ccp-banner .noptin-submitting .noptin-form-submit,
.ccp-book .noptin-submitting .noptin-form-submit,
.ccp-post-cta .noptin-submitting .noptin-form-submit,
.ccp-dl-page .noptin-submitting .noptin-form-submit {
  opacity: 0.45;
  cursor: wait;
  filter: none;
  box-shadow: none;
  pointer-events: none;
}
/* No Noptin white overlay — we lock fields instead. */
.ccp-banner .noptin-loader,
.ccp-book .noptin-loader,
.ccp-post-cta .noptin-loader,
.ccp-dl-page .noptin-loader,
form.ccp-form.noptin-form .noptin-loader {
  display: none !important;
}
.ccp-banner .noptin-submitting .noptin-form-field,
.ccp-book .noptin-submitting .noptin-form-field,
.ccp-post-cta .noptin-submitting .noptin-form-field,
.ccp-dl-page .noptin-submitting .noptin-form-field,
form.ccp-form.noptin-form.noptin-submitting .noptin-form-field {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}
.ccp-banner .noptin-form-submit:disabled:hover,
.ccp-book .ccp-hero .noptin-form-submit:disabled:hover,
.ccp-book .ccp-final .noptin-form-submit:disabled:hover {
  background: var(--ccp-sky);
  color: var(--ccp-navy);
}
.ccp-banner .noptin-form-field.ccp-email-invalid,
.ccp-book .noptin-form-field.ccp-email-invalid {
  border-color: #f07178 !important;
  box-shadow: 0 0 0 3px rgba(240, 113, 120, 0.22);
}
.ccp-banner .noptin-form-field.ccp-email-valid,
.ccp-book .noptin-form-field.ccp-email-valid {
  border-color: #3dd68c !important;
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.22);
}
.ccp-banner .noptin-form-submit:focus-visible,
.ccp-banner .noptin-form-field:focus-visible,
.ccp-book .noptin-form-submit:focus-visible,
.ccp-book .noptin-form-field:focus-visible {
  outline: 3px solid var(--ccp-sky);
  outline-offset: 2px;
}
.ccp-banner .noptin-label,
.ccp-book .ccp-hero .noptin-label,
.ccp-book .ccp-final .noptin-label {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.ccp-banner .noptin-form-field-wrapper,
.ccp-book .noptin-form-field-wrapper {
  position: relative;
}
.ccp-banner .noptin-response,
.ccp-book .noptin-response {
  width: 100%;
  color: var(--ccp-on-navy);
  font-size: 14px;
}
.ccp-mobile-pill-new::after {
  content: "NEW";
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: var(--ccp-radius-pill);
  background: var(--ccp-sky);
  color: var(--ccp-navy);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  vertical-align: middle;
}
/* Keep the theme pill row from overflowing once Free Book is injected (declared deviation). */
.mobile-pill-nav:has(.ccp-mobile-pill-new) {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 8px;
  max-width: 100%;
  overflow-x: hidden;
}
.ccp-banner__consent a,
.ccp-final .ccp-banner__consent a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  border-bottom: 1px solid currentColor;
}
