/* =====================================================================
   Components — cards, archives, the search overlay and the reader
   Shared by every site.
   ===================================================================== */

.topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: .86rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.topic-pill:hover { border-color: var(--accent); color: var(--accent-text); }
.topic-pill .count {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
}


.fatal {
  max-width: 720px;
  padding: 72px 24px 80px;
}

.fatal h1 {
  margin: 0 0 20px;
  font-size: clamp(1.7rem, 4.4vw, 2.4rem);
  letter-spacing: -.03em;
  font-weight: 800;
}

.fatal-lead {
  margin: 0 0 16px;
  font-size: 1.02rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.fatal-fix { margin: 0 0 16px; font-size: .95rem; color: var(--text-dim); }

.fatal code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--accent-text);
}

.fatal a { color: var(--link); }

.fatal-code {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  font-family: var(--font-mono);
  font-size: .86rem;
  line-height: 1.65;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}


.post { max-width: 760px; padding-top: 34px; padding-bottom: 40px; }

.post-head { margin-bottom: 30px; }

/* The article's social image, shown as a hero.
   This is the 1200x630 Open Graph artwork — the wide format needs no crop.
   The separate 2:3 Pinterest pin is referenced in the metadata and on the
   /pinterest/ board, so both platforms get the shape they want. */
.post-hero {
  display: block;
  margin-bottom: 26px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}
.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.post-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.share-btn:hover { border-color: var(--border-strong); color: var(--text); }
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }

.share-pinterest { color: #e60023; border-color: #e6002333; background: #e600230a; }
.share-pinterest:hover { color: #fff; background: #e60023; border-color: #e60023; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.post-category { color: var(--accent-text); text-decoration: none; }
.post-category:hover { text-decoration: underline; }

.post-title {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -.032em;
  font-weight: 800;
}

.post-lede {
  margin: 0 0 20px;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.post-byline .avatar { width: 30px; height: 30px; font-size: .78rem; }
.byline-name { color: var(--text); font-weight: 600; text-decoration: none; }
.byline-name:hover { color: var(--accent-text); }
.post-stats { color: var(--text-faint); font-family: var(--font-mono); font-size: .78rem; }

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.post-tags .tag { display: inline-block; }

.post-body {
  font-size: 1.06rem;
  line-height: 1.78;
  color: var(--text-dim);
}
.post-body p { margin: 0 0 20px; }
.post-body p:first-child { color: var(--text); font-size: 1.12rem; }
.post-body h2, .post-body h3 { color: var(--text); letter-spacing: -.015em; margin: 34px 0 12px; }
.post-body a { color: var(--link); }
.post-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.post-body pre {
  padding: 15px 17px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow-x: auto;
  line-height: 1.6;
}
.post-body pre code { background: none; border: 0; padding: 0; }
.post-body blockquote {
  margin: 22px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
  font-style: italic;
}

.post-foot { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }

.post-subscribe {
  padding: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 30px;
}
.post-subscribe p { margin: 0 0 14px; color: var(--text-dim); font-size: .94rem; }
.post-subscribe strong { color: var(--text); }

.post-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 34px;
}
.post-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s;
}
.post-nav:hover { border-color: var(--accent); }
.post-nav-newer { text-align: right; }
.post-nav-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
}
.post-nav-title { font-size: .93rem; font-weight: 600; line-height: 1.4; }

.post-related h2 {
  margin: 0 0 14px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.post-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.post-related a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--text-dim);
}
.post-related a:hover { background: var(--bg-raised); color: var(--text); }
.rel-title { display: block; font-size: .92rem; font-weight: 600; }
.rel-meta { display: block; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); margin-top: 3px; }


.pinboard { max-width: 1100px; padding-top: 34px; padding-bottom: 40px; }

.pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.pin { margin: 0; display: flex; flex-direction: column; }

.pin-image {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.pin-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  /* The pin art puts the title in the lower third. When the grid is narrow the
     image would be cropped to its middle and the title would vanish, so anchor
     the crop to the bottom where the text is. */
  object-position: center bottom;
  transition: transform .3s ease;
}
.pin-image:hover img { transform: scale(1.03); }

