.rsag {
  --rsag-bg: #050505;
  --rsag-control: #1b1b1b;
  --rsag-control-hover: #242424;
  --rsag-text: #ffffff;
  --rsag-muted: rgba(255, 255, 255, 0.72);
  --rsag-gap: 14px;
  position: relative;
  width: 100%;
  padding: clamp(18px, 2.5vw, 36px);
  color: var(--rsag-text);
  background: var(--rsag-bg);
  box-sizing: border-box;
}

.rsag *,
.rsag *::before,
.rsag *::after {
  box-sizing: border-box;
}

.rsag .rsag__controls {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px;
  width: 100%;
  max-width: 520px !important;
  margin: 0 0 clamp(22px, 3vw, 34px) !important;
}

.rsag .rsag__search,
.rsag .rsag__select-wrap {
  position: relative !important;
  display: flex !important;
  min-height: 48px !important;
  height: 48px !important;
  align-self: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  color: var(--rsag-text);
  background: var(--rsag-control);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0 !important;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.rsag .rsag__search {
  flex: 1 1 260px !important;
  align-items: center;
}

.rsag .rsag__select-wrap {
  flex: 0 1 190px !important;
  align-items: center;
}

.rsag__search:focus-within,
.rsag__select-wrap:focus-within {
  background: var(--rsag-control-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.rsag__search > svg {
  position: absolute;
  left: 16px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.rsag__search input,
.rsag__select-wrap select {
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
  height: 46px !important;
  margin: 0 !important;
  color: inherit;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  font: inherit;
  font-size: 13px !important;
  line-height: 46px !important;
}

.rsag__search input {
  padding: 0 16px 0 43px !important;
}

.rsag__search input::placeholder {
  color: rgba(255, 255, 255, 0.72);
  opacity: 1;
}

.rsag__select-wrap select {
  position: relative;
  z-index: 1;
  padding: 0 42px 0 16px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer;
}

.rsag__select-wrap select option {
  color: #fff;
  background: #1b1b1b;
}

.rsag__select-wrap > svg {
  display: none !important;
}

.rsag__select-wrap::after {
  content: "" !important;
  position: absolute;
  z-index: 2;
  right: 17px;
  top: 50%;
  display: block !important;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border: 0 !important;
  border-right: 1.5px solid currentColor !important;
  border-bottom: 1.5px solid currentColor !important;
  background: none !important;
  transform: rotate(45deg);
  pointer-events: none;
}

.rsag__results {
  position: relative;
  min-height: 140px;
  transition: opacity 180ms ease;
}

.rsag.is-loading .rsag__results {
  opacity: 0.38;
  pointer-events: none;
}

.rsag.is-loading::after {
  content: "";
  position: absolute;
  z-index: 20;
  top: 55%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rsag-spin 0.7s linear infinite;
}

@keyframes rsag-spin {
  to { transform: rotate(360deg); }
}

.rsag > .rsag__results > .rsag__grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  gap: var(--rsag-gap) !important;
  width: 100% !important;
  max-width: none !important;
}

.rsag .rsag__grid > .rsag-card {
  position: relative;
  display: block !important;
  grid-column: auto !important;
  grid-row: auto !important;
  min-width: 0;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  aspect-ratio: 811 / 676 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.15), transparent 32%),
    linear-gradient(135deg, #252525, #080808 70%);
  isolation: isolate;
}

.rsag-card__link {
  position: absolute;
  inset: 0;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  color: #fff !important;
  text-decoration: none !important;
}

.rsag-card__image {
  position: absolute;
  inset: 0;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: scale(1.001);
  filter: saturate(0.92) contrast(1.03);
  transition: transform 650ms cubic-bezier(.2,.7,.2,1), filter 400ms ease;
}

.rsag-card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.1) 43%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 68%);
  transition: background-color 350ms ease;
}

.rsag-card__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 42px);
}

.rsag-card__topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 13px;
  min-height: 18px;
  margin-bottom: clamp(14px, 2vw, 22px);
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(10px, 0.8vw, 12px);
  font-weight: 500;
  line-height: 1.3;
}

.rsag-card__category {
  font-weight: 700;
}

.rsag-card__date {
  color: var(--rsag-muted);
}

.rsag-card__title {
  max-width: 78%;
  margin: 0 !important;
  padding: 0 !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: clamp(28px, 2.4vw, 42px) !important;
  font-weight: 650 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.08 !important;
  text-transform: none !important;
  text-decoration: none !important;
  text-wrap: balance;
}

.rsag-card__excerpt {
  display: block;
  max-width: 72%;
  margin-top: auto;
  padding: 24px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.55;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms ease, transform 350ms ease;
}

.rsag-card__icon {
  position: absolute;
  right: clamp(20px, 2.7vw, 38px);
  bottom: clamp(20px, 2.7vw, 38px);
  display: block;
  width: 24px;
  height: 24px;
  color: #fff;
}

.rsag-card__icon svg {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: opacity 220ms ease, transform 300ms ease;
}

.rsag-card__arrow {
  opacity: 0;
  transform: translate(-4px, 4px);
}

.rsag-card__link:hover .rsag-card__image,
.rsag-card__link:focus-visible .rsag-card__image {
  transform: scale(1.045);
  filter: saturate(1.04) contrast(1.06);
}

.rsag-card__link:hover .rsag-card__excerpt,
.rsag-card__link:focus-visible .rsag-card__excerpt {
  opacity: 1;
  transform: translateY(0);
}

.rsag-card__link:hover .rsag-card__plus,
.rsag-card__link:focus-visible .rsag-card__plus {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.rsag-card__link:hover .rsag-card__arrow,
.rsag-card__link:focus-visible .rsag-card__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.rsag-card__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -5px;
}

.rsag__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: clamp(24px, 4vw, 46px);
}

.rsag__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  color: #fff;
  background: #1b1b1b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.rsag__pagination a.page-numbers:hover,
.rsag__pagination a.page-numbers:focus-visible,
.rsag__pagination .page-numbers.current {
  color: #050505;
  background: #fff;
  border-color: #fff;
}

.rsag__pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
}

.rsag__empty {
  display: grid;
  min-height: 260px;
  padding: 30px;
  place-items: center;
  text-align: center;
  background: #111;
}

.rsag__empty p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 900px) {
  .rsag-card__title {
    max-width: 88%;
    font-size: clamp(25px, 4.3vw, 38px) !important;
  }

  .rsag-card__excerpt {
    max-width: 78%;
  }
}

@media (max-width: 767px) {
  .rsag {
    --rsag-gap: 10px;
    padding: 16px;
  }

  .rsag .rsag__controls {
    max-width: none !important;
    margin-bottom: 18px;
  }

  .rsag > .rsag__results > .rsag__grid {
    grid-template-columns: 1fr !important;
  }

  .rsag .rsag__grid > .rsag-card {
    aspect-ratio: 4 / 5 !important;
    min-height: 410px !important;
  }

  .rsag-card__title {
    max-width: 90%;
    font-size: clamp(27px, 8vw, 38px) !important;
  }

  .rsag-card__excerpt {
    max-width: calc(100% - 52px);
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .rsag__controls {
    flex-direction: column;
  }

  .rsag .rsag__search,
  .rsag .rsag__select-wrap {
    flex-basis: auto !important;
    width: 100% !important;
  }

  .rsag .rsag__grid > .rsag-card {
    min-height: 390px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rsag *,
  .rsag *::before,
  .rsag *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
