/* Cars Forum — only what is specific to the forum. Buttons, tiles, fields, chips, posts and
   pagination come from Cars Theme (cct-*); colours are the theme's palette variables, with
   "retro sunset" fallbacks for other themes. */

.cforum, .cforum-row, .cforum-vehicle {
	--cf-surface: var(--c-surface, #fff);
	--cf-ground: var(--c-ground, #fff6ea);
	--cf-ink: var(--c-ink, #2b1e3f);
	--cf-muted: var(--c-muted, #665870);
	--cf-line: var(--c-line, #efe2cf);
	--cf-accent: var(--c-accent, #c42e44);
	--cf-accent-soft: var(--c-accent-soft, #ffebc8);
	--cf-ok: #1f7a4d;
	--cf-ok-soft: var(--c-success-soft, #e5f2ea);
	--cf-dark: var(--c-dark, #2b1e3f);
	--cf-on-dark: var(--c-on-ink, #fff6ea);
	--cf-r: var(--r-tile, 22px);
	--cf-gap: var(--gap, 12px);
}
.cforum { display: flex; flex-direction: column; gap: var(--cf-gap); }
.cforum .cct-page-head { margin-bottom: 0; }
.cforum h2 { margin: .4em 4px .2em; }

/* ---- Sub-navigation ---- */
.cforum-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cforum-nav__links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.cforum-nav__links::-webkit-scrollbar { display: none; }
.cforum-nav__links a { white-space: nowrap; }
.cforum-nav__links a[aria-current="page"] { background: var(--cf-dark); color: var(--cf-on-dark); }
@media (max-width: 599.98px) { .cforum-nav > .cct-btn { width: 100%; } }

.cforum-filter { margin: 0; }
.cforum-filter .cct-filters__main { margin-bottom: 0; }
@media (max-width: 599.98px) { .cforum-filter .cct-filters__field:last-child { grid-column: 1 / -1; } }

/* ---- Topic rows ---- */
.cforum-list { display: flex; flex-direction: column; gap: 8px; }
.cforum-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--cf-surface); border-radius: var(--cf-r); min-width: 0; }
.cforum-row__main { flex: 1; min-width: 0; }
.cforum-row__title { margin: 0 0 4px; font-family: var(--f-body, inherit); font-size: 16px; font-weight: 600; letter-spacing: 0; line-height: 1.3; overflow-wrap: anywhere; }
.cforum-row__title a { text-decoration: none; }
.cforum-row__title a:hover { text-decoration: underline; }
.cforum-row__meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--cf-muted); }
.cforum-row__car { font-weight: 600; color: var(--cf-accent); }
.cforum-row__count { flex: none; min-width: 58px; padding: 6px 4px; border-radius: 14px; background: var(--cf-ground); display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--cf-muted); line-height: 1.2; }
.cforum-row__count strong { font-family: var(--f-head, inherit); font-size: 18px; color: var(--cf-ink); }
.cforum-row.is-solved .cforum-row__count { background: var(--cf-ok-soft); }
/* Compact rows inside tiles and car pages: separated by lines, not tiles of their own. */
.cforum-row--compact { padding: 10px 0; border-radius: 0; background: none; }
.cforum-row--compact + .cforum-row--compact { border-top: 1px solid var(--cf-line); }
.cforum-row--compact .cforum-row__title { font-size: 14px; }
.cforum-row--compact .cforum-row__count { min-width: 46px; padding: 4px; }
.cforum-row--compact .cforum-row__count strong { font-size: 15px; }
.cforum-vehicle .cforum-list { background: var(--cf-surface); border-radius: var(--cf-r); padding: 4px 16px; gap: 0; }

/* ---- Topic page ---- */
.cforum-topic { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--cf-gap); align-items: start; }
@media (min-width: 1024px) { .cforum-topic { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap-lg, 20px); } }
.cforum-topic__main { display: flex; flex-direction: column; gap: var(--cf-gap); min-width: 0; max-width: 820px; }
.cforum-topic__side { display: flex; flex-direction: column; gap: var(--cf-gap); min-width: 0; }
.cforum-topic__side:empty { display: none; }
.cforum-section { display: flex; flex-direction: column; gap: var(--cf-gap); }

.cforum-question__labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cforum-question__title { margin: 0; font-size: 1.6rem; overflow-wrap: anywhere; }
@media (min-width: 1024px) { .cforum-question__title { font-size: 2rem; } }

.cforum-post .cct-post__head .cct-badge { margin-left: auto; }
.cforum-avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; flex: none; }
.cforum-text { overflow-wrap: anywhere; }
.cforum-text p { margin: 0 0 .75em; }
.cforum-text p:last-child { margin-bottom: 0; }
.cforum-text a { color: var(--cf-accent); }
.cforum-post .cct-gallery { margin-top: 0; }
.cforum-post .cct-post__foot { min-height: 36px; }
.cforum-reply.is-solution { box-shadow: inset 0 0 0 2px var(--cf-ok); }
.cforum-raw[hidden] { display: none; }

.cforum-tools { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; }
.cforum-link { border: 0; background: none; padding: 6px 0; min-height: 36px; font: inherit; font-size: 14px; font-weight: 500; color: var(--cf-accent); cursor: pointer; }
.cforum-link:hover { text-decoration: underline; }
.cforum-link--danger { color: var(--c-danger, #b42318); }
.cforum-link--muted { color: var(--cf-muted); }
.cforum-link:disabled { opacity: .6; cursor: default; text-decoration: none; }

.cforum-edit { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cforum-edit input, .cforum-edit textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--c-line-strong, #dcc5a4); border-radius: var(--r-ctl, 14px); background: var(--cf-surface); }
.cforum-edit input { min-height: 48px; }
.cforum-edit textarea { min-height: 160px; }
.cforum-edit .cct-btn { margin-right: 6px; }

.cforum-form .cct-field input[type="file"] { width: 100%; padding: 10px 0; }
.cforum-form .cct-alert[hidden] { display: none; }
.cforum .cct-form { max-width: none; }
.cforum .cct-form .cct-fieldset:last-of-type { margin-bottom: 0; }

/* ---- Notifications ---- */
.cforum-notifs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cforum-notif { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 12px 4px 12px 14px; border-top: 1px solid var(--cf-line); position: relative; }
.cforum-notif a { text-decoration: none; overflow-wrap: anywhere; }
.cforum-notif a:hover { text-decoration: underline; }
.cforum-notif time { font-size: 13px; color: var(--cf-muted); white-space: nowrap; }
.cforum-notif.is-unread a { font-weight: 600; }
.cforum-notif.is-unread::before { content: ""; position: absolute; left: 0; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--cf-accent); }

/* ---- Tile tabs ---- */
.cforum-tabs { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 12px; background: var(--c-ground, #fff6ea); }
.cforum-tab { min-height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--c-muted, #665870); cursor: pointer; }
.cforum-tab[aria-selected="true"] { background: var(--c-surface, #fff); color: var(--c-ink, #2b1e3f); box-shadow: 0 1px 4px rgba(var(--c-shadow, 43, 30, 63), .12); }
.cct-t--ink .cforum-tab[aria-selected="true"] { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: none; }
.cforum-tile__panel { display: flex; flex-direction: column; }
.cforum-tile__panel[hidden] { display: none; }
.cforum-tile__ask { align-self: flex-start; margin-top: auto; }
.cct-t--ink .cforum-row.is-solved .cforum-row__count { background: var(--c-dark-2); }

/* ---- Bell in the top bar ---- */
.cforum-bell { position: relative; color: var(--c-ink, #2b1e3f); }
.cforum-bell__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--c-accent, #c42e44); color: var(--c-accent-ink, #fff); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* ---- Block on car pages ---- */
.cforum-vehicle { margin-top: var(--gap-lg, 20px); max-width: 760px; }
.cforum-vehicle h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cforum-vehicle .cforum-list { margin-bottom: 12px; }
