/* TrustUs — /posts/ -----------------------------------------------------------
   The head is the one every page in this family uses; the card is the
   homepage's. What is here is the category row, the lead article, the date and
   the pager. */

.pst-head {
  padding-bottom: clamp(var(--sp-6), 4vw, var(--sp-7));
  /* The shared head ends on --wash, which is right where a --wash section
     follows it. Here the feature below is on white, so the ground walks to
     white instead and the head ends where the next section begins rather than
     on a line across the page. */
  background:
    radial-gradient(130% 95% at 50% 0%,
      rgba(167, 0, 30, .085) 0%,
      rgba(167, 0, 30, .035) 42%,
      rgba(167, 0, 30, 0) 100%),
    var(--paper);
}

/* --- The newest article ----------------------------------------------------
   Above the categories and out of the grid: someone arriving at a blog wants
   the latest thing, not a list of subjects to choose between first. */
.pst-featured { padding-bottom: clamp(var(--sp-6), 4vw, var(--sp-7)); }
.pst-featured__in {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(var(--sp-5), 3vw, var(--sp-7));
  align-items: center;
  padding: clamp(var(--sp-5), 2vw, var(--sp-6));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
}
.pst-featured__media { display: block; line-height: 0; overflow: hidden; border-radius: var(--r-surface); }
.pst-featured__media img {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.pst-featured__in:hover .pst-featured__media img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .pst-featured__media img, .pst-featured__in:hover .pst-featured__media img { transition: none; transform: none; }
}
.pst-featured__flag {
  display: inline-flex;
  color: var(--red); font-weight: 800; font-size: var(--fs-caption);
  margin-bottom: var(--sp-4);
}
.pst-featured__copy h2 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.4; margin: 0 0 var(--sp-3); }
.pst-featured__copy h2 a { color: var(--ink); }
.pst-featured__copy h2 a:hover { color: var(--red); }
.pst-featured__copy p { margin: var(--sp-4) 0 0; color: var(--muted); }
.pst-featured__copy .pst-date { margin-top: var(--sp-5); padding-top: 0; }

/* --- The categories --------------------------------------------------------
   Links to each category's own archive, not a filter in script: the reader
   gets a URL they can send to someone, and it works with no JavaScript. */
.pst-cats { padding-bottom: clamp(var(--sp-6), 4vw, var(--sp-7)); }
/* One line that scrolls rather than a block that wraps: pills of very different
   widths wrapped into a ragged two-row shape, and a row of subjects should be a
   row. It scrolls with the page's own direction and fades at the far end so it
   is visible there is more. */
.pst-cats ul {
  list-style: none; margin: 0; padding: 0 0 var(--sp-3);
  display: flex; flex-wrap: nowrap; gap: var(--sp-3);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to left, #000 88%, transparent);
  mask-image: linear-gradient(to left, #000 88%, transparent);
}
.pst-cats ul::-webkit-scrollbar { display: none; }
.pst-cats li { flex: none; }
.pst-cats a {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  padding: 9px var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: var(--fs-small); font-weight: 700;
  white-space: nowrap;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
/* The count is a qualifier, not a badge: same size as the label, held back. */
.pst-cats a span {
  color: var(--muted); font-weight: 700; font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
  opacity: .8;
}
.pst-cats a:hover { border-color: var(--red-edge); color: var(--red); }
.pst-cats a:hover span { color: var(--red); }
.pst-cats .is-on {
  background: var(--red); border-color: var(--red); color: #fff;
}
.pst-cats .is-on:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }

/* The categories are the list's own heading, so the list starts under them
   rather than a section's worth of air below. `.hp-section` gives every section
   the same rhythm top and bottom; here the top belongs to the row above. */
.pst-list { padding-top: 0; }

/* --- The body: articles, and a column beside them --------------------------
   The side column follows the list down rather than scrolling away from it, and
   stops leading on a phone, where it goes under the articles instead. */
.pst-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: clamp(var(--sp-6), 4vw, var(--sp-8));
  align-items: start;
}
.pst-main { min-width: 0; }

