/*
 * seo.css - SEO-related CSS, linked right after the theme stylesheets.
 *
 * 1) Heading neutralizers. One existing visual heading per indexable page was promoted to <h1>.
 *    The theme styles h1 differently from the original tag
 *    (Redux options.css: h1 {font-size:71px; line-height:71px; letter-spacing:-2px}, plus UA margins),
 *    so each rule below restores exactly the computed style of the ORIGINAL tag. Values were measured
 *    on every candidate at 1440/1024/768/390 (46 computed properties + geometry, residual 0).
 *    Responsive font sizes of the hero titles keep working: they come from inline style / per-module
 *    rules that target .dfd-title regardless of the tag.
 */

/* Hero titles of the service pages and portfolio-edica: h3.dfd-title -> h1 (only letter-spacing differs). */
h1.dfd-title.seo-h1 {
	letter-spacing: normal;
}

/* Portfolio single project title: h3.entry-title -> h1. */
h1.entry-title.seo-h1 {
	font-size: 21px;
	line-height: 26px;
	letter-spacing: normal;
	margin-top: 10px;
}

/*
 * Theme rules that style the element FOLLOWING the original <h3> (sibling combinator) stop matching after
 * the retag, so they are cloned here with h3 -> h1:where(.seo-h1). :where() adds no specificity, so each
 * clone has exactly the specificity of the original rule and only ever matches the promoted heading.
 * Found with a CSSOM audit (rules with a heading in a non-subject position that
 * match a sibling/descendant of the promoted heading), source: dfd-native app.css.
 */
.dfd-content-wrap.dfd-portfolio_single h1.entry-title:where(.seo-h1) + .entry-meta,
#layout.single-folio .dfd-content-wrap.dfd-portfolio_single > article.portfolio h1.entry-title:where(.seo-h1) + .entry-meta {
	margin-top: 10px;
}

/* Cookie policy: first <h2> ("Utilizzo Cookie") -> h1. */
h1.seo-h1-from-h2 {
	font-size: 45px;
	line-height: 50px;
	letter-spacing: normal;
}

/* Home: <h1> wrapped INSIDE the Slider Revolution text layer (the rs-layer element itself is untouched,
   rs6.min.js drives it). all:unset makes the h1 an inline box that inherits every text property
   from the layer, i.e. it renders exactly like the bare text node it wraps. */
rs-layer h1.seo-h1 {
	all: unset;
}

/*
 * 2) Visually hidden heading (accessible to screen readers and crawlers, no layout box).
 *    Used only for the H1 of the portfolio category archives, which have no visible title.
 */
.seo-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
