/**
 * Supplementary styles: placeholders, sidebar, archive tweaks, admin bar fixes.
 */

/* Placeholders when no image is set */
.pv-cat__placeholder,
.pv-post__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-height: 160px;
	background: linear-gradient(135deg, var(--pv-cream) 0%, var(--pv-blue-soft) 100%);
	color: var(--pv-navy);
	opacity: .45;
}
.pv-cat__placeholder svg,
.pv-post__placeholder svg { width: 56px; height: 56px; }

/* Category tile body is an inline-level span in markup — force block layout */
.pv-cat__media { display: block; }
.pv-cat__body { display: flex; }
.pv-cat__title { display: block; }
.pv-cat__count { display: block; margin-top: 2px; }

/* Archive/search list grid */
.pv-posts__grid--list { grid-template-columns: repeat(3, 1fr); }

/* Same short-row treatment as the product grid: a category with one or two
   posts should keep normal-sized cards rather than stretch across the width. */
.pv-posts__grid--list:has(> article:last-child:nth-child(1)) {
	grid-template-columns: minmax(min(100%, 260px), 380px);
}
.pv-posts__grid--list:has(> article:last-child:nth-child(2)) {
	grid-template-columns: repeat(2, minmax(min(100%, 260px), 380px));
}

@media (max-width: 992px) {
	.pv-posts__grid--list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
	.pv-posts__grid--list,
	.pv-posts__grid--list:has(> article:last-child:nth-child(-n + 2)) {
		grid-template-columns: 1fr;
	}
}

/* Sidebar */
.pv-sidebar { align-self: start; position: sticky; top: 100px; }
.pv-sidebar .pv-widget {
	background: var(--pv-cream-soft);
	border: 1px solid var(--pv-border);
	border-radius: var(--pv-radius);
	padding: 22px 24px;
}
.pv-sidebar .pv-widget:last-child { margin-bottom: 0; }
.pv-sidebar select,
.pv-sidebar input[type="search"],
.pv-sidebar input[type="text"] {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--pv-border);
	border-radius: var(--pv-radius-sm);
	background: #fff;
}
@media (max-width: 992px) { .pv-sidebar { position: static; } }

/* Search form (core widget) */
.wp-block-search__inside-wrapper { gap: 8px; }

.pv-widget .search-form,
.pv-widget form[role="search"] {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.pv-widget .search-form label { flex: 1 1 100%; margin: 0; }
.pv-widget .search-form input[type="search"] { width: 100%; }
.pv-widget .search-form input[type="submit"],
.pv-widget form[role="search"] input[type="submit"] {
	padding: 10px 22px;
	border: 0;
	border-radius: var(--pv-radius-pill);
	background: var(--pv-navy);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s var(--pv-ease);
}
.pv-widget .search-form input[type="submit"]:hover { background: var(--pv-blue); }

.pv-widget .wp-block-latest-posts,
.pv-widget .wp-block-categories { list-style: none; padding: 0; }

/* Quick strip inner alignment */
.pv-quick__sub a { margin-left: 4px; }

/* Admin bar offset for the sticky header */
body.admin-bar .pv-header.is-sticky { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .pv-header.is-sticky { top: 46px; }
}

/* Blocks inside the entry content */
.pv-entry > *:first-child { margin-top: 0; }
.pv-entry .wp-block-image img { border-radius: var(--pv-radius); }
.pv-entry ul, .pv-entry ol { padding-left: 1.4em; }
.pv-entry li { margin-bottom: .4em; }
.pv-entry figure { margin: 1.8em 0; }
.pv-entry figcaption { font-size: .9rem; color: var(--pv-muted); text-align: center; margin-top: 10px; }

/* Empty state */
.pv-empty {
	padding: 40px;
	text-align: center;
	color: var(--pv-muted);
	background: var(--pv-cream-soft);
	border: 1px dashed var(--pv-border);
	border-radius: var(--pv-radius);
}
