/* ---------------------------
   Base de estilos — Centenário
   Ficheiro: styles.css
   --------------------------- */

/* Variáveis de tema */
:root{
  --bg: #0e0e10;
  --bg-alt: #141418;
  --text: #eaeaea;
  --text-muted: #b9bbc2;
  --brand: #d7b56d;        /* dourado discreto, “teatro clássico” */
  --brand-dark: #b29246;
  --accent: #22232a;
  --card: #1a1b22;
  --border: #2a2b33;
  --ghost: rgba(215,181,109,0.12);

  --ff-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --ff-serif: "Georgia", "Times New Roman", serif;

  --maxw: 1180px;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Reset simples */
*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
img{ max-width: 100%; height: auto; display: block; }
a{ color: var(--brand); text-decoration: none; }
a:hover{ text-decoration: underline; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  line-height: 1.6;
}

/* Utilidades */
.container{ width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
.muted{ color: var(--text-muted); }
.lead{ color: var(--text); opacity: .92; font-size: 1.05rem; }
.text-link{ font-weight: 600; }
.figure{ margin: 0; }
.figure__img{ border: 1px solid var(--border); border-radius: var(--radius); }
.notice{
  background: var(--ghost);
  border: 1px solid var(--brand);
  color: var(--text);
  padding: 1rem;
  border-radius: var(--radius);
}
.hint{ margin-top: .5rem; }
.hint summary{ cursor: pointer; color: var(--brand); }

/* Acessibilidade: link para saltar conteúdo */
.skip-link{
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus{
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto; padding: .5rem .75rem;
  background: #000; color: #fff; z-index: 9999; border-radius: 6px;
}

/* Header */
.site-header{
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(180deg, #0b0b0d 0%, rgba(11,11,13,0.7) 100%);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header__wrap{
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0;
}
.brand{
  display: inline-flex; align-items: baseline; gap: .5rem; color: var(--text); text-decoration: none;
}
.brand__logo{
  display: grid; place-items: center; width: 36px; height: 36px;
  background: var(--brand); color: #121212; font-weight: 800;
  border-radius: 50%;
}
.brand__logo--small{ width: 28px; height: 28px; font-size: .85rem; }
.brand__name{ font-weight: 700; letter-spacing: .3px; }
.brand__years{ color: var(--text-muted); font-size: .9rem; }

/* Navegação */
.site-nav__toggle{
  display: none;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: .5rem .75rem; border-radius: 8px; cursor: pointer;
}
.site-nav__list{
  list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0;
}
.site-nav__list a{ color: var(--text); opacity: .9; }
.site-nav__list a:hover{ opacity: 1; }

@media (max-width: 860px){
  .site-nav__toggle{ display: inline-block; }
  .site-nav__list{
    position: absolute; right: 1rem; top: 64px; background: var(--bg-alt);
    border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem;
    display: none; flex-direction: column; gap: .5rem; min-width: 220px; box-shadow: var(--shadow);
  }
  .site-nav__list.is-open{ display: flex; }
}

/* Hero */
.hero{
  position: relative;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,.85)),
      color: #fff;
}
.hero__content{
  padding: clamp(3rem, 6vw, 7rem) 0;
  text-align: center;
}
.hero__title{
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
}
.hero__subtitle{
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: #f0f0f0; opacity: .95; margin: 0 0 1.25rem;
}
.hero__cta{ display: inline-flex; gap: .75rem; }

/* Botões */
.btn{
  display: inline-block; padding: .75rem 1rem; border-radius: 10px;
  background: var(--brand); color: #111; font-weight: 700; border: none;
  box-shadow: 0 10px 18px rgba(215,181,109,.15);
}
.btn:hover{ filter: brightness(1.03); text-decoration: none; }
.btn--ghost{
  background: transparent; color: var(--brand); border: 1px solid var(--brand);
}
.btn--outline{
  background: transparent; color: var(--text); border: 1px solid var(--border);
}

/* Secções */
.section{ padding: clamp(2rem, 5vw, 4rem) 0; border-top: 1px solid var(--border); }
.section--intro{ background: var(--bg); }
.section--accent{ background: var(--accent); }
.section--alt{ background: var(--bg-alt); }

/* Layouts em grelha */
.grid{ display: grid; gap: 1.25rem; }
.grid--2col{ grid-template-columns: 1.2fr .8fr; align-items: start; }
.grid--3col{ grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px){
  .grid--2col{ grid-template-columns: 1fr; }
  .grid--3col{ grid-template-columns: 1fr; }
}

/* Cards */
.cards{
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 1rem;
}
.card{
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.card h3{ margin-top: 0; }
.card__link{ display: inline-block; margin-top: .5rem; font-weight: 700; }

.cards--media{ grid-template-columns: repeat(3, 1fr); }
.media{ display: grid; grid-template-columns: 120px 1fr; gap: .75rem; align-items: center; }
.media__thumb{ width: 120px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

@media (max-width: 700px){
  .cards{ grid-template-columns: 1fr; }
  .cards--media{ grid-template-columns: 1fr; }
  .media{ grid-template-columns: 1fr; }
}

/* Features */
.feature{
  padding: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Timeline */
.timeline{ position: relative; margin-top: 1rem; }
.timeline::before{
  content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border);
}
.timeline__item{ position: relative; padding-left: 2rem; margin-bottom: 1rem; }
.timeline__item::before{
  content: ""; position: absolute; left: 2px; top: .4rem; width: 12px; height: 12px;
  background: var(--brand); border-radius: 50%;
}
.timeline__date{ display: inline-block; min-width: 80px; color: var(--text-muted); font-weight: 700; }

/* Listas */
.list-check{ list-style: none; padding: 0; }
.list-check li{
  position: relative; padding-left: 1.5rem; margin: .4rem 0;
}
.list-check li::before{
  content: "✓"; position: absolute; left: 0; color: var(--brand);
}

/* Rodapé */
.site-footer{
  background: #0b0b0d; border-top: 1px solid var(--border); margin-top: 2rem;
}
.footer__wrap{ padding: 1.25rem 0; display: grid; gap: .75rem; align-items: center; }
.footer__brand{ display: flex; align-items: center; gap: .5rem; }
.footer__nav{ display: flex; flex-wrap: wrap; gap: .75rem; }
.footer__nav a{ color: var(--text-muted); }

.footer__nav a:hover{ color: var(--text); }


/* ---------------------------
   Fichas de livro (Obras Completas)
   --------------------------- */
.books{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 1rem; }
.book{
  display: grid; grid-template-columns: 150px 1fr; gap: 1.1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.book__cover{ width: 150px; height: auto; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.book__vol{ font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.book h3{ margin: .1rem 0 .4rem; font-family: var(--ff-serif); font-size: 1.35rem; }
.book__meta{ list-style: none; margin: .5rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .82rem; color: var(--text-muted); }
.book__actions{ display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.book__actions .btn{ padding: .5rem .85rem; font-size: .9rem; box-shadow: none; }
.book__rights{ font-size: .78rem; color: var(--text-muted); margin: .6rem 0 0; }
.jumpbar{ display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

@media (max-width: 900px){ .books{ grid-template-columns: 1fr; } }
@media (max-width: 520px){
  .book{ grid-template-columns: 105px 1fr; gap: .75rem; padding: .75rem; }
  .book__cover{ width: 105px; }
}

/* Páginas de texto (Sobre, Créditos, Direitos, Contactos) */
.prose{ max-width: 70ch; }
.prose h2{ margin-top: 2rem; }

.brand__years{ white-space: nowrap; }


/* Cronologia e fontes */
.tl{ list-style: none; margin: 1.5rem 0; padding: 0; border-left: 2px solid var(--border); }
.tl__item{ display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0 0 1.5rem 1.25rem; position: relative; }
.tl__item::before{ content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.tl__year{ font-family: var(--ff-serif); font-size: 1.25rem; color: var(--brand); font-weight: 700; }
.tl__tag{ font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.tl__body p{ margin: .2rem 0; }
.tl__src{ font-size: .85rem; }
.src{ padding-left: 1.1rem; }
.src li{ margin-bottom: .7rem; }
@media (max-width: 600px){ .tl__item{ grid-template-columns: 1fr; gap: .1rem; } }


/* Início: foto e título lado a lado */
.hero--split .hero__grid{ display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 2.5rem; align-items: center; padding: 2.5rem 0 2rem; }
.hero--split .hero__photo{ margin: 0; }
.hero--split .hero__photo img{ width: 100%; height: auto; display: block; border-radius: 4px; }
.hero--split .hero-caption{ margin: .4rem 0 0; font-size: .8rem; color: var(--text-muted); }
.hero--split .hero__content{ text-align: left; padding: 0; }
.hero--split .hero__title{ font-size: clamp(1.7rem, 3.4vw, 2.7rem); }
.hero--split .hero__subtitle{ font-size: clamp(1rem, 1.8vw, 1.2rem); margin: 0; }
@media (max-width: 700px){ .hero--split .hero__grid{ grid-template-columns: 1fr; gap: 1.25rem; } .hero--split .hero__photo{ max-width: 320px; } }


/* Início: tudo ao centro (foto por cima, título por baixo) */
.hero--split .hero__grid{ display: block; text-align: center; padding: 2rem 0 1.5rem; }
.hero--split .hero__photo{ max-width: 340px; margin: 0 auto 1.25rem; }
.hero--split .hero__content{ text-align: center; }


/* Centenário: programa e parceiros */
.tl__year .muted{ font-size: .8rem; font-weight: 400; }
.prog{ margin: .4rem 0 0; padding-left: 1.1rem; }
.prog li{ margin-bottom: .55rem; }
.prog ul{ margin: .35rem 0 0; padding-left: 1.1rem; font-size: .95rem; }
.prog ul li{ margin-bottom: .3rem; }
.partners{ list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.partners li{ background: #fff; border-radius: 6px; padding: .6rem .9rem; display: flex; align-items: center; }
.partners img{ height: 54px; width: auto; max-width: 190px; object-fit: contain; display: block; }

/* Início: assinatura por baixo do menu */
.hero > .hero__signature{ display:block; position:absolute; right:10%; top:290px; width:min(540px,calc(90vw - 490px)); height:auto; mix-blend-mode:screen; }
@media (max-width: 900px){ .hero > .hero__signature{ position:static; width:min(320px,75%); margin:1rem auto 0; } }


/* Galerias (Fotografias, Documentos) */
.gal{ display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1rem; align-items: start; }
.gal__item{ margin: 0; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gal__item img{ width: 100%; height: auto; display: block; }
.gal__item--small img{ width: auto; max-width: 100%; margin: 1rem auto 0; }
.gal__item--wide{ grid-column: span 2; }
.gal__item figcaption{ padding: .75rem .9rem 1rem; font-size: .9rem; line-height: 1.5; }
.gal__credit{ display: block; margin-top: .3rem; font-size: .78rem; color: var(--text-muted); font-style: italic; }
@media (max-width: 640px){ .gal__item--wide{ grid-column: auto; } }

/* Menu: evita quebras de linha em ecrãs médios */
@media (min-width: 861px) and (max-width: 1200px){
  .site-nav__list{ gap: .8rem; }
  .site-nav__list a{ white-space: nowrap; font-size: .9rem; }
  .brand__years{ display: none; }
}

/* Início: o par de retratos acompanha exactamente a altura do texto */
@media (min-width: 901px){
  .section--intro .grid--2col{ grid-template-columns: minmax(0,1fr) clamp(190px,22vw,290px); align-items: stretch; gap: 2.5rem; }
  .intro__aside--pair{ position: relative; }
  .intro__aside--pair .figure{ position: absolute; inset: 0; display: flex; flex-direction: column; gap: .75rem; }
  .intro__aside--pair .figure img{ flex: 1 1 0; min-height: 0; width: 100%; height: 0; object-fit: cover; object-position: center 20%; border-radius: 3px; }
  .intro__aside--pair figcaption{ display: none; }
}
.intro__aside--pair .mirror{ transform: scaleX(-1); }
@media (max-width: 900px){
  .intro__aside--pair .figure{ display: flex; gap: .75rem; }
  .intro__aside--pair .figure img{ width: calc(50% - .4rem); height: auto; margin: 0; border-radius: 3px; }
  .intro__aside--pair figcaption{ display: none; }
}

/* Biografia: fotografias pequenas junto ao texto */
.bio{ max-width: 860px; }
.bio-fig{ float: right; clear: right; width: 180px; margin: .25rem 0 1rem 1.5rem; font-size: .78rem; line-height: 1.35; color: var(--text-muted); }
.bio-fig--wide{ width: 230px; }
.bio-fig--l{ float: left; clear: left; margin: .25rem 1.5rem 1rem 0; }
.bio-fig img{ display: block; width: 100%; height: auto; border-radius: 3px; border: 1px solid var(--border); }
.bio-fig figcaption{ margin-top: .35rem; }
.bio-fig .gal__credit{ display: block; font-size: .72rem; opacity: .8; }
.bio article::after{ content:""; display:block; clear:both; }
@media (max-width: 640px){
  .bio-fig, .bio-fig--wide{ float: none; width: min(230px,65%); margin: 1rem auto; }
}

/* Teatro: tabelas de espectáculos */
.tbl-wrap{ overflow-x: auto; margin: .5rem 0 1.5rem; }
.tbl{ width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .92rem; }
.tbl th:nth-child(1){ width: 110px; } .tbl th:nth-child(2){ width: 38%; } .tbl th:nth-child(3){ width: 26%; }
.tbl th{ text-align: left; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); padding: .5rem .7rem; border-bottom: 1px solid var(--border); }
.tbl td{ padding: .5rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl__d{ white-space: nowrap; color: var(--text-muted); }
@media (max-width: 640px){ .tbl{ min-width: 560px; } }

.quote{ margin: 1rem 0 1.5rem; padding: .2rem 0 .2rem 1.1rem; border-left: 3px solid var(--brand); color: var(--text-muted); font-size: .95rem; overflow: hidden; }
.quote footer{ font-size: .8rem; font-style: italic; margin-top: .4rem; }

/* Centenário: cartazes e programas */
.postais{ display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .9rem; }
.postais figure{ margin: 0; width: min(300px, 100%); }
.postais--geral figure{ width: min(460px, 100%); }
.postais img{ display: block; width: 100%; height: auto; border-radius: 3px; border: 1px solid var(--border); }
.postais figcaption{ margin-top: .3rem; font-size: .78rem; color: var(--text-muted); }

/* Quadro genealógico */
.tbl--gen th:nth-child(1){ width: 34%; } .tbl--gen th:nth-child(2){ width: 24%; } .tbl--gen th:nth-child(3){ width: auto; }
.tbl--gen td:nth-child(2){ color: var(--text-muted); }
.tbl--gen tr.tbl__grp td{ font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); padding-top: 1.1rem; border-bottom: 1px solid var(--brand); }

/* Nota autobiográfica: páginas à esquerda, transcrição à direita */
.nota{ display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); gap:1.5rem; align-items:start; margin-top:1rem; }
.nota__imgs{ display:grid; gap:1rem; }
.nota__imgs figure{ margin:0; background:var(--bg-alt); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.nota__imgs img{ width:100%; height:auto; display:block; }
.nota__imgs figcaption{ padding:.4rem .75rem; font-size:.8rem; color:var(--text-muted); }
.nota__txt{ font-size:.88rem; line-height:1.55; }
.nota__txt p{ margin:0 0 .9rem; }
.nota__cap{ margin-top:1.5rem; background:var(--bg-alt); border:1px solid var(--border); border-radius:var(--radius); padding:1rem 1.25rem; font-size:.9rem; color:var(--text-muted); }
@media (max-width:800px){ .nota{ grid-template-columns:1fr; } }

/* Galerias a duas colunas (Documentos: Serrana) */
.gal--2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px){ .gal--2{ grid-template-columns: 1fr; } }