.pin-caption { padding: 10px 2px 0; }
.pin-title {
  display: block;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 5px;
}
.pin-title:hover { color: var(--accent-text); }
.pin-desc {
  margin: 0 0 6px;
  font-size: .8rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pin-meta { margin: 0 0 9px; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }
.pin-meta a { color: var(--accent-text); text-decoration: none; }

.pin-btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: #e60023;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.pin-btn:hover { background: #c8001e; }


.listing { max-width: 900px; padding-top: 34px; padding-bottom: 40px; }
.listing-head { margin-bottom: 28px; }
.listing-head h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4.2vw, 2.4rem);
  letter-spacing: -.03em;
  font-weight: 800;
}
.listing-head-hero h1 { max-width: 20ch; }
.listing-intro { margin: 0 0 8px; color: var(--text-dim); font-size: 1.02rem; max-width: 62ch; }
.listing-intro a { color: var(--link); }
.listing-count { margin: 0; font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); }

.listing h2, .featured-strip h2, .recent h2, .topic-index h2, .category-index h2 {
  margin: 34px 0 16px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.listing h2:first-child, .featured-strip h2:first-child { margin-top: 0; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.post-card:hover { border-color: var(--border-strong); }

.post-card-image { display: block; overflow: hidden; background: var(--bg-input); }
.post-card-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  object-position: left center;
  transition: transform .3s ease;
}
.post-card:hover .post-card-image img { transform: scale(1.03); }

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
}
.post-card-meta a { color: var(--accent-text); text-decoration: none; }
.post-card-title { margin: 0 0 0 18px; font-size: 1rem; font-weight: 650; line-height: 1.38; letter-spacing: -.012em; }
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--accent-text); }

/* The title link is stretched over the whole card, so clicking the image,
   the excerpt, or any blank space in the card opens the article. The tag
   links and the Pin button sit above it, so they keep their own actions. */
.post-card { position: relative; }
.post-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-card-tags, .post-card-pin { position: relative; z-index: 2; }
.post-card-meta { position: relative; z-index: 2; }
.post-card:hover .post-card-title a { color: var(--accent-text); }
.post-card-excerpt {
  margin: 0 18px;
  font-size: .87rem;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: auto 18px 0; padding: 6px 0 12px; }

.post-card-pin {
  align-self: flex-start;
  margin: 0 18px 16px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #e6002340;
  background: #e600230d;
  color: #e60023;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}
.post-card-pin:hover { background: #e60023; color: #fff; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: .85rem;
  text-decoration: none;
}
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent-text); }
.tag-cloud span { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }

.category-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.category-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.category-list a:hover { background: var(--bg-raised); }
.category-list strong { color: var(--text); font-weight: 650; min-width: 8.5rem; }
.category-list span { flex: 1; font-size: .88rem; }
.category-list em { font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); font-style: normal; }

.see-all { margin: 16px 0 0; font-size: .9rem; }
.see-all a { color: var(--link); text-decoration: none; }
.see-all a:hover { text-decoration: underline; }


.search-page-input { margin: 0 0 30px; }
.search-page-input input {
  width: 100%;
  max-width: 520px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.search-page-input input:focus { outline: none; border-color: var(--accent); }

.search-page-hint { margin: 10px 0 0; font-size: .86rem; color: var(--text-faint); }
.search-page-hint kbd {
  font-family: var(--font-mono);
  font-size: .74rem;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-input);
}
.search-page-hint code {
  font-family: var(--font-mono);
  font-size: .84em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--accent-text);
}

.search-page-form {
  display: flex;
  gap: 8px;
  max-width: 560px;
}
.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.search-page-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-page-go {
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  font: inherit;
  font-size: .94rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.search-page-go:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }

.search-page-popular { margin: 30px 0 8px; }
.search-page-popular .facet-title { margin-bottom: 10px; }

/* The results rendered in place on the /search/ page. They reuse the result
   card styles, laid out in a single column. */
.search-page-results { margin: 26px 0 0; }
.search-page-results .facet-title { margin-bottom: 12px; }
.search-page-results .result {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  border-left: 0;
}
.search-page-results .result:hover { background: transparent; }
.search-page-results .result-image { width: 168px; }
.search-page-results .result-title { font-size: 1rem; }
.search-page-results .result-excerpt { font-size: .87rem; }
.search-page-results .result-tags { margin-top: 2px; }

