/* =====================================================================
   Articles (the blog) — static/blog/articles.css

   Loaded by templates/blog/post_list.html, post_detail.html and
   user_posts.html after ctg-ui.css and community.css, with ?v={{ cm_v }}.
   The pages are `main.ctg.cm.art`: ctg-ui gives the components, community.css
   the member chips, empty state and counts, and this file only the layout of
   an article list and an article. Tokens from ctg-ui only, logical
   properties, every class `art-`, every selector under `.art`.
   ===================================================================== */

/* The Community's navigation above a narrow reading column (members). */
.art .art-navwrap { padding-block-end: 0; }
.art .art-after-nav { padding-block-start: 0; }

/* ---------- List ------------------------------------------------------- */
.art .art-head { margin-block-end: 18px; }
.art .art-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  max-width: 560px; margin: 0 0 16px;
}
.art .art-search input {
  flex: 1 1 auto; min-width: 0; height: 42px;
  padding-block: 8px; padding-inline: 40px 14px;
  border-radius: 999px; background-color: var(--surface);
}
.art .art-search__icon {
  position: absolute; inset-inline-start: 15px; inset-block-start: 50%;
  transform: translateY(-50%); color: var(--text-3); font-size: 14px; pointer-events: none;
}
.art .art-search .btn { flex: none; border-radius: 999px; }
.art .art-results { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 14px; font-size: 14px; color: var(--text-2); }
.art .art-results a { color: var(--primary); font-weight: 700; }
.art .art-results a:hover { text-decoration: underline; }

.art .art-list { display: flex; flex-direction: column; gap: 14px; }
.art .art-card {
  display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.art .art-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.art .art-card--media { grid-template-columns: 240px minmax(0, 1fr); }
.art .art-card__media { display: block; background: var(--surface-2); min-height: 100%; }
.art .art-card__media img { display: block; width: 100%; height: 100%; min-height: 170px; object-fit: cover; }
.art .art-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; min-width: 0; }
.art .art-card__title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.015em; line-height: 1.35; }
.art .art-card__title a { color: var(--text); }
.art .art-card__title a:hover { color: var(--primary); }
/* The whole card is a target without nesting links: the title's link
   stretches over it, and the real links inside sit above that layer. */
.art .art-card { position: relative; }
.art .art-card__title a::after { content: ""; position: absolute; inset: 0; }
.art .art-card .cm-chip a, .art .art-card .art-stat, .art .art-card__media { position: relative; z-index: 1; }
.art .art-card__excerpt {
  margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.art .art-card__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  margin-block-start: auto; padding-block-start: 10px; border-block-start: 1px solid var(--surface-3);
}
.art .art-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.art .art-tags .cm-pill { height: 24px; font-size: 12px; }
.art .art-stats { display: inline-flex; align-items: center; gap: 14px; margin-inline-start: auto; }
.art .art-stat {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650;
  color: var(--text-3); font-variant-numeric: tabular-nums;
}
.art a.art-stat:hover { color: var(--primary); }

.art .art-pages { display: flex; justify-content: center; margin-block-start: 22px; }
.art .art-pages .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0; }

.art .art-join {
  display: flex; align-items: center; gap: 14px; margin-block-start: 22px;
}
.art .art-join > div { flex: 1 1 auto; min-width: 0; }
.art .art-join .cm-panel__title { margin-block-end: 2px; }
.art .art-join .btn { flex: none; }

/* ---------- One article --------------------------------------------------- */
.art .backlink { margin-block-end: 14px; }
.art .art-article {
  padding: 26px 30px 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.art .art-article > .cm-notice:first-child { margin-block-start: 0; }
.art .art-article > .cm-notice { margin-block-end: 16px; }
.art .art-article__head { display: flex; flex-direction: column; gap: 12px; }
.art .art-article__title {
  margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; color: var(--text);
  overflow-wrap: anywhere;
}
.art .art-article__meta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  padding-block-end: 16px; border-block-end: 1px solid var(--surface-3);
}
.art .art-article__cover {
  margin: 20px 0 0; overflow: hidden; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
}
.art .art-article__cover img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: cover; }
.art .art-article__body { margin-block-start: 20px; font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.art .art-article__body img { max-width: 100%; height: auto; }
.art .art-article__body iframe { max-width: 100%; }
.art .art-article__body table { display: block; max-width: 100%; overflow-x: auto; }
.art .art-article__actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  margin-block-start: 20px; padding-block-start: 14px; border-block-start: 1px solid var(--surface-3);
}

