/**
 * Shim for WYSIWYG-editable legacy pages (.pg-editable, rendered by
 * legacy-editable.php). Maps the TinyMCE-safe content conventions onto the
 * old Fusion layout so editors work with clean markup while the front end
 * stays pixel-faithful. Values mirror the crawled inline styles of the
 * original pages (see content/pages/info-tecniche.html).
 */

/* ---- geometry: every top-level element sits in the old 1100px band ---- */
.pg-editable {
	padding-bottom: 10px; /* the old last row's bottom padding */
}
.pg-editable > * {
	max-width: 1100px;
	margin-left: auto;
	margin-right: auto;
}

/* ---- title row (the old 28px/50px fusion-text div, NOT a heading) ---- */
.pg-editable .pg-page-title {
	font-size: 28px;
	line-height: 50px;
	margin: 0;
}

/* ---- separators: plain hr = invisible spacer, .pg-line = visible rule ---- */
.pg-editable hr {
	border: 0;
	height: 0;
	margin: 0 auto 16px;
	background: none;
}
.pg-editable hr.pg-line {
	border-top: 1px solid #e0dede;
}
.pg-editable hr.pg-line-sheet {
	margin: 15px auto;
}

/* ---- accordion (markup upgraded from .pg-toggle by legacy.js; colors
        mirror the old per-instance #accordion-16147-* style blocks) ---- */
/* The old page's accordion headers carry wpautop artifacts (empty <p>s with
   20px margins) that are part of its real geometry; reproduced as paddings.
   The 26px under the title rule = its 16px separator margin + the accordion
   row's 10px top padding (hr/acc margins would collapse, padding won't). */
.pg-editable hr.pg-line {
	margin-bottom: 28px;
}
.pg-editable .fusion-accordian + hr {
	margin-bottom: 18px;
}
.pg-editable .fusion-toggle-heading {
	padding-bottom: 20px;
}
.pg-editable .fusion-accordian .panel-title {
	padding-bottom: 20px;
}
.pg-editable .fusion-accordian .fusion-panel {
	padding-bottom: 20px;
}
/* scheda section rhythm: 9px between sections (old row bottom padding),
   48px before the first one (separator + column margin + row paddings) —
   sibling margins collapse, so the largest value wins the whole gap */
.pg-editable > h2.pg-scheda-title {
	margin-top: 10px; /* flex columns don't collapse margins like the old floats */
}
.pg-editable > h2.pg-scheda-title:first-of-type {
	margin-top: 48px;
}
.pg-editable .fusion-accordian .panel-title a {
	font-size: 18px;
}
.pg-editable .fusion-accordian .fa-fusion-box {
	background-color: #333333;
	border-color: #333333;
}
.pg-editable .fusion-accordian .panel-title a .fa-fusion-box {
	color: #ffffff;
}
.pg-editable .fusion-accordian .panel-title a .fa-fusion-box:before {
	font-size: 16px;
	width: 16px;
}
.pg-editable .fusion-accordian .panel-title a:hover {
	color: #ffc107;
}
.pg-editable .fusion-accordian .panel-title .active .fa-fusion-box,
.pg-editable .fusion-accordian .panel-title a:hover .fa-fusion-box {
	background-color: #ffc107 !important;
	border-color: #ffc107 !important;
}

/* ---- download rows (core/table block: row controls are native) ---- */
.pg-editable .pg-downloads,
.pg-editable .pg-downloads table,
.pg-editable .pg-downloads td {
	border: 0;
}
.pg-editable figure.pg-downloads {
	margin: 0;
}
.pg-editable .pg-downloads table {
	table-layout: auto;
	width: 100%;
	margin: 0;
}
.pg-editable .pg-downloads td {
	vertical-align: top;
	text-align: left;
	line-height: 2.4;
	padding: 0;
}
.pg-editable .pg-downloads td:first-child {
	width: 186px;
}
/* a plain link in the first column renders as the old small grey button */
.pg-editable .pg-downloads td:first-child a {
	display: inline-block;
	background: #f0f0f0;
	color: #333333;
	font-family: "PT Sans", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 14px;
	padding: 9px 20px;
	text-align: center;
	text-decoration: none;
	border: 0;
	border-radius: 0;
	transition: all 0.2s;
}
.pg-editable .pg-downloads td:first-child a:hover {
	background: #d6d6d6;
}

/* ---- old fusion buttons: base geometry comes from the vendored bundle,
        the per-instance colors are reproduced here ---- */
