/* Suntyp Block — block pattern polish */

.suntyp-pattern-faq :where(.wp-block-details summary) {
	cursor: pointer;
	font-weight: 600;
	list-style-position: outside;
}

.suntyp-pattern-faq :where(.wp-block-details summary:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary, #2563eb);
	outline-offset: 2px;
	border-radius: 0.25rem;
}

.suntyp-pattern-portfolio :where(.wp-block-image a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary, #2563eb);
	outline-offset: 4px;
	border-radius: 0.5rem;
}

.suntyp-pattern-contact .suntyp-contact-form :where(label) {
	display: block;
	font-weight: 600;
	margin-block-end: 0.35rem;
}

.suntyp-pattern-contact .suntyp-contact-form :where(p) {
	margin-block: 0 1.25rem;
}

.suntyp-pattern-testimonials :where(.is-style-card p:first-child) {
	margin-block-start: 0;
}

:where(.suntyp-pattern-cta, .suntyp-pattern-woo-sale) .is-style-outline .wp-block-button__link {
	color: inherit;
	border-color: currentColor;
}

:where(.suntyp-pattern-cta, .suntyp-pattern-woo-sale) .is-style-outline .wp-block-button__link:hover {
	background: color-mix(in srgb, currentColor 14%, transparent);
	color: inherit;
}

/* Blog homepage — tier visibility (see inc/home-posts.php) */
.suntyp-home-featured__label--hero {
	display: none;
}

/* 0 posts: welcome empty state only */
:is(body, main).suntyp-home-posts-0 .suntyp-home-hero,
:is(body, main).suntyp-home-posts-0 .suntyp-home-latest-articles,
:is(body, main).suntyp-home-posts-0 .suntyp-home-categories,
:is(body, main).suntyp-home-posts-0 .suntyp-home-newsletter {
	display: none;
}

/* 1 post: hero + featured post */
:is(body, main).suntyp-home-posts-1 .suntyp-home-latest-articles,
:is(body, main).suntyp-home-posts-1 .suntyp-home-categories,
:is(body, main).suntyp-home-posts-1 .suntyp-home-newsletter {
	display: none;
}

:is(body, main).suntyp-home-posts-1 .suntyp-home-featured__label--default {
	display: none;
}

:is(body, main).suntyp-home-posts-1 .suntyp-home-featured__label--hero {
	display: block;
}

:is(body, main).suntyp-home-posts-1 .suntyp-home-featured {
	padding-top: var(--wp--preset--spacing--80, 4rem);
}

:is(body, main).suntyp-home-posts-1 .suntyp-home-featured-post {
	flex-direction: column;
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}

:is(body, main).suntyp-home-posts-1 .suntyp-home-featured-post__media {
	flex: none;
	inline-size: 100%;
	max-inline-size: none;
}

:is(body, main).suntyp-home-posts-1 .suntyp-home-featured-post .wp-block-post-title {
	font-size: var(--wp--preset--font-size--5xl, 3rem);
}

/* 2–5 posts: hero, featured, latest articles, categories */
:is(body, main).suntyp-home-posts-few .suntyp-home-newsletter {
	display: none;
}

/* 6+ posts: full homepage */

.suntyp-home-hero :where(.wp-block-site-title a) {
	text-decoration: none;
}

.suntyp-home-featured-post {
	align-items: stretch;
}

.suntyp-home-featured-post__media {
	flex: 1 1 16rem;
	min-width: 0;
}

/* No featured image: drop the media column so the body fills the card */
.suntyp-home-featured-post__media:not(:has(img)) {
	display: none;
}

.suntyp-home-featured-post__body {
	flex: 2 1 20rem;
	min-width: 0;
}

/* Featured post: category and date links use normal text color, no underline */
.suntyp-home-featured :where(.wp-block-post-terms a, .wp-block-post-date a) {
	text-decoration: none;
	color: var(--wp--preset--color--secondary, #475569);
}

@media (min-width: 48rem) {
	.suntyp-home-featured-post {
		flex-wrap: nowrap;
	}
}

.suntyp-home-grid .wp-block-post-template {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 47.99rem) {
	.suntyp-home-grid .wp-block-post-template {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
	.suntyp-home-grid .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.suntyp-home-latest--many:not(:has(.wp-block-post)) {
	display: none;
}

.suntyp-home-grid__empty {
	display: none;
}

.suntyp-home-categories:not(:has(.wp-block-categories-list a)) {
	display: none;
}

.suntyp-home-categories__list :where(.wp-block-categories-list) {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wp--preset--spacing--30, 0.75rem);
	list-style: none;
	margin: 0;
	padding: 0;
}

.suntyp-home-categories__list :where(.wp-block-categories-list a) {
	display: inline-block;
	padding: var(--wp--preset--spacing--30, 0.75rem) var(--wp--preset--spacing--40, 1rem);
	border: 1px solid var(--wp--preset--color--border, #e2e8f0);
	border-radius: var(--wp--preset--border-radius--full, 9999px);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	font-weight: 600;
}

.suntyp-home-categories__list :where(.wp-block-categories-list a:hover) {
	border-color: var(--wp--preset--color--primary, #2563eb);
	color: var(--wp--preset--color--primary, #2563eb);
}

.suntyp-home-empty__inner {
	text-align: center;
}

.suntyp-home-hero__cta .wp-block-button__link:focus-visible,
.suntyp-home-categories__list :where(.wp-block-categories-list a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary, #2563eb);
	outline-offset: 2px;
}
