/*
 * Importa Word in Pagina — stile dei contenuti importati.
 * Volutamente "neutro": colori, font, titoli e link restano quelli del tema (OceanWP).
 */

.w2p-content { overflow-wrap: break-word; }
.w2p-content::after { content: ""; display: table; clear: both; }

/* Testo giustificato */
.w2p-justify p,
.w2p-justify li { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.w2p-justify td p, .w2p-justify th p,
.w2p-justify td li, .w2p-justify th li { text-align: left; }
.w2p-content .w2p-center { text-align: center; }
.w2p-content .w2p-right { text-align: right; }

/* Titoli: tornano sempre a capo sotto le immagini flottanti */
.w2p-content h1, .w2p-content h2, .w2p-content h3,
.w2p-content h4, .w2p-content h5, .w2p-content h6 { clear: both; text-align: left; }

/* Elenchi */
.w2p-content ul, .w2p-content ol { margin: 0 0 1.2em 1.6em; }
.w2p-content li > ul, .w2p-content li > ol { margin-top: .3em; margin-bottom: .3em; }
.w2p-content li { margin-bottom: .3em; }

/* Indice / sommario */
.w2p-content .w2p-toc { margin: 0 0 .35em; text-align: left; }
.w2p-content .w2p-toc-2 { padding-left: 1.5em; }
.w2p-content .w2p-toc-3 { padding-left: 3em; }

/* Immagini */
.w2p-content .w2p-figure { max-width: 100%; margin: .3em 0 1.4em; padding: 0; border: 0; background: none; }
.w2p-content .w2p-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.w2p-content .w2p-figure.alignleft { float: left; margin: .35em 1.6em 1em 0; }
.w2p-content .w2p-figure.alignright { float: right; margin: .35em 0 1em 1.6em; }
.w2p-content .w2p-figure.aligncenter { display: table; clear: both; margin-left: auto; margin-right: auto; }
.w2p-content .w2p-figure.alignnone { clear: both; }
.w2p-content .w2p-figure.w2p-block-right { clear: both; margin-left: auto; }
.w2p-content img.w2p-inline-img { display: inline; vertical-align: middle; max-width: 100%; height: auto; }

/* Didascalie */
.w2p-content .w2p-figure figcaption,
.w2p-content .w2p-caption,
.w2p-content .w2p-cell-caption {
	font-size: .88em; line-height: 1.5; text-align: center !important; opacity: .85; padding: .5em .25em 0; margin: 0;
}
.w2p-content .w2p-caption { margin: -.6em 0 1.4em; clear: both; }

/* Più immagini affiancate */
.w2p-content .w2p-image-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin: .3em 0 1.4em; clear: both; }
.w2p-content .w2p-image-row.aligncenter { justify-content: center; }
.w2p-content .w2p-image-row.alignright { justify-content: flex-end; }
.w2p-content .w2p-image-row .w2p-figure { margin: 0; float: none; }

/* Caselle di testo flottanti */
.w2p-content .w2p-box { max-width: 100%; margin: .35em 0 1em; }
.w2p-content .w2p-box.alignleft { float: left; margin-right: 1.6em; }
.w2p-content .w2p-box.alignright { float: right; margin-left: 1.6em; }
.w2p-content .w2p-box.aligncenter { margin-left: auto; margin-right: auto; clear: both; }

/* Tabelle di dati */
.w2p-content .w2p-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.6em; clear: both; }
.w2p-content table.w2p-table { width: 100%; border-collapse: collapse; margin: 0; }
.w2p-content table.w2p-table th,
.w2p-content table.w2p-table td { border: 1px solid #e1e1e1; padding: 9px 12px; vertical-align: top; text-align: left; }
.w2p-content table.w2p-table th { background: rgba(0, 0, 0, .04); font-weight: 600; }
.w2p-content table.w2p-table tbody tr:nth-child(even) td { background: rgba(0, 0, 0, .015); }
.w2p-content table td > :last-child, .w2p-content table th > :last-child { margin-bottom: 0; }

/* Tabelle usate per impaginare immagini (come nel documento Word) */
.w2p-content table.w2p-layout-table { width: 100%; border: 0; border-collapse: collapse; margin: 0; background: none; }
.w2p-content table.w2p-layout-table td { border: 0; padding: 8px; vertical-align: top; background: none; }
.w2p-content table.w2p-layout-table .w2p-figure { float: none; margin: 0 auto; }
.w2p-content table.w2p-layout-table .w2p-figure.alignleft,
.w2p-content table.w2p-layout-table .w2p-figure.alignright { float: none; margin: 0 auto; }

.w2p-content td.w2p-va-middle { vertical-align: middle; }
.w2p-content td.w2p-va-bottom { vertical-align: bottom; }

/* Note a piè di pagina */
.w2p-content sup.w2p-fn-ref { font-size: .75em; line-height: 0; }
.w2p-content sup.w2p-fn-ref a { text-decoration: none; }
.w2p-content .w2p-footnotes { clear: both; margin-top: 2.5em; padding-top: 1em; border-top: 1px solid #e1e1e1; font-size: .9em; }
.w2p-content .w2p-footnotes ol { margin-left: 1.4em; }
.w2p-content .w2p-fn-back { text-decoration: none; }

.w2p-content .w2p-clear { clear: both; }

/* Tablet: immagini flottanti non oltre metà colonna */
@media (max-width: 959px) {
	.w2p-content .w2p-figure.alignleft,
	.w2p-content .w2p-figure.alignright { max-width: 50%; }
}

/* Cellulare: tutto in colonna, niente testo stretto accanto alle immagini */
@media (max-width: 600px) {
	.w2p-content .w2p-figure.alignleft,
	.w2p-content .w2p-figure.alignright,
	.w2p-content .w2p-box.alignleft,
	.w2p-content .w2p-box.alignright { float: none; max-width: 100%; margin: .3em auto 1.2em; }
	.w2p-content .w2p-figure { width: auto !important; }
	.w2p-content table.w2p-layout-table,
	.w2p-content table.w2p-layout-table tbody,
	.w2p-content table.w2p-layout-table tr,
	.w2p-content table.w2p-layout-table td { display: block; width: 100% !important; }
	.w2p-content table.w2p-layout-table td { padding: 6px 0; }
}
