/* Community boards, post lists, post content and the post editor (spec 02 §5). */
.board-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -6px 0 24px;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.board-nav a,
.sort-nav a {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: #646e85;
  border-radius: 999px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.board-nav a:hover,
.sort-nav a:hover {
  border-color: #bac1ed;
  color: #303957;
}
.board-nav a[aria-current],
.sort-nav a[aria-current] {
  background: #252b43;
  border-color: #252b43;
  color: #fff;
}
.sort-nav {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}
.sort-nav a {
  padding: 6px 14px;
  font-size: 13px;
}
.pinned-list + .sort-nav {
  margin-top: 22px;
}
.topic-row {
  display: flex;
  gap: 18px;
  align-items: center;
}
.topic-main {
  flex: 1;
  min-width: 0;
}
.topic-tags:not(:empty) {
  margin-bottom: 6px;
}
.thread .topic-tags {
  margin-top: 12px;
}
.page-top [data-action='new-post'] {
  white-space: nowrap;
}
.tag.board-tag {
  color: #4758d9;
  background: #e8ebfc;
}
.tag.pin {
  color: #9a5a00;
  background: #fff1d6;
}
.topic-cover {
  flex: none;
  width: 112px;
  height: 84px;
  border-radius: 12px;
  object-fit: cover;
  background: #e9edf4;
}

/* Post page */
.thread h1.deleted-title {
  color: #8a93a8;
}
.deleted-note {
  font-size: 14px;
}
.post-meta {
  flex-wrap: wrap;
}
.post-meta time,
.post-meta .edited {
  color: #8a93a8;
}
.post-meta .author {
  color: #47516d;
  font-weight: 600;
}
.post-meta .author:hover {
  color: var(--blue);
  text-decoration: underline;
}
.post-owner {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.post-owner a,
.post-owner button {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #47516d;
}
.post-owner button:hover,
.post-owner a:hover {
  border-color: #bac1ed;
}
.thread .post-body {
  white-space: normal;
}
.post-text {
  white-space: pre-wrap;
  color: #47516d;
  line-height: 1.9;
  margin: 0 0 14px;
}
.post-text a {
  color: var(--blue);
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: #fafbff;
  max-width: 560px;
}
.link-card:hover {
  background: #f2f4ff;
}
.link-host {
  font-size: 13px;
  font-weight: 700;
  color: #303957;
}
.link-url {
  font-size: 13px;
  color: #646e85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-images,
.post-works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}
.post-images img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #e9edf4;
}
.work-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.work-card img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 7;
  object-fit: cover;
  background: #171e2b;
}
.work-card figcaption {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 4px;
}
.work-card .badge {
  margin: 0;
}
.work-card b {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.work-entry {
  font-size: 13px;
  font-weight: 650;
  color: var(--blue);
}

/* Post editor */
.post-editor {
  margin: auto;
}
.post-editor select {
  width: 100%;
}
.hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #8a93a8;
  line-height: 1.6;
}
.editor-images,
.editor-works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.editor-images:not(:empty),
.editor-works:not(:empty) {
  margin-bottom: 12px;
}
.editor-thumb,
.work-chip {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.editor-thumb img,
.work-chip img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9edf4;
}
.work-chip figcaption {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.work-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-chip small {
  color: #8a93a8;
}
.editor-thumb button,
.work-chip button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  background: #ffffffe6;
}
.post-editor .add-button {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px dashed #bac1ed;
  border-radius: 10px;
  background: #fafbff;
  color: #4758d9;
  cursor: pointer;
  margin: 0;
}
.post-editor .add-button:hover {
  background: #f0f2ff;
}
.post-editor label.add-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.post-editor label.add-button:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}
.post-editor label.add-button:focus-within {
  outline: 3px solid #a5afff;
  outline-offset: 3px;
}
.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.draft-state {
  font-size: 13px;
  color: #8a93a8;
}
.editor-foot .actions {
  margin-left: auto;
  flex-wrap: wrap;
}
a.button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 19px;
  font-weight: 600;
}
a.button.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  margin: 16px 0;
}
.pick-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  font-size: 13px;
}
.pick-item:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #bec5fa;
}
.pick-item input {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
}
.pick-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9edf4;
}
.pick-item span {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}
.pick-item small {
  color: #8a93a8;
}

@media (max-width: 640px) {
  .topic-cover {
    width: 76px;
    height: 76px;
  }
  .topic-row {
    gap: 12px;
  }
  .post-owner {
    margin-left: 0;
    width: 100%;
  }
  .post-images,
  .post-works {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-foot .actions {
    width: 100%;
  }
  .editor-foot .actions > * {
    flex: 1;
    justify-content: center;
  }
}
