/* VietHub — lightweight, no framework. Craigslist-plain but friendly. */
:root {
  --accent: #c8102e;
  --accent-dark: #9c0c23;
  --link: #0645ad;
  --text: #1a1a1a;
  --muted: #666;
  --border: #ddd;
  --bg-soft: #f7f5f2;
  --ok-bg: #e7f6e7;
  --ok-border: #6cbf6c;
  --err-bg: #fdeaea;
  --err-border: #e08a8a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background: #fff;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
a { color: var(--link); }
h1 { font-size: 1.5rem; }
h1 small, h2 small { color: var(--muted); font-weight: normal; font-size: 0.9rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; }
code { background: var(--bg-soft); padding: 0 0.25rem; }

/* header */
.site-header { background: var(--bg-soft); border-bottom: 2px solid var(--accent); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; }
.logo { font-size: 1.5rem; font-weight: 800; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.header-search { display: flex; flex: 1 1 200px; min-width: 160px; }
.header-search input { flex: 1; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-right: 0; border-radius: 4px 0 0 4px; font-size: 1rem; }
.header-search button { padding: 0.4rem 0.9rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 0 4px 4px 0; cursor: pointer; }
.header-nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-size: 0.95rem; }
.lang-switch { color: var(--muted); }

/* buttons */
.btn { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); text-decoration: none; font-size: 0.95rem; cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 0.7rem 1.4rem; font-size: 1.05rem; }
.btn-sm { padding: 0.2rem 0.5rem; font-size: 0.85rem; }
.linklike { background: none; border: none; color: var(--link); cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }
.inline-form { display: inline; }

/* home */
.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.loc-banner { background: var(--bg-soft); padding: 0.5rem 0.8rem; border-radius: 4px; }
.city-grid, .state-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.3rem 1rem; }
.city-grid small { color: var(--muted); }
.cat-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.cat-grid a { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); background: #fff; }
.cat-grid a:hover { border-color: var(--accent); }
.cat-emoji { font-size: 1.4rem; }
.cat-name { flex: 1; font-weight: 600; }
.cat-count { color: var(--muted); font-size: 0.9rem; }

/* post lists */
.post-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.post-card { display: flex; gap: 0.75rem; padding: 0.55rem 0.25rem; border-bottom: 1px solid #eee; }
.post-card.featured { background: #fffbe8; }
.post-card .thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.post-card-main { min-width: 0; }
.post-title { font-weight: 600; text-decoration: none; }
.post-title:hover { text-decoration: underline; }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.price { color: #0a7a0a; font-weight: 700; }
.badge { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 3px; margin-right: 0.4rem; vertical-align: middle; }
.badge-featured { background: #f5c518; color: #4a3a00; }

/* breadcrumbs & nav */
.breadcrumbs { font-size: 0.9rem; margin: 0.75rem 0; color: var(--muted); }
.breadcrumbs .sep { margin: 0 0.35rem; }
.sub-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.sub-nav a { padding: 0.25rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: 0.9rem; color: var(--text); }
.sub-nav a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin: 1.25rem 0; }

/* post detail */
.post-detail h1 { margin-bottom: 0.25rem; }
.post-images { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.post-images img { max-width: 100%; width: 280px; border-radius: 6px; border: 1px solid var(--border); }
.post-body { white-space: pre-wrap; overflow-wrap: break-word; margin: 1rem 0; max-width: 42rem; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin: 1rem 0; padding: 0.6rem 0.8rem; background: var(--bg-soft); border-radius: 6px; }
.contact-box { border: 1px solid var(--border); border-radius: 6px; padding: 0.8rem 1rem; margin: 1.25rem 0; background: #fafafa; }
.contact-box h2 { margin-top: 0; }
.report-box { margin: 1rem 0; color: var(--muted); }
.post-id { color: var(--muted); font-size: 0.85rem; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 0.8rem; max-width: 42rem; }
.stack.narrow { max-width: 24rem; }
.stack label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; font-size: 0.95rem; }
.stack label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
.stack input:not([type='checkbox']), .stack select, .stack textarea {
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; font-family: inherit; font-weight: 400;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--border); border-radius: 6px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.1rem 0; }
.form-intro { background: var(--ok-bg); border: 1px solid var(--ok-border); padding: 0.6rem 0.8rem; border-radius: 4px; }
.search-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.search-form input[type='search'] { flex: 2 1 220px; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; }
.search-form select { flex: 1 1 130px; padding: 0.5rem 0.4rem; border: 1px solid var(--border); border-radius: 4px; }

/* honeypot — hidden from humans, present for bots */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; overflow: hidden; }

/* alerts */
.alert { padding: 0.7rem 0.9rem; border-radius: 4px; margin: 0.75rem 0; }
.alert-ok { background: var(--ok-bg); border: 1px solid var(--ok-border); }
.alert-err { background: var(--err-bg); border: 1px solid var(--err-border); }
.alert ul { margin: 0; padding-left: 1.2rem; }
.empty { color: var(--muted); padding: 1.25rem 0; }

/* tables (me/admin) */
.me-table, .admin-table { width: 100%; border-collapse: collapse; }
.me-table td, .admin-table td { padding: 0.5rem 0.4rem; border-bottom: 1px solid #eee; vertical-align: top; }
.actions { white-space: nowrap; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.status { font-size: 0.8rem; padding: 0.15rem 0.4rem; border-radius: 3px; background: var(--bg-soft); }
.status-active { background: var(--ok-bg); }
.status-held, .status-pending_email { background: #fff3cd; }
.status-banned, .status-expired { background: var(--err-bg); }

/* manage */
.manage-actions { display: flex; gap: 0.75rem; margin: 1rem 0; }

/* prose (static pages) */
.prose { max-width: 42rem; }
.prose li { margin-bottom: 0.4rem; }

/* footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: var(--bg-soft); padding: 1.25rem 0 1.5rem; font-size: 0.9rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.5rem; }
