/* ============================================================
   Páginas internas — Galeria & Livros
   Depende das variáveis de css/styles.css (paleta FRELIMO)
   ============================================================ */

/* ---------- Page hero ---------- */
.page-hero {
  position: relative; color: #fff; overflow: hidden;
  padding: 150px 0 60px;
  background:
    radial-gradient(900px 400px at 85% -20%, rgba(240,201,94,.18), transparent 60%),
    linear-gradient(160deg, var(--red-800), var(--red-900) 60%, var(--black));
}
.page-hero::after {
  content:""; position:absolute; inset:0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px; opacity:.5;
}
.page-hero__inner { position: relative; z-index: 2; }
.page-hero .kicker { color: var(--gold-soft); }
.page-hero h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05;
}
.page-hero p { color: rgba(255,255,255,.82); max-width: 60ch; margin-top: 12px; }
.crumb { font-size: .85rem; color: rgba(255,255,255,.7); margin-bottom: 18px; }
.crumb a { color: var(--gold-soft); }
.crumb a:hover { text-decoration: underline; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 36px; }
.filters button {
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: .55rem 1.2rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--red-800);
  transition: all .2s;
}
.filters button:hover { border-color: var(--gold); }
.filters button.active { background: var(--red-700); border-color: var(--red-700); color: #fff; }

/* ---------- Grelha da galeria ---------- */
.gal-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.g-item {
  position: relative; border: 0; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: var(--radius-sm); aspect-ratio: 1; background: var(--ivory);
  box-shadow: var(--shadow-sm);
}
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, filter .3s; display:block; }
.g-item::after {
  content: "⤢"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 1.6rem; background: rgba(69,9,13,.0);
  opacity: 0; transition: opacity .3s;
}
.g-item:hover img { transform: scale(1.06); }
.g-item:hover::after { opacity: 1; background: rgba(69,9,13,.35); }
.g-item.is-hidden { display: none; }

/* ---------- Grelha de livros (capa + legenda) ---------- */
.book-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px 24px;
}
.book-card { display: flex; flex-direction: column; color: inherit; }
.book-card__cover {
  border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s; background: var(--ivory);
}
.book-card__cover img { width: 100%; aspect-ratio: 7/9.4; object-fit: cover; display: block; }
.book-card:hover .book-card__cover { transform: translateY(-6px); box-shadow: var(--shadow); }
/* placeholder para livros sem foto de capa */
.book-card__ph {
  aspect-ratio: 7/9.4; display: grid; place-items: center; text-align: center; padding: 22px;
  color: #fff; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.25;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(240,201,94,.18), transparent 60%),
    linear-gradient(160deg, var(--red-700), var(--red-900) 70%, var(--black));
}
.book-card__cap { padding: 14px 4px 0; }
.book-card__cap strong {
  display: block; font-family: var(--serif); font-weight: 600; color: var(--red-900);
  font-size: 1rem; line-height: 1.25;
}
.book-card:hover .book-card__cap strong { color: var(--red-600); }
.book-card__cap span { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.book-card__cap .more { color: var(--gold); font-weight: 600; font-size: .82rem; margin-top: 6px; display: inline-block; }

/* ---------- Galeria: figura com legenda ---------- */
.g-fig { margin: 0; display: flex; flex-direction: column; }
.g-fig.is-hidden { display: none; }
.g-fig figcaption {
  padding: 10px 2px 0; font-size: .85rem; color: var(--muted); line-height: 1.35;
}
.g-fig figcaption b { color: var(--red-800); font-weight: 600; }

/* ---------- Bibliografia / Artigos ---------- */
.biblio { max-width: 920px; margin-inline: auto; display: grid; gap: 0; }
.biblio__group { border-top: 1px solid var(--line); }
.biblio__year {
  font-family: var(--serif); font-weight: 600; color: var(--gold);
  padding: 18px 0 6px; font-size: 1.3rem;
}
.biblio__item {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.biblio__item:last-child { border-bottom: 0; }
.biblio__item h4 { font-weight: 600; color: var(--ink); font-size: 1rem; }
.biblio__item span { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.articles { max-width: 920px; margin-inline: auto; display: grid; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.articles li {
  padding: 16px 22px; background: var(--paper); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr; gap: 4px;
}
.articles li:last-child { border-bottom: 0; }
.articles li:hover { background: var(--ivory); }
.articles a { display: grid; gap: 4px; color: inherit; }
.articles a:hover strong { color: var(--red-600); }
.articles strong { font-weight: 600; color: var(--ink); }
.articles em { font-style: normal; color: var(--gold); font-weight: 600; font-size: .85rem; }
.articles .more { color: var(--gold); font-weight: 600; font-size: .8rem; margin-top: 2px; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: none; }
.lb.open { display: block; }
.lb__backdrop { position: absolute; inset: 0; background: rgba(15,6,7,.92); backdrop-filter: blur(4px); }
.lb__stage {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 5vh 6vw;
}
.lb__img {
  max-width: 100%; max-height: 90vh; border-radius: 8px; object-fit: contain;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
  animation: lbin .25s ease;
}
@keyframes lbin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb__btn {
  position: absolute; z-index: 2; background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.25); width: 52px; height: 52px; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer; display: grid; place-items: center; transition: background .2s;
}
.lb__btn:hover { background: var(--gold); color: var(--red-900); border-color: var(--gold); }
.lb__close { top: 22px; right: 22px; }
.lb__prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb__caption {
  position: absolute; left: 0; right: 0; bottom: 52px; text-align: center;
  padding: 0 70px; color: #fff; font-size: 1rem; pointer-events: none;
}
.lb__caption b { color: var(--gold-soft); font-weight: 600; }
.lb__count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.65); font-size: .85rem; letter-spacing: .05em; }

/* ---------- Botão Ver tudo (home) ---------- */
.see-all { text-align: center; margin-top: 44px; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .gal-grid { grid-template-columns: repeat(3, 1fr); }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .biblio__item { grid-template-columns: 1fr; }
  .lb__prev { left: 10px; } .lb__next { right: 10px; }
}

/* ---------- Contact Form 7 (combinar com o tema) ---------- */
.form .wpcf7-spinner { margin: 8px auto 0; display: block; }
.form .wpcf7-response-output {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .9rem; border: 1px solid var(--line); background: var(--ivory); color: var(--ink);
}
.form .wpcf7-not-valid-tip { color: var(--red-600); font-size: .8rem; font-weight: 600; margin-top: 4px; }
.form input.wpcf7-not-valid, .form textarea.wpcf7-not-valid { border-color: var(--red-600); }
.wpcf7-form.sent .wpcf7-response-output { border-color: #2e7d32; background: #eef7ee; color: #1f5c2b; }
.wpcf7-form.invalid .wpcf7-response-output, .wpcf7-form.failed .wpcf7-response-output { border-color: var(--red-600); background: #fdecec; color: var(--red-700); }
