/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover { background: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover { background: var(--accent); }

.btn-destructive {
  background: transparent;
  color: var(--destructive);
}

.btn-destructive:hover {
  background: oklch(0.58 0.22 27 / 0.1);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
}

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 9999px;
}

.btn-icon svg { width: 1rem; height: 1rem; }

/* Liked article heart (feed, town, writer, article page) */
.heart-btn.feed-action-btn--heart-liked,
.feed-action-btn.heart-btn.feed-action-btn--heart-liked,
#btnHeart.feed-action-btn--heart-liked {
  color: #e11d48;
  background: #fff;
}
.heart-btn.feed-action-btn--heart-liked svg path,
.feed-action-btn.heart-btn.feed-action-btn--heart-liked svg path,
#btnHeart.feed-action-btn--heart-liked svg path {
  fill: #e11d48;
  stroke: #e11d48;
}

/* Like pill: white; "Like to support the author" hint at 95% opacity */
.feed-action-btn.heart-btn {
  background: #fff;
  color: var(--foreground);
  border-color: var(--border);
}
.feed-action-btn.heart-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}
.feed-action-btn.heart-btn.feed-action-btn--heart-liked:hover {
  background: #fff;
  color: #e11d48;
}
.feed-action-btn.heart-btn .heart-hint {
  color: var(--muted-foreground);
  opacity: 0.95;
}

/* Article share row: same white heart pill (no .feed-action-btn class) */
.share-btn.heart-btn {
  background: #fff;
  color: var(--foreground);
  border-color: var(--border);
}
.share-btn.heart-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}
.share-btn.heart-btn.feed-action-btn--heart-liked:hover {
  background: #fff;
  color: #e11d48;
}

/* Bookmark button — white background on all pages (feed, town, writer, article) */
.feed-action-btn.bookmark-btn,
.share-btn.bookmark-btn {
  background: #fff;
  color: var(--foreground);
  border-color: var(--border);
}
.feed-action-btn.bookmark-btn:hover,
.share-btn.bookmark-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}
/* Saved state — orange/red fill, mirrors the heart "liked" treatment */
.feed-action-btn.bookmark-btn.feed-action-btn--saved,
.share-btn.bookmark-btn.feed-action-btn--saved {
  color: oklch(0.45 0.16 25);
  border-color: oklch(0.6 0.16 25);
  background: oklch(0.97 0.04 25);
}
.feed-action-btn.bookmark-btn.feed-action-btn--saved svg,
.share-btn.bookmark-btn.feed-action-btn--saved svg {
  fill: oklch(0.55 0.18 25);
  stroke: oklch(0.45 0.16 25);
}
.feed-action-btn.bookmark-btn.feed-action-btn--saved:hover,
.share-btn.bookmark-btn.feed-action-btn--saved:hover {
  background: oklch(0.97 0.04 25);
}

/* Comments button — white background on all pages */
.feed-action-btn.feed-comment-btn {
  background: #fff;
  color: var(--foreground);
  border-color: var(--border);
}
.feed-action-btn.feed-comment-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}

/* ── Cards ── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: var(--card-foreground);
}

.card-hover {
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px oklch(0.21 0.04 265 / 0.15);
}

/* ── Pills / Tags ── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  line-height: 1.5;
}

.pill-news {
  background: oklch(0.24 0.05 265 / 0.1);
  color: var(--primary);
}

.pill-events {
  background: oklch(0.82 0.15 80 / 0.3);
  color: oklch(0.45 0.12 80);
}

.pill-sport {
  background: oklch(0.65 0.15 150 / 0.15);
  color: var(--success);
}

.pill-business {
  background: var(--accent);
  color: var(--accent-foreground);
}

.pill-community {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.pill-history {
  background: oklch(0.58 0.22 27 / 0.1);
  color: oklch(0.5 0.15 27);
}

.pill-people {
  background: oklch(0.55 0.14 300 / 0.14);
  color: oklch(0.38 0.14 300);
}

.pill-town {
  background: var(--muted);
  color: var(--muted-foreground);
}

.pill-town--labeled {
  display: inline-flex;
  align-items: center;
  height: auto;
  padding: 0.2rem 0.55rem;
  line-height: 1.15;
  text-decoration: none;
}

.pill-town--labeled .wt-town-label__county {
  color: inherit;
  opacity: 0.78;
}

/* Stacked town name + county (Wellington / Somerset) */
.wt-town-label {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  line-height: 1.2;
  min-width: 0;
}

.wt-town-label__name {
  font-weight: inherit;
}

.wt-town-label__county {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  font-weight: 400;
  line-height: 1.15;
}

/* ── Status Badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-draft {
  background: var(--muted);
  color: var(--muted-foreground);
}

.badge-pending {
  background: oklch(0.82 0.15 80 / 0.2);
  color: oklch(0.45 0.12 80);
}

.badge-published {
  background: oklch(0.65 0.15 150 / 0.15);
  color: var(--success);
}

.badge-rejected {
  background: oklch(0.58 0.22 27 / 0.1);
  color: var(--destructive);
}

/* ── Form Inputs ── */

