/* Living in Korea — forum styles */
/* sticky footer: fill the viewport so the footer sits at the bottom on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
.forum-main { padding: 28px 0 64px; flex: 1 0 auto; }
.footer { flex-shrink: 0; }
.forum-header { margin-bottom: 18px; }
.forum-header h1 { font-size: 1.7rem; margin: 0 0 4px; }
.forum-sub { color: #64748B; font-size: .9rem; margin: 0; }
.forum-back { color: #2563EB; text-decoration: none; font-size: .9rem; display: inline-block; margin-bottom: 10px; }
.forum-back:hover { text-decoration: underline; }

.forum-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.forum-header-top h1 { margin: 0; }
.forum-filters { display: flex; gap: 12px; margin: 16px 0 18px; }
.forum-filters .form-select { flex: 0 1 260px; min-width: 150px; padding: 8px 10px; }
@media (max-width: 640px) { .forum-filters { flex-direction: column; } .forum-filters .form-select { flex: 1 1 auto; } }

.btn-sm { padding: 5px 10px; font-size: .85rem; }

/* topic list */
.topic-list { list-style: none; margin: 0; padding: 0; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; background: #fff; }
.topic-item { padding: 14px 16px; border-bottom: 1px solid #F1F5F9; }
.topic-item:last-child { border-bottom: none; }
.topic-title { font-weight: 600; color: #1E293B; text-decoration: none; font-size: 1.02rem; }
.topic-title:hover { color: #2563EB; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; color: #64748B; font-size: .82rem; }
.topic-badges { background: #EFF6FF; color: #2563EB; padding: 2px 8px; border-radius: 999px; font-size: .76rem; }
.topic-author .muted { color: #94A3B8; }
.forum-empty { padding: 28px 16px; text-align: center; color: #94A3B8; }
.forum-pager { text-align: center; margin-top: 16px; }

/* topic detail */
.topic-detail-title { font-size: 1.5rem; margin: 6px 0; }
.topic-body.card { padding: 18px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; margin: 12px 0 24px; }
.replies-heading { font-size: 1.1rem; margin: 8px 0 12px; }
.post-list { list-style: none; margin: 0 0 24px; padding: 0; }
.post-item { padding: 12px 14px; border-left: 3px solid #E2E8F0; background: #F8FAFC; border-radius: 8px; margin-bottom: 8px; }
.post-body { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.post-meta { color: #64748B; font-size: .8rem; display: flex; gap: 12px; flex-wrap: wrap; }

/* Share row (topic detail) */
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 26px; }
.share-label { color: var(--gray-600, #525252); font-size: 0.875rem; font-weight: 600; margin-right: 2px; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--gray-200, #e5e5e5); background: #fff; color: var(--gray-700, #404040); font-size: 0.875rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.share-btn:hover { background: var(--gray-50, #fafafa); border-color: var(--gray-300, #d4d4d4); }
.share-btn svg { display: block; flex: none; }
.share-fb { color: #1877F2; }
.share-fb:hover { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-x { color: #0f1419; }
.share-x:hover { background: #0f1419; color: #fff; border-color: #0f1419; }
.share-copy.copied { color: #10B981; border-color: #10B981; background: #ecfdf5; }

/* Recommend / report bar */
.react-bar { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.react-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 16px; border: 1px solid var(--gray-200, #e5e5e5); background: #fff; color: var(--gray-600, #525252); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.react-btn:hover { border-color: var(--gray-300, #d4d4d4); background: var(--gray-50, #fafafa); }
.react-btn svg { display: block; }
.react-rec.active { color: #e0245e; border-color: #f5b8c8; background: #fdf0f4; }
.react-rep.active { color: #b45309; border-color: #fcd9a8; background: #fff7ed; }
.react-bar .react-count { font-variant-numeric: tabular-nums; }
.post-item .react-bar { margin-top: 8px; }

/* Topic-level actions: recommend/report on the left, share on the right (desktop) */
.topic-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 26px; flex-wrap: wrap; }
.topic-actions .react-bar, .topic-actions .share-row { margin: 0; }
@media (max-width: 768px) {
  .topic-actions { flex-direction: column; align-items: flex-start; gap: 14px; margin: 14px 0 22px; }
}

/* Pin badge + pinned highlight */
.pin-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.72rem; font-weight: 700; color: var(--accent, #2563EB); background: #eff6ff; border-radius: 5px; padding: 1px 6px; vertical-align: middle; }
.topic-item.pinned { border-left: 3px solid var(--accent, #2563EB); padding-left: 9px; }
.post-item.pinned { border-left-color: var(--accent, #2563EB); background: #f5f9ff; }

/* Author link */
.author-link { color: var(--gray-700, #404040); font-weight: 600; text-decoration: none; }
.author-link:hover { color: var(--accent, #2563EB); text-decoration: underline; }

/* Author profile page */
.profile-header { display: flex; align-items: center; gap: 16px; margin: 12px 0 20px; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--accent, #2563EB); color: #fff; font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.profile-name { font-size: 1.5rem; margin: 0 0 2px; }
.profile-meta { color: #64748B; font-size: 0.85rem; margin: 0 0 4px; }
.profile-stats { color: var(--gray-700, #404040); font-size: 0.9rem; margin: 0; }
.profile-replies .post-item .topic-title { font-size: 0.95rem; }

/* reply box */
.reply-box { border: 1px solid #E2E8F0; border-radius: 12px; padding: 14px; background: #fff; }
.reply-box .form-textarea { width: 100%; min-height: 70px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.char-count { color: #94A3B8; font-size: .8rem; }
.form-msg { margin-top: 8px; font-size: .85rem; color: #16A34A; }
.form-msg.err { color: #DC2626; }

/* auth chip */
.auth-chip { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.auth-nick { color: #CBD5E1; font-weight: 600; font-size: .9rem; }
.auth-link { background: none; border: 1px solid rgba(255,255,255,.28); color: #CBD5E1; border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; }
.auth-link:hover { color: #fff; background: rgba(255,255,255,.1); }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 420px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-box h3 { margin: 0 0 6px; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #94A3B8; }
.m-help { color: #64748B; font-size: .9rem; margin: 0 0 14px; }
.m-step .form-input { margin-bottom: 10px; }
.m-row { display: flex; gap: 8px; margin-bottom: 10px; }
.m-row .form-select { flex: 1; min-width: 0; }
.modal-box .form-input, .modal-box .form-textarea { width: 100%; margin-bottom: 10px; }
.modal-box .form-textarea { min-height: 120px; }
.m-msg { font-size: .85rem; margin-top: 6px; }
.m-msg.err { color: #DC2626; } .m-msg.ok { color: #16A34A; }

@media (max-width: 560px) {
  .forum-toolbar { flex-direction: column; align-items: stretch; }
  .topic-meta { gap: 8px; }
}

/* owner edit/delete + inline edit + footer logout */
.topic-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.topic-title-row .topic-detail-title { margin: 6px 0; }
.owner-actions { display: inline-flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
.post-meta .owner-actions { margin-left: 0; }
.mini-btn { background: none; border: 1px solid #E2E8F0; color: #64748B; border-radius: 6px; padding: 3px 9px; font-size: 0.78rem; cursor: pointer; line-height: 1.4; }
.mini-btn:hover { background: #F1F5F9; color: #1E293B; }
.mini-danger:hover { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.inline-edit { margin: 6px 0; }
.inline-edit .form-textarea { width: 100%; min-height: 54px; }
.footer-logout { text-align: center; margin-top: 16px; }
.footer-logout .auth-link { background: none; border: 1px solid rgba(255, 255, 255, 0.28); color: #CBD5E1; border-radius: 8px; padding: 6px 16px; cursor: pointer; font: inherit; }
.footer-logout .auth-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
/* larger modal for the new/edit topic form */
.modal-box.modal-lg { max-width: 520px; }
.modal-lg .form-textarea { min-height: 150px; }
