/* ============================================================
   Biblioteca Particular Fernando Pessoa — folha de estilos única
   VARIANTE «SIDEBAR CLARA» (novo2/): barra lateral branca, separada do
   conteúdo por uma linha; o resto igual a novo/assets/css/estilo.css.
   Aspecto alinhado com o site novo da Casa Fernando Pessoa
   (tema WordPress «cfp»: web/app/themes/cfp/resources/styles/).

   Junta o que era preciso de normalize.css, master.css, cfp_extra.css e
   font-awesome.min.css do site original com o novo design (cores, fontes e
   espaçamentos do tema). Sem JavaScript, excepto no visualizador.

   Secções: tokens · fontes · reset · barra superior · layout · barra lateral ·
   conteúdo · listas (autores, datas, classes, obras) · ficha do livro ·
   visualizador · voltar ao topo · rodapé · ícones · telemóvel
   ============================================================ */

/* Public Sans: o tema carrega-a do Google Fonts (layouts/app.blade.php). */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* ——— Tokens (abstracts/_tokens.scss) ——— */
:root {
  --ink: #111111;
  --bg: #FFF;
  --bg-dim: #EAE4E4;
  --grey-light: #EDEDED;   /* anos sem livros (o --bg-dim puxa para o rosa) */
  --red: #C33E3F;
  --red-deep: #B93738;
  --serif: 'TiemposTextWeb', 'Tiempos', 'Times New Roman', serif;
  --sans: 'Public Sans', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --ease-out: cubic-bezier(.19, 1, .22, 1);
  --line: rgba(17, 17, 17, .18);
  --line-soft: rgba(17, 17, 17, .10);
  --muted: rgba(17, 17, 17, .55);
  --sidebar: 320px;
}

