/* library-listing block */

.library-listing__inner {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 40px;
  padding-bottom: 33px;

  @media (width >= 768px) {
    padding-top: 50px;
    padding-bottom: 32px;
  }

  @media (width >= 1024px) {
    padding-top: 72px;
    padding-bottom: 90px;
  }
}

/* ── Filters ─────────────────────────────────── */

.library-listing__filters.g-row {
  align-items: flex-end;
  row-gap: var(--corp-space-xl);
  justify-content: space-between;
}

/* Search */

.library-listing__search {
  display: flex;
  align-items: center;
  gap: var(--corp-space-lg);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--corp-color-neutral-black);
}

.library-listing__search-icon {
  width: var(--corp-cta-icon-size);
  height: var(--corp-cta-icon-size);
  flex-shrink: 0;
  opacity: 0.6;
}

.library-listing__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 18px;
  font-weight: var(--fw-400);
  line-height: 18px;
  letter-spacing: -0.03em;
  color: var(--corp-color-text);
}

.library-listing__search-input::placeholder {
  color: var(--corp-color-neutral-black);
}

/* Dropdowns */

.library-listing__dropdowns {
  display: flex;
  flex-direction: row;
  gap: var(--corp-space-lg);
  justify-content: space-between;
}

.library-listing__dropdown {
  flex: 1;
  position: relative;
}

.library-listing__dropdown-trigger {
  align-items: center;
  background: var(--corp-color-surface-200);
  border: 0;
  border-radius: var(--corp-radius-sm);
  color: var(--corp-color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: var(--corp-space-lg) 20px;
  text-align: start;
  width: 100%;
}

.library-listing__dropdown-copy {
  align-items: center;
  display: flex;
  gap: 10px;
}

.library-listing__dropdown-label {
  color: rgb(0 0 0 / 40%);
  font-size: var(--corp-type-mobile-tag-1-font-size);
  font-weight: var(--corp-type-mobile-tag-1-font-weight);
  line-height: var(--corp-type-mobile-tag-1-line-height);
}

.library-listing__dropdown-value {
  color: var(--corp-color-text);
  font-size: var(--corp-type-mobile-tag-1-font-size);
  font-weight: var(--fw-500);
  font-style: normal;
  line-height: 18px; /* 128.571% */
}

.library-listing__dropdown-icon {
  background: url('/corporate/icons/caret-arrow-down-blue.svg') center / 20px no-repeat;
  display: block;
  flex: 0 0 20px;
  height: 20px;
  transition: transform 160ms ease;
  width: 20px;
}

.library-listing__dropdown.is-open .library-listing__dropdown-icon {
  transform: rotate(180deg);
}

.library-listing__dropdown-menu {
  background: var(--corp-color-surface-200);
  border-radius: var(--corp-radius-sm);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--corp-space-lg);
  list-style: none;
  margin: var(--corp-space-sm) 0 0;
  min-width: 100%;
  padding: var(--corp-space-lg);
  position: absolute;
  top: 100%;
  width: 100%;
  z-index: 2;
  max-height: 220px;
  overflow-y: auto;
}

.library-listing__dropdown-item {
  margin: 0;
}

.library-listing__dropdown-option {
  background: transparent;
  border: 0;
  color: var(--corp-color-text);
  cursor: pointer;
  display: block;
  font-family: inherit;
  font-size: var(--corp-type-mobile-tag-1-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-type-mobile-tag-1-line-height);
  padding: 0;
  text-align: start;
  width: 100%;
}

.library-listing__dropdown-option.is-selected {
  color: var(--corp-color-primary);
}

/* ── Cards grid ──────────────────────────────── */

.library-listing__grid.g-row {
  row-gap: 36px;
  align-items: stretch;
}

/* ── Card ────────────────────────────────────── */

.library-listing__card {
  display: flex;
  flex-direction: column;
  gap: var(--corp-space-lg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;

  @media (width >= 768px) {
    gap: 10px;
  }

  @media (width >= 1024px) {
    gap: 20px;
  }
}

/* Card image */

.library-listing__card-image {
  position: relative;
  width: 100%;
  height: 184px;
  border-radius: var(--corp-radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #050c54 0%, var(--corp-color-primary) 55%, #5780ff 100%);
  flex-shrink: 0;
}

.library-listing__card-document-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-listing__card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 37% at 100% 0%, rgb(87 128 255 / 45%) 0%, transparent 100%),
    radial-gradient(ellipse 60% 50% at -15% 0%, rgb(5 12 84 / 80%) 0%, transparent 100%);
  border-radius: inherit;
}

.library-listing__card-image-tag {
  position: absolute;
  top: 15px;
  left: var(--corp-space-lg);
  padding: var(--corp-space-xs) var(--corp-space-sm);
  background: rgb(255 255 255 / 20%);
  backdrop-filter: blur(12px);
  border-radius: 5px;
  font-size: var(--corp-type-mobile-body-sm-2-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-space-lg);
  color: var(--corp-color-white);
  z-index: 1;
}

.library-listing__card-pdf-icon {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgb(255 255 255 / 30%);
  backdrop-filter: blur(37px);
  z-index: 1;
}

.library-listing__card-pdf-icon img {
  width: var(--corp-cta-icon-size);
  height: var(--corp-cta-icon-size);
}

/* Card content */

.library-listing__card-content {
  display: flex;
  flex-direction: column;
  gap: var(--corp-space-lg);

  @media (width >= 768px) {
    gap: 10px;
  }

  @media (width >= 1024px) {
    gap: 20px;
  }
}

.library-listing__card-text-content {
  display: flex;
  flex-direction: column;
  gap: 12px;

  @media (width >= 768px) {
    gap: 10px;
  }

  @media (width >= 1024px) {
    gap: 10px;
  }
}

