/* WeChat article lists - the portal page and the search page.

   Both used to be a six-column table. The title is the only long value and the
   only one anybody reads, yet it shared the width with a 公众号 column that
   repeated one name down a portal page and a 来源 column holding the same word in
   every one of 55k rows. These are cards: title first at full width, the facts
   under it in one muted line, and the repeated columns gone. */
.wx-page {
  margin: 0 auto;
  max-width: 820px;
  padding: 0 14px;
  text-align: left;
}

.wx-head {
  border-bottom: 1px solid #ddddc8;
  padding-bottom: 10px;
}

.wx-head__title {
  color: #4e0d0d;
  font-size: 1.3em;
}

/* Counts on one muted line under the title, where they describe the column they
   sit above. They used to hang off the left edge of the viewport in a blue box. */
.wx-head__meta {
  color: #8a7a6a;
  font-size: 0.85em;
  margin-top: 4px;
}

.wx-head__meta strong {
  color: #4a7c59;
  font-weight: 600;
}

.wx-head__sep {
  opacity: 0.5;
  padding: 0 6px;
}

/* One bar, box and button joined, across the full column (站长 11-11). The box
   used to stop halfway - a site-wide rule caps every `keyword` input at 540px -
   leaving the button adrift in the middle, in a blue no other control on these
   pages uses. Now it is the green these pages act in. */
.wx-search {
  align-items: stretch;
  display: flex;
  gap: 0;
  padding: 14px 0 6px;
}

/* forms_styling.css dresses every input for a stacked form, padding included
   (with !important). */
.wx-search input[type="search"] {
  background-color: #fff;
  border: 1px solid #cfc9b3;
  border-radius: 22px 0 0 22px;
  border-right: none;
  box-sizing: border-box;
  flex: 1 1 auto;
  font-size: 0.95em;
  height: 44px;
  max-width: none;
  min-width: 0;
  padding: 0 16px 0 18px !important;
  width: 100%;
}

.wx-search input[type="search"]:focus-visible {
  border-color: #4a7c59;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.18);
  outline: none;
}

/* `.styled-button` carries its own vertical padding, which sat the label below
   centre once the bar gave the button a fixed height. */
.wx-search__go {
  align-items: center;
  box-sizing: border-box;
  display: inline-flex;
  flex: none;
  gap: 6px;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding-bottom: 0;
  padding-top: 0;
  white-space: nowrap;
}

.wx-search button.wx-search__go {
  background-color: #4a7c59;
  border: 1px solid #4a7c59;
  border-radius: 0 22px 22px 0;
  color: #fff;
  font-size: 1em;
  margin: 0;
  padding-left: 20px;
  padding-right: 22px;
}

.wx-search button.wx-search__go:hover,
.wx-search button.wx-search__go:focus-visible {
  background-color: #3d6a4a;
  border-color: #3d6a4a;
  color: #fff;
}

/* On a phone the box needs the room more than the button needs its word: the
   magnifier alone, the word still there for screen readers. */
@media (max-width: 480px) {
  .wx-search button.wx-search__go {
    font-size: 0;
    gap: 0;
    padding-left: 16px;
    padding-right: 18px;
  }

  .wx-search button.wx-search__go i {
    font-size: 17px;
  }
}

/* 重置 beside the bar, not welded to it. */
.wx-search a.wx-search__go {
  margin-left: 10px;
}

.wx-facets {
  padding: 4px 0 10px;
}

.wx-facets__row {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px 0;
}

.wx-facets__label {
  color: #8a8a78;
  flex: none;
  font-size: 0.82em;
  width: 2.6em;
}

/* Name first, count second and quieter: you read the year, then check the number. */
.wx-chip small {
  opacity: 0.7;
  padding-left: 3px;
}