/* ——— Fontes (Tiempos Text já existia no site; Font Awesome 4.5 só os 7 ícones usados) ——— */
@font-face { font-family: 'TiemposTextWeb'; src: url('../fonts/TiemposTextWeb-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'TiemposTextWeb'; src: url('../fonts/TiemposTextWeb-RegularItalic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'TiemposTextWeb'; src: url('../fonts/TiemposTextWeb-Semibold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'TiemposTextWeb'; src: url('../fonts/TiemposTextWeb-SemiboldItalic.woff2') format('woff2'); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'FontAwesome'; src: url('../fonts/fontawesome-webfont.woff2') format('woff2'); font-weight: normal; font-style: normal; font-display: block; }

/* ——— Reset mínimo ——— */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; border: 0; }
a { color: inherit; text-decoration: none; background-color: transparent; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, blockquote { margin: 0; }
::selection { background: var(--red); color: #fff; }

html, body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  height: 100%;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }

/* clearfix do original (.group e .cf) */
.group::before, .group::after, .cf::before, .cf::after { content: ""; display: table; }
.group::after, .cf::after { clear: both; }

/* ——— Barra superior ——— */
header.main {
  background-color: var(--ink);
  color: var(--bg);
  width: 100%;
  min-height: 44px;
  padding: 13px 0;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 18px;
  text-transform: uppercase;
  position: relative;
}
header.main a { color: rgba(255, 255, 255, .55); transition: color .3s var(--ease-out); }
header.main a.selected,
header.main a:hover { color: #fff; }
.h-left { width: var(--sidebar); float: left; padding: 0 40px; }
.h-right { position: absolute; left: var(--sidebar); right: 0; padding-right: 40px; text-align: right; }
.h-right-inner { float: right; }
.h-right ul { float: right; }
.h-right ul li { float: left; padding-right: 20px; }
.h-right .header-icons li { padding-right: 7px; }
.h-right .header-icons li:last-child { padding-right: 0; }
.header-icons { font-size: 1rem; text-transform: none; }
.ptLanguage { color: #fff; }

/* ——— Layout: barra lateral escura + conteúdo branco ——— */
.page { height: 100%; }
main {
  position: relative;
  min-height: 100%;
  background-color: var(--bg);
  background-image: linear-gradient(to right, var(--line-soft), var(--line-soft));
  background-size: 1px 100%;
  background-position: calc(var(--sidebar) - 1px) 0;
  background-repeat: no-repeat;
  padding-right: var(--sidebar);
}

/* ——— Barra lateral ——— */
.sidebar {
  width: var(--sidebar);
  min-height: 100%;
  float: left;
  position: relative;
  z-index: 1;
  padding: 3.4rem 2.5rem 6rem;
}
.sidebar-logo a {
  display: block;
  font-family: var(--serif);
  font-size: 2.3rem;
  line-height: 1.02;
  color: var(--ink);
  margin-bottom: 3.6rem;
}
.sidebar-logo span { color: var(--red); }

.sidebar nav > ul > li {
  border-top: 1px solid var(--line-soft);
  padding: .85rem 0 .95rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar nav > ul > li:last-child { border-bottom: 1px solid var(--line-soft); }
.sidebar nav a { display: block; color: var(--ink); transition: color .3s var(--ease-out); }
.sidebar nav a:hover { color: var(--red); }
.sidebar nav li ul { display: none; padding-top: .7rem; font-size: .72rem; font-weight: 500; letter-spacing: .14em; }
.sidebar nav li ul li { padding: .22rem 0; }
.sidebar nav li ul a { color: var(--muted); }
.sidebar nav li ul a:hover { color: var(--red); }
.sidebar nav li.nav-selected > a,
.sidebar nav li.path-selected > a { color: var(--red); }
.sidebar nav li.nav-selected > ul,
.sidebar nav li.path-selected > ul { display: block; }
.sidebar nav li ul li.nav-selected > a { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.sidebar footer { padding-top: 2.8rem; }
.sidebar footer .logo-cfp { width: 150px; }
.sidebar footer .logo-cfp img { filter: brightness(0); opacity: .85; }

/* ——— Conteúdo ——— */
.main-content-wrapper { float: right; width: 100%; margin-right: calc(var(--sidebar) * -1); padding: 3.4rem 0 6rem; }
.main-content { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

h1.page-title {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.1;
  margin: 0 0 clamp(2.5rem, 6vh, 4.5rem);
}

main header { text-align: center; margin-bottom: 3rem; }
main header img { display: inline; }
main header blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.3;
  margin: 2.6rem 0 0;
}
main header blockquote footer {
  font-family: var(--sans);
  font-style: normal;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: .9rem;
}

.content { font-size: 1rem; line-height: 1.7; }
.content p { margin: 0 0 1.1rem; overflow: hidden; }
.content h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.25; margin-top: 1.2rem; }
.content h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; margin-top: 2.2rem; }
.content h4 { color: var(--red); font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.content p a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.content p a:hover { color: var(--red-deep); }
.autor-texto { color: var(--red); font-family: var(--serif); font-style: italic; margin-top: 2.6rem; text-align: right; }
.textoIntroducaoItalic { font-style: italic; }
.textoIntroducaoBold { font-weight: 600; }
span.superScript, span.superScriptNote { color: var(--muted); font-size: .7em; vertical-align: baseline; position: relative; top: -.4em; }

/* ——— Índice alfabético e lista de autores ——— */
.abc { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .04em; padding-bottom: 1.8rem; }
.abc a { padding: 0 .1em; transition: color .3s var(--ease-out); }
.abc a.selected,
.abc a:hover { color: var(--red); }
.abc a.selected { text-decoration: underline; text-underline-offset: 4px; }

.list-items-header {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .55rem;
}
.list-item { border-top: 1px solid var(--line-soft); line-height: 1em; }
.list-items a { display: block; width: 100%; padding: .55rem 0; transition: background .3s var(--ease-out), color .3s var(--ease-out); }
.list-items a:hover { background-color: rgba(17, 17, 17, .05); color: var(--red); }
.list-items .author { float: left; min-width: 70%; display: inline-block; }
.list-items .datas { float: right; display: block; width: 20%; color: var(--muted); font-size: .9rem; }
.list-items .book-num { float: right; display: block; width: 10%; text-align: center; color: var(--muted); font-size: .9rem; }

/* ——— Datas ——— */
.date-decade { width: 100%; }
.date-item { float: left; width: 9%; text-align: center; padding: 2px; }
.date-item .book-data {
  display: block;
  background-color: var(--ink);
  color: var(--bg);
  font-size: .85rem;
  padding: .3rem .4rem;
  transition: background .3s var(--ease-out);
}
.date-item a.book-data:hover { background-color: var(--red); }
.date-item .book-num { display: block; padding: 4px 5px 2px; color: var(--red); font-size: .85rem; }
.empty .book-num { opacity: 0; }
.empty .book-data { background-color: var(--grey-light); }

/* ——— Classes ——— */
.classe-list { line-height: 1.5; }
.classe-list li { padding: .35rem 0; border-top: 1px solid var(--line-soft); }
.classe-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.classe-list a { transition: color .3s var(--ease-out); }
.classe-list .selected a,
.classe-list a:hover { color: var(--red); }
.classe-num { display: inline-block; width: 15px; padding-right: 15px; text-align: center; color: var(--muted); font-weight: 600; font-size: .85rem; }
.classe-list .selected a .classe-num,
.classe-list a:hover .classe-num { color: var(--red); }

/* ——— Listagem de obras ——— */
.authorTitleSelected { font-family: var(--serif); font-size: 1.5rem; margin-top: 3rem; }
.paginacao {
  margin: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: .7rem 0;
  font-size: .85rem;
}
.paginacao li { width: 11.11%; text-align: center; float: left; }
.paginacao a { display: block; color: var(--muted); }
.paginacao a:hover { color: var(--red); }
.paginacaoS { color: var(--red); font-weight: 600; }

.listWorks { border-bottom: 1px solid var(--line-soft); padding: 1.4rem 0; line-height: 1.6; }
.listWorks:last-child { border-bottom: none; }
.coverThumb { width: 70px; float: left; margin-right: 1.8rem; }
.coverThumb img { box-shadow: 0 1px 0 var(--line); }
.listWorks span.categoria {
  display: inline-block;
  width: 6rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}
.listwork-titulo a { font-family: var(--serif); font-size: 1.15rem; }
.listWorks .infoCover a { transition: color .3s var(--ease-out); }
.listWorks .infoCover a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.book-code, .view-book .classeInfo, .listwork-cota .texto { font-size: .85rem; letter-spacing: .04em; color: var(--muted); }

/* ——— Ficha do livro ——— */
.recordCover { float: right; }
.recordCover img { box-shadow: 0 1px 0 var(--line); }
ul.recordText { padding-right: 170px; }
.recordText li { padding: .7rem 0; border-top: 1px solid var(--line-soft); line-height: 1.65; }
.recordText li:last-child { border-bottom: 1px solid var(--line-soft); }
.recordText li.record {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0;
}
.DigitalItems { margin-top: 3rem; }
.DigitalItems .itemDiv { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 1rem 0 1rem .1rem; }
.DigitalItems .itemDiv:last-child { border-top: none; }
.DigitalItems .itemDiv .fa { color: var(--red); font-size: 1.2rem; padding-right: .7rem; }
.DigitalItems-title { display: inline-block; color: var(--ink); font-weight: 500; }
.DigitalItems .itemDiv a { display: block; margin-top: 10px; transition: color .3s var(--ease-out); }
.itemDiv a.DigitalItems-title { display: inline-block; margin-top: 0; }
.DigitalItems .itemDiv a:hover,
.DigitalItems .itemDiv a:hover .fa { color: var(--red); }
.pdf-group { margin-top: .4rem; }
.pdf-item { margin-bottom: 10px; }
.pdf-item a { font-size: .95rem; }
.pdf-item .nodeIndex { color: var(--muted); }
.nota { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.nota a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ——— Visualizador de páginas digitalizadas ——— */
.view-book { max-width: 90%; text-align: center; }
.view-book h1 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); margin-bottom: .3rem; }
.view-book .classeInfo { margin: .3rem 0 1rem; }

.pageSelection {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--red);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: .5rem 0;
  margin: 1.2rem 0 1.6rem;
  transition: color .3s var(--ease-out);
}
.pageSelection:hover { color: var(--ink); }
.pageSelection .fa { padding-left: .3rem; }
.hide-toggle, .indexIndex { display: none; }            /* o JS troca */
.index.is-open .show-toggle { display: none; }
.index.is-open .hide-toggle,
.index.is-open .indexIndex { display: inline-block; }
.index.is-open .indexIndex { display: block; }

.indexRange, .grayText { border-bottom: 1px solid var(--line-soft); padding-bottom: 5px; }
.indexRange { border-top: 1px solid var(--line-soft); padding-top: 15px; }
.index .pageNumber { display: inline-block; width: 30px; margin-bottom: 10px; }
.index .space { display: none; }
.view-book .indexIndex .grayRange,
.view-book .indexIndex .grayRangeSelected { display: inline-block; width: 60px; margin-bottom: 10px; }
.view-book .indexIndex span.grayRange { display: none; }
.view-book .indexIndex .grayText { margin: 15px 0; }
.view-book .indexIndex .grayPage,
.view-book .indexIndex .grayRange { color: var(--muted); font-size: .85rem; transition: color .3s var(--ease-out); }
.view-book .indexIndex .grayPage:hover,
.view-book .indexIndex .grayRange:hover { color: var(--ink); }
.view-book .indexIndex .grayRangeSelected,
.view-book .indexIndex .grayPageSelected { color: var(--red); font-weight: 600; font-size: .85rem; }

.buttonNavigation { margin: 1.4rem 0; }
.buttonNavigation .buttonImage {
  display: inline-block;
  width: 25px;
  height: 25px;
  margin: 0 5px;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  opacity: .45;
  transition: opacity .3s var(--ease-out);
}
.buttonNavigation .buttonImage:hover { opacity: 1; }
.buttonNavigation #firstPage { background-image: url(../img/bpfp_icones-first.png); }
.buttonNavigation #previousPage { background-image: url(../img/bpfp_icones-previous.png); }
.buttonNavigation #zoomOut { background-image: url(../img/bpfp_icones-zoom-out.png); }
.buttonNavigation #zoomDefault { background-image: url(../img/bpfp_icones-zoom-default.png); }
.buttonNavigation #zoomIn { background-image: url(../img/bpfp_icones-zoom-in.png); }
.buttonNavigation #nextPage { background-image: url(../img/bpfp_icones-next.png); }
.buttonNavigation #lastPage { background-image: url(../img/bpfp_icones-last.png); }
.buttonNavigation #magnify { background-image: url(../img/bpfp_icones-magnify.png); }
.buttonNavigation #print { background-image: url(../img/bpfp_icones-print.png); }
.buttonNavigation #magnify.is-active { opacity: 1; outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }

.view-book .image { max-width: 695px; margin: auto; }
.view-book img.image { margin: 0 auto; max-width: 100%; height: auto; display: block; box-shadow: 0 10px 40px rgba(17, 17, 17, .14); }
.view-book .image .techImage { display: none; }
.magnifyBoxClass { display: none; position: absolute; width: 100px; height: 100px; overflow: hidden; border: 1px solid var(--ink); background: #fff; pointer-events: none; z-index: 5; }
.magnifyBoxClass img { max-width: none; }

/* ——— Voltar ao topo (ligação simples, sem JS) ——— */
#back-to-top {
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 50;
  width: 40px;
  text-align: center;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
#back-to-top .arrow {
  display: block;
  width: 25px;
  height: 25px;
  margin: 0 auto 10px;
  background: url(../img/top.png) center center no-repeat;
  background-size: contain;
}
#back-to-top:hover .arrow { background-image: url(../img/top_full.png); }

/* ——— Rodapé (escuro, como no tema) ——— */
footer.main {
  clear: both;
  background: var(--ink);
  color: var(--bg);
  padding: clamp(3rem, 7vh, 5rem) var(--gutter) 2.2rem;
  font-size: .9rem;
  line-height: 1.7;
}
footer.main a { color: var(--bg); }
footer.main a:hover { text-decoration: underline; text-underline-offset: 3px; }
footer.main section { display: inline-block; width: 33%; padding-right: 2.5rem; vertical-align: top; }
footer.main p { margin: 1rem 0; }
/* os logótipos CFP e EGEAC são PNG a preto: passam a branco; o da Fundação
   Vodafone já é texto branco com círculo vermelho e fica com as cores originais */
.footer-logo img, .egeac img { filter: brightness(0) invert(1); opacity: .85; }
.footer-logo { width: 110px; margin-bottom: 2rem; }
.egeac { width: 150px; }
.parcerias { margin: 2.6rem 0 1.6rem; }
.direitos { font-size: .78rem; opacity: .65; }
.vodafone a { display: block; width: 150px; }

/* ——— Ícones (Font Awesome 4.5, só os usados) ——— */
.fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; }
.fa-facebook::before { content: "\f09a"; }
.fa-instagram::before { content: "\f16d"; }
.fa-search::before { content: "\f002"; }
.fa-eye::before { content: "\f06e"; }
.fa-download::before { content: "\f019"; }
.fa-file-pdf-o::before { content: "\f1c1"; }
.fa-bookmark::before { content: "\f02e"; }

/* ——— Movimento reduzido ——— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ——— Telemóvel e tablet: a barra lateral passa para cima ——— */
@media (max-width: 900px) {
  header.main { padding: .7rem var(--gutter); }
  .h-left, .h-right { position: static; float: none; width: auto; padding: 0; text-align: left; }
  .h-right { margin-top: .4rem; }
  .h-right-inner { float: none; }
  .h-right ul { float: none; display: inline-block; vertical-align: middle; margin-right: 1.2rem; }

  main { padding-right: 0; background-image: none; }
  .sidebar { float: none; width: 100%; min-height: 0; background: var(--bg); border-bottom: 1px solid var(--line-soft); padding: 2.2rem var(--gutter) 2.4rem; }
  .sidebar-logo a { font-size: 1.9rem; margin-bottom: 2rem; }
  .sidebar footer { padding-top: 2rem; }

  .main-content-wrapper { float: none; width: auto; margin-right: 0; padding: 2.4rem 0 3.5rem; }
  .main-content { max-width: none; }
  h1.page-title { margin-bottom: 2rem; }

  .list-items .author { min-width: 56%; }
  .list-items .datas { width: 28%; }
  .list-items .book-num { width: 14%; }
  .date-item { width: 20%; }
  .paginacao li { width: 14.28%; font-size: .8rem; }

  .recordCover { float: none; margin-bottom: 1.5rem; }
  ul.recordText { padding-right: 0; }
  .view-book { max-width: none; }

  footer.main section { display: block; width: 100%; padding-right: 0; }
  footer.main section + section { margin-top: 2rem; }
  #back-to-top { right: .8rem; bottom: .8rem; width: 30px; }
  #back-to-top span:not(.arrow) { display: none; }   /* só a seta */
}
