/**
 * notes-card.css — lib primitive: card grid layout для коротких заметок.
 *
 * Extracted from monolith team.css per memory `feedback_no_monolith_css` —
 * каждый visual primitive = свой lib/*.css файл.
 *
 * Task: radar-os--547-notes-mode-unified, block 3050 (⭐ lib-first anchor per
 * CADENCE_HEURISTICS v1.0.2 §5 Q6). Producer of `.notes-grid` + `.note-card`
 * classes consumed by block 3055 render.
 *
 * Reference pattern: training `.prog-grid` + `.prog-card` (radar/team/team.css)
 * — но здесь extracted в lib/ вместо monolith, готово к future reuse
 * (courses / kb-cards / short-text modes).
 *
 * Loaded via radar/team/index.html <link rel="stylesheet"> (block 5004 fix,
 * task radar-os--547 audit-doc hole #3). NOT loaded via manifest.deps.esm —
 * mode_loader._validateDeps (radar/team/src/mode_loader.js:111) requires each
 * esm entry to return content-type=application/javascript, CSS files return
 * text/css and fail validation → mode init skipped → error renderer.
 * All lib CSS primitives follow this pattern (sibling <link> lines in index.html).
 *
 * Structure:
 *   .notes-grid                       — CSS Grid container, responsive 4→3→1 cols
 *   .note-card                        — single note card, badge/text/entity-sub/footer layout
 *   .note-card__badge                 — entity_type label top-left (Контакт/Встреча/Задача)
 *   .note-card__badge--contact        — color variant by entity_type (contact = blue)
 *   .note-card__badge--meeting        — meeting = purple
 *   .note-card__badge--task           — task = green
 *   .note-card__badge--offer          — offer = orange
 *   .note-card__text                  — main body, 3-line clamp
 *   .note-card__entity-sub            — «Клиент Иван» / «Встреча 2026-07-11» attach preview
 *   .note-card__footer                — bottom row: pin icon + relative time
 *   .note-card__pin                   — 📌 icon (visible when is_pinned=1)
 *   .note-card__time                  — «5 мин назад» / «12 июля» relative datetime
 *   .note-card--pinned                — modifier: subtle top border accent когда pinned
 */

/* ============================================================
 * Grid container — responsive breakpoints
 * ============================================================ */

.notes-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 16px 0;
}

/* Tablet: 3 cols cap */
@media (max-width: 1200px) {
  .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Mobile: 1 col */
@media (max-width: 640px) {
  .notes-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 0;
  }
}

/* ============================================================
 * Card container
 * ============================================================ */

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--panel-bg, #0d1828);
  border: 1px solid var(--panel-border, #1a2942);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
  min-height: 120px;
}

.note-card:hover {
  border-color: var(--accent, #3aa7e2);
  transform: translateY(-1px);
}

.note-card--pinned {
  border-top: 2px solid var(--saffron, #F4A300);
}

/* ============================================================
 * Badge — entity_type tag top-left
 * ============================================================ */

.note-card__badge {
  align-self: flex-start;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 999px;
  color: var(--text-secondary, #8a9ab5);
  background: rgba(138, 154, 181, 0.12);
}

.note-card__badge--contact {
  color: #7cc2ff;
  background: rgba(124, 194, 255, 0.14);
}

.note-card__badge--meeting {
  color: #b19cff;
  background: rgba(177, 156, 255, 0.14);
}

.note-card__badge--task {
  color: #7ae0a3;
  background: rgba(122, 224, 163, 0.14);
}

.note-card__badge--offer {
  color: #ffb27a;
  background: rgba(255, 178, 122, 0.14);
}

/* ============================================================
 * Text body — 3 line clamp
 * ============================================================ */

.note-card__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary, #e8edf5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* ============================================================
 * Entity subtitle — «прикреплено к»
 * ============================================================ */

.note-card__entity-sub {
  font-size: 12px;
  color: var(--text-secondary, #8a9ab5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
 * Footer — pin icon + relative time
 * ============================================================ */

.note-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(138, 154, 181, 0.1);
}

.note-card__pin {
  font-size: 13px;
  line-height: 1;
  opacity: 0.85;
}

.note-card__pin--hidden {
  visibility: hidden;
}

.note-card__time {
  font-size: 11px;
  color: var(--text-secondary, #8a9ab5);
}

/* ============================================================
 * Empty state (grid contains только empty placeholder)
 * ============================================================ */

.notes-grid--empty {
  display: block;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary, #8a9ab5);
  font-size: 14px;
}