.input,
.select,
.textarea {
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px oklch(0.24 0.05 265 / 0.15);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-foreground);
}

.textarea {
  height: auto;
  min-height: 6rem;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── Article Card ── */

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px oklch(0.21 0.04 265 / 0.15);
}

.article-card-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.article-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.article-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 0.5rem;
}

.article-card-excerpt {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.article-card-meta .dot::before { content: "·"; }

/* ── Avatars ── */

.avatar {
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm { width: 2rem; height: 2rem; }
.avatar-md { width: 2.25rem; height: 2.25rem; }
.avatar-lg { width: 3rem; height: 3rem; }
.avatar-xl { width: 6rem; height: 6rem; font-size: 1.5rem; }

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Sponsor Banner ── */

.sponsor-banner {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sponsor-banner-logo {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  object-fit: contain;
}

/* ── Ornament Divider ── */

.ornament-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  color: var(--muted-foreground);
  font-size: 1rem;
}

.ornament-divider::before,
.ornament-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--foreground); }

.tab.active {
  color: var(--foreground);
  border-bottom-color: var(--primary);
}

/* Category-coloured underline for town article tabs */
.tab[data-tab="news"].active      { border-bottom-color: var(--primary); }
.tab[data-tab="events"].active    { border-bottom-color: oklch(0.5 0.14 80); }
.tab[data-tab="sport"].active     { border-bottom-color: var(--success); }
.tab[data-tab="business"].active  { border-bottom-color: oklch(0.45 0.06 265); }
.tab[data-tab="community"].active { border-bottom-color: oklch(0.45 0.08 320); }
.tab[data-tab="history"].active   { border-bottom-color: oklch(0.5 0.15 27); }
.tab[data-tab="people"].active    { border-bottom-color: oklch(0.45 0.14 300); }

/* ── Category Filter Pills ── */

.filter-pills {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  background: var(--card);
  color: var(--muted-foreground);
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

.filter-pill:hover {
  background: var(--accent);
  color: var(--foreground);
}

.filter-pill:focus,
.filter-pill:active {
  outline: none;
  box-shadow: none;
}

.filter-pill:focus-visible {
  outline: 2px solid oklch(0.55 0.1 265 / 0.35);
  outline-offset: 2px;
  border-radius: 9999px;
}

.filter-pill.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  box-shadow: none;
}

/* ── Category-coloured filter pills (matches How it works categories) ── */
.filter-pill[data-cat] {
  border: none;
}
.filter-pill[data-cat="news"]      { background: oklch(0.24 0.05 265 / 0.08); color: var(--primary); }
.filter-pill[data-cat="news"]:hover,
.filter-pill[data-cat="news"].active     { background: oklch(0.24 0.05 265 / 0.18); color: var(--primary); border: none; }

.filter-pill[data-cat="events"]    { background: oklch(0.82 0.15 80 / 0.22); color: oklch(0.42 0.13 80); }
.filter-pill[data-cat="events"]:hover,
.filter-pill[data-cat="events"].active   { background: oklch(0.82 0.15 80 / 0.45); color: oklch(0.4 0.14 80); border: none; }

.filter-pill[data-cat="sport"]     { background: oklch(0.65 0.15 150 / 0.12); color: var(--success); }
.filter-pill[data-cat="sport"]:hover,
.filter-pill[data-cat="sport"].active    { background: oklch(0.65 0.15 150 / 0.25); color: var(--success); border: none; }

.filter-pill[data-cat="business"]  { background: var(--accent); color: var(--accent-foreground); }
.filter-pill[data-cat="business"]:hover,
.filter-pill[data-cat="business"].active { background: oklch(0.85 0.04 265); color: var(--accent-foreground); border: none; }

.filter-pill[data-cat="community"] { background: var(--secondary); color: var(--secondary-foreground); }
.filter-pill[data-cat="community"]:hover,
.filter-pill[data-cat="community"].active{ background: oklch(0.88 0.06 320); color: var(--secondary-foreground); border: none; }

.filter-pill[data-cat="history"]   { background: oklch(0.58 0.22 27 / 0.1); color: oklch(0.5 0.15 27); }
.filter-pill[data-cat="history"]:hover,
.filter-pill[data-cat="history"].active  { background: oklch(0.58 0.22 27 / 0.22); color: oklch(0.5 0.15 27); border: none; }

.filter-pill[data-cat="people"]    { background: oklch(0.55 0.14 300 / 0.14); color: oklch(0.38 0.14 300); }
.filter-pill[data-cat="people"]:hover,
.filter-pill[data-cat="people"].active   { background: oklch(0.55 0.14 300 / 0.3); color: oklch(0.38 0.14 300); border: none; }

.filter-pill[data-cat="all"]       { background: var(--muted); color: var(--muted-foreground); }
.filter-pill[data-cat="all"]:hover,
.filter-pill[data-cat="all"].active      { background: var(--primary); color: var(--primary-foreground); border: none; }

/* ── Accordion ── */

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--foreground);
}

