:root {
  --azul: #2F4F86;
  --azul-escuro: #1F3760;
  --branco: #FFFFFF;
  --serifa: 'Lusitana', Georgia, serif;
  --rotulo: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
}
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--branco); }
* { box-sizing: border-box; }
a { color: inherit; }
a:hover { color: var(--azul-escuro); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }

.pagina { font-family: var(--serifa); color: var(--azul); background: var(--branco); overflow-x: clip; }

.mar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  background-image: url(../img/mar.svg);
  background-size: 1000px 150px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  -webkit-mask-image: linear-gradient(#000 74%, transparent);
  mask-image: linear-gradient(#000 74%, transparent);
  animation: mare 110s linear infinite;
}
@keyframes mare { to { background-position: -1000px 100%; } }

.colecao {
  appearance: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 104px;
  padding: 14px 16px 12px;
  border: 0;
  border-top: 1px solid var(--azul);
  background: transparent;
  color: var(--azul);
  font-family: var(--serifa);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
}
.colecao em { font-family: var(--rotulo); font-size: 21px; font-style: normal; font-weight: 600; line-height: 1; }
.colecao:hover { box-shadow: inset 0 2px 0 var(--azul); }
.colecao[aria-pressed="true"] { background: var(--azul); color: var(--branco); }

.grupo-filtro { display: flex; flex-direction: column; gap: 8px; }
.rotulo { margin: 0; font-family: var(--rotulo); font-size: 23px; font-weight: 800; line-height: 1; }

.chip {
  appearance: none;
  min-height: 40px;
  padding: 7px 12px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--azul);
  color: var(--azul);
  font-family: var(--rotulo);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.chip:hover { box-shadow: inset 0 0 0 2px var(--azul); }
.chip[aria-pressed="true"] { background: var(--azul); color: var(--branco); }

.campo {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--azul);
  border-radius: 2px;
  background: transparent;
  color: var(--azul);
  font-family: var(--serifa);
  font-size: 18px;
}
.campo::placeholder { color: var(--azul); opacity: .78; }

.limpar {
  appearance: none;
  align-self: flex-start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--azul);
  font-family: var(--rotulo);
  font-size: 23px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.faixa {
  background-color: var(--branco);
  background-image: url(../img/mar-pontos.svg);
  background-size: 442px 442px;
  overflow-x: auto;
  scrollbar-width: none;
}
.faixa::-webkit-scrollbar { display: none; }
#carta { position: relative; min-width: 1040px; height: 216px; }
#rota { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#rota-base { fill: none; stroke: var(--azul); stroke-width: 3; stroke-dasharray: .1 9; stroke-linecap: round; }
#rota-feita { fill: none; stroke: var(--azul); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0 999999; }
#barco { position: absolute; left: 0; top: 0; width: 104px; height: 85px; pointer-events: none; z-index: 4; will-change: transform; }
#barco::before { content: ''; position: absolute; inset: 8% 2% 4%; border-radius: 42%; background: var(--branco); }
#barco img { position: relative; display: block; width: 100%; height: auto; }

.porto {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--azul);
  cursor: pointer;
}
.porto:disabled { cursor: default; }
.porto .marca {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: var(--branco);
  box-shadow: 0 0 0 1.5px var(--azul);
  transition: background-color .3s ease, transform .3s ease;
}
.porto:not(:disabled):hover .marca { transform: rotate(45deg) scale(1.3); }
.porto.visitado .marca { background: var(--azul); }
.porto.fechado .marca { width: 7px; height: 7px; box-shadow: 0 0 0 1px var(--azul); }
.porto em {
  position: absolute;
  top: 37px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  background: var(--branco);
  font-family: var(--rotulo);
  font-size: 19px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.heteronimo {
  appearance: none;
  min-height: 46px;
  padding: 8px 14px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--azul);
  color: var(--azul);
  font-family: var(--rotulo);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.heteronimo:hover { box-shadow: inset 0 0 0 2px var(--azul); }
.heteronimo[aria-pressed="true"] { background: var(--azul); color: var(--branco); }

.retratos { position: relative; aspect-ratio: 5 / 6; }
.retrato { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .55s ease; }

.risco {
  background-image: linear-gradient(var(--azul), var(--azul));
  background-repeat: no-repeat;
  background-position: 0 56%;
  background-size: 100% .065em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: riscar 1.8s cubic-bezier(.5, 0, .2, 1) .4s backwards;
}
@keyframes riscar { from { background-size: 0% .065em; } }


.nav-botao {
  appearance: none;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--azul);
  font-family: var(--rotulo);
  font-size: 25px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.nav-botao.atual { font-weight: 800; }
.mapa-linha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(28px, 5vw, 64px); align-items: center; padding: 22px 0; border-bottom: 2px dotted var(--azul); }
.rota-porto.fechado { background: var(--branco); box-shadow: 0 0 0 1.5px var(--azul); }
.acoes-mapa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 14px; }

