/* ----------------------------------------------------------------
	Canvas: Modern Blog — entry cards (estratto da demos/modern-blog,
	senza il layout split-screen che confligge con il sito)
-----------------------------------------------------------------*/

/* Video embed negli articoli: FitVids.js a volte calcola un'altezza errata
   (es. padding-top 18% → iframe schiacciato). Forziamo il 16:9 standard, ma
   se l'embed è già dentro un wrapper con aspect-ratio (es. Short dal pulsante)
   lasciamo che il wrapper di FitVids lo riempia rispettando quella proporzione. */
.mg-blog .fluid-width-video-wrapper {
    padding: 0 !important;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}
.mg-blog div[style*="aspect-ratio"] > .fluid-width-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.mg-blog .fluid-width-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Combo "Scegli il tuo blog": larghezza piena della colonna (evita che eventuali
   regole del template Canvas su <select> la restringano). */
.mg-blog select[data-blog-select] {
    width: 100%;
    display: block;
}
/* Tabella articoli */
.mg-blog-table thead th { color: #14406e; border-bottom: 2px solid #dee2e6; white-space: nowrap; }
.mg-blog-table td a { color: #14406e; }
.mg-blog-table td a:hover { color: #A07828; }

.mg-blog .entry {
	background-color: #FFF;
	padding: 0;
	vertical-align: top;
	border-bottom: 0;
	border-radius: 4px;
	height: 100%;
	transform-origin: 50% 50% 0px;
	transition: all 250ms cubic-bezier(.02, .01, .5, 1);
}

.mg-blog .entry:hover {
	box-shadow: 0 10px 20px rgba(0,0,0,.08);
	transform: translate(0, -8px);
}

.mg-blog .entry-title,
.mg-blog .entry-meta,
.mg-blog .entry-content { padding: 0 20px; }

.mg-blog .entry-title h3 {
	font-size: 20px;
	line-height: 1.4;
	margin-bottom: 12px;
}

.mg-blog .entry-title a { color: #333; }
.mg-blog .entry-title a:hover { color: #A07828; }

.mg-blog .entry-content p {
	margin-bottom: 0;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 14px;
	line-height: 22px !important;
}

.mg-blog .entry-meta {
	font-size: 0.8125rem;
	text-transform: uppercase;
	border-top: 1px solid #E9EBEE;
	padding: 15px 0;
	margin: 15px 15px 0;
}

.mg-blog .entry-meta li {
	margin-left: 0;
	margin-right: 0;
}

.mg-blog .entry::after { display: none; }

.mg-blog .entry-meta li::before { content: none; }

.mg-blog .entry-meta.nohover,
.mg-blog .entry:hover .entry-meta.hover { display: block; }

.mg-blog .entry-meta.hover,
.mg-blog .entry:hover .entry-meta.nohover { display: none; }

/* Blocco categoria al posto dell'immagine (i contenuti non hanno foto) */
.mg-blog .entry-cat {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 130px;
	border-radius: 4px 4px 0 0;
	margin-bottom: 1rem;
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1.9rem;
	font-weight: 700;
	letter-spacing: .06em;
	color: #fff;
	text-decoration: none;
}
.mg-blog .entry-cat small {
	display: block;
	font-family: 'Jost', system-ui, sans-serif;
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	opacity: .65;
	text-align: center;
}
.mg-blog .entry-cat-0 { background: linear-gradient(135deg, #081D35, #14406e); }
.mg-blog .entry-cat-1 { background: linear-gradient(135deg, #0D2B4E, #2a6496); }
.mg-blog .entry-cat-2 { background: linear-gradient(135deg, #A07828, #C9A84C); }
.mg-blog .entry-cat-3 { background: linear-gradient(135deg, #1d3a2f, #2e6b50); }
.mg-blog .entry-cat-4 { background: linear-gradient(135deg, #4a1d35, #7e3a5e); }
.mg-blog .entry-cat-5 { background: linear-gradient(135deg, #33414a, #5c7585); }

/* ════════════════════════════════════════════════════════════════
   Pagina dettaglio contenuto — impaginazione dei testi lunghi
   Il corpo del testo è per leggere, non per l'interfaccia: serif,
   riga lunga il giusto (~68 caratteri) e respiro verticale.
   ════════════════════════════════════════════════════════════════ */
.mg-content-body {
	background: #fff;
	border-radius: 8px;
	padding: clamp(1.4rem, 4vw, 3.25rem) clamp(1.25rem, 4vw, 3.5rem);
	box-shadow: 0 4px 16px rgba(0,0,0,.06);
	overflow-x: auto;

	font-family: 'Lora', 'Cormorant Garamond', Georgia, serif;
	/* 17px sul telefono → 19px sul desktop: la misura cresce con lo schermo */
	font-size: clamp(1.06rem, .99rem + .3vw, 1.19rem);
	line-height: 1.62;
	color: #26303a;
	text-rendering: optimizeLegibility;
	/* Impaginazione da libro: testo giustificato e sillabato (la pagina è lang="it",
	   senza sillabazione il giustificato lascerebbe buchi bianchi fra le parole). */
	text-align: justify;
	hyphens: auto;
}

/* Colonna di lettura: la riga oltre i ~70 caratteri stanca, l'occhio perde
   il capo della successiva. Il testo si stringe, le immagini no.

   Nota sui <div>: parecchi articoli arrivano da un incolla e hanno i capoversi
   in <div> invece che in <p>. Un div che non contiene blocchi né media è un
   capoverso a tutti gli effetti e va impaginato come tale — altrimenti resta
   fuori da misura, rientri e capolettera, com'è successo su «La salita». */
.mg-content-body > p,
.mg-content-body > div:not(:has(div, p, img, video, iframe, table, pre, figure, ul, ol, blockquote, h1, h2, h3, h4, hr)),
.mg-content-body > ul,
.mg-content-body > ol,
.mg-content-body > h2,
.mg-content-body > h3,
.mg-content-body > h4,
.mg-content-body > blockquote,
.mg-content-body > figure > figcaption {
	max-width: 34em;
	margin-left: auto;
	margin-right: auto;
}

/* Capoversi come in un libro: nessuno stacco fra l'uno e l'altro, il cambio si
   legge dal rientro della prima riga. */
.mg-content-body p,
.mg-content-body > div:not(:has(div, p, img, video, iframe, table, pre, figure, ul, ol, blockquote, h1, h2, h3, h4, hr)) {
	margin: 0;
	text-indent: 1.4em;
	/* ripetuto qui: Canvas impone 1.65 su tutti i <p> e vincerebbe sull'ereditarietà */
	line-height: 1.62;
}

/* Il primo capoverso non si rientra mai: dopo un titolo, uno stacco di scena o
   un'immagine non c'è nessun capoverso precedente da distinguere. */
.mg-content-body > :is(p, div):first-child,
.mg-content-body > h2 + :is(p, div),
.mg-content-body > h3 + :is(p, div),
.mg-content-body > h4 + :is(p, div),
.mg-content-body > hr + :is(p, div),
.mg-content-body > blockquote + :is(p, div),
.mg-content-body > figure + :is(p, div),
.mg-content-body > ul + :is(p, div),
.mg-content-body > ol + :is(p, div),
.mg-content-body > pre + :is(p, div),
.mg-content-body > table + :is(p, div) { text-indent: 0; }

/* Un capoverso che contiene solo un media non è testo: niente rientro né
   giustificato, sta al centro come una tavola fuori testo. */
.mg-content-body :is(p, div):has(> img),
.mg-content-body :is(p, div):has(> video),
.mg-content-body :is(p, div):has(> iframe) {
	text-indent: 0;
	text-align: center;
	margin: 1.6em 0;
}
.mg-content-body > :first-child { margin-top: 0; }
.mg-content-body > :last-child { margin-bottom: 0; }

.mg-content-body strong, .mg-content-body b { font-weight: 600; }
.mg-content-body em, .mg-content-body i { font-style: italic; }

/* Titoli interni: stessa voce dei titoli del sito */
.mg-content-body h2,
.mg-content-body h3,
.mg-content-body h4 {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 700;
	color: var(--mg-navy, #0D2B4E);
	line-height: 1.22;
	letter-spacing: .01em;
	margin: 1.9em 0 .6em;
}
.mg-content-body h2 { font-size: 1.85em; }
.mg-content-body h3 { font-size: 1.45em; }
.mg-content-body h4 { font-size: 1.2em; }

.mg-content-body a {
	color: var(--mg-navy, #0D2B4E);
	text-decoration: underline;
	text-decoration-color: var(--mg-gold, #C9A84C);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
	transition: color .2s;
}
.mg-content-body a:hover { color: var(--mg-gold-dk, #A07828); }

.mg-content-body ul, .mg-content-body ol { margin: 0 auto 1.15em; padding-left: 1.4em; }
.mg-content-body li { margin-bottom: .4em; }
.mg-content-body li::marker { color: var(--mg-gold-dk, #A07828); }

.mg-content-body blockquote {
	margin: 1.8em auto;
	padding: .1em 0 .1em 1.4em;
	border-left: 3px solid var(--mg-gold, #C9A84C);
	font-style: italic;
	font-size: 1.06em;
	color: #46535f;
}
.mg-content-body blockquote p:last-child { margin-bottom: 0; }

/* Stacco di scena: un filetto d'oro breve e centrato, non una riga di tabella */
.mg-content-body hr {
	width: 110px;
	margin: 2.6em auto;
	border: 0;
	border-top: 1px solid var(--mg-gold, #C9A84C);
	opacity: .65;
}

.mg-content-body img { max-width: 100%; height: auto; border-radius: 8px; }
.mg-content-body figure { margin: 1.8em 0; }
.mg-content-body figcaption {
	font-family: 'Jost', system-ui, sans-serif;
	font-size: .82rem;
	color: var(--mg-muted, #607176);
	text-align: center;
	margin-top: .6em;
}

/* Capolettera: si attiva sezione per sezione con la spunta «Apri con il capolettera»
   (prima compariva da solo su ogni sezione, anche dove non serviva). Resta escluso
   dove c'è del codice: su un testo tecnico stonerebbe. */
.mg-content-body.mg-dropcap:not(:has(pre, .dp-highlighter, code)) > :is(p, div):first-child::first-letter {
	float: left;
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 700;
	font-size: 3.5em;
	line-height: .78;
	color: var(--mg-gold-dk, #A07828);
	margin: .04em .1em 0 0;
}

/* Il codice resta a spaziatura fissa e non eredita il serif */
.mg-content-body pre, .mg-content-body code, .mg-content-body kbd {
	font-family: Consolas, Monaco, monospace;
	hyphens: none;
}
.mg-content-body pre {
	background: #0D2B4E;
	color: #e8eef5;
	padding: 1rem 1.25rem;
	border-radius: 6px;
	overflow-x: auto;
	font-size: .85rem;
}
.mg-content-body .dp-highlighter {
	background: #f4f6f9;
	border-left: 3px solid #C9A84C;
	padding: .75rem 1rem;
	border-radius: 4px;
	overflow-x: auto;
	font-family: Consolas, Monaco, monospace;
	font-size: .85rem;
}
.mg-content-body .dp-highlighter ol { margin: 0; padding-left: 2.2rem; }
.mg-content-body .dp-highlighter .keyword { color: #0D5BD7; font-weight: 600; }
.mg-content-body .dp-highlighter .string { color: #B02A37; }
.mg-content-body .dp-highlighter .comment { color: #6c757d; font-style: italic; }

/* ── Indice del blog: la pagina /blog come l'indice di un libro ──
   Titolo in tondo, filetto punteggiato, data al posto del numero di pagina. */
.mg-index {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: 46em;
}

.mg-index-item {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--mg-border, rgba(13,43,78,.12));
}
.mg-index-item:last-child { border-bottom: 0; }

.mg-index-link {
	display: flex;
	align-items: baseline;
	gap: .5rem;
	text-decoration: none;
	color: var(--mg-navy-dk, #081D35);
}

.mg-index-title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	transition: color .2s;
}
.mg-index-link:hover .mg-index-title { color: var(--mg-gold-dk, #A07828); }

/* Il filetto occupa lo spazio che avanza: la data resta appoggiata a destra
   comunque sia lungo il titolo. */
.mg-index-dots {
	flex: 1 1 auto;
	min-width: 1.5rem;
	align-self: flex-end;
	margin-bottom: .32em;
	border-bottom: 1px dotted rgba(13,43,78,.35);
}

.mg-index-date {
	flex: 0 0 auto;
	font-family: 'Jost', system-ui, sans-serif;
	font-size: .76rem;
	font-weight: 500;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--mg-muted, #607176);
	white-space: nowrap;
}

.mg-index-meta {
	font-family: 'Jost', system-ui, sans-serif;
	font-size: .72rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--mg-muted, #607176);
	margin-top: .25rem;
}

/* Pulsante di modifica: lo vede solo l'amministratore, e non deve rubare
   l'occhio a chi legge l'indice. */
.mg-index-edit {
	margin-left: .75rem;
	padding: .1rem .5rem;
	border: 1px solid var(--mg-gold, #C9A84C);
	border-radius: 999px;
	font-size: .68rem;
	letter-spacing: .08em;
	color: var(--mg-gold-dk, #A07828);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s, color .2s;
}
.mg-index-edit:hover {
	background: var(--mg-gold, #C9A84C);
	color: var(--mg-navy-dk, #081D35);
}

.mg-index-preview {
	font-family: 'Lora', Georgia, serif;
	font-size: .95rem;
	line-height: 1.6;
	color: #56626d;
	margin: .5rem 0 0;
	/* due righe: è un assaggio, non l'articolo */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Sul telefono la data va a capo sotto il titolo: il filetto punteggiato
   non avrebbe spazio e spezzerebbe la riga in modo brutto. */
@media (max-width: 480px) {
	.mg-index-link { flex-wrap: wrap; gap: .15rem; }
	.mg-index-dots { display: none; }
	.mg-index-title { font-size: 1.3rem; flex: 1 1 100%; }
}

/* ── Testata dell'articolo (titolo + riga dei dati) ───────────── */
.mg-article-title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 700;
	font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.3rem);
	line-height: 1.1;
	letter-spacing: -.005em;
	color: var(--mg-navy-dk, #081D35);
	/* righe di lunghezza simile invece di un titolo lungo e una parola sotto */
	text-wrap: balance;
	margin: .35rem 0 .7rem;
}
.mg-article-meta {
	font-family: 'Jost', system-ui, sans-serif;
	font-size: .74rem;
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--mg-muted, #607176);
}
/* Filetto d'oro fra la testata e il testo */
.mg-article-head { padding-bottom: 1.4rem; border-bottom: 1px solid var(--mg-border, rgba(13,43,78,.12)); }
.mg-article-head .mg-back-link {
	font-family: 'Jost', system-ui, sans-serif;
	font-size: .78rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--mg-muted, #607176);
	text-decoration: none;
}
.mg-article-head .mg-back-link:hover { color: var(--mg-gold-dk, #A07828); }

/* Carousel citazioni (/sentences) */
.mg-sentences-slider { box-shadow: 0 12px 40px rgba(8,29,53,.15); border-radius: 10px; overflow: hidden; }

/* Navigazione pagine (Precedente / Successivo) sopra e sotto il carousel */
.mg-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Filtri citazioni (collassabili): toggle + pannello ── */
.mg-filters { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.mg-filters-toggle {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #0D2B4E;
    background: #fff;
    border: 1px solid rgba(13,43,78,.2);
    border-radius: 999px;
    padding: .5rem 1.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: background .2s, color .2s, border-color .2s;
}
.mg-filters-toggle:hover { background: #C9A84C; border-color: #C9A84C; }
.mg-filters-caret { transition: transform .2s; font-size: .7rem; }
.mg-filters-panel { display: none; }
.mg-filters-panel.open {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    width: 100%;
    background: rgba(13,43,78,.03);
    border: 1px solid rgba(13,43,78,.1);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
}
.mg-filters:has(.mg-filters-panel.open) .mg-filters-caret { transform: rotate(180deg); }
.mg-filter-search { min-width: 240px; }
.mg-search-row { display: flex; gap: .4rem; }
.mg-search-input {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .9rem;
    color: #0D2B4E;
    background: #fff;
    border: 1px solid rgba(13,43,78,.25);
    border-radius: 999px;
    padding: .5rem 1rem;
    min-width: 180px;
    flex: 1 1 auto;
}
.mg-search-input:focus { outline: none; border-color: #C9A84C; box-shadow: 0 0 0 2px rgba(201,168,76,.25); }
.mg-search-btn {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .8rem;
    font-weight: 600;
    color: #0D2B4E;
    background: #C9A84C;
    border: 1px solid #C9A84C;
    border-radius: 999px;
    padding: .5rem 1.1rem;
    cursor: pointer;
    white-space: nowrap;
}
.mg-search-btn:hover { filter: brightness(.95); }

/* ── (legacy) barra filtri ── */
.mg-filterbar {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.mg-filter {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.mg-filter label {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #0D2B4E;
}
.mg-filter-select {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .9rem;
    color: #0D2B4E;
    background: #fff;
    border: 1px solid rgba(13,43,78,.25);
    border-radius: 999px;
    padding: .5rem 1rem;
    min-width: 220px;
    max-width: 320px;
    cursor: pointer;
}
.mg-filter-select:focus { outline: none; border-color: #C9A84C; box-shadow: 0 0 0 2px rgba(201,168,76,.25); }
.mg-filter-clear {
    align-self: center;
    font-size: .8rem;
    font-weight: 600;
    color: #0D2B4E;
    text-decoration: none;
    border: 1px solid rgba(13,43,78,.2);
    border-radius: 999px;
    padding: .5rem 1rem;
    transition: background .2s, color .2s;
}
.mg-filter-clear:hover { background: #C9A84C; border-color: #C9A84C; color: #0D2B4E; }
.mg-page-btn {
    display: inline-block;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #0D2B4E;
    background: #fff;
    border: 1px solid rgba(13,43,78,.2);
    border-radius: 999px;
    padding: .5rem 1.2rem;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}
.mg-page-btn:hover { background: #C9A84C; border-color: #C9A84C; color: #0D2B4E; }
.mg-page-btn.disabled,
.mg-page-btn:disabled { opacity: .4; pointer-events: none; cursor: default; }
.mg-page-info {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .82rem;
    color: #607176;
    min-width: 120px;
    text-align: center;
}

/* ── Schema semantico della slide: <sentence><title><author><image><HtmlText><tags> ── */
.mg-sentences-slider sentence {
    position: relative;   /* ancoraggio del link ✏️ admin */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 460px;
    padding: 2.75rem 2rem;
    text-align: center;
    color: #1d2b2f;
    background: #fff;
}
.mg-sentences-slider sentence > title {
    display: block;                 /* override del display:none di default per <title> nel body */
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
    font-weight: 600;
    font-style: italic;
    line-height: 1.4;
    color: #14406e;
}
/* il focus sul titolo è solo programmatico (allo scorrimento): niente anello visibile */
.mg-sentences-slider sentence:focus,
.mg-sentences-slider sentence > title:focus { outline: none; }
.mg-sentences-slider sentence > author {
    display: block;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #C9A84C;
}
.mg-sentences-slider sentence > .mg-sentence-image {
    display: block;
    /* altezza fissa: riserva lo spazio anche prima del caricamento, così l'altezza
       della slide è deterministica e FlexSlider non taglia il contenuto sotto. */
    height: 300px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.mg-sentences-slider sentence > .mg-sentence-image[visible="false"] { display: none; }
.mg-sentences-slider sentence > .mg-sentence-image { cursor: zoom-in; }

.mg-sentences-slider sentence > .mg-sentence-video {
    display: block;
    width: 100%;
    max-width: 720px;
    max-height: 420px;
    margin: 0 auto;
    background: #000;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* Lightbox immagine a tutto schermo (click o ESC per chiudere) */
.mg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(8,29,53,.93);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}
.mg-lightbox img,
.mg-lightbox video {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.mg-lightbox-close {
    position: fixed;
    top: .75rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}
.mg-lightbox-close:hover { opacity: 1; }
.mg-sentences-slider sentence > htmltext {
    display: block;
    /* La card è flex column con align-items:center: senza una larghezza esplicita
       htmltext si restringe al contenuto e gli embed con width:100% collassano a 0
       (il video non parte perché l'iframe è 0×0). Forziamo la larghezza piena. */
    width: 100%;
    align-self: stretch;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .95rem;
    line-height: 1.7;
    color: #3a464c;
}
.mg-sentences-slider sentence > htmltext p { margin: 0 0 .6rem; }
.mg-sentences-slider sentence > htmltext a { color: #A07828; }
.mg-sentences-slider sentence > htmltext h2,
.mg-sentences-slider sentence > htmltext h3 { color: #14406e; font-family: 'Cormorant Garamond', Georgia, serif; }
.mg-sentences-slider sentence > htmltext pre,
.mg-sentences-slider sentence > htmltext code {
    background: #f0f3f7; color: #0D2B4E; border-radius: 4px; padding: .1rem .35rem;
}
.mg-sentences-slider sentence > htmltext pre { padding: .75rem 1rem; overflow-x: auto; }
.mg-sentences-slider sentence > htmltext img { max-width: 100%; height: auto; border-radius: 6px; }
.mg-sentences-slider sentence > htmltext iframe { max-width: 100%; }
/* embed video (iframe in wrapper responsivo) centrati */
.mg-sentences-slider sentence > htmltext > div { margin-left: auto; margin-right: auto; }
/* FitVids.js (plugin Canvas) avvolge gli iframe in .fluid-width-video-wrapper e ne
   calcola l'altezza via padding-top dagli attributi width/height: i nostri embed
   non li hanno, così FitVids imposta altezza 0 e il video collassa (non parte).
   Il nostro wrapper con aspect-ratio gestisce già la proporzione: qui annulliamo
   il sizing di FitVids facendo riempire al suo wrapper il box con aspect-ratio. */
.mg-sentences-slider sentence > htmltext div[style*="aspect-ratio"] > .fluid-width-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0 !important;
}
.mg-sentences-slider sentence > tags {
    display: block;
    font-size: .78rem;
    letter-spacing: .05em;
    color: #8a969c;
}

.mg-sentence-slide {
    position: relative;
    min-height: 460px;
    display: flex;
    overflow: hidden;
    /* Sfondo navy: visibile dietro le foto verticali (letterbox) e quando manca l'immagine */
    background: linear-gradient(135deg, #081D35 0%, #0D2B4E 60%, #14406e 100%);
}

/* Immagine reale: l'orientamento decide come viene mostrata (classi aggiunte via JS) */
.mg-sentence-img { display: block; }

/* ── Landscape (default): foto a tutto campo, testo sovrapposto ── */
.mg-sentence-slide.orient-landscape .mg-sentence-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mg-sentence-slide.orient-landscape .mg-sentence-overlay {
    position: relative;
    width: 100%;
    background: linear-gradient(0deg, rgba(8,29,53,.78), rgba(8,29,53,.55));
}

/* ── Portrait: foto intera (no taglio) affiancata al testo ── */
.mg-sentence-slide.orient-portrait { flex-direction: row; }
.mg-sentence-slide.orient-portrait .mg-sentence-img {
    position: relative;
    width: 42%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    align-self: center;
    flex-shrink: 0;
}
.mg-sentence-slide.orient-portrait .mg-sentence-overlay {
    position: relative;
    width: 58%;
    background: transparent;
}

/* ── Quasi quadrata: foto intera (contain) centrata a tutta larghezza, testo sovrapposto ── */
.mg-sentence-slide.orient-square .mg-sentence-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mg-sentence-slide.orient-square .mg-sentence-overlay {
    position: relative;
    width: 100%;
    background: linear-gradient(0deg, rgba(8,29,53,.55), rgba(8,29,53,.30));
}

/* ── Immagine + HTML: foto come banner in alto, citazione e testo HTML sotto ── */
.mg-sentence-slide.mg-sentence-stacked { flex-direction: column; min-height: 0; }
.mg-sentence-slide.mg-sentence-stacked .mg-sentence-img {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
}
.mg-sentence-slide.mg-sentence-stacked .mg-sentence-overlay {
    position: relative;
    width: 100%;
    background: transparent;
}

/* Prima che il JS classifichi l'immagine: la nascondiamo per evitare un flash a piena larghezza
   (le slide "stacked" sono già pronte lato server, quindi escluse) */
.mg-sentence-slide:not(.orient-landscape):not(.orient-portrait):not(.orient-square):not(.mg-sentence-stacked) .mg-sentence-img { visibility: hidden; }

.mg-sentence-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}
.mg-sentence-inner {
    max-width: 760px;
    text-align: center;
    color: #fff;
}

/* Su mobile il portrait torna impilato */
@media (max-width: 768px) {
    .mg-sentence-slide.orient-portrait { flex-direction: column; }
    .mg-sentence-slide.orient-portrait .mg-sentence-img { width: 100%; max-height: 260px; }
    .mg-sentence-slide.orient-portrait .mg-sentence-overlay { width: 100%; }
}
.mg-sentence-quote-mark {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 5rem;
    line-height: .6;
    color: #C9A84C;
    margin-bottom: 1rem;
}
.mg-sentence-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
    font-weight: 600;
    font-style: italic;
    line-height: 1.4;
    color: #fff;
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
}
.mg-sentence-author {
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #C9A84C;
}
.mg-sentence-tags {
    margin-top: .75rem;
    font-size: .78rem;
    letter-spacing: .05em;
    color: rgba(255,255,255,.55);
}

/* Testo HTML mostrato nelle slide senza immagine (default) */
.mg-sentence-html {
    margin: 1rem auto 1.25rem;
    max-width: 680px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .95rem;
    line-height: 1.7;
    color: rgba(255,255,255,.82);
    text-align: left;
}
.mg-sentence-html p { margin: 0 0 .6rem; }
.mg-sentence-html a { color: #C9A84C; }
.mg-sentence-html h2, .mg-sentence-html h3 { color: #fff; font-family: 'Cormorant Garamond', Georgia, serif; }
.mg-sentence-html pre, .mg-sentence-html code {
    background: rgba(255,255,255,.1);
    color: #e8eef5;
    border-radius: 4px;
    padding: .1rem .35rem;
}
.mg-sentence-html pre { padding: .75rem 1rem; overflow-x: auto; }
.mg-sentence-html img { max-width: 100%; height: auto; border-radius: 6px; }

/* ── Galleria media pubblica (/media) ───────────────────────────────────── */
.mg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.mg-gallery-item {
    margin: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(8,29,53,.08);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.mg-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(8,29,53,.16);
}
.mg-gallery-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #f1f4f8;
    cursor: zoom-in;
}
.mg-gallery-file {
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: #f1f4f8;
    text-decoration: none;
    color: #14406e;
}
.mg-gallery-file-icon { font-size: 3rem; }
.mg-gallery-file-name { font-size: .85rem; padding: 0 .75rem; text-align: center; }
.mg-gallery-caption {
    padding: .75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.mg-gallery-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    color: #14406e;
    font-size: 1.1rem;
}
.mg-gallery-desc {
    font-size: .85rem;
    line-height: 1.5;
    color: #5a6b80;
}

/* Pulsanti di condivisione citazione (/sentences) */
.mg-share { }
.mg-share-label {
    display: block;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #8a98a8;
    margin-bottom: .6rem;
}
.mg-share-btns {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    align-items: center;
}
.mg-share-btn {
    border: 1px solid #d4dbe3;
    background: #fff;
    color: #14406e;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.mg-share-btn:hover { transform: translateY(-2px); color: #fff; }
.mg-share-btn.mg-share-cp {
    width: auto;
    padding: 0 1rem;
    gap: .4rem;
    font-size: .9rem;
}
.mg-share-fb:hover { background: #1877f2; border-color: #1877f2; }
.mg-share-x:hover  { background: #000;     border-color: #000; }
.mg-share-wa:hover { background: #25d366;  border-color: #25d366; }
.mg-share-tg:hover { background: #229ed9;  border-color: #229ed9; }
.mg-share-em:hover { background: #14406e;  border-color: #14406e; }
.mg-share-cp:hover { background: #C9A84C;  border-color: #C9A84C; }
.mg-share-btn.mg-share-copied { background: #25d366; border-color: #25d366; color: #fff; }

/* Galleria foto stile Canvas (flex-thumb-grid) negli articoli: l'immagine grande
   è cliccabile per aprirla a tutto schermo (lightbox). */
.mg-photo-gallery .entry img { cursor: zoom-in; }

/* Miniatura video nella galleria: primo fotogramma + badge play */
.mg-gallery-vid {
    position: relative;
    height: 220px;
    background: #0b1f38;
    cursor: pointer;
    overflow: hidden;
}
.mg-gallery-vid .mg-gallery-img {
    height: 220px;
    cursor: pointer;
    pointer-events: none;
}
.mg-gallery-vid-playing .mg-gallery-img { pointer-events: auto; }
.mg-gallery-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(8,29,53,.55);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    pointer-events: none;
    transition: background .2s ease, transform .2s ease;
}
.mg-gallery-vid:hover .mg-gallery-play {
    background: #C9A84C;
    transform: translate(-50%, -50%) scale(1.08);
}
.mg-gallery-vid-playing .mg-gallery-play { display: none; }

/* Video YouTube in home: se FitVids avvolge l'iframe, fagli riempire il box 16:9 */
.mg-home-video > .fluid-width-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0 !important;
}
.mg-home-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Facade YouTube: copertina + tasto play (il player si carica al click) */
.mg-yt-facade { overflow: hidden; }
.mg-yt-facade .mg-yt-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 68px; height: 48px;
    border-radius: 12px;
    background: rgba(18,18,18,.75);
    display: flex; align-items: center; justify-content: center;
    transition: background .2s ease;
}
.mg-yt-facade .mg-yt-play::after {
    content: "";
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}
.mg-yt-facade:hover .mg-yt-play { background: #ff0000; }

/* Messaggio "accedi" sotto i video YouTube/Facebook */
.mg-video-note {
    text-align: center;
    font-size: .8rem;
    color: #8a98a8;
    margin: .4rem auto 0;
    max-width: 760px;
}
.mg-video-note a { color: #14406e; font-weight: 600; text-decoration: underline; }
.mg-video-note a:hover { color: #A07828; }

/* ── Newsletter citazioni (box iscrizione + pagina gestione) ── */
.mg-newsletter {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.6rem 1.8rem;
    box-shadow: 0 6px 24px rgba(8, 29, 53, .06);
}
.mg-newsletter h3 { font-family: 'Cormorant Garamond', Georgia, serif; color: #081D35; margin-bottom: .4rem; }
.mg-newsletter > p { color: #555; font-size: .95rem; margin-bottom: 1rem; }
.mg-nl-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.mg-nl-input, .mg-nl-select {
    border: 1px solid #d5d9e2;
    border-radius: 8px;
    padding: .55rem .8rem;
    font-size: .95rem;
    background: #fff;
}
.mg-nl-input { flex: 1 1 260px; }
.mg-nl-lbl { display: block; font-weight: 600; color: #081D35; margin: .9rem 0 .35rem; }
.mg-nl-tags {
    display: flex; flex-wrap: wrap; gap: .4rem .5rem;
    max-height: 180px; overflow-y: auto;
    padding: .4rem 0; margin-bottom: 1rem;
}
.mg-nl-tag {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 1px solid #d5d9e2; border-radius: 999px;
    padding: .25rem .7rem; font-size: .85rem; color: #333;
    cursor: pointer; user-select: none; margin: 0; background: #fafbfc;
}
.mg-nl-tag:has(input:checked) { background: #14406e; color: #fff; border-color: #14406e; }
.mg-nl-tag:has(input:checked) span { color: rgba(255,255,255,.7); }
.mg-nl-tag input { accent-color: #C9A84C; }
.mg-nl-tag span { color: #98a1b3; font-size: .78rem; }
.mg-nl-btn {
    background: #14406e; color: #fff; border: none; border-radius: 8px;
    padding: .6rem 1.4rem; font-weight: 600; cursor: pointer;
}
.mg-nl-btn:hover { background: #0D2B4E; color: #fff; }
.mg-nl-btn:disabled { opacity: .6; cursor: default; }
.mg-nl-btn-outline { background: transparent; color: #14406e; border: 1px solid #14406e; }
.mg-nl-btn-outline:hover { background: #f1f5fb; color: #0D2B4E; }
.mg-nl-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.mg-nl-msg { margin-top: .9rem; padding: .6rem .9rem; border-radius: 8px; font-size: .92rem; }
.mg-nl-msg.ok { background: #e8f7ee; color: #14804a; }
.mg-nl-msg.err { background: #fdecef; color: #c81e3f; }
.mg-nl-who { color: #333; }
.mg-nl-badge.off { background: #fdecef; color: #c81e3f; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; }
.mg-nl-linkbtn {
    background: none; border: none; padding: .6rem .4rem;
    color: #14406e; font-size: .85rem; text-decoration: underline; cursor: pointer;
}
.mg-nl-linkbtn:hover { color: #A07828; }
.mg-nl-linkbtn:disabled { opacity: .6; cursor: default; }
.mg-nl-toggle {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-top: 1rem;
    background: #14406e; color: #fff; border: none; border-radius: 999px;
    padding: .55rem 1.3rem; font-weight: 600; font-size: .92rem; cursor: pointer;
}
.mg-nl-toggle:hover { background: #0D2B4E; color: #fff; }
.mg-nl-toggle[aria-expanded="true"] .mg-nl-caret { transform: rotate(180deg); }
.mg-nl-caret { transition: transform .2s; }
.mg-nl-channels { gap: .4rem; }

/* ── Biblioteca (griglia copertine + stelle) ── */
.mg-lib-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mg-lib-count { color: #78829d; font-size: .92rem; }
.mg-lib-search {
    border: 1px solid #d5d9e2; border-radius: 999px; padding: .5rem 1.1rem;
    font-size: .95rem; min-width: 260px; background: #fff;
}
.mg-lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.4rem 1.1rem;
}
.mg-lib-card { display: flex; flex-direction: column; }
.mg-lib-cover {
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #0D2B4E;
    box-shadow: 0 4px 14px rgba(8, 29, 53, .18);
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease, box-shadow .15s ease;
}
.mg-lib-card:hover .mg-lib-cover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(8, 29, 53, .28); }
.mg-lib-cover img { width: 100%; height: 100%; object-fit: cover; }
.mg-lib-nocover {
    color: rgba(255,255,255,.85); font-size: .85rem; text-align: center;
    padding: .8rem; font-family: 'Cormorant Garamond', Georgia, serif;
}
.mg-lib-info { padding: .55rem .15rem 0; }
.mg-lib-title {
    font-size: .88rem; font-weight: 600; color: #081D35; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mg-lib-author { font-size: .8rem; color: #78829d; margin-top: .15rem; }
.mg-lib-stars { margin-top: .2rem; font-size: .85rem; color: #d5d9e2; letter-spacing: .1em; }
.mg-lib-stars .on { color: #C9A84C; }
.mg-lib-hash { margin-left: .35rem; font-weight: 700; letter-spacing: 0; color: #C9A84C; font-size: .82rem; }

/* ── Dettaglio libro ── */
.mg-bk-detail { display: flex; gap: 2rem; flex-wrap: wrap; }
.mg-bk-coverbox { flex: 0 0 220px; max-width: 220px; margin: 0 auto; }
.mg-bk-coverbox img { width: 100%; border-radius: 10px; box-shadow: 0 8px 26px rgba(8,29,53,.25); }
.mg-bk-info { flex: 1 1 380px; }
.mg-bk-title { font-family: 'Cormorant Garamond', Georgia, serif; color: #081D35; margin-bottom: .2rem; }
.mg-bk-author { color: #14406e; font-weight: 600; margin-bottom: .2rem; }
.mg-bk-isbn { color: #98a1b3; font-size: .85rem; margin-bottom: 1rem; }
.mg-bk-desc { color: #444; line-height: 1.7; white-space: pre-line; }
.mg-bk-h { font-family: 'Cormorant Garamond', Georgia, serif; color: #081D35; border-bottom: 2px solid #C9A84C; display: inline-block; padding-bottom: .2rem; margin-bottom: 1rem; }
.mg-bk-note { background: #fff; border: 1px solid #e5e7eb; border-left: 4px solid #C9A84C; border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: .8rem; line-height: 1.7; }
.mg-bk-comment { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: .8rem 1rem; margin-bottom: .6rem; }
.mg-bk-comment-head { color: #78829d; font-size: .85rem; margin-bottom: .25rem; }
.mg-bk-commentform textarea { width: 100%; border: 1px solid #d5d9e2; border-radius: 8px; padding: .7rem .9rem; font-size: .95rem; }
.mg-bk-sentence { display: block; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: .8rem 1rem; margin-bottom: .6rem; color: #333; }
.mg-bk-sentence:hover { border-color: #C9A84C; color: #081D35; }
.mg-bk-quote { font-style: italic; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.05rem; }
.mg-bk-tags { display: block; color: #98a1b3; font-size: .78rem; margin-top: .25rem; }
.mg-lib-searchform { display: inline; }
a.mg-page-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
a.mg-page-btn.disabled { pointer-events: none; opacity: .4; }

/* ── Link admin "modifica citazione" sulle slide pubbliche (solo SiteAdmin) ── */
.mg-sentence-adminedit {
    position: absolute; top: .55rem; right: .6rem; z-index: 5;
    background: rgba(255,255,255,.92); border: 1px solid #d5d9e2; border-radius: 999px;
    padding: .15rem .45rem; font-size: .9rem; text-decoration: none; line-height: 1;
    box-shadow: 0 2px 8px rgba(8,29,53,.15);
}
.mg-sentence-adminedit:hover { border-color: #C9A84C; transform: scale(1.08); }
.mg-sentence-adminedit.static { position: static; align-self: center; flex: 0 0 auto; }
.mg-bk-sentencerow { display: flex; gap: .5rem; align-items: stretch; }
.mg-bk-sentencerow .mg-bk-sentence { flex: 1 1 auto; margin-bottom: .6rem; }
.mg-bk-comment-del {
    background: none; border: none; cursor: pointer; font-size: .9rem;
    margin-inline-start: .5rem; opacity: .55; vertical-align: middle;
}
.mg-bk-comment-del:hover { opacity: 1; transform: scale(1.1); }

/* ── Community: voto lettori + liste sul dettaglio libro ── */
.mg-bk-readeravg { margin-top: .35rem; color: #78829d; font-size: .85rem; }
.mg-bk-readeravg-star { color: #C9A84C; }
.mg-bk-readeravg strong { color: #081D35; }
.mg-bk-my { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: .9rem 1.1rem; }
.mg-bk-my-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mg-bk-my-row + .mg-bk-my-row { margin-top: .7rem; }
.mg-bk-my-lbl { color: #78829d; font-size: .88rem; }
.mg-bk-mystars { display: inline-flex; }
.mg-bk-mystar {
    background: none; border: none; cursor: pointer; padding: 0 .1rem;
    font-size: 1.35rem; line-height: 1; color: #d5d9e2; transition: color .15s, transform .1s;
}
.mg-bk-mystar:hover { transform: scale(1.15); }
.mg-bk-mystar.on { color: #C9A84C; }
.mg-bk-mystars:hover .mg-bk-mystar { color: #C9A84C; }
.mg-bk-mystars .mg-bk-mystar:hover ~ .mg-bk-mystar { color: #d5d9e2; }
.mg-bk-myclear { background: none; border: none; cursor: pointer; color: #98a1b3; font-size: .85rem; }
.mg-bk-myclear:hover { color: #c81e3f; }
.mg-bk-listbtn {
    background: #fff; border: 1px solid #d5d9e2; border-radius: 999px; cursor: pointer;
    padding: .3rem .85rem; font-size: .88rem; color: #444; transition: all .15s;
}
.mg-bk-listbtn:hover { border-color: #C9A84C; }
.mg-bk-listbtn.on { background: #081D35; border-color: #081D35; color: #fff; }
.mg-bk-my-profilo { margin-inline-start: auto; font-size: .82rem; color: #78829d; }
.mg-bk-my-profilo:hover { color: #081D35; }

/* ── Community: commenti generici (blog + citazioni) ── */
.mg-cmt-count { color: #98a1b3; font-size: .85rem; font-family: 'Jost', sans-serif; }
.mg-sc-comments {
    max-width: 720px; margin-inline: auto; background: #f8f6f1;
    border: 1px solid #e8e2d4; border-radius: 12px; padding: 1.2rem 1.4rem;
}

/* ── Pagina /profilo ── */
.mg-prof-namerow { display: flex; gap: .6rem; flex-wrap: wrap; }
.mg-prof-namerow .mg-nl-input { flex: 1 1 240px; max-width: 340px; }
.mg-prof-bookgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.mg-prof-book { display: block; text-decoration: none; }
.mg-prof-cover {
    display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden;
    background: #eceef2; box-shadow: 0 4px 14px rgba(8,29,53,.15);
}
.mg-prof-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-prof-book:hover .mg-prof-cover { box-shadow: 0 6px 18px rgba(8,29,53,.3); }
.mg-prof-nocover { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2rem; }
.mg-prof-bk-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: .4rem; font-size: .84rem; font-weight: 600; color: #081D35; line-height: 1.3;
}
.mg-prof-bk-author { display: block; font-size: .76rem; color: #78829d; }
.mg-prof-mystars { display: block; font-size: .8rem; color: #d5d9e2; letter-spacing: .08em; }
.mg-prof-mystars .on { color: #C9A84C; }
.mg-prof-badge { border-radius: 999px; padding: .1rem .55rem; font-size: .74rem; white-space: nowrap; }
.mg-prof-badge.ok { background: #e8f7ee; color: #14804a; }
.mg-prof-badge.wait { background: #fdf3e0; color: #b26a00; }

/* ── Pagine legali (privacy) ── */
.mg-legal h3 { font-family: 'Cormorant Garamond', Georgia, serif; color: #081D35; margin-top: 2rem; margin-bottom: .6rem; }
.mg-legal p, .mg-legal li { color: #444; line-height: 1.75; }
.mg-legal ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.mg-legal li { margin-bottom: .4rem; }
.mg-legal a { color: #14406e; text-decoration: underline; }

/* ── Scorciatoie ai temi delle citazioni (in testa a /sentences) ──
   Sono la prima cosa che si vede: devono invitare, non pesare. */
.mg-tagbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 0 auto 1.25rem;
    max-width: 60em;
}

.mg-tagchip {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    padding: .38rem .85rem;
    border: 1px solid var(--mg-border, rgba(13,43,78,.12));
    border-radius: 999px;
    background: #fff;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .82rem;
    color: var(--mg-navy, #0D2B4E);
    text-decoration: none;
    transition: border-color .2s, background-color .2s, color .2s;
}

.mg-tagchip:hover {
    border-color: var(--mg-gold, #C9A84C);
    color: var(--mg-gold-dk, #A07828);
}

/* Il tema aperto: pieno, così si sa sempre dove si è */
.mg-tagchip.active {
    background: var(--mg-navy, #0D2B4E);
    border-color: var(--mg-navy, #0D2B4E);
    color: #fff;
}

.mg-tagchip-n {
    font-size: .68rem;
    opacity: .55;
}
.mg-tagchip.active .mg-tagchip-n { opacity: .7; }

@media (max-width: 480px) {
    .mg-tagbar { gap: .35rem; }
    .mg-tagchip { padding: .3rem .65rem; font-size: .76rem; }
    /* sul telefono il conteggio è rumore: conta il tema */
    .mg-tagchip-n { display: none; }
}
