/*
 * Mainstage project presentation
 * Hallmark: existing Editorial Sales Stage / restrained Mainstage edge light.
 * Avada owns structure, spacing, typography, colour choices, and editable content.
 */

:is(
  .ms-project-card-featured,
  .ms-project-card-compact,
  .ms-project-archive,
  .ms-project-single-opening,
  .ms-project-single-facts,
  .ms-project-single-body,
  .ms-project-single-closing,
  .ms-project-single-actions
) {
  --ms-project-blue: var(--awb-color5, #5b9dd3);
  --ms-project-ice: #9fe4ff;
  --ms-project-pink: var(--awb-color8, #e72f76);
  --ms-project-orange: var(--awb-custom_color_2, #eb6021);
  --ms-project-paper: var(--awb-custom_color_4, #060119);
  --ms-project-line: rgba(143, 214, 255, 0.2);
  --ms-project-line-hot: rgba(231, 47, 118, 0.44);
  --ms-project-glow: rgba(62, 140, 203, 0.18);
  --ms-project-focus: var(--ms-project-ice);
  --ms-project-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.ms-project-card-featured {
  --ms-project-title-size: 34px;
  --ms-project-line: rgba(143, 214, 255, 0.28);
  --ms-project-glow: rgba(231, 47, 118, 0.16);
}

.ms-project-card-compact {
  --ms-project-title-size: 22px;
  --ms-project-line: rgba(99, 77, 155, 0.38);
  --ms-project-glow: rgba(62, 140, 203, 0.14);
}

.ms-project-feature {
  --ms-project-feature-title-size: 32px;
}

.ms-project-single-intro-text p:last-child,
.ms-project-feature-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .ms-project-feature {
    --ms-project-feature-title-size: 28px;
  }
}

@media (max-width: 640px) {
  .ms-project-feature {
    --ms-project-feature-title-size: 26px;
  }
}

.ms-project-card,
.ms-project-archive,
.ms-project-archive > .fusion-builder-row,
.ms-project-single-opening,
.ms-project-single-opening > .fusion-builder-row,
.ms-project-single-facts,
.ms-project-single-facts > .fusion-builder-row,
.ms-project-single-body,
.ms-project-single-body > .fusion-builder-row,
.ms-project-single-closing,
.ms-project-single-closing > .fusion-builder-row,
.ms-project-single-actions {
  position: relative;
  overflow: visible !important;
}

body:not(.fusion-builder-live) .ms-project-single-body:has(.ms-project-single-content:empty) {
  display: none;
}

.ms-project-card > .fusion-column-wrapper {
  position: relative;
  overflow: visible !important;
  border: 1px solid var(--ms-project-line) !important;
  background: var(--awb-bg-color, var(--ms-project-paper)) !important;
  box-shadow:
    0 0 0 1px rgba(94, 184, 255, 0.04),
    0 0 20px var(--ms-project-glow) !important;
  isolation: isolate;
  transition:
    border-color 180ms var(--ms-project-ease),
    box-shadow 220ms var(--ms-project-ease);
}

.ms-project-card > .fusion-column-wrapper::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  z-index: 3;
  height: 1px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(
    90deg,
    var(--ms-project-blue),
    var(--ms-project-pink) 64%,
    var(--ms-project-orange)
  );
  box-shadow:
    0 0 8px rgba(143, 214, 255, 0.34),
    0 0 14px rgba(231, 47, 118, 0.16);
  pointer-events: none;
}

.ms-project-card:hover > .fusion-column-wrapper,
.ms-project-card:focus-within > .fusion-column-wrapper {
  transform: none !important;
}

.ms-project-card:focus-within > .fusion-column-wrapper {
  border-color: var(--ms-project-line-hot) !important;
  box-shadow:
    0 0 0 1px rgba(143, 214, 255, 0.08),
    0 0 22px var(--ms-project-glow) !important;
}

.ms-project-card-featured .ms-project-card-layout,
.ms-project-card-compact .ms-project-card-layout {
  align-items: stretch !important;
}

.ms-project-card-featured .ms-project-card-layout > .fusion-layout-column,
.ms-project-card-compact .ms-project-card-layout > .fusion-layout-column {
  display: flex !important;
  min-width: 0;
  margin-bottom: 0 !important;
}

.ms-project-card-featured .ms-project-card-layout > .fusion-layout-column > .fusion-column-wrapper,
.ms-project-card-compact .ms-project-card-layout > .fusion-layout-column > .fusion-column-wrapper {
  width: 100%;
}

.ms-project-card-type,
.ms-project-card-fact-label {
  color: var(--ms-project-ice) !important;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ms-project-card-type:empty {
  display: none !important;
  margin: 0 !important;
}

.ms-project-card-title {
  color: var(--awb-color1, #ffffff) !important;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.ms-project-card-need,
.ms-project-card-build {
  overflow-wrap: break-word;
}

.ms-project-card .fusion-text p {
  margin: 0;
}

.ms-project-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: auto;
  overflow: clip;
  border: 1px solid rgba(143, 214, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  isolation: isolate;
}

.ms-project-single-media {
  position: relative;
  display: block;
  aspect-ratio: auto;
  overflow: clip;
  border: 1px solid rgba(143, 214, 255, 0.22);
  border-radius: 8px;
  background: var(--ms-project-paper);
  box-shadow:
    0 0 0 1px rgba(231, 47, 118, 0.06),
    0 0 20px rgba(62, 140, 203, 0.14);
}

.ms-project-card-media > a,
.ms-project-single-media > a {
  display: block;
  width: 100%;
  height: auto;
}

.ms-project-card-media img,
.ms-project-single-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: 50% 50%;
  transition:
    filter 240ms var(--ms-project-ease),
    transform 320ms var(--ms-project-ease);
}

:is(
  .ms-project-card,
  .ms-project-single-opening,
  .ms-project-single-closing
) :is(a, button):focus-visible {
  outline: 2px solid var(--ms-project-focus) !important;
  outline-offset: 4px;
  border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(6, 1, 25, 0.88) !important;
}

@media (hover: hover) and (pointer: fine) {
  .ms-project-card:hover > .fusion-column-wrapper {
    transform: none !important;
    border-color: rgba(143, 214, 255, 0.42) !important;
    box-shadow:
      0 0 0 1px rgba(231, 47, 118, 0.08),
      0 0 24px var(--ms-project-glow) !important;
  }

  .ms-project-card:hover .ms-project-card-media img {
    filter: saturate(1.04) contrast(1.02);
  }

  .ms-project-single-media:hover img {
    filter: saturate(1.035) contrast(1.015);
  }
}

@media (max-width: 1024px) {
  .ms-project-card-featured {
    --ms-project-title-size: 30px;
  }

  .ms-project-card-compact {
    --ms-project-title-size: 21px;
  }

  .ms-project-card > .fusion-column-wrapper {
    box-shadow:
      0 0 0 1px rgba(94, 184, 255, 0.035),
      0 0 18px var(--ms-project-glow) !important;
  }

  .ms-project-single-media {
    box-shadow: 0 0 18px rgba(62, 140, 203, 0.12);
  }
}

@media (max-width: 800px) {
  .ms-project-card > .fusion-column-wrapper::before {
    box-shadow: 0 0 8px rgba(143, 214, 255, 0.26);
  }
}

@media (max-width: 640px) {
  .ms-project-card-featured {
    --ms-project-title-size: 26px;
  }

  .ms-project-card-compact {
    --ms-project-title-size: 20px;
  }

  .ms-project-card-compact .ms-project-card-layout {
    flex-direction: column !important;
  }

  .ms-project-card-compact .ms-project-card-layout > .fusion-layout-column {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ms-project-card-media,
  .ms-project-single-media {
    border-radius: 6px;
  }

  :is(
    .ms-project-card,
    .ms-project-single-opening,
    .ms-project-single-closing
  ) :is(a, button):focus-visible {
    outline-offset: 3px;
  }
}

.ms-project-card-media > a:focus-visible,
.ms-project-single-media > a:focus-visible {
  outline: 2px solid var(--ms-project-focus) !important;
  outline-offset: -4px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(6, 1, 25, 0.88) !important;
}

@media (max-width: 390px) {
  .ms-project-card-featured,
  .ms-project-card-compact,
  .ms-project-card-layout,
  .ms-project-card-media-column,
  .ms-project-card-copy-column {
    min-width: 0;
  }

  .ms-project-card :is(.fusion-title, .fusion-text, .fusion-button) {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-project-card > .fusion-column-wrapper,
  .ms-project-card-media img,
  .ms-project-single-media img,
  .ms-project-card-primary,
  .ms-project-card-live,
  .ms-project-single-live,
  .ms-project-single-all,
  .ms-project-single-contact {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .ms-project-card:hover .ms-project-card-media img,
  .ms-project-card:focus-within .ms-project-card-media img,
  .ms-project-single-media:hover img {
    transform: none !important;
  }
}
