/*
 * Accessibilità (accessibilita.php): dimensione del testo, contrasto, link, interlinea; tasto e pannello;
 * lettura a tutto schermo. Il tema usa unità rem, quindi cambiare la dimensione di <html> ingrandisce tutto.
 */

/* Dimensione del testo */
html.pa-testo-piccolo { font-size: 90%; }
html.pa-testo-grande { font-size: 120%; }

/* Contrasto elevato: fondo bianco, testo nero, bordi e link scuri */
html.pa-contrasto {
	--wp--preset--color--base: #ffffff !important;
	--wp--preset--color--base-2: #ffffff !important;
	--wp--preset--color--contrast: #000000 !important;
	--wp--preset--color--accent-4: #000000 !important;
	--wp--preset--color--accent-5: #000000 !important;
}
html.pa-contrasto body { background: #ffffff !important; color: #000000 !important; }
html.pa-contrasto main a,
html.pa-contrasto footer a { text-decoration: underline !important; }
html.pa-contrasto .parrocchia-blocco { --pc-tenue: #000000; border-width: 2px; }

/* Link sottolineati, più spazio tra le righe */
html.pa-link a { text-decoration: underline !important; text-underline-offset: 0.15em; }
html.pa-interlinea body p,
html.pa-interlinea body li,
html.pa-interlinea body dd { line-height: 1.95 !important; letter-spacing: 0.02em; word-spacing: 0.08em; }

/* Tasto e pannello */
.pa-tasto {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 52px;
	padding: 0 14px;
	border: 2px solid #fffdf9;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-2, #3a2a20);
	color: #fffdf9;
	font: 600 16px/1 "Fira Sans", system-ui, sans-serif;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}
.pa-tasto span { display: none; }
.pa-tasto:hover span,
.pa-tasto:focus-visible span,
.pa-tasto[aria-expanded="true"] span { display: inline; }
.pa-tasto:focus-visible,
.pa-pannello button:focus-visible,
.pa-pannello input:focus-visible,
.pa-lettura:focus-visible,
.pa-schermo button:focus-visible { outline: 3px solid var(--wp--preset--color--accent-1, #8c6420); outline-offset: 2px; }

.pa-pannello {
	position: fixed;
	right: 16px;
	bottom: 80px;
	z-index: 9999;
	width: min(320px, calc(100vw - 32px));
	padding: 16px 18px;
	border: 1px solid #e6dccb;
	border-radius: 10px;
	background: #fffdf9;
	color: #2b2a28;
	font: 17px/1.4 "Fira Sans", system-ui, sans-serif; /* in pixel: il pannello non cambia con la dimensione scelta */
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.pa-pannello[hidden] { display: none; }
.pa-titolo { margin: 0 0 10px; font: 600 20px/1.2 "Literata", Georgia, serif; }
.pa-gruppo { margin: 0 0 12px; padding: 0; border: 0; }
.pa-gruppo legend { margin-bottom: 6px; font-weight: 600; }
.pa-dimensioni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pa-dimensioni button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-height: 56px;
	padding: 6px 4px;
	border: 2px solid #e6dccb;
	border-radius: 8px;
	background: #ffffff;
	color: #2b2a28;
	font: 15px/1.2 "Fira Sans", system-ui, sans-serif;
	cursor: pointer;
}
.pa-dimensioni button span { font: 600 20px/1 "Literata", Georgia, serif; }
.pa-dimensioni button[aria-pressed="true"] { border-color: var(--wp--preset--color--accent-2, #3a2a20); background: #f6f2ea; font-weight: 600; }
.pa-interruttore { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.pa-interruttore input { width: 22px; height: 22px; margin: 0; accent-color: var(--wp--preset--color--accent-2, #3a2a20); }
.pa-piede { display: flex; justify-content: space-between; margin: 10px 0 0; }
.pa-piede button { min-height: 40px; padding: 0 12px; border: 1px solid #e6dccb; border-radius: 6px; background: #ffffff; color: #2b2a28; font: inherit; cursor: pointer; }
.pa-piede .pa-chiudi { background: var(--wp--preset--color--accent-2, #3a2a20); border-color: transparent; color: #fffdf9; }

/* Tasto «Leggi a tutto schermo» */
.pa-lettura-riga { margin: 0.5rem 0 1rem !important; }
.pa-lettura {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 44px;
	padding: 0.3rem 0.9rem;
	border: 1px solid var(--wp--preset--color--accent-5, #e6dccb);
	border-radius: 6px;
	background: var(--wp--preset--color--base-2, #fffdf9);
	color: var(--wp--preset--color--contrast, #2b2a28);
	font: inherit;
	font-size: 1rem;
	cursor: pointer;
}
.pa-lettura:hover { border-color: var(--wp--preset--color--accent-2, #3a2a20); }

/* Lettura a tutto schermo */
.pa-schermo {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	flex-direction: column;
	background: #fbf7ef;
	color: #1f1b16;
	--pa-corpo: 26px;
}
.pa-schermo.pa-notte { background: #15120f; color: #efe6d6; }
.pa-schermo-barra {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 1px solid rgba(127, 110, 90, 0.35);
	font: 16px/1.2 "Fira Sans", system-ui, sans-serif;
}
.pa-schermo-barra .pa-schermo-nome { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.pa-schermo-barra button {
	min-width: 48px;
	min-height: 48px;
	padding: 0 12px;
	border: 1px solid rgba(127, 110, 90, 0.5);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: 600 18px/1 "Fira Sans", system-ui, sans-serif;
	cursor: pointer;
}
.pa-schermo-testo {
	flex: 1;
	overflow-y: auto;
	padding: 28px 20px 60px;
	-webkit-overflow-scrolling: touch;
}
.pa-schermo-colonna {
	max-width: 38em;
	margin: 0 auto;
	font-family: "Literata", Georgia, serif;
	font-size: var(--pa-corpo);
	line-height: 1.6;
}
.pa-schermo-colonna h1,
.pa-schermo-colonna h2,
.pa-schermo-colonna h3 { color: inherit; } /* i titoli del tema sono scuri: in «Notte» sparirebbero */
.pa-schermo-colonna h1 { margin: 0 0 0.8em; font-size: 1.25em; line-height: 1.25; }
.pa-schermo-colonna h2,
.pa-schermo-colonna h3 { margin: 1.4em 0 0.5em; font-size: 1em; }
.pa-schermo-colonna p { margin: 0 0 0.9em; }
/* Il testo copiato dalla pagina ha a volte una grandezza fissa (es. il Vangelo della home, 1.2rem):
   qui deve seguire A−/A+, cioè --pa-corpo. Solo la fonte resta più piccola. */
.pa-schermo-colonna div,
.pa-schermo-colonna p,
.pa-schermo-colonna li,
.pa-schermo-colonna span,
.pa-schermo-colonna em,
.pa-schermo-colonna strong,
.pa-schermo-colonna blockquote { font-size: inherit !important; line-height: inherit; }
.pa-schermo-colonna h2,
.pa-schermo-colonna h3 { font-size: 1.05em !important; }
.pa-schermo-colonna .parrocchia-fonte,
.pa-schermo-colonna .has-small-font-size { font-size: 0.6em !important; opacity: 0.8; }
.pa-schermo-colonna a { color: inherit; }
html.pa-schermo-aperto { overflow: hidden; }
@media (max-width: 600px) {
	.pa-schermo { --pa-corpo: 22px; }
	.pa-schermo-barra .pa-schermo-nome { display: none; }
}

@media print {
	.pa, .pa-lettura-riga { display: none !important; }
}
