/**
 * SureRank XML sitemap fallback styles.
 *
 * Browsers that no longer run XSLT skip the XSL stylesheet
 * and apply this CSS to the raw sitemap XML instead. Browsers that still
 * run XSLT use the XSL view and ignore this file. Search engines read the
 * raw XML and ignore both.
 *
 * Works for any sitemap root (sitemapindex, urlset) and any extension
 * namespace (image, video, news) without per-sitemap rules.
 *
 * @since x.x.x
 * @package SureRank
 */

/* stylelint-disable selector-type-no-unknown -- Sitemap XML element names, not HTML. */

@namespace url("http://www.sitemaps.org/schemas/sitemap/0.9");

sitemapindex,
urlset {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 16px 32px;
	background-color: #fff;
	color: #4b5563;
	font-family: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	counter-reset: surerank-sitemap-entries;
}

sitemapindex::before,
urlset::before {
	order: -2;
	display: block;
	margin: 0 -16px 16px;
	padding: 32px;
	background-color: #4330d2;
	color: #fff;
	font-size: 22px;
	font-weight: 600;
	content: "XML Sitemap";
}

/* Counted in document order, shown under the header through flex order. */
sitemapindex::after,
urlset::after {
	order: -1;
	display: block;
	padding-bottom: 16px;
	color: #111827;
	font-size: 16px;
	content: "Entries in this sitemap: " counter(surerank-sitemap-entries);
}

sitemap,
url {
	display: block;
	padding: 16px 12px;
	border: 1px solid #e5e7eb;
	border-top-width: 0;
	background-color: #fdfdfd;
	counter-increment: surerank-sitemap-entries;
}

sitemap:first-of-type,
url:first-of-type {
	border-top-width: 1px;
	border-radius: 8px 8px 0 0;
}

sitemap:last-of-type,
url:last-of-type {
	border-radius: 0 0 8px 8px;
}

sitemap:only-of-type,
url:only-of-type {
	border-radius: 8px;
}

sitemap > loc,
url > loc {
	display: block;
	color: #4330d2;
	word-break: break-word;
}

sitemap > lastmod,
url > lastmod {
	display: block;
	color: #6b7280;
	font-size: 13px;
}

sitemap > lastmod::before,
url > lastmod::before {
	content: "Last modified: ";
}

/* Extension data (image:image, video:video, news:news and their children). */
url > *|*:not(loc):not(lastmod),
url > *|* *|* {
	display: block;
	overflow: hidden;
	color: #6b7280;
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Empty elements such as xhtml:link hreflang alternates carry no text. */
url *|*:empty {
	display: none;
}