.pg-editable .fusion-button {
	border-radius: 0;
	background: #f0f0f0;
}
.pg-editable .fusion-button.button-small {
	border-color: rgba(255, 255, 255, 0.8);
}
.pg-editable .fusion-button.button-small .fusion-button-text {
	color: #333333;
}
.pg-editable .fusion-button.button-small:hover,
.pg-editable .fusion-button.button-small:focus {
	border-color: #333333;
	background: #d6d6d6;
}
.pg-editable .fusion-button.button-large {
	border-color: rgba(38, 38, 38, 0.8);
}
.pg-editable .fusion-button.button-large .fusion-button-text {
	color: rgba(38, 38, 38, 0.8);
}
.pg-editable .fusion-button.button-large:hover,
.pg-editable .fusion-button.button-large:focus {
	background: #d6d6d6;
}

/* ---- block-editor wrappers mapped onto the old geometry ----
   NOTE: the vendored block-library CSS loads in the footer (like on the old
   site), AFTER this file — every block override here needs higher
   specificity than the block-library selector it replaces. */
.pg-editable hr.wp-block-separator,
.pg-editable hr.wp-block-separator.has-alpha-channel-opacity {
	background: none;
	border: 0;
	height: 0;
	margin: 0 auto 16px;
	opacity: 1;
	width: 100%; /* block-library defaults short separators to 100px */
	max-width: 1100px;
}
.pg-editable hr.wp-block-separator.has-alpha-channel-opacity.pg-line {
	border-top: 1px solid #e0dede;
	margin-bottom: 28px;
}
.pg-editable hr.wp-block-separator.has-alpha-channel-opacity.pg-line-sheet {
	margin: 15px auto;
}
.pg-editable .fusion-accordian + hr.wp-block-separator.has-alpha-channel-opacity {
	margin-bottom: 18px;
}
.pg-editable .wp-block-columns.pg-cols > .wp-block-column.pg-side {
	align-self: flex-start;
}
.pg-editable .wp-block-columns.pg-cols {
	display: flex;
	gap: 0;
	flex-wrap: nowrap;
	align-items: flex-start; /* the old float columns didn't stretch */
}
.pg-editable .wp-block-columns.pg-cols > .wp-block-column {
	flex: 0 0 auto;
	min-width: 0;
}
.pg-editable figure.wp-block-image {
	margin: 0;
}
.pg-editable h2.wp-block-heading {
	margin-left: auto;
	margin-right: auto;
}
/* plain links in the sidebar render as the old large grey block buttons */
.pg-editable .pg-side p a {
	display: block;
	background: #f0f0f0;
	color: rgba(38, 38, 38, 0.8);
	font-family: "PT Sans", Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 17px;
	padding: 13px 29px;
	text-align: center;
	text-decoration: none;
	border: 0;
	border-radius: 0;
	transition: all 0.2s;
}
.pg-editable .pg-side p a:hover {
	background: #d6d6d6;
}

/* ---- 2/3 + 1/3 scheda split (old fusion_builder_column_2_3 / _1_3) ---- */
.pg-editable .pg-cols {
	/* the old image rows carried a 2px top padding (plus heading margins) */
	margin-top: 6px;
	margin-bottom: 0;
}
.pg-editable .pg-cols::after {
	content: "";
	display: table;
	clear: both;
}
.pg-editable .pg-cols .pg-main {
	float: left;
	width: 65.3333%;
	margin-right: 4%;
}
.pg-editable .pg-cols .pg-side {
	float: left;
	width: 30.6666%;
	padding: 20px;
	box-sizing: border-box;
	background-color: #ffffff;
	margin-bottom: 20px;
}
.pg-editable .pg-cols .pg-side p {
	margin: 0;
}
.pg-editable .pg-cols .pg-side p + p {
	margin-top: 2px; /* the old invisible separator between the two buttons */
}
.pg-editable .pg-scheda-title {
	margin-bottom: 0;
}
.pg-editable .pg-cols img {
	max-width: 100%;
	height: auto;
}

/* ---- converted pages: buttons as context-styled plain links ----
   (geometry mirrors the vendored .button-small/.button-large rules;
   per-instance colors come from the generated pg-btnc-* classes) */
.pg-editable p.pg-btn {
	margin: 0;
}
.pg-editable .pg-btn a {
	display: inline-block;
	font-family: "PT Sans", Arial, Helvetica, sans-serif;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	border: 0; /* the old button-flat buttons render border-width 0 */
	border-radius: 0;
	transition: all 0.2s;
}
/* metrics mirror the vendored .button-small/.fusion-button-default-size/.button-large */
.pg-editable .pg-btn--small a { padding: 9px 20px; line-height: 14px; font-size: 12px; }
.pg-editable .pg-btn--default a { padding: 13px 29px; line-height: 17px; font-size: 14px; }
.pg-editable .pg-btn--large a { padding: 13px 29px; line-height: 17px; font-size: 14px; }
.pg-editable .pg-btn--span a { display: block; }

/* block utility classes normally served only by the footer block-library
   copy: restate in the head so first paint is already aligned */
