/* Crumb: a lightweight reader styled after late-2000s / early-2010s web design.
   Sans-serif, gray page, centered white content column, blue chrome. */

:root {
	--page: #dfe3ee;
	--col: #ffffff;
	--alt: #f7f8fa;
	--text: #333333;
	--muted: #777777;
	--faint: #999999;
	--border: #cbd0dd;
	--border-soft: #e6e8ee;
	--link: #305d9e;
	--link-visited: #5c4a8a;
	--chrome: #4a6c9b;
	--chrome-dark: #3a5680;
	--accent: #d97b34;
	--wrap: 860px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0 0 24px;
	background: var(--page);
	color: var(--text);
	font-family: Tahoma, Geneva, Verdana, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.45;
}

.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 16px;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:visited {
	color: var(--link-visited);
}

a:hover {
	text-decoration: underline;
}

/* Header: solid blue chrome bar */
.site-header {
	background: var(--chrome);
	background-image: linear-gradient(to bottom, var(--chrome), var(--chrome-dark));
	border-bottom: 1px solid var(--chrome-dark);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 8px 0;
}

.brand {
	font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
	font-weight: bold;
	font-size: 20px;
	color: #ffffff;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.brand:visited,
.brand:hover {
	color: #ffffff;
	text-decoration: none;
}

.top-nav a,
.top-nav a:visited {
	font-size: 12px;
	color: #dbe5f3;
	margin-right: 12px;
}

.top-nav a:hover {
	color: #ffffff;
}

.header-search {
	margin-left: auto;
}

.header-search input {
	font-family: inherit;
	font-size: 12px;
	padding: 3px 7px;
	width: 150px;
	border: 1px solid var(--chrome-dark);
	border-radius: 3px;
	background: #ffffff;
	color: var(--text);
}

/* Search page */
.search-form {
	display: flex;
	gap: 6px;
	margin: 8px 0 4px;
}

.search-form input[type="search"] {
	flex: 1;
	font-family: inherit;
	font-size: 13px;
	padding: 5px 8px;
	border: 1px solid var(--border);
	border-radius: 3px;
}

.search-form button {
	font-family: inherit;
	font-size: 12px;
	padding: 5px 14px;
	background: linear-gradient(to bottom, #fbfbfc, #eceef2);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--link);
	cursor: pointer;
}

.search-form button:hover {
	background: linear-gradient(to bottom, #ffffff, #e4e7ec);
}

.community-body {
	min-width: 0;
	flex: 1;
}

/* Centered white content column */
main.wrap {
	background: var(--col);
	border: 1px solid var(--border);
	border-top: 0;
	padding: 14px 16px 18px;
	margin-top: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Feed heading + sort tabs */
.feed-head h1 {
	font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
	font-size: 18px;
	font-weight: bold;
	margin: 0 0 4px;
	color: #2a2a2a;
}

.section-title {
	font-size: 12px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--muted);
	background: var(--alt);
	border: 1px solid var(--border-soft);
	padding: 4px 8px;
	margin: 20px 0 8px;
}

.sort-bar {
	margin: 8px 0 12px;
	border-bottom: 1px solid var(--border);
	padding-bottom: 0;
	font-size: 12px;
}

.sort-bar.small {
	border: 0;
	margin: 0;
	padding: 0;
}

.sort,
.sort:visited {
	display: inline-block;
	color: var(--link);
	padding: 3px 10px;
	margin-right: 2px;
	/* Reserve the active tab's border and weight on every tab so switching
	   tabs never reflows the row. */
	border: 1px solid transparent;
	border-radius: 3px 3px 0 0;
	margin-bottom: -1px;
}

.sort.active {
	color: #333;
	background: var(--col);
	border-color: var(--border);
	border-bottom-color: var(--col);
}

/* Comment sort bar: plain inline links, no raised tab. */
.sort-bar.small .sort {
	margin-bottom: 0;
	border-radius: 0;
	padding: 1px 8px 1px 0;
}

.sort-bar.small .sort.active {
	background: none;
	border-color: transparent;
	color: #333;
	text-decoration: underline;
}

/* Post list */
.post {
	display: flex;
	gap: 10px;
	padding: 8px 6px;
	border-bottom: 1px solid var(--border-soft);
	align-items: flex-start;
}

.post:hover {
	background: var(--alt);
}

.score {
	flex: 0 0 auto;
	min-width: 40px;
	text-align: center;
	color: var(--muted);
	font-size: 12px;
	padding-top: 2px;
}

.score-num {
	color: var(--accent);
	font-weight: bold;
	font-size: 13px;
}

.thumb img {
	width: 70px;
	height: 54px;
	object-fit: cover;
	border: 1px solid var(--border);
	display: block;
}

.post-main {
	min-width: 0;
	flex: 1;
}

.post-title {
	font-size: 14px;
	font-weight: bold;
	margin: 0;
	line-height: 1.3;
	display: inline;
}

.post-title a {
	color: var(--link);
}

.post-link {
	display: inline;
	font-size: 11px;
	margin-left: 6px;
}

.post-link a,
.post-link a:visited {
	color: var(--faint);
}

.post-meta {
	font-size: 11px;
	color: var(--muted);
	margin-top: 3px;
}

.post-meta a,
.post-meta a:visited {
	color: var(--link);
}

.tag {
	font-size: 9px;
	font-weight: bold;
	padding: 1px 4px;
	border: 1px solid;
	border-radius: 2px;
	margin-left: 5px;
	text-transform: uppercase;
	vertical-align: middle;
}

.tag.nsfw {
	color: #b23b30;
	border-color: #b23b30;
}

.tag.mod {
	color: #3f7a4a;
	border-color: #3f7a4a;
}

.load-more {
	display: inline-block;
	margin-top: 12px;
	padding: 4px 14px;
	background: linear-gradient(to bottom, #fbfbfc, #eceef2);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--link);
	font-family: inherit;
	font-size: 12px;
	cursor: pointer;
}

.load-more:hover {
	background: linear-gradient(to bottom, #ffffff, #e4e7ec);
	text-decoration: none;
}

.empty {
	color: var(--muted);
	padding: 12px 0;
	font-style: italic;
}

/* Single post */
.post-full {
	padding: 2px 0 12px;
	border-bottom: 1px solid var(--border);
}

.post-full .post-title {
	display: block;
	font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
	font-size: 21px;
	font-weight: bold;
	line-height: 1.25;
	margin: 6px 0 8px;
}

.post-image img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border);
}

.post-body {
	margin-top: 12px;
	font-size: 13px;
	overflow-wrap: break-word;
}

.post-stats {
	margin-top: 12px;
	font-size: 11px;
	color: var(--muted);
}

/* Shared rendered-markdown rules */
.post-body img,
.comment-body img {
	max-width: 100%;
	height: auto;
}

.post-body pre,
.comment-body pre {
	background: #f4f5f7;
	border: 1px solid var(--border-soft);
	border-radius: 3px;
	padding: 8px;
	overflow-x: auto;
	max-width: 100%;
}

.post-body code,
.comment-body code {
	font-family: Consolas, "Courier New", monospace;
	font-size: 92%;
}

.post-body blockquote,
.comment-body blockquote {
	margin: 8px 0;
	padding-left: 10px;
	border-left: 3px solid var(--border);
	color: var(--muted);
}

.post-body a,
.comment-body a {
	word-break: break-word;
}

/* Comments (collapsible via <details>) */
.comments {
	margin-top: 18px;
}

.comments-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.comments-head h2 {
	font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
	font-size: 16px;
	margin: 0;
}

.comment {
	border-left: 2px solid var(--border-soft);
	padding: 4px 0 4px 10px;
	margin-top: 6px;
}

.comment > summary {
	list-style: none;
	cursor: pointer;
	font-size: 11px;
	color: var(--muted);
	user-select: none;
}

.comment > summary::-webkit-details-marker {
	display: none;
}

.comment-toggle {
	color: var(--faint);
	margin-right: 4px;
	font-family: Consolas, monospace;
}

.comment-toggle::before {
	content: "[\2013]"; /* [–] when open */
}

.comment:not([open]) > summary .comment-toggle::before {
	content: "[+]";
}

.comment-author,
.comment-author:visited {
	font-weight: bold;
	color: var(--link);
}

.reply-count {
	color: var(--faint);
	margin-left: 4px;
}

.comment:not([open]) > summary .reply-count {
	color: var(--muted);
}

.comment-body {
	margin: 3px 0 0;
	overflow-wrap: break-word;
	font-size: 13px;
}

.comment-body p:first-child {
	margin-top: 4px;
}

.comment-children {
	margin-top: 4px;
}

.muted {
	color: var(--muted);
}

/* Community directory */
.community-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 8px 6px;
	border-bottom: 1px solid var(--border-soft);
}

.community-item:hover {
	background: var(--alt);
}

.community-item h2 {
	font-size: 14px;
	font-weight: bold;
	margin: 0;
}

.community-icon {
	width: 38px;
	height: 38px;
	object-fit: cover;
	border: 1px solid var(--border);
	flex: 0 0 auto;
	background: var(--alt);
}

.community-icon.placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--chrome);
	font-weight: bold;
	font-size: 18px;
}

.community-handle {
	font-size: 11px;
	color: var(--muted);
	margin-top: 1px;
}

.community-stats {
	font-size: 11px;
	color: var(--muted);
	margin-top: 3px;
}

.community-header {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 2px;
}

/* User profile */
.user-header {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 4px 0 12px;
	border-bottom: 1px solid var(--border);
}

.user-header h1 {
	font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
	font-size: 20px;
	margin: 0;
}

.user-avatar {
	width: 58px;
	height: 58px;
	object-fit: cover;
	border: 1px solid var(--border);
	flex: 0 0 auto;
}

.user-handle {
	font-size: 12px;
	color: var(--muted);
	margin-top: 2px;
}

.user-stats {
	font-size: 11px;
	color: var(--muted);
	margin-top: 3px;
}

.user-comment {
	padding: 8px 6px;
	border-bottom: 1px solid var(--border-soft);
}

/* Footer */
.site-footer {
	color: var(--muted);
	font-size: 11px;
	text-align: center;
	padding: 12px 0 0;
}

.site-footer a,
.site-footer a:visited {
	color: var(--link);
}