.corpo { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px clamp(32px, 5vw, 72px); max-width: 1328px; margin: 0 auto; }
.corpo.com-mapa { grid-template-columns: 240px minmax(0, 1fr) 380px; gap: 32px 40px; }

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 0;
  border-radius: 2px;
  background: var(--azul);
  color: var(--branco);
  font-family: var(--rotulo);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.botao:hover { background: var(--azul-escuro); }
.botao-linha { background: transparent; box-shadow: inset 0 0 0 1px var(--azul); color: var(--azul); }
.botao-linha:hover { background: transparent; box-shadow: inset 0 0 0 2px var(--azul); }

.linha-cabeca { display: flex; align-items: center; gap: 12px; }
.adicionar {
  appearance: none;
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--azul);
  color: var(--azul);
  font-family: var(--rotulo);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.adicionar:hover { box-shadow: inset 0 0 0 2px var(--azul); }
.adicionar[aria-pressed="true"] { background: var(--azul); color: var(--branco); }

.juntar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: clamp(20px, 3vw, 32px);
  padding: 12px 0;
  border-top: 2px dotted var(--azul);
  border-bottom: 2px dotted var(--azul);
}

.painel {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px;
  background: var(--branco);
  box-shadow: inset 0 0 0 1px var(--azul);
}
.rota-mini {
  position: relative;
  height: 112px;
  background-image: url(../img/mar-pontos.svg);
  background-size: 442px 442px;
  overflow: hidden;
}
.rota-mini svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rota-mini path { fill: none; stroke: var(--azul); stroke-width: 2.4; stroke-dasharray: .1 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rota-porto { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg); background: var(--azul); box-shadow: 0 0 0 2px var(--branco); }
.rota-barco { position: absolute; width: 68px; margin: -46px 0 0 -14px; }

.entrada { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 2px dotted var(--azul); }
.entrada-n { font-family: var(--rotulo); font-size: 21px; font-weight: 800; line-height: 1; }
.entrada-titulo { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; }
.entrada-ano { display: block; font-family: var(--rotulo); font-size: 18px; font-weight: 600; line-height: 1.1; }
.icone {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--azul);
  cursor: pointer;
}
.icone:hover:not(:disabled) { color: var(--azul-escuro); box-shadow: inset 0 0 0 1px var(--azul); }
.icone:disabled { opacity: .3; cursor: default; }
.ligacao {
  appearance: none;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--azul);
  font-family: var(--rotulo);
  font-size: 21px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.barra-mapa {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  max-width: 1328px;
  margin: 24px auto 0;
  padding: 10px 12px 10px 18px;
  background: var(--branco);
  box-shadow: inset 0 0 0 1px var(--azul);
}

.lateral { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 22px; }
.mais-filtros { display: contents; }
.abrir-filtros { display: none; }

