/*
 * Каталог конспектов (/notes) и поиск по ним (/notes/search).
 *
 * Из макета notes_catalog.html — заголовок с кикером и серифным h1, поле
 * поиска (.search-big макета, здесь .notes-find) и карточки предметов. Без
 * «главного за неделю» с авторами и оценками, полосок прочитанного и
 * раскрытого предмета со статистикой чтения: ничего из этого у нас нет.
 * Полоска прогресса внизу карточки предмета тоже убрана — читателей мы не
 * знаем.
 *
 * Строки выдачи (.nrows) повторены в notes-subject.css — по той же причине,
 * что и карточка ниже.
 *
 * Карточка конспекта (.topic-card) — та же, что на странице предмета, и
 * блок её стилей повторён в notes-subject.css: стили страницы подключаются
 * по одному файлу на слаг. Правка карточки — в обоих файлах.
 */

  .page.notes { padding-top: 40px; padding-bottom: 80px; }

  /* ---------- заголовок ---------- */
  .notes-hero { margin-bottom: 24px; max-width: 760px; }
  .notes-hero .kicker {
    font-family: "Geist Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
  }
  .notes-hero h1 {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: clamp(44px, 6vw, 72px);
    line-height: 0.96;
    letter-spacing: -0.025em;
    margin-bottom: 14px;
  }
  .notes-hero h1 em {
    font-style: italic;
    background: linear-gradient(90deg, var(--accent), var(--pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .notes-hero p { color: var(--muted); font-size: 16px; max-width: 60ch; }

  /* ---------- поиск ---------- */
  .notes-find {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 760px;
    padding: 8px;
    margin-bottom: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }
  .notes-find-in {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: 14px;
    transition: all 0.2s;
  }
  .notes-find-in:focus-within {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
  }
  .notes-find-in .mi { font-size: 18px; color: var(--muted); }
  .notes-find-in input {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    border: 0;
    background: transparent;
    outline: none;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
  }
  .notes-find-in input::placeholder { color: var(--muted-2); }
  /* Родной крестик поля поиска синий и из другой системы; этот — в цвет. */
  .notes-find-in input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    background: var(--muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-438 270-228q-9 9-21 9t-21-9q-9-9-9-21t9-21l210-210-210-210q-9-9-9-21t9-21q9-9 21-9t21 9l210 210 210-210q9-9 21-9t21 9q9 9 9 21t-9 21L522-480l210 210q9 9 9 21t-9 21q-9 9-21 9t-21-9L480-438Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-438 270-228q-9 9-21 9t-21-9q-9-9-9-21t9-21l210-210-210-210q-9-9-9-21t9-21q9-9 21-9t21 9l210 210 210-210q9-9 21-9t21 9q9 9 9 21t-9 21L522-480l210 210q9 9 9 21t-9 21q-9 9-21 9t-21-9L480-438Z'/%3E%3C/svg%3E") center / contain no-repeat;
    cursor: pointer;
  }
  .notes-find .btn { border: 0; cursor: pointer; font-family: inherit; }
  .notes-find .btn-dark:hover { background: var(--accent); }

  /* ---------- страница поиска ---------- */
  .page.notes-search { padding-top: 24px; }
  .crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
  }
  .crumbs a { font-weight: 500; }
  .crumbs a:hover { color: var(--accent); }
  .crumbs b { color: var(--ink); font-weight: 600; }
  .crumbs .mi { font-size: 15px; color: var(--muted-2); }
  .notes-hero.is-compact { margin-bottom: 18px; }
  .notes-hero.is-compact h1 { font-size: clamp(38px, 5vw, 56px); margin-bottom: 0; }
  .notes-search .notes-find { margin-bottom: 18px; }
  .nsr-chips { margin-bottom: 8px; }
  .nsr-chips .filter-chip { padding: 6px 12px; font-size: 12.5px; }
  .nsr-sum { margin: 6px 0 22px; font-size: 13.5px; color: var(--muted); }
  .nsr-group { margin-bottom: 30px; }
  .nsr-group .section-h { margin-bottom: 10px; }
  .nsr-group .right-actions a { display: inline-flex; align-items: center; gap: 5px; }
  .nsr-start { margin-top: 36px; }
  .notes-search .soon-block { margin-top: 8px; }

  /* Строка выдачи: вид, заголовок с описанием, раздел и номера. */
  .nrows {
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .nrows li + li { border-top: 1px solid var(--border); }
  .nrow {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    min-width: 0;
    transition: background 0.15s;
  }
  .nrow:hover { background: var(--surface-2); }
  .nrow-kind {
    flex: none;
    width: 72px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-2);
  }
  .nrow-kind.is-conspect { color: var(--accent); }
  .nrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .nrow-main b {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
  }
  .nrow:hover .nrow-main b { color: var(--accent-700); }
  .nrow-about {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nrow-side { flex: none; display: flex; align-items: center; gap: 10px; max-width: 40%; }
  .nrow-part {
    min-width: 0;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nrow .ege-pill {
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--accent-50);
    color: var(--accent-700);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .nrow .ege-pill.oge { background: var(--blue-soft); color: var(--blue); }
  mark {
    background: var(--yellow-soft);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
  }

  /* ---------- предметы ---------- */
  .subjects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 44px;
  }
  .subject-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
  }
  .subject-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
  }
  .subject-card .ic {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: "Instrument Serif", serif;
    font-style: italic;
    font-size: 22px;
    margin-bottom: 14px;
  }
  .subject-card h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 4px;
  }
  /* Разделы строкой: у математики их девять, и во всю длину они
     растянули бы карточку выше соседних. */
  .subject-card .meta {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .subject-card .stats {
    display: flex;
    gap: 16px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .subject-card .st { display: flex; flex-direction: column; }
  .subject-card .st .v {
    font-family: "Instrument Serif", serif;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
  }
  .subject-card .st .l {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    margin-top: 4px;
  }
  .subject-card .arrow {
    position: absolute;
    top: 20px; right: 20px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--ink-2);
    transition: all 0.2s;
  }
  .subject-card:hover .arrow {
    background: var(--ink);
    color: white;
    transform: rotate(-45deg);
  }

  /* ---------- карточка конспекта ---------- */
  .topics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  .topic-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px 14px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .topic-card:hover {
    border-color: var(--accent-100);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
  .topic-card .top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 9px;
  }
  .topic-card .num-l {
    font-family: "Instrument Serif", serif;
    font-style: italic;
    font-size: 24px;
    line-height: 0.85;
    color: var(--accent);
    flex-shrink: 0;
  }
  .topic-card .kick {
    min-width: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topic-card .top-right {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* Не моноширинный: в Geist Mono нет знака «№», и браузер подставляет
     чужой, похожий на «₽». */
  .topic-card .ege-pill {
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--accent-50);
    color: var(--accent-700);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .topic-card .ege-pill.oge { background: var(--blue-soft); color: var(--blue); }
  .topic-card h3 {
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--ink);
    margin-bottom: 5px;
  }
  .topic-card .preview {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .topic-card .foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11.5px;
    color: var(--muted);
  }
  .topic-card .foot .item { display: inline-flex; align-items: center; gap: 4px; }
  .topic-card .diff { display: inline-flex; gap: 2px; margin-left: auto; }
  .topic-card .diff i {
    width: 4px; height: 8px;
    border-radius: 99px;
    background: var(--surface-3);
  }
  .topic-card .diff i.on { background: var(--accent); }
  .sr {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* ---------- мобильный ---------- */
  @media (max-width: 1100px) {
    .subjects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 760px) {
    .page.notes { padding-top: 24px; }
    .subjects-grid, .topics-grid { grid-template-columns: 1fr; }
    .notes-find { padding: 6px; gap: 6px; margin-bottom: 32px; }
    .notes-find-in { padding: 0 12px; }
    .notes-find .btn { padding: 12px 16px; }
    .nsr-chips {
      flex-wrap: nowrap;
      overflow-x: auto;
      margin-left: -18px;
      margin-right: -18px;
      padding: 0 18px 4px;
      scrollbar-width: none;
    }
    .nsr-chips::-webkit-scrollbar { display: none; }
    .nsr-chips .filter-chip { flex: none; white-space: nowrap; }
    .nrow { flex-wrap: wrap; row-gap: 4px; padding: 11px 14px; }
    .nrow-kind { width: 100%; }
    .nrow-side { max-width: 100%; }
    .nsr-group .section-h { flex-wrap: wrap; gap: 4px; }
    .nsr-start { flex-direction: column; gap: 4px; }
  }
