/*
  CommentGang — classifieds vibe.
  System font stack, monochrome with a single muted accent, link-driven, dense.
*/
:root {
  --bg: #f7f5f1;
  --fg: #1a1a1a;
  --muted: #707070;
  --rule: #d8d4cc;
  --accent: #c65d2e;
  --accent-soft: #e8833a;
  --card-bg: #ffffff;
  --hl: #fff4d6;
  --max: 920px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--fg); color: #fff; border-bottom: 3px solid var(--accent); }
.topbar .container { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: 0.2px; display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { color: #fff; text-decoration: none; }
.brand:hover .brand-wordmark { opacity: 0.85; }
.brand-logo { display: block; flex-shrink: 0; border-radius: 8px; }
.brand-wordmark { letter-spacing: 0.3px; line-height: 1; }
.brand-wordmark .w-comment { color: #dedad4; font-weight: 500; }
.brand-wordmark .w-gang { color: var(--accent-soft); font-weight: 800; }
.nav { display: flex; gap: 14px; }
.nav a { color: #d0d0d0; font-size: 14px; }
.nav a.active, .nav a:hover { color: #fff; text-decoration: none; }
.searchbar { margin-left: auto; display: flex; gap: 0; }
.searchbar input { padding: 6px 10px; border: 1px solid #444; background: #2a2a2a; color: #fff; min-width: 220px; font-size: 14px; border-radius: 0; }
.searchbar button { padding: 6px 12px; border: 1px solid #444; border-left: 0; background: var(--accent); color: #fff; cursor: pointer; font-size: 14px; border-radius: 0; }
.searchbar button:hover { background: var(--accent-soft); }

main.container { padding-top: 18px; padding-bottom: 60px; }

.page-title { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
.creator-meta { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.filters { background: var(--card-bg); border: 1px solid var(--rule); padding: 8px 12px; margin-bottom: 16px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters strong { color: var(--muted); font-weight: 600; font-size: 13px; }
.filters a { color: var(--fg); padding: 2px 8px; border: 1px solid transparent; border-radius: 2px; }
.filters a:hover { background: var(--hl); text-decoration: none; }
.filters a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.feed { display: flex; flex-direction: column; }
.cmt { background: var(--card-bg); border: 1px solid var(--rule); border-top: 0; padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start; }
.cmt:first-child { border-top: 1px solid var(--rule); }
.cmt-main { flex: 1; min-width: 0; }
.cmt-thumb { flex-shrink: 0; display: block; width: 160px; aspect-ratio: 16/9; overflow: hidden; background: var(--rule); border: 1px solid var(--rule); }
.cmt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.15s; }
.cmt-thumb:hover img { opacity: 0.85; }
.cmt-meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.cmt-author { color: var(--fg); font-weight: 600; }
.cmt-likes { color: var(--accent); font-weight: 600; }
.cmt-sep { color: var(--rule); margin: 0 4px; }
.cmt-badge { background: var(--accent); color: #fff; padding: 1px 6px; font-size: 11px; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.cmt-text { display: block; color: var(--fg); font-size: 15.5px; line-height: 1.55; margin-bottom: 8px; white-space: pre-wrap; word-wrap: break-word; }
.cmt-text:hover { background: var(--hl); text-decoration: none; }
.cmt-src { font-size: 13px; color: var(--muted); }
.cmt-src a { color: var(--fg); border-bottom: 1px dotted var(--muted); }
.cmt-src a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.cmt-ext { color: var(--accent) !important; }

.permalink { background: var(--card-bg); border: 1px solid var(--rule); padding: 24px; margin-bottom: 28px; }
.permalink-text { font-size: 19px; line-height: 1.5; margin: 0 0 16px; padding: 0; border-left: 4px solid var(--accent); padding-left: 16px; white-space: pre-wrap; word-wrap: break-word; }
.permalink-meta { font-size: 14px; margin-bottom: 10px; }
.permalink-src { font-size: 14px; color: var(--muted); }

/* === Permalink hero — the comment IS the page === */
.permalink-hero { background: var(--card-bg); border: 1px solid var(--rule); padding: 28px 32px 24px; margin: 8px 0 20px; box-shadow: 0 1px 0 var(--rule); }
.permalink-author-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.permalink-author { display: flex; align-items: center; gap: 12px; min-width: 0; }
.permalink-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--rule); }
.permalink-author-meta { min-width: 0; }
.permalink-author-name { font-weight: 700; font-size: 16px; color: var(--fg); }
.permalink-author-date { font-size: 13px; color: var(--muted); margin-top: 1px; }
.permalink-likes { text-align: right; flex-shrink: 0; }
.permalink-likes-num { display: block; font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.permalink-likes-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-top: 4px; }

.permalink-quote { font-size: 22px; line-height: 1.55; font-weight: 400; margin: 0 0 24px; padding: 8px 0 8px 20px; border-left: 5px solid var(--accent); white-space: pre-wrap; word-wrap: break-word; color: var(--fg); }

/* === Share row === */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--rule); }
.share-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 14px; font-weight: 500; color: var(--fg); background: var(--bg); border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; cursor: pointer; font-family: inherit; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.share-btn:hover { background: var(--hl); border-color: var(--accent); color: var(--fg); text-decoration: none; }
.share-icon { font-size: 14px; line-height: 1; }
.share-copied { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }

/* === Source attribution card === */
.permalink-source { display: flex; gap: 16px; align-items: stretch; background: var(--card-bg); border: 1px solid var(--rule); padding: 14px; margin-bottom: 28px; }
.permalink-source-thumb { flex-shrink: 0; display: block; width: 180px; aspect-ratio: 16/9; overflow: hidden; background: var(--rule); border: 1px solid var(--rule); }
.permalink-source-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.15s; }
.permalink-source-thumb:hover img { opacity: 0.85; }
.permalink-source-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.permalink-source-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 4px; }
.permalink-source-title { display: block; font-weight: 600; font-size: 16px; color: var(--fg); margin-bottom: 6px; line-height: 1.3; }
.permalink-source-title:hover { color: var(--accent); text-decoration: none; }
.permalink-source-creator { font-size: 13px; color: var(--muted); }
.permalink-source-creator a { color: var(--fg); }

.related h2 { font-size: 16px; margin: 24px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }

.pagination { margin-top: 18px; padding: 12px 0; text-align: center; font-size: 14px; }
.pagination a { padding: 4px 10px; }
.pagination-info { color: var(--muted); margin: 0 12px; }

.creator-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border: 1px solid var(--rule); font-size: 14px; }
.creator-table th, .creator-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule); }
.creator-table th { background: #efece5; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
.creator-table td.num, .creator-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.creator-table tr:last-child td { border-bottom: 0; }
.creator-table tr:hover td { background: var(--hl); }

.aside { margin-top: 28px; background: var(--card-bg); border: 1px solid var(--rule); padding: 14px 16px; }
.aside h2 { font-size: 15px; margin: 0 0 8px; }
.aside ul { margin: 0; padding-left: 18px; font-size: 14px; }
.aside li { margin-bottom: 4px; }

.creator-list-inline { list-style: none; padding: 0; margin: 8px 0 20px; }
.creator-list-inline li { padding: 6px 0; border-bottom: 1px dashed var(--rule); }

.video-results { list-style: none; padding: 0; margin: 8px 0 20px; }
.video-result { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.video-result-thumb { flex-shrink: 0; display: block; width: 120px; aspect-ratio: 16/9; overflow: hidden; background: var(--rule); border: 1px solid var(--rule); }
.video-result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.15s; }
.video-result-thumb:hover img { opacity: 0.85; }
.video-result-meta { flex: 1; min-width: 0; }
.video-result-title { display: block; color: var(--fg); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.video-result-title:hover { color: var(--accent); text-decoration: none; }
.dim { color: var(--muted); font-size: 13px; }
.hint { background: var(--card-bg); border-left: 3px solid var(--accent); padding: 12px 16px; color: var(--muted); }
.empty { color: var(--muted); padding: 30px 0; text-align: center; font-size: 14px; }

.footer { background: #1f1f1f; color: #b0b0b0; padding: 24px 0; margin-top: 40px; font-size: 13px; }
.footer p { margin: 0 0 6px; }
.footer a { color: #b0b0b0; text-decoration: underline; }
.footer a:hover { color: #fff; }

@media (max-width: 640px) {
  .topbar .container { gap: 8px; }
  .nav { order: 3; width: 100%; justify-content: space-around; padding-top: 6px; border-top: 1px solid #333; }
  .searchbar { width: 100%; margin-left: 0; order: 2; }
  .searchbar input { flex: 1; min-width: 0; }
  .filters { font-size: 13px; }
  .cmt { padding: 12px; gap: 10px; }
  .cmt-thumb { width: 96px; }
  .cmt-text { font-size: 15px; }
  .permalink-text { font-size: 17px; }
  .permalink-hero { padding: 20px 18px 18px; }
  .permalink-quote { font-size: 19px; padding-left: 14px; border-left-width: 4px; }
  .permalink-likes-num { font-size: 22px; }
  .share-btn { padding: 7px 11px; font-size: 13px; }
  .permalink-source { flex-direction: column; padding: 12px; gap: 12px; }
  .permalink-source-thumb { width: 100%; }
}