.pg-editable .has-text-align-center { text-align: center; }
.pg-editable .has-text-align-right { text-align: right; }
.pg-editable .has-text-align-left { text-align: left; }

/* WP core styles div.wp-block-image (aligned image wrapper) with 1em
   bottom margin; the old imageframes had none */
.pg-editable .wp-block-image {
	margin: 0;
}

/* ---- converted pages: portfolio sidebar widget (nav menu) ----
   the old per-instance widget-area style (h4 color/size), restated */
.pg-editable .fusion-widget-area .widget h4 {
	color: #333333;
	font-size: 18px;
}
.pg-editable .fusion-widget-area .widget ul.wp-block-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---- converted pages: content boxes (image + linked heading trios) ----
   icon-on-top layout rules whose vendor selectors (.col/.heading/.image
   wrappers) no longer match the flattened markup. #main bumps specificity
   over the vendored `#main .columns h2 { line-height: 35px }`; size/leading
   come from the generated per-instance pg-t* tokens so the fluid-typography
   calc still applies. */
#main .pg-editable .pg-cbox h2.content-box-heading {
	margin: 0 0 15px; /* the old .heading wrapper's bottom margin */
	line-height: 1.8; /* the crawled inline value on every content-box heading */
}
.pg-editable .pg-cbox h2.content-box-heading a {
	color: #333333;
}
.pg-editable .pg-cbox .content-box-column {
	text-align: center; /* old .content-boxes-icon-on-top .col rule */
}
.pg-editable .pg-cbox .pg-cbox-img {
	margin: 0 0 20px; /* old .icon-on-top .heading img { margin-bottom: 20px } */
}
.pg-editable .pg-cbox .content-container {
	color: #747474;
	text-align: left;
}

/* ---- converted pages (blockify.py): fusion row/column groups ----
   Rows reuse the crawled fusion classes, so the vendored Avada CSS lays
   them out (incl. the -30px width-100 escape and the 800px column
   collapse). Only the interactions with this file's flat-content
   defaults need neutralizing. */
/* zero-height verbatim elements (SVG section separators, menu anchors)
   would let their neighbours' margins collapse through them — the old
   markup's 1px sep-clear divs prevented that. A cancelled sub-pixel
   padding rebuilds the barrier without adding height. */
.pg-editable .fusion-section-separator,
.pg-editable .fusion-menu-anchor {
	padding-top: 0.05px;
	margin-top: -0.05px;
}

/* rows come either as group blocks or as verbatim core/html rows (home
   sliders with layers) — both must escape the flat-content 1100px cap */
.pg-editable > .fusion-fullwidth {
	max-width: none; /* the 1100px band lives on the inner .fusion-row */
}
.pg-editable:has(> .fusion-fullwidth) {
	padding-bottom: 0; /* row paddings come from their own tokens */
}
/* the original column split width (outer div) and padding (inner wrapper)
   are merged onto one group div: border-box keeps the outer size */
.pg-editable .wp-block-group.fusion_builder_column {
	box-sizing: border-box;
}
/* aligned images render as div.wp-block-image > figure: kill the inner
   figure's default margins like the flat figure.wp-block-image rule does,
   but keep the auto side margins that implement centering */
.pg-editable div.wp-block-image > figure {
	margin: 0;
}
.pg-editable div.wp-block-image > figure.aligncenter {
	margin: 0 auto;
}
.pg-editable .wp-block-group.fusion_builder_column::after,
.pg-editable .wp-block-group.fusion-row::after {
	content: "";
	display: table;
	clear: both;
}

@media only screen and (max-width: 800px) {
	.pg-editable .wp-block-columns.pg-cols {
		flex-direction: column;
	}
	.pg-editable .pg-cols .pg-main,
	.pg-editable .pg-cols .pg-side {
		float: none;
		width: 100%;
		margin-right: 0;
	}
	.pg-editable > * {
		max-width: none;
	}
	.pg-editable .pg-scheda-title,
	.pg-editable .pg-cols {
		margin-left: 0;
		margin-right: 0;
	}
	/* the old title + accordion rows had no side padding: full-bleed past
	   the shell's 30px (the scheda rows keep it) */
	.pg-editable > .pg-page-title,
	.pg-editable > hr,
	.pg-editable > hr.wp-block-separator.has-alpha-channel-opacity,
	.pg-editable > .fusion-accordian {
		margin-left: -30px;
		margin-right: -30px;
		width: calc(100% + 60px);
		max-width: none;
	}
	.pg-editable .pg-cols .pg-side {
		margin-top: 3px;
	}
	.pg-editable > h2.pg-scheda-title {
		margin-top: 8px;
	}
	.pg-editable {
		padding-bottom: 5px;
	}
}
