/* =========================================================================
   Powered By Steam — Extra Styles
   Everything theme.json can't express.
   ========================================================================= */

/* --- Link hover (global) --- */

a:hover {
	opacity: 0.7;
}

/* --- Accent links (Signal Red) --- */

.pbs-pagination a,
.pbs-post-nav-link a,
.pbs-category-list a.current-cat,
.yarpp-related a {
	color: var(--wp--preset--color--signal-red);
	text-decoration: none;
	font-weight: 700;
}

/* In-content links: Signal Red, underlined */
.entry-content a,
.wp-block-post-content a {
	color: var(--wp--preset--color--signal-red);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

/* --- Meta line treatment --- */

.pbs-meta {
	font-family: var(--wp--preset--font-family--ibm-plex-mono);
	font-size: var(--wp--preset--font-size--meta);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--meta);
	gap: 0 !important;
}

.pbs-meta > * {
	font-family: inherit;
	font-size: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
	color: inherit;
}

.pbs-meta .wp-block-post-date,
.pbs-meta .wp-block-post-terms,
.pbs-meta .pbs-comment-count,
.pbs-meta .pbs-meta-by,
.pbs-meta .wp-block-post-author-name {
	font-family: inherit;
	font-size: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
}

.pbs-meta .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

/* Dot separators between meta items */
.pbs-meta > *:not(:last-child)::after {
	content: " \00b7 ";
	margin: 0 0.35em;
}

/* Single post meta: Signal Red */
.pbs-single-meta,
.pbs-single-meta .wp-block-post-date,
.pbs-single-meta .wp-block-post-terms a,
.pbs-single-meta .wp-block-post-author-name,
.pbs-single-meta .pbs-meta-by {
	color: var(--wp--preset--color--signal-red);
}

.pbs-meta-by {
	margin: 0;
}

/* --- Post list rows (default: list layout) --- */

.pbs-post-template {
	list-style: none;
	padding: 0;
	margin: 0;
}

.pbs-post-item {
	display: grid;
	grid-template-columns: 148px 1fr;
	gap: 28px;
	padding: 28px 0;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	align-items: start;
}

.pbs-post-item .pbs-post-thumb {
	margin: 0;
}

.pbs-post-item .pbs-post-thumb img {
	width: 148px;
	height: 148px;
	object-fit: cover;
	display: block;
}

/* Posts without thumbnails: WP omits the image block entirely when
   the binding returns null, so there is no .pbs-post-thumb in the DOM. */
.pbs-post-item:not(:has(.pbs-post-thumb)) {
	grid-template-columns: 1fr;
}

.pbs-post-item .wp-block-post-title {
	font-size: 28px;
	font-weight: 900;
	letter-spacing: -0.015em;
	line-height: 1.15;
	margin: 4px 0 8px;
}

.pbs-post-item .wp-block-post-excerpt {
	color: var(--wp--preset--color--muted);
	font-size: 15px;
	line-height: 1.55;
	margin: 0;
}

.pbs-post-item .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.wp-block-post-excerpt__more-link {
	color: var(--wp--preset--color--signal-red);
	font-weight: 700;
	text-decoration: none;
}


.pbs-post-content {
	min-width: 0;
}

.pbs-post-item > *,
.pbs-post-item .pbs-post-content > * {
	margin-block-start: 0;
}

/* --- Featured post (first child, page 1 only) --- */

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-post-item {
	display: block;
	grid-template-columns: none;
	padding-top: 0;
	border-bottom: none;
	margin-bottom: 16px;
}

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-post-thumb {
	margin-bottom: 24px;
}

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-post-thumb img {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 8;
	object-fit: cover;
}

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-meta {
	color: var(--wp--preset--color--signal-red);
	margin-bottom: 4px;
}

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-meta .wp-block-post-terms a {
	color: var(--wp--preset--color--signal-red);
}

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .wp-block-post-title {
	font-size: 52px;
	letter-spacing: -0.02em;
	line-height: 1.05;
	margin-bottom: 16px;
}