.wx-cards {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wx-card {
  background-color: #fff;
  border: 1px solid #d9d9c6;
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 12px 16px;
  transition: border-color 0.15s;
}

/* With a picture from the post: the text beside it, the picture at the right
   edge at a fixed 4:3, so a row of cards keeps one rhythm whatever the post's
   picture is shaped like. */
.wx-card--pic {
  align-items: flex-start;
  display: flex;
  gap: 16px;
}

.wx-card__text {
  flex: 1 1 auto;
  min-width: 0;
}

.wx-card__pic {
  aspect-ratio: 4 / 3;
  background: #f2efe4;
  border-radius: 8px;
  flex: none;
  overflow: hidden;
  width: 128px;
}

.wx-card__pic img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* The post's opening lines: two of them, quieter than the title, enough to say
   what it is about without turning the list into the articles. */
.wx-card__summary {
  -webkit-box-orient: vertical;
  color: #5f5a4e;
  display: -webkit-box;
  font-size: 0.9em;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.65;
  margin: 4px 0 0;
  overflow: hidden;
}

.wx-card__summary mark {
  background-color: var(--highlight-search);
  color: inherit;
  padding: 0 1px;
}

/* What the 公众号 says it is, under its name on its own page. */
.wx-head__desc {
  color: #6b6455;
  font-size: 0.9em;
  line-height: 1.6;
  margin: 6px 0 0;
}

.wx-card:hover {
  border-color: #b9b9a0;
}

.wx-card__title {
  color: #1a5276;
  display: block;
  font-size: 1.02em;
  line-height: 1.5;
  text-decoration: none;
}

.wx-card__title:hover {
  text-decoration: underline;
}

.wx-card__title mark {
  background-color: var(--highlight-search);
  color: inherit;
  padding: 0 1px;
}

.wx-card__audio {
  color: #4a7c59;
  font-size: 0.8em;
  margin-left: 8px;
  vertical-align: middle;
}

/* One line of facts, wrapping rather than widening: a date, the account where it
   varies, and the way out to the original. */
.wx-card__meta {
  align-items: baseline;
  color: #8a8a78;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82em;
  gap: 4px 14px;
  padding-top: 4px;
}

.wx-card__date {
  flex: none;
}

.wx-card__portal,
.wx-card__link {
  color: #4a7c59;
  text-decoration: none;
}

.wx-card__portal:hover,
.wx-card__link:hover {
  text-decoration: underline;
}

.wx-card__link-icon {
  font-size: 0.85em;
  margin-left: 4px;
  opacity: 0.7;
}

/* Admin-only. The sync state was a True/False cell in a column of its own; it is
   a state, so it reads as a word and only stands out when something is missing. */
.wx-card__sync {
  color: #4a7c59;
}

.wx-card__sync--off {
  color: #a15c3e;
}

.wx-card__delete {
  margin-left: auto;
}

.wx-empty {
  background-color: #fff;
  border: 1px dashed #d0d0ba;
  border-radius: 10px;
  list-style: none;
  padding: 26px 18px;
  text-align: center;
}

.wx-empty__lead {
  color: #6f6f5e;
  font-size: 1.02em;
  margin: 0;
}

.wx-empty__hint {
  color: #9a9a88;
  font-size: 0.85em;
  margin: 6px 0 12px;
}

@media screen and (max-width: 600px) {
  .wx-facets__label {
    width: auto;
  }

  /* Years on one line that scrolls sideways, as 堪布微博's rows do. */
  .wx-facets__row {
    align-items: center;
    flex-wrap: nowrap;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
    overflow-x: auto;
    padding-right: 24px;
    scrollbar-width: none;
  }

  .wx-facets__row::-webkit-scrollbar {
    display: none;
  }

  .wx-facets__row .wx-chip {
    flex: none;
  }

  .wx-card--pic {
    gap: 12px;
  }

  .wx-card__pic {
    width: 96px;
  }

  .wx-card__summary {
    font-size: 0.86em;
  }
}

/* The portal directory is a grid of cards, not a reading column, so it gets the
   full width the grid can use. */
.wx-page--wide {
  max-width: 1160px;
}

/* The box on that page searches articles and lands on another page; say so once,
   quietly, rather than letting the reader find out by pressing Enter. */
.wx-search__hint {
  color: #a5a593;
  font-size: 0.78em;
  margin: 4px 0 0;
}

/* The title and the reader's own collections on one line: 我的文章收藏夹 and
   高亮笔记 sit beside the lists they collect from, the way 我的佛词典收藏夹 sits
   on 佛词典 (dict.css), in the green these pages use for anything you act on. */
.wx-head__row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.wx-head__mine {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.wx-mine-btn {
  background-color: #4a7c59;
  border-radius: 12px;
  color: #fff;
  font-size: 0.85em;
  padding: 4px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.wx-mine-btn:hover {
  background-color: #3d6a4a;
  color: #fff;
}

.wx-mine-btn[hidden] {
  display: none;
}

.wx-mine-btn--quiet {
  background-color: #f3f0e4;
  border: 1px solid #ddd8c4;
  color: #4a7c59;
}

.wx-mine-btn--quiet:hover {
  background-color: #fff;
  color: #4a7c59;
}

.wx-mine-btn__n {
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.88em;
  margin-left: 4px;
  padding: 0 6px;
}

.wx-card__saved {
  color: #9a8f7c;
}

.wx-card__unsave {
  display: inline;
  margin: 0;
}

.wx-card__unsave-btn {
  background: none;
  border: none;
  color: #a0523d;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.wx-card__unsave-btn:hover {
  text-decoration: underline;
}

/* 公众号选读 and 学习资料 as two cards under the header, not two more words in
   the muted count line where nobody saw them (站长 11-11). Side by side on a
   wide screen, stacked on a phone. */
.wx-entries {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding-top: 10px;
}

.wx-entry {
  align-items: center;
  border: 1px solid #e3dece;
  border-radius: 6px;
  color: inherit;
  display: flex;
  gap: 8px;
  padding: 5px 10px;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.wx-entry:hover,
.wx-entry:focus-visible {
  background-color: #f4f1e6;
  border-color: #c9c2a8;
  color: inherit;
}

.wx-entry__icon {
  color: #7a9a82;
  flex: none;
  font-size: 0.9em;
  text-align: center;
  width: 1.2em;
}

.wx-entry__body {
  align-items: baseline;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0 8px;
  min-width: 0;
}

.wx-entry__title {
  color: #4e0d0d;
  font-size: 0.92em;
  font-weight: 500;
}

.wx-entry__desc {
  color: #9a8c7c;
  font-size: 0.78em;
}

.wx-entry__go {
  color: #b5ab96;
  flex: none;
  font-size: 1.1em;
  line-height: 1;
}
