/* ============================================================
   Раздел «Документы» Allora. Собственная вёрстка (библиотека
   документов + встроенный просмотрщик PDF). Тёмная тема, единая
   с брендом, но независимая от вёрстки лекций.
   ============================================================ */
:root {
  --bg:          #0e1117;
  --bg-soft:     #161b22;
  --bg-card:     #1c232c;
  --bg-card-2:   #222a35;
  --line:        #2a3340;
  --text:        #e6edf3;
  --text-dim:    #8b96a3;
  --text-muted:  #6b7480;
  --accent:      #6fb1ff;
  --accent-soft: rgba(111,177,255,0.10);
  --accent-line: rgba(111,177,255,0.30);
  --serif: "Iowan Old Style", "Charter", "Cambria", "Georgia", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(900px 500px at 90% -5%, #1c2a45 0%, transparent 60%),
    radial-gradient(700px 400px at -10% 10%, #16243a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------------- Шапка (общая) ---------------- */
.doc-top {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(14,17,23,0.7);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.doc-top__brand { display: inline-flex; align-items: center; transition: opacity 0.2s; }
.doc-top__brand:hover { opacity: 0.8; }
.doc-top__brand img { height: 42px; width: auto; display: block; }
.doc-top__sep { width: 1px; height: 26px; background: var(--line); }
.doc-top__crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); min-width: 0; }
.doc-top__crumbs a:hover { color: var(--text); }
.doc-top__crumbs .cur { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-top__crumbs .chev { color: var(--text-muted); }

/* ---------------- Каталог ---------------- */
.doc-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 28px 72px; }

.doc-hero { margin-bottom: 40px; }
.doc-hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: 40px; line-height: 1.1; margin: 0 0 10px; letter-spacing: 0.01em;
}
.doc-hero p { color: var(--text-dim); font-size: 16px; line-height: 1.6; max-width: 640px; margin: 0; }

.doc-cat { margin-top: 44px; }
.doc-cat__title {
  font-family: var(--serif); font-size: 13px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.doc-cat__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.doc-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}

.doc-card {
  position: relative; display: flex; align-items: flex-start; gap: 15px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--line);
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.doc-card:hover { border-color: var(--accent-line); background: var(--bg-card-2); transform: translateY(-2px); }
.doc-card__icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
}
.doc-card__icon svg { width: 22px; height: 22px; }
.doc-card__body { min-width: 0; display: flex; flex-direction: column; }
.doc-card__title {
  font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text);
  line-height: 1.3; margin: 2px 0 0;
}
.doc-card__note { color: var(--text-dim); font-size: 13px; line-height: 1.45; margin-top: 4px; }
.doc-card__meta { color: var(--text-muted); font-size: 11.5px; letter-spacing: 0.03em; margin-top: 7px; text-transform: uppercase; }

.doc-foot {
  margin: 8px 28px 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--text-muted); font-size: 13px; text-align: center;
}

/* ---------------- Просмотрщик PDF ---------------- */
body.doc-viewer { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.doc-viewer .doc-top { flex-shrink: 0; }
.doc-frame { flex: 1; min-height: 0; background: #22262b; }
.doc-frame iframe, .doc-frame embed { width: 100%; height: 100%; border: 0; display: block; }
.doc-view__open {
  margin-left: auto; font-size: 13px; color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: 8px; padding: 7px 13px;
  transition: background 0.15s;
}
.doc-view__open:hover { background: var(--accent-soft); }
.doc-view__missing { padding: 60px 28px; text-align: center; color: var(--text-dim); }

/* ---------------- Адаптив ---------------- */
@media (max-width: 720px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-hero h1 { font-size: 30px; }
  .doc-wrap { padding: 28px 18px 56px; }
  .doc-top { padding: 14px 18px; gap: 12px; }
  .doc-top__brand img { height: 36px; }
}
