/* 물밑 노트 목록(/notes) — 글마다 카드 한 장, 카드 머리에 그 글의 대표 그림.
 *
 * 운영자 2026-10-15: "여기 디자인 너무 심플하다 이미지도없고" → 처음에는 좌표만 가진 인라인 SVG를
 * 그렸다. 2026-10-19 운영자가 토스뱅크 금융용어집을 보여 주며 "글과 사진을 적절히 섞어서" 만들자고 해,
 * 글마다 이미지 모델이 그린 3D 일러스트(글자·숫자·로고 없음, `notes/img/{slug}.webp`)를 글 머리와
 * 이 카드에 함께 쓴다. 그림은 장식이라 alt를 비운다 — 카드의 뜻은 제목이 말한다.
 *
 * 글 링크는 제목 하나뿐이고 카드 전체로 늘린다(`::after`) — 화면 읽기 프로그램에는 제목만
 * 링크로 읽히고, 목록의 한·영 판에 글마다 링크가 한 번씩이라는 약속(`test_notes.py`)도 그대로다. */

.note-list {
  list-style: none; margin: 0 0 var(--sp-6); padding: 0;
  display: grid; gap: var(--sp-4);
}
@media (min-width: 640px) {
  .note-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.note-list > .note-card { margin: 0; }

.note-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--mo-settle) var(--mo-ease), transform var(--mo-settle) var(--mo-ease);
}

.note-cover {
  aspect-ratio: 1200 / 670; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 5%, var(--bg));
}
.note-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.note-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) var(--sp-5); }
.note-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2);
  margin: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--ink-2);
}
.note-topic { font-weight: 650; color: var(--accent-text, var(--accent)); }
.note-date::before { content: "·"; margin-right: var(--sp-2); color: var(--ink-3); }
.note-card h2 {
  margin: 0; padding: 0; border: 0;
  font-size: var(--fs-lg); line-height: 1.45; letter-spacing: -.01em; font-weight: 700;
  /* 공용 제목의 `balance`는 "after-|hours"처럼 카드 폭의 절반에서 줄을 끊었다. */
  text-wrap: pretty;
}
.note-card h2 a { color: var(--ink); text-decoration: none; }
.note-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.note-summary { margin: 0; font-size: var(--fs-md); line-height: 1.65; color: var(--ink-2); }

@media (hover: hover) {
  .note-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
  .note-card:hover h2 a { color: var(--accent-text, var(--accent)); }
}
.note-card h2 a:focus-visible { outline: none; }
.note-card:has(h2 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .note-card { transition: none; }
  @media (hover: hover) { .note-card:hover { transform: none; } }
}

/* 더 확인하기 — 한 줄에 이름, 그 아래 무엇인지. 줄 전체가 손가락 자리다. */
.note-more { list-style: none; margin: 0 0 var(--sp-4); padding: 0; border-top: 1px solid var(--line); }
.note-more li { position: relative; margin: 0; padding: var(--sp-3) var(--sp-6) var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.note-more li::after {
  content: ""; position: absolute; right: var(--sp-1); top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none;
  background: var(--ink-3); -webkit-mask: var(--ico-caret) center / contain no-repeat; mask: var(--ico-caret) center / contain no-repeat;
}
.note-more a { display: block; font-weight: 650; color: var(--ink); text-decoration: none; }
.note-more a::after { content: ""; position: absolute; inset: 0; }
.note-more span { display: block; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
@media (hover: hover) { .note-more li:hover a { color: var(--accent-text, var(--accent)); } }
.note-more-title { border-top: 0; padding-top: 0; }

/* One lead story, then readable illustrated rows on a phone. */
.notes-index > h1 { margin-bottom: var(--sp-2); }
.notes-index > .doc-lede { margin-bottom: var(--sp-5); font-size: var(--fs-md); line-height: 1.65; text-wrap: pretty; }
#notes-browse:empty { display: none; }
#notes-browse { margin: 0 0 var(--sp-5); }
.notes-browse-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-2); }
.notes-browse-heading [role="status"] { font-variant-numeric: tabular-nums; }
/* 주제 알약(2026-11-03 운영자 "상단 알약 디자인 별로"): 홈 '종목 추가'의 거르개와 같은 꼴 — 36px 알약, 고른 것은 잉크색으로
   차고, 나머지는 가는 테두리. 파란 큰 알약은 화면의 주인공(첫 글)보다 먼저 눈을 끌었다. 줄은 손가락으로 옆으로 민다. */
.notes-topics { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; padding: 5px 2px 9px; scrollbar-width: none; }
.notes-topics::-webkit-scrollbar { display: none; }
.world .notes-topics button, .notes-topics button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; height: 36px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; line-height: 1; box-shadow: none; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.world .notes-topics button[aria-pressed="true"], .notes-topics button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); font-weight: 650; }
.notes-topics button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 알약은 36px로 보이고, 누르는 자리는 위아래로 44px(옆 알약과는 겹치지 않게 옆으로는 늘리지 않는다). */
.notes-topics button::after { content: ""; position: absolute; inset: -4px 0; }
.notes-index .note-list { gap: 0; }
.notes-index .note-card { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.notes-index .note-card[hidden] { display: none; }
.notes-index .note-cover { grid-column: 2; grid-row: 1; border: 0; border-radius: var(--r-md); aspect-ratio: 1; }
.notes-index .note-cover img { object-fit: cover; }
.notes-index .note-body { grid-column: 1; grid-row: 1; min-width: 0; padding: 0; gap: var(--sp-2); }
.notes-index .note-meta { font-size: var(--fs-xs); }
.notes-index .note-date { white-space: nowrap; }
.notes-index .note-card h2 { font-size: 16px; line-height: 1.5; }
.notes-index .note-summary { display: none; }
.notes-index:not([data-topic-selected]) .note-card:first-child { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; margin-bottom: var(--sp-3); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); }
.notes-index:not([data-topic-selected]) .note-card:first-child .note-cover { grid-column: 1; grid-row: 1; border-radius: 0; aspect-ratio: 1200 / 670; }
.notes-index:not([data-topic-selected]) .note-card:first-child .note-body { grid-column: 1; grid-row: 2; padding: var(--sp-4); }
.notes-index:not([data-topic-selected]) .note-card:first-child h2 { font-size: var(--fs-xl); line-height: 1.4; }
.notes-index:not([data-topic-selected]) .note-card:first-child .note-summary { display: block; font-size: var(--fs-sm); }
@media (hover: hover) {
  .notes-index .note-card:hover { transform: none; }
  .notes-topics button:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--ink) 5%, var(--panel)); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
}
@media (min-width: 640px) {
  .notes-topics { flex-wrap: wrap; overflow: visible; }
  .notes-index .note-list { gap: var(--sp-4); }
  .notes-index .note-card { padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
  .notes-index:not([data-topic-selected]) .note-card:first-child { grid-column: 1 / -1; grid-template-columns: 44% minmax(0, 1fr); margin-bottom: 0; }
  .notes-index:not([data-topic-selected]) .note-card:first-child .note-cover { width: 100%; min-width: 0; height: 100%; min-height: 220px; aspect-ratio: auto; }
  .notes-index:not([data-topic-selected]) .note-card:first-child .note-body { grid-column: 2; grid-row: 1; padding: var(--sp-5); }
}
@media (prefers-reduced-motion: reduce) {
  .notes-topics button { transition: none; }
}