@media (max-width: 720px) {
  .search-page-results .result-image { width: 96px; }
  .search-page-form { flex-direction: column; }
  .search-page-go { width: 100%; }
}

.search-archive-wrap { display: flex; flex-direction: column; gap: 30px; }
.search-archive h2 { margin: 0 0 10px; font-size: .95rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text); }
.search-archive h2 span { color: var(--text-faint); font-family: var(--font-mono); font-size: .78rem; font-weight: 400; }
.search-archive h2 a { color: inherit; text-decoration: none; }
.search-archive h2 a:hover { color: var(--accent-text); }
.search-archive ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.search-archive li a {
  display: flex;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .9rem;
}
.search-archive li a:hover { background: var(--bg-raised); color: var(--text); }
.search-archive time { margin-left: auto; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); flex: none; }

/* =====================================================================
   SEARCH OVERLAY
   ===================================================================== */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: 8vh 20px 40px;
}
.search-overlay[hidden] { display: none; }

.search-overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(3px);
  animation: fade .16s ease;
}
@media (prefers-color-scheme: light) {
  .search-overlay-scrim { background: rgba(30, 35, 45, .42); }
}

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.search-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .18s cubic-bezier(.2, .8, .3, 1);
}

.search-head {
  flex: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.search-input-icon { color: var(--text-faint); width: 20px; height: 20px; }

#search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  padding: 4px 0;
}
#search-input::placeholder { color: var(--text-faint); }
/* hide the native clear affordance; we provide our own */
#search-input::-webkit-search-cancel-button { display: none; }

.search-clear, .search-close, .reader-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--text-faint);
  cursor: pointer;
}
.search-clear:hover, .search-close:hover, .reader-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px 11px;
  flex-wrap: wrap;
}

.search-status {
  margin: 0;
  font-size: .84rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.search-status strong { color: var(--accent-text); font-weight: 700; }
.search-status .corrected { color: var(--link); }

.search-sort {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-input);
  border-radius: 7px;
}
.sort-btn {
  padding: 4px 11px;
  background: none;
  border: 0;
  border-radius: 5px;
  color: var(--text-faint);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
.sort-btn:hover { color: var(--text); }
.sort-btn.is-active { background: var(--bg-raised); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.search-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 218px 1fr;
}

.search-facets {
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg-raised) 55%, transparent);
}

.facet-group + .facet-group { margin-top: 20px; }

.facet-title {
  margin: 0 0 9px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.facet-list { display: flex; flex-direction: column; gap: 1px; }

.facet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  background: none;
  border: 0;
  border-radius: 5px;
  color: var(--text-dim);
  font: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}
.facet-item:hover { background: var(--bg-input); color: var(--text); }
.facet-item.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.facet-item .count {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
  flex: none;
}
.facet-item.is-active .count { color: var(--accent-text); }

.facet-clear {
  margin-top: 18px;
  width: 100%;
  padding: 6px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-dim);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.facet-clear:hover { color: var(--text); border-color: var(--text-faint); }

/* The filter toggle only appears on narrow screens, where the facets start
   collapsed. On a wide screen the facets are always visible. */
.filter-toggle { display: none; }
.filter-count { font-family: var(--font-mono); font-size: .76rem; }

.search-results-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0 0;
}

.search-results { padding: 0 8px; }

.result {
  display: flex;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.result:hover, .result.is-cursor {
  background: var(--bg-raised);
  border-left-color: var(--accent);
}

.result-image {
  flex: none;
  width: 148px;
  aspect-ratio: 1200 / 630;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--bg-input);
}
/* The OG artwork puts its title in the left half. A 148px thumbnail cropped
   to the centre would show only decorative art, so anchor the crop to the
   left where the text is. */
.result-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left center; }

.result-body { flex: 1; min-width: 0; display: block; }

.result-top {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}
.result-top .sep { opacity: .4; }

.result-title {
  display: block;
  margin: 0 0 4px;
  font-size: .97rem;
  font-weight: 640;
  line-height: 1.38;
  letter-spacing: -.01em;
}
/* The title is a real link, so a result can be opened in a new tab and a
   crawler can follow it. */
