/*****************************************************************
Forum index cards (ul.forumbox) — layout shared by all styles.
Each style sets its colours on ul.forumbox via custom properties:
  --fb-card        card background
  --fb-card-hover  card background on hover (defaults to --fb-card)
  --fb-border      card border
  --fb-border-hover card border on hover (defaults to --fb-border)
  --fb-accent      "new posts" badge colour
  --fb-muted       secondary text (stats, last post)
*****************************************************************/

.pun ul.forumbox {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
	gap: 14px;
	padding: 15px;
	overflow: visible;
}

.pun li.foruminbox {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	float: none;   /* override stale cached skin rules */
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 14px;
	background: var(--fb-card, #fff);
	border: 1px solid var(--fb-border, #d9e1e7);
	border-radius: 4px;
	transition: background-color .15s ease, border-color .15s ease;
}

.pun li.foruminbox:hover {
	background: var(--fb-card-hover, var(--fb-card, #fff));
	border-color: var(--fb-border-hover, var(--fb-border, #d9e1e7));
}

/* Icon */
.pun .foruminbox a.forumicon {
	flex: 0 0 96px;
	width: 96px;
	height: 96px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 96px 96px;
	border-radius: 12px;
}

/* Text column */
.pun .foruminbox .foruminfo {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 96px;
	display: flex;
	flex-direction: column;
}

.pun .foruminbox .foruminfo h3 {
	font-size: 1.154em;
	font-weight: bold;
	line-height: 1.3;
	padding: 0;
	margin: 0 0 2px 0;
	word-break: break-word;
}

.pun .foruminbox .foruminfo h3 a {
	text-decoration: none;
}

.pun .foruminbox .foruminfo h3 a:hover {
	text-decoration: underline;
}

.pun .foruminbox .foruminfo h3 .newtext {
	display: inline-block;
	vertical-align: 2px;
	margin-left: 6px;
	padding: 0 6px;
	font-size: 0.75em;
	font-weight: normal;
	line-height: 1.6;
	border: 1px solid var(--fb-accent, #8aa);
	border-radius: 3px;
	white-space: nowrap;
}

.pun .foruminbox .foruminfo h3 .newtext a {
	color: var(--fb-accent, inherit);
}

.pun .foruminbox .foruminfo h3 .redirtext {
	font-weight: normal;
	font-size: 0.85em;
	color: var(--fb-muted, #888);
	margin-right: 4px;
}

.pun .foruminbox .forumdesc {
	font-size: 0.923em;
	line-height: 1.5;
	word-break: break-word;
}

/* Stats + last post, pinned to the bottom of the card */
.pun .foruminbox .forummeta {
	margin-top: auto;
	padding-top: 8px;
	font-size: 0.923em;
	line-height: 1.5;
	color: var(--fb-muted, #888);
}

.pun .foruminbox .forumstats {
	display: flex;
	flex-wrap: wrap;
	gap: 0 14px;
	padding: 0;
}

.pun .foruminbox .forumstats strong {
	font-weight: bold;
}

.pun .foruminbox .forumlast {
	padding: 0;
	overflow-wrap: anywhere;
}

.pun .foruminbox .forumlast .byuser {
	white-space: nowrap;
}

.pun .foruminbox .forumlast .byuser a {
	font-weight: normal;
}

/* "Auto-fit narrow screens" toggle on the title line; only shown on narrow
   screens. (pointer: coarse) keeps it reachable on phones after the visitor
   turned the option off, when the page renders at desktop width. */
#brdtitle h1 #narrowopt {
	display: none;
}

@media (max-width: 700px), (pointer: coarse) {
	#brdtitle h1 {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 12px;
	}

	#brdtitle h1 #narrowopt {
		display: inline-block;
		margin-left: auto;
		font-size: 13px;
		font-weight: normal;
		line-height: 1.4;
		white-space: nowrap;
	}

	#brdtitle h1 #narrowopt label {
		cursor: pointer;
	}

	#brdtitle h1 #narrowopt input {
		margin: 0 2px 0 0;
		vertical-align: -2px;
	}
}

/* Narrow screens */
@media (max-width: 520px) {
	.pun ul.forumbox {
		padding: 10px;
		gap: 10px;
	}

	.pun li.foruminbox {
		gap: 10px;
		padding: 10px;
	}

	.pun .foruminbox a.forumicon {
		flex-basis: 64px;
		width: 64px;
		height: 64px;
		background-size: 64px 64px;
		border-radius: 8px;
	}

	.pun .foruminbox .foruminfo {
		min-height: 64px;
	}
}
