/* ============================================================================
   ATLAS REDESIGN — Vault Notes (Obsidian) screen styles  ·  Phase 2
   Branch: atlas-redesign-2026-06-29

   Prefix: .rd-obsidian-notes. Tokens only (--r-*) so Calm (almanac) + Operator
   themes both work automatically. No hardcoded hex. Theme-specific selectors
   (html[data-rtheme="operator"] …) only where a token can't express the tweak.

   DATA: Obsidian vault is NOT reachable from the browser fetcher layer, so this
   screen renders an honest "vault not connected" empty state + em-dashes. Mock
   note titles / excerpts / counts / timestamps from the handoff are NEVER copied.
   ========================================================================== */

.rd-obsidian-notes {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- page header --------------------------------------------------------- */
.rd-vn-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-vn-eyebrow {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-vn-h1 {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--r-ink);
  margin: 0;
}
.rd-vn-sub {
  margin: 2px 0 0;
  font-size: var(--r-fs-body);
  line-height: 1.5;
  color: var(--r-muted);
  max-width: 640px;
}

/* ---- main grid (recent notes | vault) ------------------------------------ */
.rd-vn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); /* minmax kills the auto-min blowout at narrow widths */
  gap: 20px;
  align-items: start;
  min-height: 0;
}

/* shared card chrome */
.rd-vn-card {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rd-vn-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.rd-vn-card-title {
  margin: 0;
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h2);
  font-weight: 600;
  color: var(--r-ink);
}
.rd-vn-card-meta {
  font-size: var(--r-fs-meta);
  color: var(--r-faint);
  white-space: nowrap;
}

/* ---- recent notes list --------------------------------------------------- */
.rd-vn-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  overflow: auto;
  max-height: calc(100vh - 320px);
}
.rd-vn-row {
  display: flex;
  gap: 11px;
  padding: 12px 6px;
  border-top: 1px solid var(--r-hairline);
  border-radius: 10px;
  transition: background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-vn-row:first-child { border-top: none; }
.rd-vn-row[tabindex] { cursor: pointer; }
.rd-vn-row[tabindex]:hover {
  background: var(--r-canvas-raised);
  box-shadow: var(--r-shadow-hover);
  transform: translateY(-2px);
}
.rd-vn-row[tabindex]:hover .rd-vn-row-icon { color: var(--r-primary); }
.rd-vn-row[tabindex]:active { transform: translateY(0); box-shadow: none; }
.rd-vn-row:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-vn-row-icon {
  flex: 0 0 auto;
  font-size: 16px;
  color: var(--r-muted);
  margin-top: 2px;
  transition: color var(--r-dur) var(--r-ease);
}
.rd-vn-row-body {
  flex: 1 1 auto;
  min-width: 0;
}
.rd-vn-row-path {
  font-size: 13px;
  font-weight: 600;
  color: var(--r-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-vn-row-excerpt {
  font-size: 12px;
  line-height: 1.45;
  color: var(--r-muted);
}
.rd-vn-row-time {
  flex: 0 0 auto;
  font-family: var(--r-font-mono);
  font-size: 12px;
  color: var(--r-faint);
  white-space: nowrap;
  align-self: flex-start;
}

/* honest empty / not-connected state (house pattern: icon badge + title + subtext).
   Neutral well/muted tone — "not connected" is informational, not a good/bad state,
   so this deliberately does NOT reuse the mint "all clear" treatment. */
.rd-vn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 16px;
  margin-top: 10px;
  border: 1px dashed var(--r-border);
  border-radius: var(--r-radius-control);
}
.rd-vn-empty-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 12px;
  background: var(--r-well);
  color: var(--r-muted);
  font-size: 21px;
}
.rd-vn-empty-t { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--r-ink); }
.rd-vn-empty-s { margin: 6px 0 0; max-width: 320px; font-size: 12px; line-height: 1.55; color: var(--r-muted); }
@media (prefers-reduced-motion: no-preference) {
  .rd-vn-empty-ic { animation: rdVnEmptyIn .4s var(--r-ease) both; }
}
@keyframes rdVnEmptyIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }

/* ---- vault status card --------------------------------------------------- */
.rd-vn-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 13px;
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: 11px;
}
.rd-vn-status[data-state="synced"] { background: var(--r-mint-surface); border-color: transparent; }
.rd-vn-status-icon { font-size: 17px; color: var(--r-muted); flex: 0 0 auto; }
.rd-vn-status[data-state="synced"] .rd-vn-status-icon { color: var(--r-primary); }
.rd-vn-status-body { min-width: 0; }
.rd-vn-status-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--r-body);
}
.rd-vn-status[data-state="synced"] .rd-vn-status-title { color: var(--r-mint-ink); }
.rd-vn-status-sub {
  font-size: 12px;
  color: var(--r-muted);
}
.rd-vn-status[data-state="synced"] .rd-vn-status-sub { color: var(--r-primary-2); }

/* categories */
.rd-vn-cats-label {
  font-family: var(--r-font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--r-faint);
  margin: 16px 0 8px;
}
.rd-vn-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.rd-vn-cat {
  font-size: 12px;
  color: var(--r-body);
  background: var(--r-surface-2);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-badge);
  padding: 5px 10px;
}
.rd-vn-cat-count {
  font-family: var(--r-font-mono);
  color: var(--r-faint);
}
.rd-vn-cats-empty {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  color: var(--r-faint);
}

/* ---- entrance motion (respects reduced-motion) ------------------------------ */
.rd-vn-card { animation: rdVnCardIn .28s var(--r-ease); }
@keyframes rdVnCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rd-vn-card, .rd-vn-empty-ic { animation: none; }
  .rd-vn-row[tabindex]:hover { transform: none; }
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-vn-grid { grid-template-columns: minmax(0, 1fr); }
  .rd-vn-list { max-height: 52vh; }
}
@media (max-width: 720px) {
  .rd-vn-cats { gap: 6px; }
}