body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .wp-block-post-excerpt {
	color: var(--wp--preset--color--body-soft);
	font-size: 18px;
	line-height: 1.6;
	margin-bottom: 16px;
}

/* Hairline separator after featured post */
body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child {
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	padding-bottom: 28px;
	margin-bottom: 0;
}

/* --- Pagination --- */

.pbs-pagination {
	padding-top: 28px;
}

.pbs-pagination a {
	color: var(--wp--preset--color--signal-red);
	font-weight: 700;
	text-decoration: none;
}

.pbs-page-numbers {
	font-family: var(--wp--preset--font-family--ibm-plex-mono);
	font-size: var(--wp--preset--font-size--meta);
	color: var(--wp--preset--color--meta);
}

/* --- Post navigation (single post top) --- */

.pbs-post-nav-top {
	font-family: var(--wp--preset--font-family--ibm-plex-mono);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pbs-post-nav-link a {
	color: var(--wp--preset--color--meta);
	text-decoration: none;
}

.pbs-post-nav-link a:hover {
	color: var(--wp--preset--color--signal-red);
}

/* --- Sidebar --- */

.pbs-sidebar-label {
	font-family: var(--wp--preset--font-family--ibm-plex-mono);
	font-size: 12px !important;
	font-weight: 500 !important;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--meta);
	padding-bottom: 10px;
	border-bottom: 2px solid var(--wp--preset--color--ink);
	margin-bottom: 16px;
}

.pbs-sidebar-section {
	margin-bottom: 40px;
}

.pbs-category-list {
	list-style: none;
	padding: 0;
}

.pbs-category-list li {
	padding: 4px 0;
}

.pbs-category-list a {
	color: var(--wp--preset--color--ink);
	font-weight: 700;
	text-decoration: none;
}

/* Post count next to category name */
.pbs-category-list li::after {
	color: var(--wp--preset--color--faint);
	margin-left: 6px;
}

/* Active category in archive sidebar */
.pbs-category-list .current-cat > a {
	color: var(--wp--preset--color--signal-red);
}

.pbs-category-list .current-cat::after {
	color: var(--wp--preset--color--signal-red-faded);
}

/* Archives dropdown */
.pbs-archives-dropdown select,
.pbs-sidebar select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	font-family: var(--wp--preset--font-family--schibsted-grotesk);
	font-size: 15px;
	color: var(--wp--preset--color--body);
	background: var(--wp--preset--color--paper);
	appearance: auto;
}

/* Tag cloud as chips */
.pbs-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pbs-tag-cloud a {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 99px;
	color: var(--wp--preset--color--body);
	font-size: 14px !important;
	text-decoration: none;
	line-height: 1.4;
}

.pbs-tag-cloud a:hover {
	border-color: var(--wp--preset--color--ink);
}

/* --- Gallery grid (pbs-gallery plugin output) --- */

.pbs-gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin: 16px 0;
}

.pbs-gallery-grid a {
	display: block;
}

.pbs-gallery-grid img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
}

/* Also target .wp-block-gallery and legacy gallery shortcode output */
.wp-block-gallery {
	gap: 6px !important;
}

.wp-block-gallery .wp-block-image img {
	aspect-ratio: 1;
	object-fit: cover;
}

/* Gallery label */
.pbs-gallery-label {
	font-family: var(--wp--preset--font-family--ibm-plex-mono);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--meta);
	padding-bottom: 10px;
	border-bottom: 2px solid var(--wp--preset--color--ink);
	margin-bottom: 12px;
}

/* --- Related posts (YARPP) --- */

.yarpp-related ol,
.yarpp-related ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.yarpp-related li {
	margin-bottom: 8px;
}

.yarpp-related a {
	color: var(--wp--preset--color--signal-red);
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
}

/* --- Post taxonomy line --- */

.pbs-post-taxonomy {
	gap: 4px !important;
}

.pbs-tax-links a {
	color: var(--wp--preset--color--ink);
	font-weight: 700;
	text-decoration: none;
}

/* --- Comments --- */

.pbs-comment {
	margin-bottom: 28px;
}

