/* ---------- Layout for everything except the front page: one centred column ---------- */
.site-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ---------- "Most read" (shared) ---------- */
.section-heading {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
.popular__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
}
.popular__tabs { display: flex; gap: 0.25rem; }
.popular__tabs[hidden] { display: none; }
.popular__tabs button {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.35rem 0.5rem;
  margin-bottom: -0.3rem;
  cursor: pointer;
  color: var(--subtle);
}
.popular__tabs button[aria-selected="true"] {
  color: inherit;
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.popular__list { list-style: none; counter-reset: pop; margin: 0; padding: 0; }
.popular__item {
  counter-increment: pop;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  row-gap: 0.15rem;
}
.popular__item::before {
  content: counter(pop);
  grid-row: span 2;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--muted);
}
.popular__item a { text-decoration: none; color: inherit; line-height: 1.35; }
.popular__item a:hover { text-decoration: underline; }
.popular__views { grid-column: 2; font-size: 0.75rem; color: var(--muted); }
.popular__empty { color: var(--muted); font-size: 0.9rem; padding: 0.5rem 0; }

/* Sidebar variant: stacked */
.popular--sidebar .popular__item { padding: 0.6rem 0; border-bottom: 1px solid var(--line-soft); }

/* Row variant (front page): 5 across, wraps on small screens */
.popular--row .popular__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem;
}
.popular--row .popular__item::before { font-size: 2rem; line-height: 1; }
.popular--row .popular__item a { font-weight: 600; }
.popular--row .popular__empty { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .popular--row .popular__list { grid-template-columns: 1fr; gap: 0.75rem; }
  .popular--row .popular__item::before { font-size: 1.25rem; }
}