.accordion-trigger svg {
  width: 1rem;
  height: 1rem;
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.accordion-item.open .accordion-trigger svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 200ms ease;
}

.accordion-item.open .accordion-content {
  max-height: 20rem;
}

.accordion-content-inner {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ── Stat Card ── */

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.25rem;
}

/* ── Table ── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead { background: var(--muted); }

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr { transition: background 100ms ease; }
tbody tr:hover { background: var(--accent); }

/* ── Tooltip ── */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.5rem;
  padding: 0.25rem 0.625rem;
  background: var(--foreground);
  color: var(--primary-foreground);
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

[data-tooltip]:hover::after { opacity: 1; }

/* Left sidebar: no CSS pseudo-tooltips — expanded shows labels; collapsed uses JS (main.js) only. */
.sidebar [data-tooltip]::after {
  content: none !important;
  display: none !important;
}

/* ── Dropdown ── */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 12rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
  box-shadow: 0 8px 24px -12px oklch(0.21 0.04 265 / 0.2);
  z-index: 50;
  display: none;
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.375rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--foreground);
  text-decoration: none;
  transition: background 100ms ease;
}

.dropdown-item:hover { background: var(--accent); }
.dropdown-item.destructive { color: var(--destructive); }
.dropdown-item.destructive:hover { background: oklch(0.58 0.22 27 / 0.08); }

/* ── Feed: share row + inline comments ── */

/* Single-row bar: like, comment, Facebook, X, Share (replaces separate .feed-article-shares) */
.feed-actions.feed-actions--bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.feed-actions.feed-actions--bar .feed-action-btn,
.feed-actions.feed-actions--bar .feed-article-share {
  flex-shrink: 0;
  white-space: nowrap;
}

.feed-article-shares {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.feed-article-share {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.feed-article-share:hover {
  background: var(--accent);
  color: var(--foreground);
}

.feed-article-share svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Mobile + tablet: drop the "Facebook" / "X" text labels so the Share
   button has room on the action bar. Icons stay; aria-label keeps it
   accessible. Targeted via aria-label so it applies everywhere these
   share links appear (feed bar, article page share row, etc.). */
@media (max-width: 1023px) {
  [aria-label="Share on Facebook"] > span,
  [aria-label="Share on X"] > span {
    display: none !important;
  }
  [aria-label="Share on Facebook"],
  [aria-label="Share on X"] {
    gap: 0 !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

.feed-inline-comments[hidden] {
  display: none !important;
}

/* ── Comment panel (feed inline + article thread) ── */
.feed-inline-comments {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 3px oklch(0.21 0.04 265 / 0.04);
}

.feed-inline-comments-inner {
  max-width: 40rem;
}

.feed-inline-comments-thread,
#commentsThread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.feed-inline-comments-thread:empty,
#commentsThread:empty {
  margin-bottom: 0;
}

.comment-empty,
.comment-thread-msg {
  margin: 0;
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-align: center;
  background: var(--background);
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) - 0.125rem);
}

.comment-thread-msg--error {
  color: var(--destructive);
  border-color: oklch(0.58 0.22 27 / 0.35);
  background: oklch(0.58 0.22 27 / 0.06);
}

/* Individual comment row */
.comment {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0;
  border-bottom: none;
}

.comment .avatar {
  flex-shrink: 0;
  margin-top: 0.0625rem;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  margin-bottom: 0.25rem;
}

.comment-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.3;
}

.comment-date {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.comment-date::before {
  content: '·';
  margin-right: 0.5rem;
  opacity: 0.5;
}

.comment-text {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--foreground);
  margin: 0 0 0.375rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.feed-inline-comments .comment-text {
  white-space: pre-wrap;
}

/* Compose box — feed + article */
.comment-compose,
.new-comment-form {
  margin-top: 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

.comment-compose-input,
.new-comment-form textarea,
.feed-inline-comment-input {
  width: 100%;
  min-height: 5rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 0.125rem);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.comment-compose-input::placeholder,
.new-comment-form textarea::placeholder,
.feed-inline-comment-input::placeholder {
  color: var(--muted-foreground);
}

.comment-compose-input:focus,
.new-comment-form textarea:focus,
.feed-inline-comment-input:focus {
  outline: none;
  border-color: var(--ring);
  background: var(--card);
  box-shadow: 0 0 0 3px oklch(0.24 0.05 265 / 0.1);
}

.comment-compose-footer,
.new-comment-actions,
.feed-inline-post-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.feed-inline-comment-login {
  margin: 0.875rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-align: center;
  background: var(--background);
  border-radius: calc(var(--radius) - 0.125rem);
}

.feed-inline-comment-login a {
  font-weight: 600;
  color: var(--primary);
}

.feed-comment-count {
  font-variant-numeric: tabular-nums;
}

/* Article page: collapsed comments + share row (with .article-share-wider) */
.article-share-row.article-share-wider {
  margin-top: 1rem;
  row-gap: 0.5rem;
}

.comments-section {
  margin-top: 2.5rem;
  max-width: 48rem;
}

.article-comments-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 2.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.article-comments-toggle:hover {
  background: var(--accent);
  border-color: oklch(0.85 0.01 255);
}

.article-comments-body {
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 3px oklch(0.21 0.04 265 / 0.04);
}

.article-comments-body[hidden] { display: none !important; }

#commentLoginPrompt {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-align: center;
  background: var(--background);
  border-radius: calc(var(--radius) - 0.125rem);
}

#commentLoginPrompt a {
  font-weight: 600;
  color: var(--primary);
}

