/*
 * Proxecto Epístola 2 — edición para imprimir / gardar en PDF (edicion.php)
 * Paxinado en follas A4 con Paged.js, tanto en pantalla como ao imprimir: @page dá marxes,
 * cabeceira e números de páxina; os índices levan o número de páxina de cada entrada.
 */
@font-face { font-family: 'EPX Atlantica'; src: url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerif-Book.woff2') format('woff2'), url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerif-Book.woff') format('woff'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'EPX Atlantica'; src: url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerif-BookItalic.woff2') format('woff2'), url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerif-BookItalic.woff') format('woff'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'EPX Atlantica'; src: url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerif-Bold.woff2') format('woff2'), url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerif-Bold.woff') format('woff'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'EPX Atlantica Display'; src: url('https://consellodacultura.gal/css-numax/fonts/AtlanticaSerifDisplay-Black.otf') format('opentype'); font-weight: 900; }

:root { --tinta: #1d1b18; --suave: #6b665e; --acento: #8c2f1c; --filete: #d9d1c3; --azul: #0000a3;
	--serifa: 'EPX Atlantica', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; --seco: 'Helvetica Neue', Arial, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--tinta); font-family: var(--serifa); font-size: 11.5pt; line-height: 1.55; font-kerning: normal; font-variant-numeric: oldstyle-nums; hyphens: auto; -webkit-hyphens: auto; }
a { color: inherit; text-decoration: none; }

