/* Homepage: quote wall grouped by topic */


/* Search bar styles live in site.css (shared with topic pages) */
.chip-n { color: var(--muted); font-size: 0.7rem; margin-left: 0.15rem; }

/* Topic sections */
.wall-topic { margin-top: 3rem; }
.wall-topic .topic-head { border-top: 3px solid var(--rule-strong); padding-top: 0.75rem; margin-bottom: 1.1rem; }
.wall-topic .topic-head h2 { font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.2rem); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.9rem; }
.wall-topic .topic-count { font-family: var(--sans); font-size: 0.78rem; font-weight: 500; color: var(--muted); margin: 0; }
.wall-topic .topic-head p { margin: 0.35rem 0 0; color: var(--muted); font-style: italic; max-width: 48rem; }

/* Cards: headline first, his words underneath */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; align-items: stretch; }
.card { display: flex; }
.card--more { display: none; }
.wall-topic.expanded .card--more,
.wall-topic.filtering .card--more { display: flex; }
.card[hidden] { display: none !important; }
.card-btn {
  all: unset;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 1.1rem 1.2rem 0.95rem;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.card--hot .card-btn { border-top-color: var(--red); }
.card-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgb(0 0 0 / 0.08); }
.card-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.card-flag { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--sans); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); margin-bottom: -0.35rem; }
.card-head { font-family: var(--display); font-weight: 700; font-size: 1.22rem; line-height: 1.22; color: var(--ink); text-wrap: balance; }
.card-btn:hover .card-head { color: var(--red); }
.card-quote {
  position: relative;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--quote-bg);
  border-left: 3px solid var(--red);
  padding: 0.6rem 0.8rem 0 2rem;
  border-bottom: 0.6rem solid var(--quote-bg);
  border-radius: 0 4px 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-quote::before { content: "“"; position: absolute; left: 0.4rem; top: -0.1rem; font-family: var(--display); font-size: 2.2rem; line-height: 1; color: var(--red); }
.card-meta { margin-top: auto; font-family: var(--sans); font-size: 0.7rem; color: var(--muted); }

.show-all { display: block; margin: 1rem auto 0; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; padding: 0.55rem 1.1rem; border: 1.5px solid var(--rule-strong); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer; }
.show-all:hover { border-color: var(--red); color: var(--red); }
.wall-topic.filtering .show-all { display: none; }

/* Reader dialog */
.dlg { width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0; border: 0; border-radius: 10px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 0.35); }
.dlg::backdrop { background: rgb(0 0 0 / 0.55); }
.dlg-body { padding: 1.75rem clamp(1rem, 4vw, 2rem) 1.5rem; overflow: auto; overscroll-behavior: contain; max-height: calc(100dvh - 3rem); }
.dlg { max-height: calc(100dvh - 3rem); }
/* 44px close target, kept clear of the headline */
.dlg-close { position: absolute; right: 0.3rem; top: 0.3rem; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; background: var(--bg); border: 0; border-radius: 50%; font-size: 1.9rem; line-height: 1; cursor: pointer; color: var(--muted); }
.dlg-close:hover { color: var(--red); }
.dlg-title { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem); margin-bottom: 0.75rem; padding-right: 2.25rem; }
.dlg-body .kicker { padding-right: 2.75rem; }
.dlg-loading { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }
/* The page behind the dialog stays put */
html.dlg-open, html.dlg-open body { overflow: hidden; }

@media (max-width: 640px) {
  .jump { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: none; }
  .jump a { white-space: nowrap; flex: none; }
  /* Fade the right edge while more chips are off-screen, so it reads as scrollable */
  .jump:not(.at-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 3.5rem), transparent); }
}

/* Recently added (appears once statements are added after launch) */
.recent { margin: 0.25rem 0 1rem; padding: 0.85rem 1rem; border: 1px solid var(--rule); border-left: 4px solid var(--red); border-radius: 0 6px 6px 0; font-family: var(--sans); font-size: 0.9rem; }
.recent-h { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin: 0 0 0.5rem; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.recent-list a { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.3; text-decoration: none; color: var(--ink); }
.recent-list a:hover { color: var(--red); }
.recent-topic { color: var(--muted); font-size: 0.75rem; margin-left: 0.35rem; }
.recent-feed { margin: 0.6rem 0 0; font-size: 0.78rem; }
.recent-feed a { color: var(--muted); }
