/* Public Reports (/reports-public, templates/feed.html): the posting box and reports on the left, Trending on the right. */
.feed-page { max-width: 1120px; }
.feed-page .page-intro { margin-bottom: 14px; }

.feed-banner {
  margin: 0 0 22px; padding: 12px 16px; border: 1px solid #f3c98b; border-left: 4px solid var(--orange);
  border-radius: 8px; background: #fff7eb; color: #5c3a06; font-size: 0.92rem; line-height: 1.5;
}

.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.feed-side { position: sticky; top: calc(var(--header-h, 0px) + 16px); display: grid; gap: 16px; }

/* ---- posting box ---- */
.feed-compose, .feed-post, .feed-trending, .feed-rules {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft);
}
.feed-compose { padding: 16px 18px; margin-bottom: 18px; }
.feed-compose-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; margin-bottom: 10px; }
.feed-field { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.feed-page input:not(.hp-field), .feed-page select, .feed-page textarea {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.95rem; font-weight: 400;
}
.feed-page textarea { resize: vertical; min-height: 3em; line-height: 1.5; }
.feed-page input:focus, .feed-page select:focus, .feed-page textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.feed-form-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.feed-form-foot .form-status { flex: 1; margin: 0; }
.feed-form-foot .btn-primary { margin-left: auto; }
.feed-form-foot .btn-primary:disabled { opacity: 0.6; cursor: wait; }
.feed-count { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- tabs ---- */
.feed-tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.feed-tab {
  padding: 9px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted);
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.feed-tab:hover { color: var(--ink); }
.feed-tab.is-current { color: var(--accent); border-bottom-color: var(--accent); }
.feed-note { margin: 0 0 12px; font-size: 0.85rem; color: var(--muted); }

/* ---- posts ---- */
.feed-list { display: grid; gap: 12px; }
.feed-post { padding: 14px 18px; }
.feed-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 0.85rem; }
.feed-author { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.feed-sep, .feed-time { color: var(--muted); }
.feed-time-link { color: inherit; text-decoration: none; }
.feed-time-link:hover { text-decoration: underline; }
.feed-tag {
  margin-left: auto; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.feed-tag[data-cat="Report"] { background: #fdecec; color: var(--red); }
.feed-tag[data-cat="Question"] { background: #e8f0fc; color: var(--blue); }
.feed-text { margin: 8px 0 10px; font-size: 0.97rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.feed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feed-act {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted);
  font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: var(--ease);
}
.feed-act:hover { background: var(--hover); color: var(--ink); }
.feed-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.feed-act[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.feed-report[aria-pressed="true"] { border-color: var(--red); color: var(--red); background: #fdecec; }
.feed-n { font-variant-numeric: tabular-nums; font-weight: 600; }
.feed-act-status { font-size: 0.78rem; color: var(--muted); }

/* ---- replies ---- */
.feed-replies { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.feed-reply-list { list-style: none; margin: 0 0 10px; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.feed-reply-list:empty { display: none; }
.feed-reply .feed-text { margin: 4px 0 0; font-size: 0.92rem; cursor: auto; }
.feed-reply-form { display: grid; gap: 8px; }
.feed-reply-form input:not(.hp-field) { max-width: 240px; }

/* ---- hidden by community reports (collapsed, at the bottom) ---- */
.feed-hidden { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.feed-hidden summary {
  cursor: pointer; width: fit-content; font-size: 0.85rem; font-weight: 600; color: var(--muted); list-style-position: inside;
}
.feed-hidden summary:hover { color: var(--ink); }
.feed-hidden summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.feed-hidden[open] summary { margin-bottom: 10px; }
.feed-hidden-list { display: grid; gap: 10px; }
.feed-post.is-hidden { background: var(--hover); box-shadow: none; }
.feed-post.is-hidden .feed-text { color: #475467; cursor: auto; margin-bottom: 6px; }
.feed-hidden-meta { margin: 0; font-size: 0.78rem; color: var(--muted); }

.feed-empty { padding: 28px 0; text-align: center; color: var(--muted); }
.feed-more { margin: 18px 0 0; text-align: center; }

/* ---- sidebar ---- */
.feed-trending, .feed-rules { padding: 16px 18px; }
.trending-list { margin: 0; padding: 0; list-style: none; counter-reset: trend; }
.trending-list li {
  counter-increment: trend; display: flex; align-items: baseline; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.trending-list li:first-child { border-top: 0; padding-top: 0; }
.trending-list li::before { content: counter(trend); width: 1.2em; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.trending-word { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.trending-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.trending-note { margin: 12px 0 0; font-size: 0.75rem; color: var(--muted); }
.feed-rules ul { margin: 0; padding-left: 18px; font-size: 0.84rem; line-height: 1.5; color: #334155; }
.feed-rules li + li { margin-top: 6px; }

@media (max-width: 900px) {
  .feed-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .feed-side { position: static; }
  .feed-rules { display: none; }
}
@media (max-width: 520px) {
  .feed-compose-row { grid-template-columns: minmax(0, 1fr); }
  .feed-compose, .feed-post { padding: 12px 14px; }
  .feed-tag { margin-left: 0; }
}

/* ---- Source Link: the field in the posting box, and the preview card (in the box and in each post) ---- */
.feed-source { margin-top: 10px; }
.feed-required { font-weight: 400; color: var(--red); }
.feed-source-note { margin: 0 0 6px; font-size: 0.78rem; font-weight: 400; color: var(--muted); }
.feed-source-row input[aria-invalid="true"] { border-color: var(--red); }
.feed-source-row { display: flex; gap: 8px; }
.feed-source-row input { flex: 1; min-width: 0; }
.feed-source-row .btn-secondary { flex: none; white-space: nowrap; }
.feed-source-row .btn-secondary:disabled { opacity: 0.6; cursor: wait; }
.feed-preview-status { min-height: 1.2em; font-size: 0.78rem; font-weight: 400; color: var(--muted); }
.feed-preview-status.error { color: var(--red); }

.feed-link {
  position: relative; display: flex; align-items: stretch; margin: 0 0 10px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); text-decoration: none; transition: var(--ease);
}
.feed-link[hidden] { display: none; }
a.feed-link:hover { border-color: #cbd5e1; background: var(--hover); }
a.feed-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feed-link-img { flex: none; width: 120px; height: auto; min-height: 96px; object-fit: cover; background: var(--hover); border-right: 1px solid var(--line); }
.feed-link-img[hidden] { display: none; }
.feed-link-body { display: grid; align-content: center; gap: 3px; min-width: 0; padding: 10px 14px; }
.feed-link-domain { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.feed-link-title {
  font-size: 0.92rem; font-weight: 700; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.feed-link-desc {
  font-size: 0.82rem; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.feed-link-desc[hidden] { display: none; }
.feed-preview { margin: 8px 0 0; padding-right: 32px; font-weight: 400; }  /* not the field label's weight */
.feed-preview-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(15, 23, 42, 0.06); color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.feed-preview-remove:hover { background: rgba(15, 23, 42, 0.12); color: var(--ink); }
@media (max-width: 520px) {
  .feed-source-row { flex-wrap: wrap; }
  .feed-source-row .btn-secondary { width: 100%; }
  .feed-link-img { width: 88px; min-height: 80px; }
}

/* ---- Share and Print on each report ---- */
.feed-share { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.feed-share-label { margin-right: 4px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.feed-share-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid transparent;
  border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 0.78rem; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: var(--ease);
}
.feed-share-icon { width: 28px; padding: 0; justify-content: center; }
.feed-share-btn:hover { border-color: var(--line); background: var(--hover); color: var(--ink); }
.feed-share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.feed-print { margin-left: auto; }
.feed-post.is-hidden .feed-share { border-top-color: #d7dde5; }
.feed-single .feed-main { max-width: 760px; }

/* The site footer (templates/_site_footer.html) at the end of the page, as on the maps */
.feed-footer { margin-top: 32px; }

/* Printing one report (feed.js adds .print-one and .is-printing): that report alone, with the unverified note and
   its addresses written out, in black on white. */
@media print {
  html.print-one .site-header, html.print-one .crumbs, html.print-one .page-intro, html.print-one .feed-compose,
  html.print-one .feed-tabs, html.print-one .feed-note, html.print-one .feed-side, html.print-one .feed-more,
  html.print-one .feed-empty, html.print-one .feed-footer, html.print-one .feed-hidden > summary,
  html.print-one .feed-post:not(.is-printing), html.print-one .to-top { display: none !important; }
  html.print-one .feed-hidden { display: block; margin: 0; padding: 0; border: 0; }
  html.print-one .feed-hidden > :not(.feed-hidden-list) { display: none; }
  html.print-one .feed-page { max-width: none; padding: 0; }
  html.print-one .feed-layout { display: block; }
  html.print-one .feed-banner { margin: 0 0 12pt; padding: 6pt 0; border: 0; border-bottom: 1pt solid #000; background: none; color: #000; font-size: 9pt; }
  .feed-post.is-printing { padding: 0; border: 0; box-shadow: none; background: none; }
  .feed-post.is-printing .feed-actions, .feed-post.is-printing .feed-share, .feed-post.is-printing .feed-reply-form,
  .feed-post.is-printing .feed-replies[hidden] { display: none !important; }
  .feed-post.is-printing .feed-text { font-size: 12pt; color: #000; }
  .feed-post.is-printing .feed-link { break-inside: avoid; border-color: #999; }
  .feed-post.is-printing .feed-tag { border: 1pt solid #999; background: none; color: #000; }
  .feed-print-source { margin: 10pt 0 0; font-size: 9pt; color: #444; overflow-wrap: anywhere; }
}
