/* ════════════════════════════════════════════════════════════════════
   materials.css — «Учебные материалы» page.
   Header dropdown menu · section tab strip · document download rows.
   Builds on tokens + header/footer/buttons in landing.css & pages.css.
   ════════════════════════════════════════════════════════════════════ */

/* ─────────── Nav dropdown ─────────── */
/* The .dd link sits inside a relative wrapper; the panel drops below the nav. */
.menu .has-dd { position: relative; display: flex; }
.menu .has-dd > a.dd.open,
.menu .has-dd:hover > a.dd { color: white; border-bottom-color: var(--r-500); }

.dd-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  background: var(--paper);
  border-radius: 0 0 var(--rd-sm) var(--rd-sm);
  box-shadow: var(--sh-lg);
  padding: 8px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.menu .has-dd:hover > .dd-menu,
.menu .has-dd > .dd-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* override inherited .menu a styling inside the panel */
.dd-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: none;
  border-radius: var(--rd-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--d-700);
  transition: background .15s ease, color .15s ease;
}
.dd-menu a::before {
  content: '';
  width: 6px; height: 6px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--d-200);
  transition: background .15s ease;
}
.dd-menu a:hover { background: var(--r-50); color: var(--r-700); border-color: transparent; }
.dd-menu a:hover::before { background: var(--r-500); }
.dd-menu a.active { background: var(--r-50); color: var(--r-700); }
.dd-menu a.active::before { background: var(--r-600); }

/* ─────────── Section tab strip ─────────── */
.mat-tabs-band {
  background: linear-gradient(180deg, var(--cream-50), #fff);
  border-bottom: 1px solid var(--d-100);
  position: sticky;
  top: 0;
  z-index: 30;
}
.mat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0;
}
.mat-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--rd-pill);
  border: 1.5px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--d-600);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mat-tab .t-count {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--rd-pill);
  background: var(--d-100);
  color: var(--d-500);
  transition: background .15s ease, color .15s ease;
}
.mat-tab:hover { background: #fff; color: var(--d-900); border-color: var(--d-100); }
.mat-tab.active {
  background: var(--g-red);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh-red);
}
.mat-tab.active .t-count { background: rgba(255,255,255,0.22); color: #fff; }

/* ─────────── Documents panel ─────────── */
.mat-panel { display: none; }
.mat-panel.active { display: block; }

.doc-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.doc-intro h2 { font-size: 28px; line-height: 1.12; max-width: 720px; }
.doc-intro p { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--d-600); max-width: 680px; }
.doc-intro .doc-tally {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--d-100);
  border-radius: var(--rd-md);
  padding: 14px 20px;
  box-shadow: var(--sh-sm);
  white-space: nowrap;
}
.doc-intro .doc-tally .n { font-size: 28px; font-weight: 800; color: var(--r-600); line-height: 1; letter-spacing: -0.02em; }
.doc-intro .doc-tally .l { font-size: 13px; line-height: 1.3; color: var(--d-500); font-weight: 500; }

/* List */
.doc-list { display: flex; flex-direction: column; }
.doc-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 22px 8px;
  border-top: 1px solid var(--d-100);
  transition: background .15s ease, padding-left .18s ease;
}
.doc-list .doc-row:last-child { border-bottom: 1px solid var(--d-100); }
.doc-row:hover { background: var(--cream-50); padding-left: 18px; border-radius: var(--rd-sm); }

.doc-row .d-ic {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--rd-sm);
  background: var(--r-50); color: var(--r-600);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.doc-row:hover .d-ic { background: var(--g-red); color: #fff; box-shadow: var(--sh-red); }
.doc-row .d-ic svg { width: 22px; height: 22px; }

.doc-row .d-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--d-900);
  line-height: 1.38;
  letter-spacing: -0.01em;
}
.doc-row .d-num { color: var(--r-600); }

.doc-row .d-fmt {
  text-align: right;
  min-width: 78px;
}
.doc-row .d-fmt small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--d-400);
}
.doc-row .d-fmt b {
  font-size: 15px;
  font-weight: 800;
  color: var(--d-800);
  letter-spacing: 0.01em;
}
.doc-row .d-dl {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.doc-row .d-dl svg { width: 16px; height: 16px; }

/* ─────────── Help strip below list ─────────── */
.mat-help {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--cream-50);
  border: 1px solid var(--d-100);
  border-radius: var(--rd-lg);
  padding: 26px 32px;
}
.mat-help .mh-ic {
  width: 50px; height: 50px; flex-shrink: 0; border-radius: var(--rd-sm);
  background: var(--g-red); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-red);
}
.mat-help .mh-ic svg { width: 24px; height: 24px; }
.mat-help .mh-txt { flex: 1; min-width: 240px; }
.mat-help .mh-txt b { display: block; font-size: 17px; color: var(--d-900); }
.mat-help .mh-txt span { font-size: 14px; color: var(--d-600); }
.mat-help .btn { flex-shrink: 0; }

/* ─────────── Responsive ─────────── */
@media (max-width: 991px) {
  .dd-menu { min-width: 280px; }
}
@media (max-width: 767px) {
  .mat-tabs-band { position: static; }
  .mat-tab { white-space: normal; }
  .doc-row { grid-template-columns: auto 1fr auto; gap: 12px 14px; padding: 18px 6px; }
  .doc-row:hover { padding-left: 10px; }
  .doc-row .d-title { grid-column: 2 / span 2; grid-row: 1; }
  .doc-row .d-fmt { grid-column: 2; grid-row: 2; text-align: left; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
  .doc-row .d-fmt small { display: inline; }
  .doc-row .d-dl { grid-column: 3; grid-row: 2; align-self: center; justify-self: end; }
}
@media (max-width: 575px) {
  .doc-row { grid-template-columns: auto 1fr; }
  .doc-row .d-title { grid-column: 2; }
  .doc-row .d-fmt { grid-column: 2; grid-row: 2; }
  .doc-row .d-dl { grid-column: 2; grid-row: 3; justify-self: start; }
  .doc-intro h2 { font-size: 23px; }
}