/* barra de pantalla */
.ed-ferramentas { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 12px 24px; background: #0e1c3a; color: #fff; font-family: var(--seco); font-size: 14px; }
.ed-ferramentas a { color: #f2d9a0; }
.ed-axuda { flex: 1; color: rgba(255, 255, 255, .7); font-size: 13px; }
.ed-ferramentas button { background: #f2d9a0; color: #0e1c3a; border: 0; border-radius: 3px; padding: 9px 18px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* portada */
.ed-portada { height: 248mm; display: flex; flex-direction: column; justify-content: space-between; text-align: center; }
.ed-portada-sup { font-family: var(--seco); font-size: 9pt; letter-spacing: 3px; text-transform: uppercase; color: var(--azul); font-weight: 700; }
.ed-portada-sup span { display: inline-block; margin-top: 4px; letter-spacing: 1px; text-transform: none; font-family: var(--serifa); font-size: 12pt; font-weight: 400; color: var(--tinta); }
.ed-portada-tipo { font-family: var(--seco); font-size: 9pt; letter-spacing: 4px; text-transform: uppercase; color: var(--acento); margin-bottom: 10mm; }
.ed-portada h1 { font-family: 'EPX Atlantica Display', var(--serifa); font-weight: 900; font-size: 30pt; line-height: 1.12; letter-spacing: -.5px; margin: 0 0 8mm; color: var(--azul); hyphens: manual; text-wrap: balance; }
.ed-portada-datos { font-size: 12pt; color: var(--suave); margin: 0 0 14mm; }
.ed-portada-estudo { font-style: italic; font-size: 13pt; margin: 0 auto 12mm; max-width: 130mm; }
.ed-portada-editores { font-size: 11pt; color: var(--suave); margin: 0; }
.ed-portada-editores strong { display: inline-block; margin-top: 2mm; font-size: 15pt; font-weight: 400; color: var(--tinta); }
.ed-portada-inf { font-family: var(--seco); font-size: 8pt; color: var(--suave); line-height: 1.6; }

/* logo do CCG na portada e no colofón */
.ed-logo { display: block; width: 46mm; height: auto; margin: 0 auto 5mm; }
.ed-portada-sup span { margin-top: 0; }
.ed-colofon .ed-logo { width: 38mm; margin-bottom: 6mm; }

/* contidos */
.ed-contidos h2, .ed-seccion { font-family: var(--seco); font-size: 10pt; letter-spacing: 4px; text-transform: uppercase; color: var(--acento); font-weight: 700; margin: 0 0 10mm; }
.ed-contidos ol { list-style: none; margin: 0; padding: 0; }
.ed-contidos-lista > li { font-size: 13pt; margin-bottom: 5mm; }
.ed-contidos-cartas { margin-top: 3mm !important; }
.ed-contidos-cartas li { font-size: 10.5pt; padding: 1.2mm 0; border-bottom: 1px dotted var(--filete); }
.ed-num { display: inline-block; min-width: 14mm; color: var(--acento); font-variant-numeric: lining-nums; }

/* estudo */
.ed-estudo header { text-align: center; margin-bottom: 12mm; }
.ed-antetitulo { font-family: var(--seco); font-size: 8.5pt; letter-spacing: 3px; text-transform: uppercase; color: var(--acento); margin-bottom: 5mm; }
.ed-estudo h2 { font-size: 18pt; line-height: 1.25; font-weight: 400; margin: 0; text-wrap: balance; }
.ed-texto p { margin: 0; text-align: justify; text-indent: 1.4em; orphans: 3; widows: 3; }
.ed-texto h3 + p, .ed-texto blockquote + p, .ed-texto .epx-verso + p { text-indent: 0; }
.ed-texto .epx-estudo-sinatura { text-align: right; text-indent: 0; font-size: 10pt; color: var(--suave); margin-bottom: 8mm; }
.ed-texto .epx-estudo-sinatura i, .ed-texto .epx-estudo-sinatura b { color: var(--tinta); font-size: 11.5pt; }
.ed-texto h3 { font-size: 11.5pt; font-weight: 700; margin: 8mm 0 3mm; break-after: avoid; }
.ed-texto h3.epx-versal, .ed-texto h3:not([class]) { font-weight: 400; }
.epx-versal { text-transform: lowercase; font-variant: small-caps; letter-spacing: .06em; }
.ed-texto blockquote { margin: 3.5mm 0 3.5mm 8mm; font-size: 10.5pt; line-height: 1.5; }
.ed-texto .epx-verso { text-indent: 0; text-align: left; margin: 3mm 0 3mm 8mm; font-style: italic; font-size: 10.5pt; break-inside: avoid; }
.epx-metrica { font-style: normal; font-family: var(--seco); font-size: 7pt; color: var(--suave); margin-left: 2mm; }
.epx-chamada { line-height: 0; font-size: 7pt; font-family: var(--seco); font-variant-numeric: lining-nums; }
.epx-chamada a { color: var(--acento); }
.epx-nota-volver { display: none; }
.epx-estudo-biblio { list-style: none; margin: 0; padding: 0; font-size: 10pt; }
.epx-estudo-biblio li { padding-left: 8mm; text-indent: -8mm; margin-bottom: 2mm; }
.ed-texto a { color: inherit; }
.epx-estudo-notas-titulo { margin-top: 10mm !important; padding-top: 4mm; border-top: .5pt solid var(--filete); }
.epx-estudo-notas { margin: 0; padding-left: 6mm; font-size: 9.5pt; line-height: 1.45; }
.epx-estudo-notas li { margin-bottom: 2mm; }
.epx-estudo-notas li::marker { color: var(--acento); font-family: var(--seco); font-size: 8pt; }

/* cartas */
.ed-carta { padding-top: 8mm; }
.ed-carta + .ed-carta { margin-top: 10mm; border-top: .5pt solid var(--filete); }
.ed-carta header { text-align: center; margin-bottom: 8mm; break-after: avoid; }
.ed-carta-num { font-size: 20pt; color: var(--acento); font-variant-numeric: lining-nums; letter-spacing: 2px; margin-bottom: 2mm; }
.ed-carta h3 { font-size: 13pt; font-weight: 400; font-style: italic; margin: 0 0 2mm; }
.ed-carta-meta { font-family: var(--seco); font-size: 8.5pt; color: var(--suave); line-height: 1.6; margin: 0; }
.ed-transcricion { font-size: 11pt; line-height: 1.6; text-align: left; hyphens: manual; }
.ed-sen-texto { color: var(--suave); font-style: italic; text-align: center; }
.ed-carta-notas { margin-top: 6mm; padding-top: 3mm; border-top: .5pt solid var(--filete); font-size: 9.5pt; color: var(--suave); }
.ed-carta-notas p { margin: 0 0 2mm; }
.ed-carta-url { font-family: var(--seco); font-size: 7pt; color: var(--suave); text-align: right; margin: 6mm 0 0; }
.ed-aviso { font-style: italic; }
.ed-colofon { font-family: var(--seco); font-size: 8.5pt; color: var(--suave); text-align: center; }

/* ---------------- follas A4 ---------------- */
@page { size: A4; margin: 22mm 20mm 24mm 22mm;
	@top-center { font-family: 'EPX Atlantica', Georgia, serif; font-style: italic; font-size: 8.5pt; color: #6b665e; }
	@bottom-center { content: counter(page); font-family: 'EPX Atlantica', Georgia, serif; font-size: 9pt; color: #6b665e; } }
@page :first { @top-center { content: none; } @bottom-center { content: none; } }
.ed-portada { break-after: page; }
.ed-contidos, .ed-estudo { break-after: page; }
.ed-carta { break-before: page; }
.ed-cartas .ed-carta:first-of-type { break-before: auto; }
.ed-seccion { break-after: avoid; }
.ed-colofon { break-before: page; padding-top: 90mm; }
/* número de páxina de cada entrada dos contidos */
.ed-contidos a { display: flex; align-items: baseline; gap: 3mm; }
.ed-contidos a::after { content: target-counter(attr(href), page); margin-left: auto; font-variant-numeric: lining-nums; color: var(--suave); font-size: 10pt; }

/* pantalla: as follas xeradas por Paged.js, como nun visor de PDF.
   Paged.js trata o documento como impreso (descarta @media screen), por iso estas regras dependen
   da clase ed-imprimindo, que o JS pon no body ao imprimir. */
body:not(.ed-imprimindo) { background: #e7e3da; }
body:not(.ed-imprimindo) .pagedjs_pages { display: flex; flex-direction: column; align-items: center; padding: 76px 0 40px; }
body:not(.ed-imprimindo) .pagedjs_page { background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .15); margin-bottom: 24px; }
/* ao imprimir agóchase a barra (Paged.js aplica sempre as regras @media print, por iso vai por JS) */
body.ed-imprimindo .ed-ferramentas { display: none; }
body.ed-imprimindo { padding: 0; background: #fff; }
