/* Списки документов: «Документы», «Деятельность», «Антитеррор» (разметка — lib/docs_view.php) */

.dl-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px 50px;
}

.dl-page h1 {
  text-align: center;
}

.dl-sections {
  display: flex;
  flex-direction: column;
  gap: 22px;
  text-align: left;
}

.dl-section {
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(20, 40, 80, 0.07);
  overflow: hidden;
}

.dl-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 0.9em;
  color: #190780;
  border-top: 4px solid #2d73bc;
  user-select: none;
}

.dl-head::-webkit-details-marker {
  display: none;
}

.dl-head:hover {
  background: #f6f9fd;
}

.dl-head-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eaf2fb;
  color: #2d73bc;
  font-size: 0.85em;
}

.dl-head-title {
  flex: 1;
  line-height: 1.3;
}

.dl-count {
  flex-shrink: 0;
  min-width: 34px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef1f6;
  color: #4b5563;
  font-size: 0.7em;
  font-weight: 600;
  text-align: center;
}

.dl-chevron {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 0.75em;
  transition: transform 0.2s;
}

.dl-section:not([open]) .dl-chevron {
  transform: rotate(-90deg);
}

.dl-list {
  list-style: none;
  margin: 0;
  padding: 0 22px 10px;
}

/* Список без заголовка раздела: первая строка без разделителя сверху */
.dl-list-flat { padding-top: 4px; }
.dl-list-flat .dl-item:first-child { border-top: none; }

.dl-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #edf0f5;
}

.dl-type {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 52px;
  border-radius: 8px;
  font-size: 0.95em;
}

.dl-type-pdf   { background: #fdecec; color: #d93025; }
.dl-type-word  { background: #e8f0fe; color: #2b579a; }
.dl-type-excel { background: #e6f4ea; color: #217346; }
.dl-type-image { background: #fff4e5; color: #c26401; }
.dl-type-file  { background: #eef1f6; color: #4b5563; }

.dl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dl-title {
  display: inline-block;
  color: #1f2937;
  font-size: 0.8em;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.dl-title::first-letter {
  text-transform: uppercase;
}

a.dl-title:hover {
  color: #2d73bc;
  text-decoration: underline;
}

.dl-meta {
  color: #6b7280;
  font-size: 0.6em;
}

.dl-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #c9d6ea;
  border-radius: 8px;
  color: #2d73bc;
  font-size: 0.65em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.dl-btn:hover {
  background: #eef4fc;
}

.dl-btn-primary {
  background: #2d73bc;
  border-color: #2d73bc;
  color: #fff;
}

.dl-btn-primary:hover {
  background: #1f5d9e;
}

.dl-empty {
  text-align: center;
  color: #6b7280;
}

@media (max-width: 700px) {
  .dl-page { padding: 10px 12px 40px; }
  .dl-head { padding: 14px 16px; gap: 10px; }
  .dl-list { padding: 0 16px 8px; }
  .dl-item { flex-wrap: wrap; gap: 12px; }
  .dl-info { flex-basis: calc(100% - 60px); }
  .dl-actions { width: 100%; }
  .dl-btn { flex: 1; justify-content: center; padding: 10px; }
}

/* Версия для слабовидящих: блоки берут цвета выбранной схемы */
.scheme-black .dl-section, .scheme-black .dl-head-icon, .scheme-black .dl-type,
.scheme-black .dl-count, .scheme-black .dl-btn { background: #000 !important; color: #fff !important; border-color: #fff !important; box-shadow: none; }
.scheme-black .dl-head, .scheme-black .dl-title, .scheme-black .dl-meta { color: #fff !important; }

.scheme-yellow .dl-section, .scheme-yellow .dl-head-icon, .scheme-yellow .dl-type,
.scheme-yellow .dl-count, .scheme-yellow .dl-btn { background: #ff0 !important; color: #000 !important; border-color: #000 !important; box-shadow: none; }
.scheme-yellow .dl-head, .scheme-yellow .dl-title, .scheme-yellow .dl-meta { color: #000 !important; }

.scheme-white .dl-section, .scheme-white .dl-head-icon, .scheme-white .dl-type,
.scheme-white .dl-count, .scheme-white .dl-btn { background: #fff !important; color: #000 !important; border-color: #000 !important; box-shadow: none; }
.scheme-white .dl-head, .scheme-white .dl-title, .scheme-white .dl-meta { color: #000 !important; }
