/* A letra cursiva é hospedada no próprio site (nada é pedido ao Google) */
@font-face {
    font-family: 'Great Vibes';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/great-vibes-latin-400-normal.woff2') format('woff2');
}

/* ===========================================================
   PÁGINA PÚBLICA DO MEMORIAL
   Mobile-first. Depende do style.css (header, botões, cores).
   =========================================================== */

.header .link-topo {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    opacity: 0.85;
}

.memorial-pagina {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
}

/* ---------- Foto principal em PRETO E BRANCO ----------
   O filtro só muda a exibição: a foto original continua colorida no servidor.
   A foto é alta e some suavemente no branco; o nome fica sobre essa transição. */
.capa {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.capa-img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 82vh;
    object-fit: cover;
    object-position: 50% 20%;          /* prioriza o rosto, que costuma ficar no alto */
    filter: grayscale(1) contrast(1.08);
}

.capa-vazia {
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 82vh;
    background: linear-gradient(160deg, #8a8a8a, #3a3a3a);
}

.capa::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.72) 48%, #fff 88%);
    pointer-events: none;
}

.capa-faixa {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 0 20px 14px;
    text-align: center;
    color: #00091C;
}

.capa-prefixo {
    margin: 0;
    font-family: 'Great Vibes', 'Brush Script MT', 'Segoe Script', cursive;
    font-weight: 400;
    font-size: clamp(28px, 8.2vw, 42px);
    line-height: 1.1;
    letter-spacing: 0;
    color: #1d2b63;
    -webkit-text-stroke: 0.4px #1d2b63;
}

.capa-nome {
    margin: 2px 0 0;
    font-weight: 800;
    font-size: clamp(24px, 7.4vw, 40px);
    line-height: 1.15;
    color: #00091C;
    overflow-wrap: anywhere;
}

.capa-datas {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(0, 9, 28, 0.6);
}

/* Botões discretos para quem está logado: voltar (à esquerda) e editar (à direita, só para o dono ou o admin) */
.memorial-barra {
    position: fixed;
    top: 12px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: calc(100% - 24px);
    max-width: 696px;
    margin: 0 auto;
    pointer-events: none;
}

.memorial-voltar,
.memorial-editar {
    pointer-events: auto;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(0, 9, 28, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.memorial-editar {
    margin-left: auto;
}

/* ---------- Biografia ---------- */
.bio {
    padding: 6px 26px 6px;
}

.bio p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.65;
    color: #0b1a3f;
    text-align: left;
    overflow-wrap: anywhere;
}

/* ---------- Galeria em mosaico (fotos + vídeo): 3 colunas coladas ---------- */
.galeria {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: dense;
    gap: 3px;
    padding: 22px 0 0;
}

.galeria .item {
    margin: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #eee;
}

.galeria .item-largo {
    grid-column: span 3;
    aspect-ratio: 16 / 10;
}

.galeria img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* Vídeo mostra o quadro inteiro (inclusive vídeos em pé, gravados no celular) */
.galeria .item-video {
    aspect-ratio: auto;
    background: #000;
}

.galeria video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 75vh;
    background: #000;
}

/* ---------- Árvore genealógica ---------- */
.arvore {
    background: #0a1420;
    color: #fff;
    text-align: center;
    padding: 32px 20px 36px;
}

.arvore h2 {
    margin: 10px 0 6px;
    font-size: 17px;
}

.arvore p {
    margin: 0 0 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

.arvore .btn {
    max-width: 320px;
}

/* ---------- Avisos (memorial privado / não encontrado) ---------- */
.aviso-pagina {
    max-width: none;
    margin: 0 auto;
    padding: 64px 24px 72px;
    text-align: center;
}

.aviso-pagina h1 {
    margin: 0 0 8px;
    font-size: 18px;
}

.aviso-pagina p {
    max-width: 380px;
    margin: 0 auto 22px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(13, 27, 47, 0.65);
}

.aviso-pagina .btn {
    max-width: 320px;
}

.aviso-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #f0eee9;
    color: var(--azul-escuro, #0d1b2f);
}

.aviso-escuro {
    background: #0a1420;
    color: #fff;
    min-height: 60vh;
}

.aviso-escuro p {
    color: rgba(255, 255, 255, 0.65);
}

.aviso-escuro .aviso-icone {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

.aviso-escuro .aviso-detalhe {
    margin-top: 18px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- Foto ampliada ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}

.lightbox.aberto {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ---------- Rodapé ---------- */
.rodape {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 16px;
    max-width: 720px;
    margin: 0 auto;
    padding: 26px 20px 30px;
    font-size: 11px;
}

.rodape-logo {
    flex-basis: 100%;
    text-align: center;
    margin-bottom: 6px;
}

.rodape-logo img {
    width: 110px;
    height: auto;
}

.rodape a {
    color: rgba(13, 27, 47, 0.7);
    text-decoration: none;
}

@media (min-width: 768px) {
    .capa-img,
    .capa-vazia {
        aspect-ratio: 4 / 3;
    }

    .bio {
        padding: 10px 40px 8px;
    }

    .bio p {
        font-size: 16px;
    }

    .galeria {
        gap: 4px;
    }
}