/* Poll */
.art .art-poll {
  margin-block-start: 26px; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border);
}
.art .art-poll__q {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.35;
}
.art .art-poll__q .ti { flex: none; width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.art .art-poll__results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.art .art-poll__label { display: flex; align-items: baseline; gap: 8px; margin-block-end: 6px; font-size: 14.5px; }
.art .art-poll__text { font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.art .art-poll__pct { margin-inline-start: auto; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-2); }
.art .art-poll__row.is-mine .art-poll__pct { color: var(--green); }
.art .art-poll__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 14px 0 0; font-size: 13px; color: var(--text-3); }
.art .art-poll__foot a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.art .art-poll__form fieldset { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.art .art-poll__option {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  font-size: 14.5px; font-weight: 650; color: var(--text);
  transition: border-color .12s var(--ease), background .12s var(--ease);
}
.art .art-poll__option:hover { border-color: var(--border-2); }
.art .art-poll__option:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.art .art-poll__option input { flex: none; margin: 0; }
.art .art-poll__static { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 14.5px; color: var(--text-2); }

/* Comments */
.art .art-comments {
  margin-block-start: 18px; padding: 22px 26px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.art .art-comments__title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
  font-size: 19px; font-weight: 800; letter-spacing: -.015em;
}
.art .art-comment-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; }
.art .art-comment { padding-block: 14px; border-block-start: 1px solid var(--surface-3); scroll-margin-block-start: 84px; }
.art .art-comment:first-child { border-block-start: 0; padding-block-start: 0; }
.art .art-comment:target { background: var(--primary-50); margin-inline: -12px; padding-inline: 12px; border-radius: var(--r); }
.art .art-comment--hidden { opacity: .85; }
.art .art-comment .cm-notice { margin-block: 8px 0; }
.art .art-comment__text {
  margin-block-start: 8px; padding-inline-start: 40px;
  font-size: 15px; line-height: 1.62; color: var(--text); overflow-wrap: anywhere;
}
.art .art-comment__actions { display: flex; gap: 2px; margin-block-start: 4px; padding-inline-start: 32px; }
.art .art-comment__note {
  display: flex; align-items: baseline; gap: 8px; margin: 8px 0 0; padding-inline-start: 40px;
  font-size: 13px; line-height: 1.5; color: var(--text-3);
}
.art .art-comment__note a { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.art .art-comments__empty { margin: 0 0 16px; font-size: 14px; color: var(--text-3); }
.art .art-comment-form { padding-block-start: 16px; border-block-start: 1px solid var(--surface-3); }
.art .art-comment-form textarea { width: 100%; min-height: 104px; }
.art .art-comment-form__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
}
.art .art-small { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.art .art-small a { color: var(--primary); font-weight: 650; text-decoration: underline; }
.art .art-error { margin: 6px 0 0; font-size: 13px; font-weight: 650; color: var(--rose); }
.art .art-join--comments { margin-block-start: 4px; box-shadow: none; background: var(--surface-2); }

/* My articles / one author */
.art .ctg-wrap > .cm-notice { margin-block: 0 16px; }
.art .art-rows { margin: 0; padding: 0; list-style: none; }
.art .art-rows .rowitem__title { font-weight: 750; color: var(--text); }
.art .art-rows .rowitem__title:hover { color: var(--primary); }

@media (max-width: 760px) {
  .art .art-card--media { grid-template-columns: minmax(0, 1fr); }
  .art .art-card__media img { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
  .art .art-card__body { padding: 16px; }
  .art .art-card__title { font-size: 17.5px; }
  .art .art-article { padding: 18px 16px; }
  .art .art-article__title { font-size: 25px; }
  .art .art-article__body { font-size: 16px; }
  .art .art-comments { padding: 18px 16px; }
  .art .art-comment__text, .art .art-comment__note { padding-inline-start: 0; }
  .art .art-comment__actions { padding-inline-start: 0; margin-inline-start: -8px; }
  .art .art-join { flex-wrap: wrap; }
  .art .art-join .btn, .art .art-comment-form__foot .btn { width: 100%; justify-content: center; }
  .art .art-search .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .art .art-card, .art .art-poll__option { transition: none; }
}