.wt-share-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.wt-share-wrap .wt-share-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 10060;
}

.wt-share-wrap.open .wt-share-menu {
  display: block;
}

.feed-actions.feed-actions--bar.wt-share-open {
  overflow: visible;
}

.wt-share-menu {
  min-width: 11rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem;
  box-shadow: 0 10px 40px -12px oklch(0.2 0.03 265 / 0.25);
}

.wt-share-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--foreground);
  background: none;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

a.wt-share-menu-item { color: var(--foreground); }
.wt-share-menu-item:hover { background: var(--accent); }

/* ── Publisher Tier Badge ── */

.wt-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.125rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  vertical-align: middle;
  margin-left: 0.25rem;
  line-height: 1;
}

.wt-tier-badge--free {
  background: var(--accent);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.wt-tier-badge--pro {
  background: linear-gradient(135deg, oklch(0.75 0.17 80), oklch(0.62 0.19 55));
  color: #fff;
  border: none;
  box-shadow: 0 1px 3px oklch(0.62 0.19 55 / 0.3);
}

/* ── Private Ads Dropdown Item ── */

.wt-private-ads-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wt-private-ads-item--locked {
  opacity: 0.75;
}

/* ── Private Ad Block in Articles ── */

.private-ad-article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
  max-width: 28rem;
  width: 100%;
  background: var(--card);
  box-shadow: 0 1px 3px oklch(0.21 0.04 265 / 0.04);
}

.private-ad-article-cover,
.private-ad-article .private-ad-article-cover,
.wt-article-body .private-ad-article-cover {
  width: 100%;
  aspect-ratio: 5 / 2;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}

.private-ad-article-body {
  padding: 1rem;
  padding-top: 1.75rem;
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
}

/* ── Private ad inside multi-column / any-width section ──────────────────
   Fill the column, drop the body's vertical margins, and tighten padding so
   the card never overflows or leaves big gaps in narrow (e.g. 33%) cells. */
.wt-multi-col .private-ad-article,
.wt-article-body .wt-multi-col .private-ad-article {
  margin: 0;
  max-width: none;
}

.wt-multi-col .private-ad-article-body {
  padding: 0.75rem;
}

.wt-multi-col .private-ad-article-name {
  font-size: 0.9375rem;
}

.wt-multi-col .private-ad-article-blurb {
  font-size: 0.75rem;
}

.private-ad-article-name,
.private-ad-article-blurb {
  overflow-wrap: anywhere;
}

.private-ad-article-eyebrow {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 0.375rem;
}

.private-ad-article-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.private-ad-article-blurb {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.private-ad-article-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 150ms ease;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.private-ad-article-trigger:hover { opacity: 0.88; }

/* Private Ad Popup */

.private-ad-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 1rem;
  animation: wtFadeIn 150ms ease;
}

@keyframes wtFadeIn { from { opacity: 0; } to { opacity: 1; } }

.private-ad-popup-card {
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  max-width: 26rem;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: wtSlideUp 200ms ease;
  position: relative;
}

