/* collect.css — layout for collect.html only. Shared rules (tokens, nav, the
   Japanese gothic stack, .hl/.ul, alignment) come from styles.css and
   posts/post.css; nothing from those files is repeated here. */

.collect {
  max-width: var(--post-maxw);
  margin: 0 auto;
  padding: clamp(44px, 7vh, 80px) var(--pad) 90px;
  position: relative; z-index: 1;
}
.collect-head .post-title { margin-bottom: 16px; }
.collect-head .post-standfirst { margin-bottom: 30px; }

/* Author display rules (grid, block) would otherwise beat the browser's own
   [hidden] { display: none }, which is how the editor showed up for readers. */
.collect [hidden], .collect-dialog[hidden] { display: none !important; }

/* tabs + tools row */
.collect-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.collect-tabs { display: flex; gap: 26px; }
.collect-tabs button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); padding: 10px 0 12px; position: relative;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.collect-tabs button .count { color: var(--muted); font-size: 10.5px; margin-left: 6px; letter-spacing: 0.06em; }
.collect-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.collect-tabs button:hover { color: var(--fg); }
.collect-tools { display: flex; gap: 14px; align-items: center; padding-bottom: 10px; }
.collect-tools input[type="search"] {
  font: inherit; font-family: var(--font-mono); font-size: 13px;
  color: var(--fg); background: transparent; border: 0;
  border-bottom: 1px solid var(--line-soft); padding: 6px 2px; width: 200px; outline: none;
  -webkit-appearance: none; appearance: none; border-radius: 0;
}
.collect-tools input[type="search"]:focus { border-bottom-color: var(--fg); }
.collect-tools input::placeholder { color: var(--muted); }
.collect-btn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--line-soft); padding: 7px 12px; color: var(--fg);
  transition: border-color 0.2s, background 0.2s, color 0.2s; white-space: nowrap;
}
.collect-btn:hover { border-color: var(--fg); }
.collect-btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.collect-btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.collect-btn.quiet { border-color: transparent; color: var(--muted); padding-left: 6px; padding-right: 6px; }
.collect-btn.quiet:hover { color: var(--fg); }
.collect-btn.danger:hover { border-color: var(--warn); color: var(--warn); }
.collect-btn[disabled] { opacity: 0.45; pointer-events: none; }
.collect-btn.editing { border-color: var(--accent); color: var(--accent-ink); }

/* tag filter row */
.collect-tags { display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 18px 0 6px; font-family: var(--font-mono); font-size: 11.5px; }
.collect-tags:empty { display: none; }
.collect-tags button {
  padding: 3px 10px; border: 1px solid var(--line-soft); color: var(--muted);
  letter-spacing: 0.02em; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.collect-tags button .n { color: var(--muted); margin-left: 5px; font-size: 10px; }
.collect-tags button:hover { border-color: var(--fg); color: var(--fg); }
.collect-tags button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.collect-tags button[aria-pressed="true"] .n { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* lists */
.collect-list { list-style: none; margin: 14px 0 0; padding: 0; }
.collect-item {
  display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 6px 26px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--line-soft);
}
.collect-item .when {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); padding-top: 5px;
  white-space: nowrap;
}
.collect-item .main { min-width: 0; }
.collect-item .memo { font-family: var(--font-serif); font-size: 17px; line-height: 1.5; }
.collect-item .memo a { color: inherit; border-bottom: 1px solid var(--line-soft); transition: border-color 0.2s, color 0.2s; }
.collect-item .memo a:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.collect-item .meta {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
  margin-top: 7px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; color: var(--muted);
}
.collect-item .meta a.host { color: var(--muted); }
.collect-item .meta a.host:hover { color: var(--accent-ink); }
.collect-item .tag { border: 1px solid var(--line-soft); padding: 1px 7px; }
.collect-item .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 3px; }
.collect-item .arrow-glyph { color: var(--accent); font-size: 15px; }
.collect-item .row-actions { display: flex; gap: 6px; }

/* the "this has a blog post" mark: the same filled accent block the site
   uses for its strongest pill, .pub-tag.intl */
.blog-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: 4px 9px; white-space: nowrap;
  transition: background 0.2s;
}
.blog-pill:hover { background: var(--fg); color: var(--bg); }
.collect-item.has-blog { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%); }

