.company-documents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 0;
}

#allrecords .information-page .company-documents__card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid #dbe7f3;
  border-radius: 20px;
  background: #fff;
  color: #24364a;
  text-decoration: none;
  box-shadow: 0 6px 18px #2949730a;
}

#allrecords .information-page .company-documents__card:hover {
  border-color: #8ab6e2;
  box-shadow: 0 10px 25px #29497320;
}

.company-documents__thumbnail {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f0f5fc;
}

.company-documents__thumbnail img {
  display: block;
  width: auto;
  height: clamp(155px, 18vw, 235px);
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 4px 14px #24364a25;
}

.company-documents__details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px 18px;
  line-height: 1.35;
}

.company-documents__details > span {
  color: #526174;
  font-size: 14px;
}

html:has(.company-document-dialog[open]) {
  overflow: hidden;
}

.company-document-dialog {
  box-sizing: border-box;
  width: min(880px, calc(100% - 32px));
  max-width: none;
  max-height: min(90vh, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #24364a;
}

.company-document-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: none;
}

.company-document-dialog::backdrop {
  background: rgb(19 35 56 / 72%);
}

.company-document-dialog__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.information-page .company-document-dialog__header h2 {
  flex: 1;
  margin: 0;
  font-size: clamp(15px, 2.3vw, 22px);
  line-height: 1.25;
}

.company-document-dialog__pdf {
  flex-shrink: 0;
  font-size: 14px;
  white-space: nowrap;
}

.company-document-dialog__close {
  flex: 0 0 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #edf4fc;
  color: #24364a;
  font: 28px/1 Arial, sans-serif;
  cursor: pointer;
}

.company-document-dialog__close:focus-visible {
  outline: 2px solid #0169c2;
  outline-offset: 2px;
}

.company-document-dialog__page {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  background: #edf4fc;
}

.company-document-dialog__page img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 660px) {
  .company-documents {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #allrecords .information-page .company-documents__card {
    grid-template: auto / minmax(88px, 31%) minmax(0, 1fr);
  }

  .company-documents__thumbnail {
    padding: 10px;
  }

  .company-documents__thumbnail img {
    height: 104px;
  }

  .company-documents__details {
    justify-content: center;
    padding: 12px;
  }

  .company-document-dialog__header {
    gap: 8px;
    padding: 8px 10px;
  }

  .company-document-dialog__page {
    padding: 6px;
  }
}
