.documents {
  padding: 0 0 var(--space-section);
  background: var(--bg-page);
}

.documents__head {
  margin: 0 0 clamp(20px, 3vw, 32px);
}

.documents__title {
  margin: 0 0 12px;
  font-size: var(--typo-h2-size);
  line-height: var(--typo-h2-line-height);
  font-weight: var(--typo-h2-weight);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.documents__subtitle {
  margin: 0;
  max-width: 860px;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text-muted);
}

.documents__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.documents__item {
  min-width: 0;
}

.documents-card {
  position: relative;
  min-height: 142px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 96, 0, 0.1) 0%, rgba(255, 96, 0, 0) 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%),
    var(--bg-panel-soft);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.documents-card__open {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.documents-card__open:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.documents-card__content {
  position: relative;
  z-index: 2;
  pointer-events: none;
  min-height: 142px;
  padding: 16px 58px 16px 16px;
  display: flex;
  align-items: flex-start;
}

.documents-card__top {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.documents-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(255, 96, 0, 0.16);
}

.documents-card__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.documents-card__meta {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.documents-card__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.documents-card__labels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.documents-card__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.documents-card__date {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-dim);
}

.documents-card__download {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base);
}

.documents-card__download:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.documents__actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.documents__all-link {
  min-width: 188px;
}

@media (hover: hover) and (pointer: fine) {
  .documents-card:hover {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  }

  .documents-card__download:hover {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.14);
  }
}

@media (max-width: 1199px) {
  .documents__subtitle {
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .documents__head {
    margin-bottom: 24px;
  }

  .documents__subtitle {
    font-size: 15px;
    line-height: 1.42;
  }

  .documents__list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .documents-card,
  .documents-card__content {
    min-height: 132px;
  }

  .documents-card__content {
    padding: 14px 54px 14px 14px;
  }

  .documents-card__title {
    font-size: 17px;
  }

  .documents__actions {
    margin-top: 16px;
  }

  .documents__all-link {
    width: 100%;
  }
}

html[data-theme="light"] .documents-card {
  background:
    linear-gradient(180deg, rgba(17, 22, 28, 0.03) 0%, rgba(17, 22, 28, 0) 100%),
    #ffffff;
  border-color: rgba(16, 20, 24, 0.16);
  box-shadow: 0 8px 20px rgba(16, 20, 24, 0.08);
}

html[data-theme="light"] .documents-card__download {
  background: rgba(17, 22, 28, 0.05);
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme="light"] .documents-card:hover {
    background:
      linear-gradient(180deg, rgba(17, 22, 28, 0.04) 0%, rgba(17, 22, 28, 0) 100%),
      #f7f9fc;
    border-color: rgba(16, 20, 24, 0.14);
    box-shadow: 0 8px 22px rgba(16, 20, 24, 0.08);
  }

  html[data-theme="light"] .documents-card:hover .documents-card__icon {
    color: var(--accent);
    background: rgba(17, 22, 28, 0.06);
  }

  html[data-theme="light"] .documents-card__download:hover {
    border-color: rgba(16, 20, 24, 0.22);
    background: rgba(17, 22, 28, 0.08);
    color: var(--text-primary);
  }
}