@keyframes wtSlideUp { from { transform: translateY(1rem); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.private-ad-popup-cover,
.private-ad-popup-card .private-ad-popup-cover,
.wt-article-body .private-ad-popup-cover {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.private-ad-popup-cover-placeholder {
  width: 100%;
  height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
}

.private-ad-popup-body {
  padding: 1.25rem;
}

.private-ad-popup-logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.private-ad-popup-logo {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 0.6rem;
  object-fit: cover;
  flex-shrink: 0;
}

.private-ad-popup-logo-placeholder {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}

.private-ad-popup-name {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.private-ad-popup-headline {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.private-ad-popup-services {
  font-size: 0.8125rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
  color: var(--foreground);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.private-ad-popup-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  color: var(--muted-foreground);
}

.private-ad-popup-contacts a { color: var(--primary); }

.private-ad-popup-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

.private-ad-popup-close:hover { background: rgba(0,0,0,0.55); }

.private-ad-popup-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none !important;
  transition: opacity 150ms ease;
  width: 100%;
  justify-content: center;
}

.private-ad-popup-cta:hover { opacity: 0.88; }

/* ── Trending section (top of feeds) ───────────────────────────────────── */
.wt-trending {
  margin: 0 0 1.25rem;
  padding: 0.875rem 1rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wt-trending-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  /* reset button styles */
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  text-align: left;
  font: inherit;
  color: inherit;
}
.wt-trending-chev {
  display: none;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: transform 0.22s ease;
}

/* Mobile + tablet: trending section is a collapsible */
@media (max-width: 1023px) {
  /* Outer clip — same pattern as home page rail; stops page scrolling sideways */
  .wt-trending {
    overflow-x: clip;
  }
  .wt-trending-head {
    cursor: pointer;
    margin-bottom: 0;
  }
  .wt-trending-head:active .wt-trending-title {
    color: var(--primary);
  }
  .wt-trending-chev {
    display: inline-flex;
    align-items: center;
  }
  /* Grid hidden when collapsed */
  .wt-trending-head[aria-expanded="false"] + .wt-trending-grid {
    display: none !important;
  }
  /* Grid visible when expanded — horizontal scroll rail */
  .wt-trending-head[aria-expanded="true"] + .wt-trending-grid {
    display: flex !important;
    margin-top: 0.625rem;
  }
  /* Chevron rotates when open */
  .wt-trending-head[aria-expanded="true"] .wt-trending-chev {
    transform: rotate(180deg);
  }
}
/* Mobile + tablet: when expanded, scroll the trending cards horizontally */
@media (max-width: 1023px) {
  .wt-trending-head[aria-expanded="true"] + .wt-trending-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }
  .wt-trending-head[aria-expanded="true"] + .wt-trending-grid::-webkit-scrollbar { display: none; }
}
.wt-trending-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: oklch(0.65 0.18 35 / 0.15);
  color: oklch(0.55 0.22 35);
}
.wt-trending-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.wt-trending-sub {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.wt-trending-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 0.5rem;
}
@media (max-width: 1024px) {
  .wt-trending-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .wt-trending-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .wt-trending-grid { grid-template-columns: 1fr; }
}

.wt-trend-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
  min-height: 4.5rem;
  border-radius: calc(var(--radius) * 0.85);
  border: 1px solid var(--border);
  background: var(--background);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--foreground);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.wt-trend-card:hover {
  transform: translateY(-1px);
  border-color: var(--ring);
  background: var(--card);
}
.wt-trend-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--foreground);
}
.wt-trend-card-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.wt-trend-card-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.wt-trend-card-stat--heart {
  color: oklch(0.55 0.18 25);
}
.wt-trend-card-stat--reads {
  color: oklch(0.45 0.08 265);
}
.wt-trend-card-stat--comment {
  color: var(--muted-foreground);
}

/* Trend card sizing when in horizontal scroll row on mobile */
@media (max-width: 639px) {
  .wt-trend-card {
    flex-shrink: 0;
    width: 58vw;
    max-width: 220px;
    min-height: unset;
    scroll-snap-align: start;
  }
}

/* Hide heart-hint text on mobile — the icon + count is enough */
@media (max-width: 639px) {
  .heart-hint { display: none; }
}

/* ──────────────────────────────────────────────────────────────────────
   Article body multi-column layouts (responsive)
   - Stack columns vertically on narrow screens so content never squishes
   ────────────────────────────────────────────────────────────────────── */
.wt-multi-col {
  display: grid;
  grid-template-columns: var(--wt-cols, 1fr 1fr);
  gap: 1rem;
}
@media (max-width: 639px) {
  .wt-multi-col { grid-template-columns: 1fr; gap: 1.25rem; }
}

