/* Case study listing filter drawer; scoped to the archive, not detail pages. */
html body.fenix-figma-case-studies-page .fenix-case-studies-listing__inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 32px !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filterbar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 32px !important;
  width: 100% !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filterbar__button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: flex-end;
  width: auto !important;
  min-width: 142px !important;
  height: 52px !important;
  padding: 0 20px !important;
  gap: 8px !important;
  border: 1px solid #291364 !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: #291364 !important;
  font-size: 16px !important;
  line-height: 24px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filterbar__badge {
  display: inline !important;
  min-width: 0;
  height: auto;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filterbar__badge[hidden],
html body.fenix-figma-case-studies-page [data-fenix-case-draft-selection][hidden] {
  display: none !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__chips {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px !important;
  margin-top: 24px;
}

html body.fenix-figma-case-studies-page .fenix-case-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #8c8c9f;
  border-radius: 8px;
  background: #f6f6f8;
  color: #55566b;
  font: 600 14px/20px var(--fenix-font);
  text-align: left;
  cursor: pointer;
}

html body.fenix-figma-case-studies-page .fenix-case-filter-chip__close {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

html body.fenix-figma-case-studies-page .fenix-case-filter-chip__close::before,
html body.fenix-figma-case-studies-page .fenix-case-filter-chip__close::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 1px;
  width: 18px;
  height: 2px;
  background: #e52828;
  transform: rotate(45deg);
}

html body.fenix-figma-case-studies-page .fenix-case-filter-chip__close::after {
  transform: rotate(-45deg);
}

html body.fenix-figma-case-studies-page :is(.fenix-case-study-results, .fenix-case-study-grid) {
  width: 100% !important;
  max-width: none !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 32px !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-card,
html body.fenix-figma-case-studies-page .fenix-case-study-card__body,
html body.fenix-figma-case-studies-page .fenix-case-study-card > .fenix-case-study-card__image-link,
html body.fenix-figma-case-studies-page .fenix-case-study-card__image,
html body.fenix-figma-case-studies-page .fenix-case-study-card::after {
  width: 100% !important;
  min-width: 0 !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter-overlay:not([hidden]) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1400 !important;
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(3, 5, 55, .8) !important;
  cursor: pointer;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter,
html body.fenix-figma-case-studies-page .fenix-case-study-filter__top,
html body.fenix-figma-case-studies-page .fenix-case-study-filter__scroll,
html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions {
  box-sizing: border-box;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter {
  position: fixed !important;
  inset: 0 0 0 auto !important;
  z-index: 1401 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: min(520px, 100vw) !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: 0 10px 25px rgba(41, 19, 100, .12) !important;
  opacity: 1 !important;
  pointer-events: none !important;
  transform: translateX(100%) !important;
  transition: transform 220ms ease !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter.is-open {
  pointer-events: auto !important;
  transform: translateX(0) !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__top {
  display: flex !important;
  flex: 0 0 88px;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 88px !important;
  margin: 0 !important;
  padding: 0 32px !important;
  border-bottom: 1px solid #d1d1db;
  box-shadow: none !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__top h2 {
  margin: 0 !important;
  color: #030537 !important;
  font-size: 28px !important;
  line-height: 36px !important;
  font-weight: 700 !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__close {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #8f68d4;
  border-radius: 50%;
  background: #fff;
  color: #291364;
  cursor: pointer;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__close::before,
html body.fenix-figma-case-studies-page .fenix-case-study-filter__close::after {
  content: '';
  position: absolute;
  top: 22px;
  left: 15px;
  width: 18px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__close::after { transform: rotate(-45deg); }

html body.fenix-figma-case-studies-page .fenix-case-study-filter__scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__selection {
  padding: 0 0 20px;
  border-bottom: 1px solid #d1d1db;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__selection-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 20px;
  line-height: 28px;
  color: #030537;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__selection-heading button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #5e2d9e;
  font: 400 16px/24px var(--fenix-font);
  text-decoration: underline;
  cursor: pointer;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__chips { margin-top: 28px; gap: 12px; }
html body.fenix-figma-case-studies-page .fenix-case-study-filter__chips .fenix-case-filter-chip { min-height: 36px; padding: 6px 8px; font-size: 12px; line-height: 20px; }
html body.fenix-figma-case-studies-page .fenix-case-study-filter__chips .fenix-case-filter-chip__close { transform: scale(.75); }

html body.fenix-figma-case-studies-page .fenix-case-study-filter__group {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 16px 0 20px !important;
  border-bottom: 1px solid #d1d1db;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__group > button {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #030537 !important;
  font-size: 20px !important;
  line-height: 28px !important;
  font-weight: 700 !important;
  cursor: pointer;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__group > button small {
  margin-left: 8px;
  color: #55566b;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__group--closed .fenix-case-study-filter__options { display: none; }

html body.fenix-figma-case-studies-page .fenix-case-study-filter__group label {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  min-height: 28px !important;
  color: #030537 !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 400 !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__group label input {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: #5e2d9e;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions {
  display: grid !important;
  flex: 0 0 auto;
  grid-template-columns: 145px minmax(0, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 104px;
  margin: 0 !important;
  padding: 26px 32px !important;
  border-top: 1px solid #d1d1db;
  background: #fff !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions button {
  width: 100% !important;
  height: 52px !important;
  padding: 0 14px !important;
  border-radius: 16px !important;
  font: 700 16px/24px var(--fenix-font) !important;
  white-space: nowrap;
  cursor: pointer;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__reset { border: 1px solid #291364 !important; background: #fff !important; color: #291364 !important; }
html body.fenix-figma-case-studies-page .fenix-case-study-filter__apply { border: 1px solid #5e2d9e !important; background: #5e2d9e !important; color: #fff !important; }

@media (min-width: 1024px) and (max-width: 1279px) {
  html body.fenix-figma-case-studies-page .fenix-case-study-grid { gap: 24px !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-card > .fenix-case-study-card__image-link,
  html body.fenix-figma-case-studies-page .fenix-case-study-card__image,
  html body.fenix-figma-case-studies-page .fenix-case-study-card::after { height: auto !important; aspect-ratio: 376 / 256; }
}

@media (max-width: 1023px) {
  html body.fenix-figma-case-studies-page .fenix-case-study-filterbar__button { align-self: flex-start; }
  html body.fenix-figma-case-studies-page .fenix-case-study-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter { width: min(520px, 100vw) !important; transform: translateX(100%) !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter.is-open { transform: translateX(0) !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter:target { transform: translateX(100%) !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__group,
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions,
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__top { width: 100% !important; max-width: none !important; }
}

@media (max-width: 767px) {
  html body.fenix-figma-case-studies-page .fenix-case-study-grid { grid-template-columns: minmax(0, 1fr) !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter { width: min(390px, 100vw) !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__top { min-height: 64px !important; flex-basis: 64px; padding-inline: 20px !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__top h2 { font-size: 20px !important; line-height: 28px !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__close { width: 40px; height: 40px; flex-basis: 40px; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__close::before,
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__close::after { top: 18px; left: 11px; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__scroll { padding-inline: 20px; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) !important; min-height: 80px; padding: 14px 20px !important; }
  html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions button { height: 48px !important; font-size: 14px !important; }
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__reset[hidden] {
  display: none !important;
}

html body.fenix-figma-case-studies-page .fenix-case-study-filter__actions:not(.has-selection) {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (prefers-reduced-motion: reduce) {
  html body.fenix-figma-case-studies-page .fenix-case-study-filter { transition: none !important; }
}