/* papers */
.collect-item.paper { grid-template-columns: 64px minmax(0, 1fr) auto; padding: 14px 0; }
.collect-item.paper .memo { font-size: 16px; line-height: 1.45; }
.collect-item.paper .authors { font-family: var(--font-sans); font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.collect-item.paper .venue { font-style: italic; font-family: var(--font-serif); color: var(--fg); font-size: 12px; letter-spacing: 0; }
.collect-item .hot { color: var(--accent); letter-spacing: 0.1em; }
.collect-item .read { color: var(--muted); }

.collect-empty, .collect-note {
  font-size: 14.5px; line-height: 1.7; color: var(--muted); margin: 26px 0 0;
}
.collect-note { margin: 16px 0 0; }
.collect-more { margin: 28px auto 0; display: block; }
.collect-status {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  background: var(--fg); color: var(--bg); padding: 9px 16px; z-index: 120;
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; max-width: min(92vw, 560px);
}
.collect-status.on { opacity: 1; visibility: visible; }
.collect-status.err { background: var(--warn); color: #fff; }

/* editor card */
.collect-editor {
  border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent);
  padding: 22px 24px 18px; margin: 22px 0 6px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 22px;
}
.collect-editor .full { grid-column: 1 / -1; }
.collect-editor label {
  display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.collect-editor input, .collect-editor textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line-soft); padding: 6px 0; outline: none; border-radius: 0;
  font-family: var(--font-serif);
}
.collect-editor input.mono { font-family: var(--font-mono); font-size: 13px; }
.collect-editor textarea { resize: vertical; min-height: 48px; line-height: 1.5; }
.collect-editor input:focus, .collect-editor textarea:focus { border-bottom-color: var(--fg); }
.collect-editor .actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.collect-editor .hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; margin-left: auto; }

/* modal (password / connect / change password) */
.collect-dialog {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--fg) 40%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.collect-dialog[hidden] { display: none; }
.collect-dialog .card {
  width: min(460px, 100%); background: var(--bg); border: 1px solid var(--line);
  padding: 30px 30px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
.collect-dialog h2 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; letter-spacing: -0.01em; margin-bottom: 8px; }
.collect-dialog p { font-size: 14px; line-height: 1.65; color: var(--muted); margin-bottom: 16px; }
.collect-dialog p.err { color: var(--warn); }
.collect-dialog label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.collect-dialog input {
  width: 100%; font: inherit; font-family: var(--font-mono); font-size: 14px; color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line-soft); padding: 8px 0; outline: none; border-radius: 0;
}
.collect-dialog input:focus { border-bottom-color: var(--fg); }
.collect-dialog .actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.collect-dialog .actions .link { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; border-bottom: 1px solid var(--line-soft); }
.collect-dialog .actions .link:hover { color: var(--fg); }
.collect-dialog ol { font-size: 13.5px; line-height: 1.7; color: var(--muted); padding-left: 20px; margin-bottom: 8px; }
.collect-dialog ol code, .collect-dialog p code { font-family: var(--font-mono); font-size: 0.86em; background: rgba(10, 10, 10, 0.05); border: 1px solid var(--line-soft); padding: 1px 5px; }
[data-theme="dark"] .collect-dialog code { background: rgba(245, 245, 240, 0.07); }

/* Japanese chrome and memos run in gothic, headings stay mincho (site rule) */
[data-lang="ja"] .collect .post-standfirst,
[data-lang="ja"] .collect-item .memo,
[data-lang="ja"] .collect-empty,
[data-lang="ja"] .collect-note,
[data-lang="ja"] .collect-dialog p,
[data-lang="ja"] .collect-dialog ol,
[data-lang="ja"] .collect-editor input,
[data-lang="ja"] .collect-editor textarea { font-family: var(--font-jp-sans); }

@media (max-width: 700px) {
  .collect { padding-bottom: 70px; }
  .collect-bar { align-items: stretch; }
  .collect-tools { width: 100%; justify-content: space-between; }
  .collect-tools input[type="search"] { flex: 1 1 auto; width: auto; }
  .collect-item, .collect-item.paper { grid-template-columns: minmax(0, 1fr) auto; }
  .collect-item .when { grid-column: 1 / -1; padding-top: 0; }
  .collect-item .memo { font-size: 15.5px; }
  .collect-item.paper .memo { font-size: 15px; }
  .collect-editor { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 14px; }
  .collect-editor .hint { margin-left: 0; }
  .collect-dialog .card { padding: 24px 20px; }
}