.wt-before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (max-width: 479px) {
  .wt-before-after { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* ──────────────────────────────────────────────────────────────────────
   Article body — shared rendering for templates / blocks. The same
   class hierarchy is used in three places, so any layout that an author
   builds in the editor preview popup looks identical when published:

   1. Editor preview popup       (.tpl-preview-body in write.html)
   2. Article detail page        (#articleBody.wt-article-body)
   3. Inline feed entries        (.feed-body.wt-article-body)

   These rules cover every block type emitted by render.bodyToHtml().
   Mobile / tablet sizes scale down typography and collapse multi-column
   layouts so long-form magazine templates stay readable at any width.
   ────────────────────────────────────────────────────────────────────── */
.wt-article-body {
  line-height: 1.7;
  font-size: 1rem;
  color: var(--foreground);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.wt-article-body p { margin: 0 0 1rem; }
.wt-article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.15em; }
.wt-article-body img { max-width: 100%; border-radius: var(--radius); display: block; }

.wt-article-body .wt-body-section-title {
  font-size: 1.5rem; font-weight: 700;
  line-height: 1.25; letter-spacing: -0.01em;
  margin: 2rem 0 0.625rem;
}
.wt-article-body .wt-body-standfirst {
  font-size: 1.25rem; line-height: 1.45;
  color: var(--muted-foreground);
  font-weight: 400; letter-spacing: -0.01em;
  margin: 0.5rem 0 1.5rem;
}
.wt-article-body .wt-body-heading {
  font-size: 1.25rem; font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}
.wt-article-body .wt-body-quote {
  border-left: 3px solid var(--primary);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

/* Single image with optional caption */
.wt-article-body .wt-body-image { margin: 1.5rem 0; }
.wt-article-body .wt-body-image img { width: 100%; }
.wt-article-body .wt-body-image figcaption {
  font-size: 0.875rem; line-height: 1.5;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
  font-style: italic; text-align: left;
}

/* Lists */
.wt-article-body .wt-body-list {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
  line-height: 1.7;
}
.wt-article-body .wt-body-list li { margin: 0 0 0.4rem; }

/* YouTube embed */
.wt-article-body .wt-body-video {
  position: relative; padding-bottom: 56.25%; height: 0;
  overflow: hidden; border-radius: var(--radius);
  margin: 1.5rem 0;
  background: oklch(0.92 0.005 265);
}
.wt-article-body .wt-body-video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; border-radius: var(--radius);
}

/* Slideshow strip */
.wt-article-body .wt-body-slideshow {
  display: flex; gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin: 1.5rem 0;
  scroll-snap-type: x mandatory;
}
.wt-article-body .wt-body-slideshow img {
  height: 18rem;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Poll */
.wt-article-body .wt-body-poll {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.wt-article-body .wt-body-poll-q {
  font-weight: 600; font-size: 1rem;
  margin: 0 0 0.625rem;
  line-height: 1.4;
}
.wt-article-body .wt-body-poll-opt {
  padding: 0.5rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}
.wt-article-body .wt-body-poll-opt:last-child { margin-bottom: 0; }

/* Divider — thin centred rule, matching the editor preview */
.wt-article-body .wt-body-divider {
  border: 0;
  border-top: 1px solid var(--border);
  width: 6rem;
  margin: 2.5rem auto;
}

/* Pull-quote — matches editor preview: top + bottom rule, centred */
.wt-article-body .wt-body-pullquote {
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin: 2rem 0;
  text-align: center;
  color: var(--foreground);
  font-style: normal;
}
.wt-article-body .wt-body-pullquote p {
  font-size: 1.5rem; line-height: 1.35;
  font-weight: 600; letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  max-width: 36rem;
  margin-inline: auto;
}
.wt-article-body .wt-body-pullquote cite {
  display: block;
  font-size: 0.8125rem;
  font-style: normal;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

/* Event card */
.wt-article-body .wt-body-event {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.wt-article-body .wt-body-event-tag {
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}
.wt-article-body .wt-body-event-title {
  font-size: 1.0625rem; font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.wt-article-body .wt-body-event-meta {
  font-size: 0.875rem;
  color: var(--foreground);
  line-height: 1.45;
}
.wt-article-body .wt-body-event-meta--loc { color: var(--muted-foreground); margin-top: 0.125rem; }
.wt-article-body .wt-body-event-cta {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.4rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  font-size: 0.8125rem; font-weight: 600;
  text-decoration: none;
}

/* Data table */
.wt-article-body .wt-body-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
}
.wt-article-body .wt-body-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.wt-article-body .wt-body-table th,
.wt-article-body .wt-body-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.625rem;
  text-align: left;
  vertical-align: top;
}
.wt-article-body .wt-body-table thead th {
  background: var(--accent);
  font-weight: 700;
}

/* Before/After */
.wt-article-body .wt-body-ba { margin: 1.5rem 0; }
.wt-article-body .wt-body-ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.wt-article-body .wt-body-ba-grid > div {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.wt-article-body .wt-body-ba-grid img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.wt-article-body .wt-body-ba-tag {
  position: absolute; top: 0.5rem; left: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: oklch(0.18 0.02 265 / 0.85);
  color: #fff;
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 0.3rem;
  z-index: 1;
}
.wt-article-body .wt-body-ba-cap {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Multi-column layouts get tighter / cleaner spacing inside cells */
.wt-article-body .wt-multi-col { margin: 1.5rem 0; gap: 1.5rem; }
.wt-article-body .wt-multi-col > div > *:first-child { margin-top: 0; }
.wt-article-body .wt-multi-col > div > *:last-child  { margin-bottom: 0; }
.wt-article-body .wt-multi-col figure { margin: 0 0 1rem; }

/* Mobile / tablet — scale typography down and collapse layouts so
   long magazine templates stay readable on a phone. */
@media (max-width: 767px) {
  .wt-article-body { font-size: 0.9375rem; line-height: 1.65; }
  .wt-article-body .wt-body-section-title { font-size: 1.25rem; margin: 1.5rem 0 0.4rem; }
  .wt-article-body .wt-body-standfirst { font-size: 1.0625rem; line-height: 1.45; }
  .wt-article-body .wt-body-heading { font-size: 1.125rem; margin: 1.25rem 0 0.4rem; }
  .wt-article-body .wt-body-pullquote p { font-size: 1.125rem; }
  .wt-article-body .wt-body-pullquote { padding: 1.125rem 0; margin: 1.5rem 0; }
  .wt-article-body .wt-body-quote { font-size: 1rem; padding-left: 1rem; }
  .wt-article-body .wt-body-event { padding: 0.875rem 1rem; }
  .wt-article-body .wt-body-event-title { font-size: 1rem; }
  .wt-article-body .wt-multi-col { gap: 1.25rem; }
  .wt-article-body .wt-body-ba-grid { gap: 0.5rem; }
  .wt-article-body .wt-body-slideshow img { height: 14rem; }
}
@media (max-width: 479px) {
  .wt-article-body .wt-body-ba-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .wt-article-body .wt-body-ba-grid img { aspect-ratio: 16 / 10; }
  .wt-article-body .wt-body-poll { padding: 0.875rem 1rem; }
}

/* Feed excerpts: fade after a few lines, expand in place */
.feed-body-shell {
  position: relative;
  margin-top: 0.75rem;
}
.feed-body-shell .feed-read-more-btn {
  display: block;
  margin: 0.75rem auto 0;
  width: min(100%, 26rem);
  max-width: 100%;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  text-align: center;
}
.feed-body.feed-body--clamped {
  position: relative;
  max-height: 9rem;
  overflow: hidden;
}
.feed-body.feed-body--clamped::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  pointer-events: none;
  /* Soft fade only — no backdrop-blur (reads cleaner than frosted text) */
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in oklch, var(--background) 28%, transparent) 38%,
    color-mix(in oklch, var(--background) 82%, transparent) 72%,
    var(--background) 100%
  );
}
.feed-body.feed-body--expanded {
  max-height: none;
  overflow: visible;
}
.feed-body.feed-body--expanded::after {
  display: none;
}

body.wt-img-lightbox-open {
  overflow: hidden;
}

.wt-img-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: oklch(0.08 0.02 260 / 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  animation: wt-img-lb-in 0.2s ease;
}

@keyframes wt-img-lb-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.wt-img-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: var(--radius);
  background: oklch(0.22 0.02 260 / 0.65);
  color: oklch(0.98 0 0);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.wt-img-lightbox-close:hover {
  background: oklch(0.32 0.03 260 / 0.88);
}

.wt-img-lightbox-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wt-img-lightbox-img {
  max-width: min(96vw, 1600px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 48px oklch(0 0 0 / 0.45);
}

/* Edit button — shown on own articles in the feed / profile */
.feed-entry {
  position: relative;
}
.feed-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 150ms ease, background 150ms ease;
  z-index: 2;
}
.feed-edit-btn:hover {
  opacity: 1;
  background: var(--accent);
}

/* Feed gallery slider */
.feed-gallery-slider {
  position: relative;
  margin: 0.5rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: oklch(0.18 0.04 268);
}
.feed-gallery-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}
.feed-gallery-nav {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.45rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.feed-gallery-arrow {
  width: 1.6rem; height: 1.6rem; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.9); color: #111; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
}
.feed-gallery-arrow:hover { background: #fff; }
.feed-gallery-dots { display: flex; gap: 0.3rem; }
.feed-gallery-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.45); flex-shrink: 0; transition: background 150ms;
}
.feed-gallery-dot.is-active { background: #fff; }

/* Briefly highlight an article when scrolled to from Trending */
.feed-entry.wt-flash {
  animation: wtFlash 1.2s ease;
}
@keyframes wtFlash {
  0%   { background: oklch(0.95 0.05 80); }
  100% { background: transparent; }
}

/* ──────────────────────────────────────────────────────────────────────
   Comment threads — actions, reply form, nested replies

   Used both by article.html's main thread and by feed.html / town.html
   inline comment panels under each feed card.
   ────────────────────────────────────────────────────────────────────── */

/* Action row under each comment: Reply · Delete · Report */
.comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 0.125rem;
}
.comment-action-btn {
  background: none;
  border: none;
  padding: 0.125rem 0;
  cursor: pointer;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 120ms ease;
}
.comment-action-btn:hover { color: var(--foreground); }
.comment-action-btn--reply:hover { color: var(--primary); }
.comment-action-btn--delete:hover { color: var(--destructive, oklch(55% 0.22 25)); }
.comment-action-btn--report:hover { color: var(--destructive, oklch(55% 0.22 25)); }
.comment-action-btn[disabled] { opacity: 0.5; cursor: default; }

/* ── Confirmation modal (delete / destructive actions) ── */
.wt-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.wt-confirm-overlay.is-open { display: flex; }
.wt-confirm-card {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: wt-confirm-in 180ms ease;
  overflow: hidden;
}
@keyframes wt-confirm-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.wt-confirm-body { padding: 1.25rem 1.25rem 0.5rem; }
.wt-confirm-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--destructive) 15%, transparent);
  color: var(--destructive);
  margin-bottom: 0.875rem;
}
.wt-confirm-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  color: var(--foreground);
}
.wt-confirm-message {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin: 0 0 1rem;
}
.wt-confirm-message strong { color: var(--foreground); }
.wt-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) 30%, transparent);
}
.wt-confirm-actions .btn { min-width: 5.5rem; }
.comment-action-btn.is-active { color: var(--primary); }

