/* Kurnool Bazar forum - public pages (loaded together with site.css, which
   already provides .card, .hero, .sec-title, .btn, .pform, .msg, .pager, .tag). */

/* ---- action bars ---- */
.f-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 10px; }
.f-actions .msg { margin: 0; flex: 1 1 100%; text-align: center; }
.f-count { font-size: 13px; font-weight: 700; opacity: .85; }

/* ---- category cards ---- */
.f-cats { display: grid; gap: 8px; margin-top: 8px; }
.f-cat { display: flex; flex-direction: column; gap: 4px; margin-top: 0; padding: 12px 14px; color: var(--ink); text-decoration: none; border-left: 6px solid var(--maroon); min-height: 64px; }
.f-cat.c2 { border-left-color: var(--blue); }
.f-cat.c3 { border-left-color: var(--purple); }
.f-cat.c4 { border-left-color: var(--green); }
.f-cat:hover .f-cat-name, .f-cat:focus-visible .f-cat-name { text-decoration: underline; }
.f-cat-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 800; font-size: clamp(16px, 4.6vw, 18px); color: var(--maroon); line-height: 1.25; overflow-wrap: anywhere; }
.f-cat.c2 .f-cat-name { color: var(--blue); }
.f-cat.c3 .f-cat-name { color: var(--purple); }
.f-cat.c4 .f-cat-name { color: #166a2c; }
.f-cat-desc { font-size: 13px; color: #444; line-height: 1.4; }
.f-cat-meta { font-size: 12px; color: var(--muted); }
.f-cat-meta b { color: var(--ink); }
@media (min-width: 520px) { .f-cats { grid-template-columns: 1fr 1fr; } }

/* ---- topic lists ---- */
.f-topics { margin-top: 8px; }
.f-topic { padding: 8px 12px 10px; border-bottom: 1px solid #eee; }
.f-topic:last-child { border-bottom: 0; }
.f-topic.pinned { background: #fffaf0; }
.f-topic-title { display: block; padding: 6px 0 2px; min-height: 40px; font-weight: 800; font-size: 15px; line-height: 1.35; color: var(--maroon); text-decoration: none; overflow-wrap: anywhere; }
.f-topic-title:hover { text-decoration: underline; }
.f-topic-meta { display: flex; flex-wrap: wrap; gap: 2px 5px; align-items: center; padding-top: 4px; font-size: 12px; color: var(--muted); }
.f-topic-meta .f-author { font-weight: 700; color: #333; }
.f-topic-meta .tag { padding: 3px 9px; }
/* small inline links (category tag, "in <category>", "Reply") keep their compact look
   but get an invisible 40px-high hit area so they are comfortable to tap */
.f-topic-meta .tag, .f-post-who .meta-line a, .f-post-foot a { position: relative; display: inline-block; }
.f-topic-meta .tag::before, .f-post-who .meta-line a::before, .f-post-foot a::before { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 40px; transform: translateY(-50%); }
.f-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; vertical-align: middle; line-height: 1.5; }
.f-badge.pin { background: #fff3c4; color: #6b4f00; }
.f-badge.lock { background: #eceff1; color: #37474f; }
.f-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.f-empty { margin: 0; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---- posts (original post + replies) ---- */
.f-post { padding: 12px 14px; }
.f-post.f-op { border-top: 6px solid var(--maroon); }
.f-post:target { box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
.f-post-head { display: flex; gap: 10px; align-items: center; }
.f-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue), #1976d2); color: #fff; font-weight: 800; font-size: 18px; }
.f-op .f-avatar { background: linear-gradient(135deg, var(--maroon), var(--title-2, #c62828)); }
.f-post-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.f-post-who b { font-size: 15px; overflow-wrap: anywhere; }
.f-post-who .meta-line a { color: var(--blue); font-weight: 700; text-decoration: none; }
.f-post-who .meta-line a:hover { text-decoration: underline; }
.f-num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 6px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; }
.f-num:hover { background: #f3f3f3; color: var(--ink); }
.f-title { margin: 10px 0 6px; font-size: clamp(18px, 5.4vw, 22px); line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.f-post-body { font-size: 15px; line-height: 1.6; color: #222; overflow-wrap: anywhere; }
.f-post:not(.f-op) .f-post-body { margin-top: 8px; }
.f-post-body a { overflow-wrap: anywhere; }
.f-post-foot { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #eee; }
.f-post-foot a { font-weight: 700; text-decoration: none; color: var(--blue); }

/* ---- forms ---- */
.f-form { padding: 14px; }
.f-form-title { margin: 0 0 4px; font-size: 18px; color: var(--maroon); }
.pform .opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.pform .btns .help { flex: 1 1 100%; margin: 0; }
.pform .btns .btn.grey { color: #fff; }
.f-errors { margin: 8px 0 4px; }
.f-errors ul { margin: 4px 0 0; padding-left: 20px; }
.f-errors li { margin: 2px 0; font-weight: 500; }
.f-locked { text-align: center; }
.f-locked .msg { margin: 0 0 8px; }
.f-locked .center { margin: 8px 0 0; }
.f-rules { font-size: 14px; }
.f-pending { padding: 18px 14px; }
.f-pending .msg { margin: 0 0 10px; text-align: left; }
.f-pending-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.f-pending .btns-row { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .f-post:target { animation: f-flash 1.2s ease-out 1; }
  @keyframes f-flash { from { background: #fff8e1; } to { background: var(--card); } }
}

/* ---- print: drop interactive chrome so a topic prints cleanly ---- */
@media print {
  .f-form, .f-post-foot, .f-actions, .f-rules, .pager { display: none !important; }
  .f-post, .f-topic-row { box-shadow: none; border: 1px solid #ccc; }
}