.result-title a { color: inherit; text-decoration: none; }
.result-title a:hover { color: var(--accent-text); }
.result-excerpt {
  display: block;
  margin: 0 0 7px;
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.result-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.result mark, .card mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  border-radius: 3px;
  padding: 0 2px;
}

.search-empty { padding: 44px 24px; text-align: center; }
.empty-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; }
.empty-body { margin: 0 0 18px; color: var(--text-dim); font-size: .9rem; }

.search-more {
  flex: none;
  margin: 12px auto 18px;
  padding: 9px 22px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.search-more:hover { color: var(--text); border-color: var(--text-faint); }

.search-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: .74rem;
  color: var(--text-faint);
}
.search-hint { display: inline-flex; align-items: center; gap: 4px; }
.search-foot kbd {
  font-family: var(--font-mono);
  font-size: .68rem;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-input);
}
.search-perf { margin-left: auto; font-family: var(--font-mono); }

@media (max-width: 720px) {
  .search-overlay { padding: 0; }
  .search-panel { max-height: 100vh; height: 100%; border-radius: 0; border: 0; }
  .search-body { grid-template-columns: 1fr; }
  .search-foot { display: none; }

  /* The facets become a collapsible drawer above the results, so filtering
     is still available on a phone instead of disappearing. */
  .search-facets {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    max-height: 42vh;
    overflow-y: auto;
  }
  .search-facets.is-collapsed { display: none; }
  .facet-group + .facet-group { margin-top: 14px; }
  .facet-list { max-height: 168px; overflow-y: auto; }

  .filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    color: var(--text-dim);
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
  }
  .filter-toggle .filter-count { color: var(--accent-text); }

  /* The results need the full width on a phone. A 148px thumbnail takes
     38% of a 390px screen, and the metadata beside it wraps onto three
     lines. A smaller thumbnail with the metadata below reads better. */
  .result { gap: 11px; padding: 11px 10px; }
  .result-image { width: 84px; }
  .result-title { font-size: .93rem; }
  .result-excerpt {
    font-size: .82rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .result-top {
    font-size: .68rem;
    gap: 6px;
    flex-wrap: wrap;
  }
  .result-tags .tag:nth-child(n + 3) { display: none; }
  .search-meta { gap: 8px; }
  .search-status { font-size: .8rem; }
  .sort-btn { padding: 4px 9px; font-size: .74rem; }
}

/* =====================================================================
   ARTICLE READER
   ===================================================================== */

.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: start center;
  padding: 6vh 20px 40px;
  overflow-y: auto;
}
.reader-overlay[hidden] { display: none; }

.reader-overlay-scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, .78);
  backdrop-filter: blur(3px);
  animation: fade .16s ease;
}
@media (prefers-color-scheme: light) {
  .reader-overlay-scrim { background: rgba(30, 35, 45, .5); }
}

.reader {
  position: relative;
  width: min(720px, 100%);
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: rise .18s cubic-bezier(.2, .8, .3, 1);
}

.reader-head { padding: 34px 36px 0; }

.reader-close { position: absolute; top: 12px; right: 12px; }

.reader-head-meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.reader-category { color: var(--accent-text); }

.reader-title {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -.028em;
  font-weight: 800;
}

.reader-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
  flex: none;
}
.byline-name { color: var(--text); font-weight: 600; }

.reader-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.reader-body {
  padding: 12px 36px 30px;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-dim);
}
.reader-body p { margin: 0 0 18px; }
.reader-body p:first-child { color: var(--text); font-size: 1.08rem; }

.reader-foot {
  padding: 22px 36px 32px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-raised) 55%, transparent);
  border-radius: 0 0 14px 14px;
}

.reader-stats {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-faint);
  margin-bottom: 22px;
}

.reader-related-title {
  margin: 0 0 12px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reader-related { display: flex; flex-direction: column; gap: 2px; }

.related-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--text-dim);
  font: inherit;
  font-size: .89rem;
  cursor: pointer;
}
.related-item:hover { background: var(--bg-input); color: var(--text); }
.related-item .rel-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-faint);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .reader-head, .reader-body, .reader-foot { padding-left: 20px; padding-right: 20px; }
}