.library-listing__card-date {
  display: block;
  font-size: var(--corp-type-mobile-tag-1-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-type-mobile-tag-1-line-height);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgb(0 0 0 / 40%);
}

.library-listing__card-title {
  margin: 0;
  font-size: var(--corp-type-mobile-heading-2-medium-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-type-mobile-heading-2-medium-line-height);
  color: var(--corp-color-neutral-black-3);
}

.library-listing__card-description {
  margin: 0;
  font-size: var(--corp-type-mobile-body-2-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-type-mobile-body-2-line-height);
  color: var(--corp-color-overlay-black-60);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.library-listing__card-read-more {
  display: flex;
  align-items: center;
  gap: var(--corp-space-sm);
  font-size: var(--corp-type-mobile-body-2-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-type-mobile-body-2-line-height);
  color: var(--corp-color-primary);

  @media (width >= 768px) {
    gap: 4.76px;
  }

  @media (width >= 1024px) {
    gap: var(--corp-space-sm);
  }
}

.library-listing__card-read-more img {
  width: var(--corp-space-sm);
  height: var(--corp-space-sm);
}

.library-listing__card:hover .library-listing__card-title {
  color: var(--corp-color-primary);
  text-decoration: underline;
}

.library-listing__card:focus-visible {
  outline: 2px solid var(--corp-color-primary);
  outline-offset: var(--corp-space-xs);
  border-radius: var(--corp-radius-xsmd);
}

/* ── No results ──────────────────────────────── */

.library-listing__no-results {
  margin: 0;
  font-size: var(--corp-type-mobile-heading-2-medium-font-size);
  font-weight: var(--fw-500);
  line-height: var(--corp-type-mobile-heading-2-medium-line-height);
  letter-spacing: 0.01em;
  color: var(--corp-color-text);
  opacity: 0.5;
}

.library-listing__no-results[hidden] {
  display: none;
}

/* ── Tablet (768px+) ─────────────────────────── */

@media (width >= 768px) {
  .library-listing__inner {
    gap: 36px;
  }

  .library-listing__grid.g-row {
    row-gap: 32px;
  }

  .library-listing__card-image {
    height: 160px;
  }

  .library-listing__card-title {
    font-size: var(--corp-type-tablet-heading-1-font-size);
    line-height: 17px;
  }

  .library-listing__card-description {
    font-size: var(--corp-type-mobile-body-sm-font-size);
    line-height: var(--corp-type-mobile-body-sm-line-height);
  }

  .library-listing__card-date {
    font-size: var(--corp-type-tablet-body-sm-font-size);
    line-height: var(--corp-type-tablet-body-sm-line-height);
  }

  .library-listing__card-read-more {
    font-size: var(--corp-type-tablet-body-sm-3-font-size);
    font-style: normal;
    font-weight: var(--fw-400);
    line-height: 130%; /* 13px */
    letter-spacing: -0.3px;
  }

  .library-listing__card-pdf-icon {
    width: var(--corp-space-xl);
    height: var(--corp-space-xl);
    bottom: 10px;
    right: 10px;
  }

  .library-listing__card-pdf-icon img {
    width: var(--corp-space-md);
    height: var(--corp-space-md);
  }

  .library-listing__card-image-tag {
    top: 9px;
    left: 9px;
    font-size: var(--corp-type-tablet-body-sm-3-font-size);
    line-height: var(--corp-type-tablet-body-sm-3-line-height);
    padding: var(--corp-space-xs) 5px;
  }
}

/* ── Desktop (1024px+) ───────────────────────── */

@media (width >= 1024px) {
  .library-listing__grid.g-row {
    row-gap: 72px;
  }

  .library-listing__search-input {
    font-size: 18px;
    font-style: normal;
    font-weight: var(--fw-400);
    line-height: var(--corp-space-xl); /* 133.333% */
    letter-spacing: -0.54px;
    color: var(--corp-color-neutral-black);
  }

  .library-listing__dropdown-trigger {
    min-height: 60px;
    padding: 18px 20px;
  }

  .library-listing__dropdown-menu {
    min-width: 164px;
    padding: 20px var(--corp-space-lg);
  }

  .library-listing__dropdown-label,
  .library-listing__dropdown-value,
  .library-listing__dropdown-option {
    font-size: var(--corp-type-desktop-body-5-font-size);
    line-height: var(--corp-type-desktop-body-5-line-height);
  }

  .library-listing__card-image {
    height: 273px;
  }

  .library-listing__card-title {
    font-size: var(--corp-type-desktop-heading-4-font-size);
    line-height: var(--corp-space-xl);
  }

  .library-listing__card-description {
    font-size: var(--corp-type-desktop-body-2-font-size);
    font-weight: var(--fw-400);
    line-height: var(--corp-space-xl);
  }

  .library-listing__card-date {
    font-size: var(--corp-type-desktop-body-3-font-size);
    line-height: 15px;
  }

  .library-listing__card-read-more {
    gap: var(--corp-space-sm);
    font-size: var(--corp-type-desktop-body-font-size);
    font-style: normal;
    font-weight: var(--fw-400);
    line-height: 150%; /* 24px */
    letter-spacing: -0.16px;
  }

  .library-listing__card-pdf-icon {
    width: 42px;
    height: 42px;
    bottom: 18px;
    right: 18px;
  }

  .library-listing__card-pdf-icon img {
    width: var(--corp-cta-icon-size);
    height: var(--corp-cta-icon-size);
  }

  .library-listing__card-image-tag {
    top: 15px;
    left: var(--corp-space-lg);
    font-size: var(--corp-type-desktop-body-2-font-size);
    line-height: var(--corp-type-desktop-body-2-line-height);
    padding: var(--corp-space-sm);
  }
}