.pst-aside { min-width: 0; }
.pst-aside__block { margin-bottom: clamp(var(--sp-6), 4vw, var(--sp-7)); }
.pst-aside__block:last-child { margin-bottom: 0; }
.pst-aside__block h2 {
  font-size: var(--fs-h4);
  margin: 0 0 var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.pst-aside__block ul { list-style: none; margin: 0; padding: 0; }

/* Scoped to the article lists by a class of their own, not to every list in the
   block. Written the broad way it reached the tags and then the accounts —
   laying the tags out as fixed 64px-plus-title rows, and painting the account
   icons in --ink so they came out black on red. Three lists, three shapes; the
   rule that draws one of them says which. */
.pst-aside__posts li + li { margin-top: var(--sp-4); }
.pst-aside__posts li a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: center;
  color: var(--ink);
  transition: color .18s ease;
}
.pst-aside__posts li a:hover { color: var(--red); }
.pst-aside__posts li.is-plain a { grid-template-columns: minmax(0, 1fr); }
.pst-aside__thumb {
  display: block; line-height: 0;
  border-radius: var(--r-control);
  overflow: hidden;
  background: var(--wash);
}
.pst-aside__thumb img {
  width: 64px; height: 64px; object-fit: cover; display: block;
}
.pst-aside__title { font-size: var(--fs-small); font-weight: 700; line-height: 1.6; }

/* The accounts: a square each, in the brand red. They are marks, not names, so
   the block is a row of them rather than a list of links. */
.pst-social { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.pst-social li + li { margin-top: 0; }
.pst-social a {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  background: var(--red);
  border-radius: var(--r-surface);
  color: #fff;
}
/* The mark carries the footer's class, and there it is held back to 80% against
   a dark ground. On red at this size it needs all of itself. */
.pst-social svg {
  opacity: 1;
  margin-top: 0;
  fill: currentColor;
  transition: background-color .2s ease, transform .2s ease;
}
.pst-social a:hover { background: var(--red-deep); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .pst-social a, .pst-social a:hover { transition: none; transform: none; }
}

/* Tags: the most used ones, so a row of names with no counts — a number beside
   each would invite reading them as a ranking, and they are shuffled. */
.pst-tags { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.pst-tags li + li { margin-top: 0; }
/* Each pill is as wide as its own name, up to the column. `nowrap` was the
   first attempt and it made four of them run outside their own pill: the
   longest tag on this site is wider than a 320px column, so it has to be
   allowed to take a second line — what it must not do is take a third with one
   word on each, which is what the fixed-width grid was doing to it. */
.pst-tags a {
  display: inline-flex;
  max-width: 100%;
  text-align: center;
  line-height: 1.6;
  padding: 7px var(--sp-4);
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: var(--fs-caption); font-weight: 700;
  transition: border-color .18s ease, color .18s ease;
}
.pst-tags a:hover { border-color: var(--red-edge); color: var(--red); }

/* --- The list --------------------------------------------------------------
   The homepage's three-column grid, and the first article of the first page
   across two of them: twelve identical cards give the eye nowhere to start. */
.pst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }

.pst-date {
  display: block;
  margin-top: auto;
  padding-top: var(--sp-4);
  color: var(--muted); font-size: var(--fs-caption);
}

.pst-empty { color: var(--muted); }

/* --- The pager ------------------------------------------------------------- */
.pst-pages { margin-top: clamp(var(--sp-6), 4vw, var(--sp-7)); }
.pst-pages ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3);
}
.pst-pages a,
.pst-pages .current,
.pst-pages .dots {
  display: grid; place-items: center;
  min-width: 42px; height: 42px;
  padding-inline: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  color: var(--ink); font-weight: 700; font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  transition: border-color .18s ease, color .18s ease;
}
.pst-pages a:hover { border-color: var(--red-edge); color: var(--red); }
.pst-pages .current { background: var(--red); border-color: var(--red); color: #fff; }
.pst-pages .dots { border-color: transparent; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .pst-cats a, .pst-pages a { transition: none; }
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 1024px) {
  /* The column goes under the articles, and stops following them. */
  .pst-body { grid-template-columns: minmax(0, 1fr); }
  .pst-aside__posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .pst-aside__posts li + li { margin-top: 0; }
  .pst-tags { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
}
@media (max-width: 640px) {
  .pst-featured__in { grid-template-columns: minmax(0, 1fr); }
  .pst-cats a { padding: 8px var(--sp-4); }
}


/* --- The search field, and the 404 --------------------------------------------
   Shared by search.php and 404.php through inc/section-search-form.php. */
.pst-search {
  display: flex;
  gap: var(--sp-3);
  max-width: 520px;
  margin: clamp(var(--sp-5), 3vw, var(--sp-6)) auto 0;
}
.pst-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pst-search input[type="search"]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-tint);
}
.pst-search .hp-btn { flex: 0 0 auto; }

.pst-404__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin: clamp(var(--sp-6), 4vw, var(--sp-7)) 0 0;
}
.pst-404 { text-align: center; }
.pst-404 .hp-eyebrow { display: block; text-align: center; }

@media (max-width: 520px) {
  .pst-search { flex-direction: column; }
  .pst-search .hp-btn { display: flex; width: 100%; }
}