.linha { border-bottom: 2px dotted var(--azul); }
.linha-botao {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 96px 20px;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  min-height: 64px;
  padding: 14px 0 12px;
  border: 0;
  background: transparent;
  color: var(--azul);
  font-family: var(--serifa);
  text-align: left;
  cursor: pointer;
}
.linha-ano { font-family: var(--rotulo); font-size: 23px; font-weight: 800; line-height: 1; }
.linha-titulo { font-size: clamp(22px, 2vw, 27px); font-weight: 700; line-height: 1.15; }
.linha-botao:hover .linha-titulo { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.linha-autor { display: block; padding-top: 2px; font-size: 18px; font-weight: 400; line-height: 1.25; }
.linha-botao:hover .linha-autor { text-decoration: none; }
.linha-genero { font-family: var(--rotulo); font-size: 21px; font-weight: 600; line-height: 1.05; }
.linha-mais { position: relative; width: 16px; height: 16px; align-self: center; justify-self: end; }
.linha-mais::before, .linha-mais::after { content: ''; position: absolute; left: 0; top: 7px; width: 16px; height: 2px; background: var(--azul); transition: transform .25s ease; }
.linha-mais::after { transform: rotate(90deg); }
.linha.aberta .linha-mais::after { transform: rotate(0deg); }

.ficha { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.ficha > div { overflow: hidden; min-height: 0; }
.linha.aberta .ficha { grid-template-rows: 1fr; }
.ficha-texto { max-width: 62ch; margin-left: 78px; padding: 0 0 18px; }
.ver-autores { display: flex; flex-wrap: wrap; gap: 0 18px; padding-top: 4px; }
.achados { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; margin-bottom: clamp(20px, 3vw, 32px); padding: 8px 0; border-top: 2px dotted var(--azul); border-bottom: 2px dotted var(--azul); }
.nome-autor { appearance: none; padding: 0; border: 0; background: transparent; color: var(--azul); font: inherit; text-align: left; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; cursor: pointer; }
.nome-autor:hover { color: var(--azul-escuro); }
.autores-barra { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.autores-procura { flex: 1 1 320px; min-width: 0; max-width: 520px; }
.autor-fila { appearance: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; gap: 4px 24px; align-items: baseline; width: 100%; padding: 18px 0 16px; border: 0; border-bottom: 2px dotted var(--azul); background: transparent; color: var(--azul); font-family: var(--serifa); text-align: left; cursor: pointer; }
.autor-fila-nome { font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; line-height: 1.1; }
.autor-fila:hover .autor-fila-nome { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.autor-fila-dados { font-family: var(--rotulo); font-size: 24px; font-weight: 600; line-height: 1; white-space: nowrap; }
.autor-fila-total { text-align: right; }
.autor-corpo { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 88px); max-width: 1328px; margin: 0 auto; }
.autor-lado { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 18px; }
.factos { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.factos dt { margin-bottom: 4px; }
.factos dd { margin: 0; font-size: 19px; line-height: 1.35; }
.vida { max-width: 62ch; padding-top: 14px; }
.vida p { margin: 0 0 14px; font-size: 20px; line-height: 1.5; }
.comecar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 22px 0 clamp(36px, 5vw, 56px); padding: 16px 0; border-top: 2px dotted var(--azul); border-bottom: 2px dotted var(--azul); }
.comecar > div { flex: 1 1 280px; }
.comecar-titulo { margin: 10px 0 0; font-size: clamp(25px, 2.6vw, 32px); font-weight: 700; line-height: 1.15; }
.comecar-motivo { margin: 6px 0 0; max-width: 56ch; font-size: 19px; line-height: 1.4; }
@media (max-width: 900px) {
  .autor-corpo { grid-template-columns: minmax(0, 1fr); }
  .autor-lado { position: static; }
}
@media (max-width: 640px) {
  .autor-fila { grid-template-columns: minmax(0, 1fr) auto; }
  .autor-fila-nome { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .corpo.com-mapa { grid-template-columns: 240px minmax(0, 1fr); }
  .painel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; align-self: stretch; width: min(420px, 100%); max-height: none; box-shadow: -1px 0 0 var(--azul); }
}
@media (max-width: 900px) {
  .corpo, .corpo.com-mapa { grid-template-columns: minmax(0, 1fr); }
  .mapa-linha { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: static; }
  .mais-filtros { display: none; }
  .mais-filtros.visiveis { display: contents; }
  .abrir-filtros {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--azul);
    color: var(--azul);
    font-family: var(--rotulo);
    font-size: 23px;
    font-weight: 800;
    cursor: pointer;
  }
  .colecao { min-height: 76px; font-size: 22px; }
  .grelha-colecoes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .linha-botao { grid-template-columns: 56px minmax(0, 1fr); }
  .linha-genero, .linha-mais { display: none; }
  .ficha-texto { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mar, .risco { animation: none; }
  .ficha, .linha-mais::before, .linha-mais::after { transition: none; }
}
