/*
 * Kirrt Core: site-wide front-end fixes that must work whatever theme is active
 * (the live site runs Fewer; kirrt-child may replace it later).
 */

/*
 * The homepage's WonderBlocks patterns use the "normal" font-size preset, which
 * Fewer doesn't define. Without it, post titles in the product/story grids fall
 * back to Fewer's 48px h3 inside ~165px columns, and Fewer's
 * `word-break: break-word` then splits words mid-word.
 */
.has-normal-font-size {
	font-size: var(--wp--preset--font-size--medium, 1.125rem) !important;
}

/* Titles in post/product grids (Query Loop, Product Collection). */
.wp-block-post-template .wp-block-post-title,
.wc-block-product-template .wp-block-post-title {
	font-size: var(--wp--preset--font-size--medium, 1.125rem) !important;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: normal;
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: manual;
	margin-block: 0.5em 0.25em;
}

.wp-block-post-template .wp-block-post-title a,
.wc-block-product-template .wp-block-post-title a {
	text-decoration: none;

	/*
	 * Long titles: show at most three lines; the full title is on the linked page.
	 * Clamped on the link because the heading's own display is forced to
	 * flow-root by the pattern's layout styles.
	 */
	display: -webkit-box !important;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	/* Room below the last line so Gurmukhi/Devanagari vowel signs aren't clipped. */
	padding-block-end: 0.15em;
}

.wp-block-post-template .wp-block-post-title a:hover,
.wp-block-post-template .wp-block-post-title a:focus-visible,
.wc-block-product-template .wp-block-post-title a:hover,
.wc-block-product-template .wp-block-post-title a:focus-visible {
	text-decoration: underline;
}

/* Gurmukhi / Devanagari need a taller line. */
.wp-block-post-template .wp-block-post-title:lang(pa),
.wp-block-post-template .wp-block-post-title:lang(hi),
.wc-block-product-template .wp-block-post-title:lang(pa),
.wc-block-product-template .wp-block-post-title:lang(hi) {
	line-height: 1.6;
}

/* Footer: keep each name/address together; on phones, one per line without bullets. */
.kirrt-footer-name .kirrt-nowrap,
.kirrt-footer-address .kirrt-nowrap {
	white-space: nowrap;
}

@media (max-width: 600px) {
	.kirrt-footer-name .kirrt-nowrap,
	.kirrt-footer-address .kirrt-nowrap {
		display: block;
	}

	.kirrt-footer-address .kirrt-nowrap {
		white-space: normal;
	}

	.kirrt-footer-name .kirrt-nowrap {
		margin-block: 0.3em;
	}

	.kirrt-footer-name [aria-hidden="true"],
	.kirrt-footer-address [aria-hidden="true"] {
		display: none;
	}
}

/* Footer name in three scripts: no letter-spacing on Gurmukhi or Shahmukhi. */
.kirrt-footer-name :lang(pa),
.kirrt-footer-name :lang(pnb) {
	letter-spacing: normal;
}

/*
 * Header rule: a thin line under the logo + menu row. Drawn with a pseudo-element
 * so it sits inside the 40px side padding (same width as the footer's separator)
 * and works with the Site Editor copy of the header on both local and live.
 */
.wc-blocks-header-pattern {
	position: relative;
}

.wc-blocks-header-pattern::after {
	content: "";
	position: absolute;
	left: var(--kirrt-rule-inset, 40px);
	right: var(--kirrt-rule-inset, 40px);
	height: 1px;
	background: currentColor;
	pointer-events: none;
}

.wc-blocks-header-pattern::after {
	bottom: 0;
}