/* Inline reply form rendered just below the comment's action row */
.comment-reply-form {
  margin-top: 0.625rem;
  padding: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.125rem);
}
.comment-reply-form textarea {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.8125rem;
  line-height: 1.45;
  font-family: inherit;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.comment-reply-form textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px oklch(0.24 0.05 265 / 0.1);
}
.comment-reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Replies indented under the parent comment */
.comment-replies {
  margin-top: 0.625rem;
  padding-left: 0.75rem;
  border-left: 2px solid oklch(0.91 0.01 255);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.comment-replies .comment {
  padding: 0;
  border-bottom: none;
}
.comment-replies .comment .avatar.avatar-md {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.625rem;
}
.comment-replies[hidden] { display: none; }

/* ──────────────────────────────────────────────────────────────────────
   Ad components (sidebar, banner, featured + popup)

   Previously inlined in feed.html / town.html. Hoisted here so other
   pages (article.html, writer.html, etc.) get the same layout.
   ────────────────────────────────────────────────────────────────────── */

/* ── Package 1: Sidebar ad widget ── */
.wt-sidebar-ad {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 150ms ease, border-color 150ms ease;
  cursor: pointer;
}
.wt-sidebar-ad:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); border-color: oklch(0.8 0.01 255); }
.wt-sidebar-ad-logo {
  width: 3rem; height: 3rem;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 0.875rem;
  flex-shrink: 0; overflow: hidden;
}
.wt-sidebar-ad-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 0; }
.wt-sidebar-ad-meta { flex: 1; min-width: 0; }
.wt-sidebar-ad-sponsored {
  font-size: 0.5625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted-foreground); margin-bottom: 0.1rem;
}
.wt-sidebar-ad-name {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-sidebar-ad-tagline {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin: 0.1rem 0 0.3rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-sidebar-ad-link {
  font-size: 0.6875rem; display: flex; align-items: center; gap: 0.2rem;
  margin-top: 0.125rem;
}

/* ── Package 2: Feed banner ad ── */
.wt-feed-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  background: var(--card);
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin: 0.25rem 0;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 150ms ease;
}
.wt-feed-banner:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.wt-feed-banner-logo {
  width: 3rem; height: 3rem;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 0.875rem;
  flex-shrink: 0; overflow: hidden;
}
.wt-feed-banner-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 0; }
.wt-feed-banner-body { flex: 1; min-width: 0; }
.wt-feed-banner-eyebrow {
  font-size: 0.5625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted-foreground); margin-bottom: 0.125rem;
}
.wt-feed-banner-headline {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-feed-banner-subhead {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.35;
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-feed-banner-blurb {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-feed-banner-cta {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.875rem;
  color: white; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600;
}
.wt-feed-banner-img {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
  align-self: center;
}
@media (max-width: 480px) {
  .wt-feed-banner-img { display: none; }
}

/* ── Package 3: Featured ad (sidebar widget + popup) ── */
.wt-featured-ad {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 150ms ease, border-color 150ms ease;
  position: relative;
}
.wt-featured-ad:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); border-color: oklch(0.78 0.01 255); }
.wt-featured-ad-cover { width: 100%; height: 100px; object-fit: cover; display: block; }
.wt-featured-ad-body { padding: 0.875rem 1rem; }
.wt-featured-ad-header { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.5rem; }
.wt-featured-ad-logo {
  width: 2.5rem; height: 2.5rem;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 0.75rem;
  flex-shrink: 0; overflow: hidden;
}
.wt-featured-ad-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 0; }
.wt-featured-ad-name {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-featured-ad-tagline {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.wt-featured-ad-hint {
  font-size: 0.625rem; color: var(--muted-foreground);
  display: flex; align-items: center; gap: 0.25rem;
  margin-top: 0.25rem;
}
.wt-featured-ad-sponsored {
  font-size: 0.5625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted-foreground); margin-bottom: 0.375rem;
}

/* ── Featured ad popup overlay ── */
.wt-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.wt-popup-overlay.is-open { display: flex; }
.wt-popup-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: wt-popup-in 200ms ease;
  position: relative;
}
@keyframes wt-popup-in {
  from { opacity:0; transform: translateY(12px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.wt-popup-cover { width: 100%; height: 160px; object-fit: cover; display: block; }
.wt-popup-body { padding: 1.25rem; }
.wt-popup-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.wt-popup-logo {
  width: 3rem; height: 3rem;
  aspect-ratio: 1;
  border-radius: 0.625rem;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 0.875rem;
  flex-shrink: 0; overflow: hidden;
}
.wt-popup-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 0; }
.wt-popup-biz-name { font-size: 1rem; font-weight: 700; }
.wt-popup-headline { font-size: 0.8125rem; color: var(--muted-foreground); margin-top: 0.125rem; }
.wt-popup-services {
  font-size: 0.8125rem; line-height: 1.6;
  margin-bottom: 0.875rem; padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.wt-popup-contact { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1rem; }
.wt-popup-contact-row {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; color: var(--muted-foreground);
}
.wt-popup-cta {
  display: block; text-align: center;
  padding: 0.625rem 1rem;
  color: white; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 600;
  text-decoration: none;
}
.wt-popup-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 2rem; height: 2rem;
  background: rgba(0,0,0,0.4); color: white;
  border: none; border-radius: 9999px;
  cursor: pointer; display: grid; place-items: center;
  z-index: 10;
}
