/**
 * Case Study Archive — a quiet, editorial work index.
 *
 * The widget owns its visual vocabulary instead of inheriting Elementor's
 * global link/button rules. Every selector is scoped to the archive so several
 * placements can coexist in one document without style collisions.
 */
.webxd-case-study-archive {
  --case-study-archive-ink: #1e1e1e;
  --case-study-archive-muted: #676767;
  --case-study-archive-rule: #d4d4d4;
  --case-study-archive-accent: #c72e22;
  --case-study-archive-surface: #d8d8d6;
  --case-study-archive-row-gap: clamp(48px, 8vw, 148px);
  --case-study-archive-ease: cubic-bezier(0.22, 1, 0.36, 1);

  box-sizing: border-box;
  width: 100%;
  overflow: clip;
  color: var(--case-study-archive-ink);
}

.webxd-case-study-archive,
.webxd-case-study-archive * {
  box-sizing: border-box;
}

.webxd-case-study-archive__inner {
  width: min(100%, 1440px);
  margin-inline: auto;
  padding-block: clamp(32px, 7vw, 112px);
  padding-inline: 0;
}

.webxd-case-study-archive__header {
  margin-block-end: clamp(32px, 5vw, 72px);
}

.webxd-case-study-archive__heading {
  margin: 0;
  color: var(--case-study-archive-ink);
  font-size: clamp(2rem, 4vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.webxd-case-study-archive__notice {
  margin: 0 0 clamp(32px, 5vw, 72px);
  padding: 14px 18px;
  border: 1px solid var(--case-study-archive-rule);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--case-study-archive-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.webxd-case-study-archive__empty {
  margin: 0;
  padding: 24px 0;
  border-block: 1px solid var(--case-study-archive-rule);
  color: var(--case-study-archive-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

/* Industry pills are plain links so filtered URLs work without JavaScript. */
.webxd-case-study-archive__filters {
  margin: 0 0 40px;
  font-family: "Roboto", sans-serif;
}

.webxd-case-study-archive__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.webxd-case-study-archive__pills li {
  margin: 0;
}

/* Scoped through the archive so Elementor's kit link colours cannot win. */
.webxd-case-study-archive .webxd-case-study-archive__pill {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--case-study-archive-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--case-study-archive-ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 180ms var(--case-study-archive-ease),
    border-color 180ms var(--case-study-archive-ease),
    color 180ms var(--case-study-archive-ease);
}

.webxd-case-study-archive .webxd-case-study-archive__pill[aria-current] {
  border-color: var(--case-study-archive-ink);
  background: var(--case-study-archive-ink);
  color: #fff;
}

@media (hover: hover) {
  .webxd-case-study-archive .webxd-case-study-archive__pill:not([aria-current]):hover {
    border-color: var(--case-study-archive-ink);
    color: var(--case-study-archive-ink);
    text-decoration: none;
  }
}

.webxd-case-study-archive .webxd-case-study-archive__pill:focus-visible {
  outline: 3px solid var(--case-study-archive-accent);
  outline-offset: 3px;
}

.webxd-case-study-archive__list {
  display: flex;
  flex-direction: column;
  gap: var(--case-study-archive-row-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.webxd-case-study-archive__item {
  margin: 0;
  padding: 0;
}

.webxd-case-study-archive__row {
  display: grid;
  grid-template-columns: 448px minmax(0, 1fr);
  align-items: stretch;
  gap: 40px;
  min-width: 0;
}

.webxd-case-study-archive__details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  font-family: "Roboto", sans-serif;
}

.webxd-case-study-archive__intro {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-block-end: 32px;
}

.webxd-case-study-archive__title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.webxd-case-study-archive__title {
  margin: 0;
  color: var(--case-study-archive-ink);
  font-size: clamp(2rem, 2.1vw, 2.5rem);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 46.55px;
}

.webxd-case-study-archive__year {
  color: var(--case-study-archive-muted);
  font-size: clamp(1.125rem, 1.05vw, 1.25rem);
  font-weight: 300;
  letter-spacing: normal;
  line-height: normal;
}

.webxd-case-study-archive__result {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--case-study-archive-ink);
  font-size: clamp(1.2rem, 1.25vw, 1.5rem);
  font-weight: 300;
  letter-spacing: normal;
  line-height: 28px;
}

.webxd-case-study-archive__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 32px;
}

.webxd-case-study-archive__fact {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding-inline-start: 16px;
  border-inline-start: 1px solid var(--case-study-archive-rule);
}

.webxd-case-study-archive__fact:only-child {
  grid-column: 1 / -1;
}

.webxd-case-study-archive__fact dt {
  margin: 0;
  color: var(--case-study-archive-muted);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  text-transform: uppercase;
}

.webxd-case-study-archive__fact dd {
  margin: 0;
  color: var(--case-study-archive-ink);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.webxd-case-study-archive__deliverables {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.webxd-case-study-archive__deliverables li {
  margin: 0;
}

.webxd-case-study-archive__cta {
  display: inline-flex;
  width: 237px;
  max-width: 100%;
  height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-block-end: 32px;
  padding: 10px 22px;
  border: 0;
  border-radius: 5px;
  background-color: var(--case-study-archive-accent);
  color: #fafcfc;
  font-family: "Inter", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 30px;
  text-decoration: none;
  transition: background-color 180ms var(--case-study-archive-ease),
    color 180ms var(--case-study-archive-ease),
    transform 180ms var(--case-study-archive-ease);
}

.webxd-case-study-archive__cta:hover {
  background-color: #a9251b;
  color: #fafcfc;
  text-decoration: none;
  transform: translateY(-2px);
}

.webxd-case-study-archive__cta:active {
  transform: translateY(0);
}

/* Elementor kit link colours can otherwise win on the text child even when
   the archive's anchor surface is correct. */
.webxd-case-study-archive .webxd-case-study-archive__cta > span:first-child {
  color: #fafcfc;
}

.webxd-case-study-archive__cta:focus-visible,
.webxd-case-study-archive__preview-window:focus-visible {
  outline: 3px solid var(--case-study-archive-accent);
  outline-offset: 4px;
}

.webxd-case-study-archive__cta-arrow {
  position: relative;
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  overflow: hidden;
  transition: transform 180ms var(--case-study-archive-ease);
}

.webxd-case-study-archive__cta-arrow-glyph {
  position: absolute;
  inset-block-start: 4.1667px;
  inset-inline-start: 2.5px;
  display: block;
  width: 15px;
  height: 11.6667px;
  max-width: none;
}

.webxd-case-study-archive__cta:hover .webxd-case-study-archive__cta-arrow {
  transform: translateX(4px);
}

.webxd-case-study-archive__preview-window {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--case-study-archive-surface);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.webxd-case-study-archive__preview-image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  transform: translate3d(0, var(--case-study-preview-offset, 0px), 0);
  transition: transform var(--case-study-preview-duration, 250ms) var(--case-study-archive-ease);
  will-change: transform;
}

.webxd-case-study-archive__preview-window.is-scrolling .webxd-case-study-archive__preview-image {
  transition-timing-function: linear;
}

.webxd-case-study-archive__preview-window--empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--case-study-archive-rule);
  background: linear-gradient(135deg, #e5e3df, #d0cfcc);
}

.webxd-case-study-archive__preview-hint {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 1;
  display: flex;
  width: 122px;
  height: 31px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--case-study-accent, var(--case-study-archive-accent));
  color: var(--case-study-accent-text, #ffffff);
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: normal;
  line-height: normal;
  pointer-events: none;
  transition: opacity 220ms var(--case-study-archive-ease),
    transform 220ms var(--case-study-archive-ease);
}

.webxd-case-study-archive__preview-window.is-scrolling .webxd-case-study-archive__preview-hint,
.webxd-case-study-archive__preview-window:focus .webxd-case-study-archive__preview-hint {
  opacity: 0;
  transform: translateY(-4px);
}

.webxd-case-study-archive__preview-window:not(.is-scrollable):not(.webxd-case-study-archive__preview-window--empty)
  .webxd-case-study-archive__preview-hint {
  opacity: 0;
}

.webxd-case-study-archive__hero {
  position: relative;
  min-width: 0;
  /* Let the details column determine row height, independent of the source
     image's intrinsic size. The grid stretches this frame to that height. */
  contain: size;
  overflow: hidden;
  margin: 0;
  border-radius: 8px;
  background: var(--case-study-archive-surface);
}

/* Outrank Elementor's `.elementor img { height: auto; }`. */
.webxd-case-study-archive .webxd-case-study-archive__hero-image {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.webxd-case-study-archive__hero--empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--case-study-archive-rule);
  background: linear-gradient(135deg, #e6e4e0, #d0cfcc);
  color: var(--case-study-archive-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .webxd-case-study-archive__row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(24px, 5vw, 56px);
  }

  .webxd-case-study-archive__facts {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (max-width: 680px) {
  .webxd-case-study-archive__inner {
    padding-block: 48px 72px;
  }

  /* One swipeable row instead of a wrapped block that pushes the first Case
     Study below the fold. */
  .webxd-case-study-archive__filters {
    margin-block-end: 28px;
  }

  .webxd-case-study-archive__pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-block-end: 8px;
    scrollbar-width: thin;
  }

  .webxd-case-study-archive__pills li {
    flex: none;
  }

  /* The scroller clips anything drawn outside it, so keep the ring inside. */
  .webxd-case-study-archive .webxd-case-study-archive__pill:focus-visible {
    outline-offset: -4px;
  }

  .webxd-case-study-archive__row {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .webxd-case-study-archive__details,
  .webxd-case-study-archive__hero {
    width: 100%;
  }

  .webxd-case-study-archive__hero {
    order: -1;
    aspect-ratio: 824 / 663;
  }

  .webxd-case-study-archive__preview-window {
    aspect-ratio: 16 / 9;
  }

  .webxd-case-study-archive__cta {
    margin-block-end: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .webxd-case-study-archive .webxd-case-study-archive__pill,
  .webxd-case-study-archive__preview-image,
  .webxd-case-study-archive__cta,
  .webxd-case-study-archive__cta-arrow,
  .webxd-case-study-archive__preview-hint {
    transition-duration: 1ms;
  }

  .webxd-case-study-archive__preview-window.is-scrolling .webxd-case-study-archive__preview-image {
    transform: translate3d(0, 0, 0);
  }

  .webxd-case-study-archive__preview-hint {
    display: none;
  }

  .webxd-case-study-archive__cta:hover {
    transform: none;
  }
}

/* The hover image sits over the Featured Image and fades in while the row is
   hovered, or while keyboard focus is inside it. `:focus-visible` keeps a
   mouse click (e.g. on the scrolling preview) from holding the swap after
   the pointer leaves. */
.webxd-case-study-archive .webxd-case-study-archive__hero-image--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 200ms ease;
}
.webxd-case-study-archive__row:has(:focus-visible) .webxd-case-study-archive__hero-image--hover {
  opacity: 1;
}
@media (hover: hover) {
  .webxd-case-study-archive__row:hover .webxd-case-study-archive__hero-image--hover {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .webxd-case-study-archive .webxd-case-study-archive__hero-image--hover {
    transition: none;
  }
}
