/* WP Suite Case Study CPT styles
   Load after common.css and shared wps-solutions.css, only on wps_case_study posts.
   Visual intent: proof/story page with warmer tone and a more editorial reading width. */

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) {
  --wps-bg: radial-gradient(circle at 12% 8%, rgba(217, 119, 6, 0.08), transparent 30%),
    radial-gradient(circle at 90% 16%, rgba(15, 143, 88, 0.07), transparent 28%),
    #f7f4ef;
  --wps-bg-alpha: rgba(247, 244, 239, 0.84);
  --wps-solutions-accent: #d97706;
  --wps-solutions-accent-2: #0f8f58;
  --wps-text-eyebrow: #92400e;
  --wps-text-headline: #b45309;
  --wps-text-headline-2: #0f8f58;
  --wps-solutions-shadow: 0 16px 38px rgba(120, 72, 16, 0.075);
}

/*
 * Solution patterns predate the shared agent box-sizing scope. Without this
 * guard, a 100%-wide Case Study card also adds its padding to that width and
 * can push copy past the mobile viewport.
 */
:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default
) :is(.wps-solutions-page, .wps-agent-page),
:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default
) :is(.wps-solutions-page, .wps-agent-page) *,
.wps-case-study-page,
.wps-case-study-page * {
  box-sizing: border-box;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default
) :is(
  .wps-solutions-page,
  .wps-agent-page,
  .wps-solutions-section,
  .wps-agent-section,
  .wps-solutions-grid,
  .wps-agent-steps,
  .wps-agent-cta
),
.wps-case-study-page :is(
  .wps-solutions-section,
  .wps-solutions-grid
) {
  min-width: 0;
  max-width: 100%;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default
) :is(.wps-solutions-page, .wps-agent-page) :where(h1, h2, h3, p, li, strong, a, cite),
.wps-case-study-page :where(h1, h2, h3, p, li, strong, a, cite) {
  overflow-wrap: anywhere;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template-default,
  .wps-case-study-page
),
:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template-default
) .wp-site-blocks {
  max-width: 100%;
  overflow-x: clip;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section {
  max-width: 1200px;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section.hero {
  position: relative;
  isolation: isolate;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  overflow: hidden;
  width: min(1200px, 100%);
  max-width: 1200px;
  min-height: unset;
  margin-top: clamp(24px, 2.4vw, 40px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: clamp(32px, 4vw, 48px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 95% 8%, rgba(217, 119, 6, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.97), rgba(255, 251, 235, .92));
  border: 1px solid rgba(217, 119, 6, 0.16);
  box-shadow: var(--wps-solutions-shadow);
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section.hero > * {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section.hero::after {
  content: "STORY";
  position: absolute;
  right: clamp(24px, 7vw, 70px);
  bottom: clamp(20px, 4vw, 44px);
  z-index: 0;
  color: rgba(217, 119, 6, 0.10);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  pointer-events: none;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section.hero h1 {
  width: min(820px, 100%);
  max-width: 100%;
  font-size: clamp(2.35rem, 4.7vw, 4.15rem) !important;
  overflow-wrap: anywhere;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section.hero .wps-solutions-lead {
  width: min(760px, 100%);
  max-width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-section.hero .wps-solutions-answer {
  width: min(720px, 100%);
  margin: 10px 0 0;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-answer {
  border-left: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, #101827, #1f2937);
  color: #ffffff !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-answer p,
:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-answer strong {
  color: #ffffff !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 24px !important;
  border-radius: 22px;
  background: #fffdf8;
  border-color: rgba(217, 119, 6, 0.14);
  overflow-wrap: anywhere;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  body:has(.wps-case-study-page)
) :is(.wps-agent-card, .wps-agent-faq details) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-grid.two .wps-solutions-card::before {
  content: none !important;
  display: none !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-diagram {
  background: linear-gradient(135deg, #25170a, #0e1625 58%, #09321f);
  color: #fff7ed !important;
  border-color: rgba(217, 119, 6, 0.22);
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-note {
  background: #fffbeb;
  border-left-color: var(--wps-solutions-accent);
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-solutions-cta {
  background: linear-gradient(135deg, #3b2608, #0e1625 58%, #09321f);
}

/*
 * The light-page kicker and paragraph tokens are too dark when the shared
 * agent CTA paints its intentional dark surface.
 */
:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-agent-cta .wps-agent-kicker {
  border-color: rgba(167, 243, 208, 0.42) !important;
  background: rgba(68, 224, 149, 0.13) !important;
  color: #a7f3d0 !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) .wps-agent-cta p:not(.wps-agent-kicker) {
  color: #dbe7f1 !important;
}

/*
 * Case Study close: use the same square Solutions button component even on
 * entries saved before the canonical wps-btn-* classes were added to the
 * pattern. The explicit classes remain the contract for newly assembled pages.
 */
:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(
  .wps-solutions-cta,
  .wps-agent-cta
) {
  --wps-case-study-cta-start: var(--wps-color-secondary, #09551a);
  --wps-case-study-cta-end: var(--wps-color-gradient-end, #44e095);
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(.wps-solutions-cta, .wps-agent-cta) .wp-block-button {
  flex-grow: 0;
  padding: 0 !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(.wps-solutions-cta, .wps-agent-cta) .wp-block-button .wp-block-button__link {
  min-height: 44px;
  padding: .65rem 1.5rem !important;
  border-radius: 0 !important;
  font-family: var(--wps-font-family) !important;
  font-weight: 500 !important;
  line-height: 1.2;
  text-decoration: none;
  transition: background .3s, border-color .3s, border-radius .3s, box-shadow .3s, transform .3s;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(.wps-solutions-cta, .wps-agent-cta) .wp-block-button:not(.is-style-outline) .wp-block-button__link {
  border: 0 !important;
  color: #ffffff !important;
  background-color: transparent !important;
  background-image: linear-gradient(40deg, var(--wps-case-study-cta-start) 0%, var(--wps-case-study-cta-end) 100%) !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(.wps-solutions-cta, .wps-agent-cta) .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  color: #ffffff !important;
  background-image: linear-gradient(40deg, var(--wps-case-study-cta-end) 0%, var(--wps-case-study-cta-start) 100%) !important;
  transform: translateY(-10px);
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(.wps-solutions-cta, .wps-agent-cta) .wp-block-button.is-style-outline .wp-block-button__link {
  border: 1px solid rgba(255, 255, 255, .45) !important;
  color: #ffffff !important;
  background: transparent !important;
  background-image: none !important;
}

:is(
  body.single-wps_case_study,
  body.post-type-wps_case_study,
  body.wps_case_study-template,
  body.wps_case_study-template-default,
  .wps-case-study-page
) :is(.wps-solutions-cta, .wps-agent-cta) .wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: rgba(255, 255, 255, .8) !important;
  color: #ffffff !important;
  background: transparent !important;
  transform: translateY(-10px);
}

@media (max-width: 900px) {
  :is(body.single-wps_case_study, body.post-type-wps_case_study, body.wps_case_study-template, body.wps_case_study-template-default, .wps-case-study-page) .wps-solutions-section.hero::after {
    opacity: 0.45;
    font-size: 3rem;
  }
}

@media (max-width: 767px) {
  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) :is(.wps-solutions-section, .wps-agent-section),
  .wps-case-study-page .wps-solutions-section {
    width: 100% !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  :is(body.single-wps_case_study, body.post-type-wps_case_study, body.wps_case_study-template, body.wps_case_study-template-default, .wps-case-study-page) .wps-solutions-section.hero {
    width: 100% !important;
    max-width: 1200px !important;
    margin-top: 16px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 20px;
    border-radius: 22px;
  }

  :is(body.single-wps_case_study, body.post-type-wps_case_study, body.wps_case_study-template, body.wps_case_study-template-default, .wps-case-study-page) .wps-solutions-section.hero h1 {
    width: 100%;
    font-size: clamp(1.9rem, 9vw, 2.75rem) !important;
    line-height: 1.08;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) :is(.wps-solutions-section, .wps-agent-section) > :is(
    .wps-solutions-eyebrow,
    .wps-agent-label,
    .wps-agent-kicker,
    h1,
    h2,
    .wps-solutions-lead,
    .wps-agent-lead
  ),
  .wps-case-study-page .wps-solutions-section > :is(
    .wps-solutions-eyebrow,
    h1,
    h2,
    .wps-solutions-lead
  ) {
    align-self: center;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) :is(.wps-solutions-card, .wps-agent-card) {
    padding: 20px !important;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) :is(
    .wps-solutions-card,
    .wps-agent-card,
    .wps-agent-quote,
    .wps-solutions-answer,
    .wps-solutions-note,
    .wps-agent-faq details
  ) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 20px !important;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) .wps-agent-steps {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) .wps-agent-steps > li {
    width: 100%;
    min-width: 0;
    padding: 20px 20px 20px 76px !important;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) .wps-agent-steps > li::before {
    left: 20px;
    top: 20px;
  }

  :is(
    body.single-wps_case_study,
    body.post-type-wps_case_study,
    body.wps_case_study-template,
    body.wps_case_study-template-default,
    body:has(.wps-case-study-page)
  ) .wps-solutions-eyebrow,
  .wps-case-study-page .wps-solutions-eyebrow {
    justify-content: center;
    max-width: 100%;
    white-space: normal;
  }
}

@supports not (overflow: clip) {
  .wps-case-study-page,
  body.single-wps_case_study {
    overflow-x: hidden;
  }
}