.wp-block-comment-reply-link a {
	color: var(--wp--preset--color--signal-red);
	font-weight: 700;
	text-decoration: none;
}

/* Comment form */
.wp-block-post-comments-form textarea {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	padding: 16px;
	font-family: var(--wp--preset--font-family--schibsted-grotesk);
	font-size: 16px;
	width: 100%;
	box-sizing: border-box;
}

.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"] {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	padding: 10px 14px;
	font-family: var(--wp--preset--font-family--schibsted-grotesk);
	font-size: 15px;
	width: 100%;
	box-sizing: border-box;
}

.wp-block-post-comments-form .form-submit input[type="submit"] {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	border: none;
	border-radius: 0;
	padding: 12px 28px;
	font-family: var(--wp--preset--font-family--schibsted-grotesk);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

/* --- Navigation: Search field in nav --- */

.pbs-nav .pbs-nav-search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	padding: 6px 10px;
	font-family: var(--wp--preset--font-family--schibsted-grotesk);
	font-size: 14px;
	max-width: 160px;
}

/* --- Navigation: Home active state --- */

.pbs-nav .current-menu-item a,
.pbs-nav [aria-current="page"] a {
	color: var(--wp--preset--color--signal-red);
}

/* --- Hamburger restyle (mobile) --- */

.wp-block-navigation__responsive-container-open {
	width: 44px;
	height: 44px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
}

.wp-block-navigation__responsive-container-open svg {
	width: 18px;
	height: 18px;
}

/* --- Footer --- */

.pbs-footer p {
	margin: 0;
}

/* --- Archive header --- */

.pbs-archive-header {
	padding-bottom: 20px;
}

/* =========================================================================
   Mobile (≤ 480px)
   ========================================================================= */

@media (max-width: 480px) {

	/* Reduce page padding */
	body {
		--wp--preset--spacing--80: 20px;
	}

	/* Single column: collapse sidebar below */
	.pbs-home-columns {
		flex-direction: column !important;
	}

	.pbs-sidebar {
		flex-basis: 100% !important;
		border-top: 3px solid var(--wp--preset--color--ink);
		padding-top: 28px;
		margin-top: 28px;
	}

	/* Featured post: mobile layout */
	body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-post-item {
		display: block;
	}

	body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .wp-block-post-title {
		font-size: 30px;
	}

	body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .pbs-post-thumb img {
		width: 112px;
		height: 112px;
		aspect-ratio: 1;
		float: left;
		margin-right: 16px;
		margin-bottom: 8px;
	}

	body:not(.paged) .pbs-post-list:not(.pbs-archive-list) .pbs-post-template > li:first-child .wp-block-post-excerpt {
		font-size: 13px;
		line-height: 1.5;
	}

	/* List rows: smaller thumbs */
	.pbs-post-item {
		grid-template-columns: 96px 1fr;
		gap: 16px;
		padding: 20px 0;
	}

	.pbs-post-item .pbs-post-thumb img {
		width: 96px;
		height: 96px;
	}

	.pbs-post-item .wp-block-post-title {
		font-size: 19px;
	}

	.pbs-post-item .wp-block-post-excerpt {
		font-size: 13px;
		line-height: 1.5;
	}

	/* Single post */
	.wp-block-post-title {
		font-size: 38px !important;
	}

	.wp-block-post-content {
		font-size: 16px;
		line-height: 1.65;
	}

	/* Archive heading */
	.pbs-archive-title {
		font-size: 38px !important;
	}

	/* Gallery: 3 columns */
	.pbs-gallery-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 4px;
	}

	/* Sidebar: categories as chips */
	.pbs-category-list {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.pbs-category-list li {
		padding: 0;
	}

	.pbs-category-list a {
		display: inline-block;
		padding: 10px 16px;
		border: 1px solid var(--wp--preset--color--border);
		border-radius: 0;
		font-size: 15px;
		min-height: 44px;
		line-height: 24px;
	}

	/* Footer: centered single line */
	.pbs-footer .wp-block-group {
		flex-direction: column !important;
		text-align: center;
		gap: 4px;
	}
}
