/*
 * category.php's own layout — header, search/sort controls, post grid,
 * pagination, and the right sidebar. Only enqueued on category archives
 * (functions.php). Builds on the primitives in rl-rectangle.css (.ang-card/
 * .ang-hover/.chip/.ang-btn/.rl-grid/.rl-thumb) rather than redefining them,
 * so both stay one system. See ratlab_theme_implementation_plan.md Phase 2.
 *
 * author.php, the Authors index page template (template-authors.php),
 * 404.php and search.php reuse this same #sohojCategoryPage-style wrapper
 * (#sohojAuthorPage / #sohojAuthorsIndex / #sohojNotFound / #sohojSearchPage)
 * rather than duplicating the container rule.
 */

#sohojCategoryPage,
#sohojAuthorPage,
#sohojAuthorsIndex,
#sohojNotFound,
#sohojSearchPage {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1.5rem 3rem;
}

.rl-header {
	margin-bottom: 1.75rem;
}

.rl-title {
	font-family: 'Tiro Bangla', sans-serif;
	font-size: clamp(1.8rem, 2.6vw, 2.5rem);
	font-weight: 700;
	color: var(--sohoj-heading);
	margin: 0 0 0.5rem;
}

.rl-title span {
	position: relative;
	display: inline-block;
	padding-bottom: 0.4rem;
}

.rl-title span::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 3px;
	background: var(--sohoj-accent-amber);
	clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.rl-intro {
	font-family: 'Tiro Bangla', sans-serif;
	color: var(--sohoj-text-muted);
	max-width: 60ch;
	margin: 0.75rem 0 0;
	line-height: 1.6;
}

.rl-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: stretch;
	margin-top: 1.25rem;
}

.ctrl {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border: 2px solid var(--sohoj-border);
	background: var(--sohoj-surface);
	padding: 0.55rem 0.75rem;
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.ctrl input[type="search"],
.ctrl select {
	border: none;
	outline: none;
	background: transparent;
	font: inherit;
	font-family: 'Tiro Bangla', sans-serif;
	color: var(--sohoj-text);
	min-width: 160px;
}

.rl-controls .ang-btn {
	padding: 0.6rem 1.1rem;
}

.rl-active {
	margin-top: 0.85rem;
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	align-items: center;
	font-family: 'Tiro Bangla', sans-serif;
}

.rl-active small {
	color: var(--sohoj-text-muted-soft);
}

@media (max-width: 600px) {
	.rl-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.ctrl select,
	.ctrl input[type="search"] {
		min-width: 0;
		width: 100%;
	}
}

/* --- Post grid (rl-layout/rl-sidebar/rl-sticky live in rl-rectangle.css
   now — single.php's sidebar needs them too, see Phase 3.6) --- */

.rl-post-grid {
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.rl-card {
	display: flex;
	flex-direction: column;
}

.rl-body {
	padding: 14px 14px 16px;
}

.rl-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 10px;
}

.rl-meta .chip {
	font-size: 0.75rem;
	padding: 5px 10px;
}

.rl-title-sm {
	font-family: 'Tiro Bangla', sans-serif;
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1.4;
	margin: 0 0 8px;
}

.rl-title-sm a {
	color: var(--sohoj-text);
	text-decoration: none;
}

.rl-title-sm a:hover {
	color: var(--sohoj-heading);
	text-decoration: underline;
}

.rl-excerpt {
	font-family: 'Tiro Bangla', sans-serif;
	color: var(--sohoj-text-muted);
	font-size: 0.92rem;
	line-height: 1.6;
	margin: 0 0 12px;
}

.rl-more {
	margin-top: auto;
	padding: 0 14px 16px;
}

/* --- Pagination --- */

.rl-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.65rem;
	margin: 2rem 0;
}

.rl-pagination .ang-btn {
	padding: 0.6rem 1rem;
}

.rl-pagination span.ang-btn[aria-current="page"] {
	background: var(--sohoj-heading);
	color: var(--sohoj-bg);
}

/* --- Sidebar: Follow / Quick Links / Categories / Latest Articles.
   .rl-sidebar/.rl-sticky/.sb-card/.sb-title/.sb-muted/.sb-post/.sb-thumb
   moved to rl-rectangle.css (Phase 3.6) — .sb-list stays here since only
   category.php's Quick Links/Categories boxes use link lists. --- */

.sb-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sb-list li {
	border-top: 2px solid var(--sohoj-border-soft);
}

.sb-list li:first-child {
	border-top: none;
}

.sb-list a {
	display: block;
	width: 100%;
	padding: 0.65rem 0.25rem;
	font-family: 'Tiro Bangla', sans-serif;
	font-size: 0.95rem;
	text-decoration: none;
	color: var(--sohoj-text);
}

.sb-list a:hover {
	color: var(--sohoj-heading);
	text-decoration: underline;
}

.sb-list a.is-active,
.sb-list a[aria-current="true"] {
	font-weight: 700;
	color: var(--sohoj-heading);
	text-decoration: underline;
	text-decoration-color: var(--sohoj-accent-amber);
	text-decoration-thickness: 2px;
}

/* --- author.php's header (avatar + name + bio) and the Authors index
   page's author-card grid (template-authors.php). Square, hard-bordered
   avatar rather than a rounded one — matches the rectangular-minimalist
   system (A3a rule 1) the rest of the site's chrome already follows. --- */

.sohoj-author-header {
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
}

.sohoj-author-avatar {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	border: 2px solid var(--sohoj-border);
	background: var(--sohoj-surface);
}

@media (max-width: 480px) {
	.sohoj-author-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

.rl-author-grid {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.rl-author-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 22px 16px;
	text-decoration: none;
	color: inherit;
}

.rl-author-card .sohoj-author-avatar {
	margin-bottom: 0.85rem;
}

.rl-author-name {
	font-family: 'Tiro Bangla', sans-serif;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--sohoj-text);
}

.rl-author-card:hover .rl-author-name {
	color: var(--sohoj-heading);
	text-decoration: underline;
}

.rl-author-count {
	font-family: 'Tiro Bangla', sans-serif;
	color: var(--sohoj-text-muted);
	font-size: 0.85rem;
	margin-top: 0.35rem;
}

/* 404.php (survey S5.26): search box and the way home side by side, then
   the latest posts in the archive grid. */
.sohoj-404-search {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2.5rem;
}

.sohoj-404-search .search-form {
	flex: 1 1 320px;
	max-width: 560px;
}

.sohoj-404-latest-title {
	margin-bottom: 1rem;
}
