/* Acervo Fotográfico (templates/Pages/acervofotografico.php) */

.acervo-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Destaques (carrossel) ---------- */
.acervo-destaques {
    margin-bottom: 32px;
}

.acervo-destaques__titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color-green);
}

.acervo-destaques__titulo .fa-star {
    color: var(--text-color-orange-details);
}

.acervo-destaque {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    background-color: #1d1d1d;
    box-shadow: var(--shadow-primary);
}

/* Seletor reforçado: o Owl e o style.css também estilizam img */
.acervo-destaques .acervo-destaque img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.acervo-destaque:hover img,
.acervo-destaque:focus-within img {
    transform: scale(1.04);
}

.acervo-destaque .acervo-card__sem-foto {
    color: #fff;
}

.acervo-destaque__legenda {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 48px 20px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
    color: #fff;
    pointer-events: none;
}

.acervo-destaque__legenda h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.acervo-destaque__legenda p {
    margin: 0;
    font-size: .9rem;
    color: rgba(255, 255, 255, .85);
}

/* Pontos e setas do carrossel (o style.css puxa os pontos para cima) */
.acervo-destaques .owl-dots {
    margin-top: 14px !important;
}

.acervo-destaques .owl-dots .owl-dot span {
    background-color: var(--background-green-light) !important;
}

.acervo-destaques .owl-nav {
    position: absolute;
    top: calc(50% - 30px);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.acervo-destaques .owl-nav button.owl-prev,
.acervo-destaques .owl-nav button.owl-next {
    pointer-events: auto;
    width: 40px !important;
    height: 40px !important;
    margin: 0 -12px !important;
    font-size: 1rem !important;
    background-color: var(--background-white) !important;
    color: var(--text-color-green) !important;
}

.acervo-destaques .owl-nav button.disabled {
    opacity: .4;
}

/* ---------- Filtros ---------- */
.acervo-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 24px;
    padding: 20px;
    background-color: var(--background-white);
    border: 1px solid var(--background-black-25);
    border-radius: 20px;
    box-shadow: var(--shadow-primary);
}

.acervo-filtros__busca {
    position: relative;
    flex: 1 1 100%;
}

.acervo-filtros__busca i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--background-green-light);
    pointer-events: none;
}

.acervo-filtros__busca input {
    width: 100%;
    height: 48px;
    padding: 0 18px 0 46px;
    font-size: 1rem;
    border-radius: 30px;
    border: 1px solid var(--background-green-light-40);
    background-color: var(--background-white);
    color: var(--text-color-black-secondary);
    transition: border-color .2s, box-shadow .2s;
}

.acervo-filtros__busca input::placeholder {
    color: var(--text-color-black-secondary);
    opacity: .6;
}

.acervo-filtros__campo {
    display: flex;
    flex-direction: column;
    flex: 1 1 180px;
    min-width: 0;
}

.acervo-filtros__campo label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-color-green);
    padding-inline: 14px;
    margin-bottom: 4px;
}

.acervo-filtros__campo select {
    width: 100%;
    height: 45px;
    padding: 0 40px 0 18px;
    font-size: 1rem;
    border-radius: 30px;
    border: 1px solid var(--background-green-light-40);
    color: var(--text-color-black-secondary);
    cursor: pointer;
    background-color: var(--background-white);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23519d34"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 22px;
    transition: border-color .2s, box-shadow .2s;
}

.acervo-filtros__busca input:hover,
.acervo-filtros__campo select:hover {
    border-color: var(--background-green-light);
}

.acervo-filtros__busca input:focus-visible,
.acervo-filtros__campo select:focus-visible {
    outline: none;
    border-color: var(--background-green-light);
    box-shadow: 0 0 0 3px var(--background-green-light-40);
}

.acervo-filtros__acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.acervo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 45px;
    padding: 0 22px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.acervo-btn--primario {
    border: 0;
    background-color: var(--background-green-light);
    color: var(--text-color-white);
}

.acervo-btn--primario:hover {
    background-color: var(--background-green);
}

.acervo-btn--secundario {
    border: 1px solid var(--background-green-light-40);
    background-color: var(--background-white);
    color: var(--background-green-light);
}

.acervo-btn--secundario:hover {
    background-color: var(--background-green-light-20);
    color: var(--background-green);
}

.acervo-btn:focus-visible {
    outline: 3px solid var(--background-green-light-40);
    outline-offset: 2px;
}

/* ---------- Cards ---------- */
.acervo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.acervo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
}

.acervo-card__imagem {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: var(--background-black-25);
}

/* Seletor reforçado: o style.css do site (carregado depois) fixa
   .card-pattern img { height: 250px } */
.acervo-card .acervo-card__imagem img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.acervo-card__sem-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    color: var(--text-color-black-secondary);
    opacity: .6;
    font-size: .95rem;
}

.acervo-card__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px 20px;
}

.acervo-card__titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color-black);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.acervo-card__data {
    margin: 0;
    font-size: .9rem;
    font-weight: 500;
    color: var(--background-green-light);
}

.acervo-card__descricao {
    margin: 0;
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.45;
    color: var(--text-color-black-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botão invisível cobrindo o card inteiro */
.acervo-card__abrir {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
}

.acervo-card__abrir:focus-visible {
    outline: 3px solid var(--background-green-light);
    outline-offset: -3px;
}

/* ---------- Paginação ---------- */
.acervo-paginacao {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
}

.acervo-paginacao a,
.acervo-paginacao .is-atual,
.acervo-paginacao__reticencias {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    font-weight: 500;
    text-decoration: none;
}

.acervo-paginacao a {
    border: 1px solid var(--background-green-light-40);
    background-color: var(--background-white);
    color: var(--background-green-light);
    transition: background-color .2s;
}

.acervo-paginacao a:hover {
    background-color: var(--background-green-light-20);
}

.acervo-paginacao .is-atual {
    background-color: var(--background-green-light);
    color: var(--text-color-white);
}

.acervo-paginacao__reticencias {
    min-width: auto;
    padding: 0 4px;
    color: var(--text-color-black-secondary);
}

/* ---------- Sem resultados ---------- */
.acervo-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 16px;
    margin-bottom: 48px;
    text-align: center;
    color: var(--text-color-black-secondary);
}

.acervo-vazio i {
    font-size: 2.5rem;
    color: var(--background-green-light);
    opacity: .7;
}

/* ---------- Janela de detalhes ---------- */

/* O atributo hidden precisa vencer os display: flex/block definidos acima */
.acervo-modal [hidden] {
    display: none !important;
}

.acervo-modal {
    width: min(1100px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background-color: var(--background-white);
    box-shadow: var(--shadow-primary);
    overflow: hidden;
}

.acervo-modal::backdrop {
    background-color: rgba(0, 0, 0, .7);
}

.acervo-modal__conteudo {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    max-height: calc(100vh - 32px);
}

.acervo-modal__imagem {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background-color: #1d1d1d;
}

.acervo-modal__imagem img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    object-fit: contain;
}

.acervo-modal__imagem .acervo-card__sem-foto {
    color: #fff;
}

.acervo-modal__texto {
    padding: 32px 28px;
    overflow-y: auto;
    color: var(--text-color-black-secondary);
}

.acervo-modal__texto h2 {
    margin: 0 40px 20px 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color-green);
}

/* Ouvir / Compartilhar */
.acervo-modal__acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 22px;
}

.acervo-acao,
.acervo-compartilhar__menu a,
.acervo-compartilhar__menu button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.acervo-acao {
    height: 40px;
    padding: 0 16px;
    border-radius: 30px;
    border: 1px solid var(--background-green-light-40);
    background-color: var(--background-white);
    color: var(--background-green-light);
    transition: background-color .2s, color .2s;
}

.acervo-acao:hover {
    background-color: var(--background-green-light-20);
    color: var(--background-green);
}

.acervo-acao[aria-pressed="true"] {
    background-color: var(--background-green-light);
    border-color: var(--background-green-light);
    color: var(--text-color-white);
}

.acervo-acao:focus-visible,
.acervo-compartilhar__menu a:focus-visible,
.acervo-compartilhar__menu button:focus-visible {
    outline: 3px solid var(--background-green-light-40);
    outline-offset: 2px;
}

.acervo-compartilhar {
    position: relative;
}

.acervo-compartilhar__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--background-black-25);
    background-color: var(--background-white);
    box-shadow: var(--shadow-primary);
}

.acervo-compartilhar__menu a,
.acervo-compartilhar__menu button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-color-black-secondary);
    text-align: left;
}

.acervo-compartilhar__menu a:hover,
.acervo-compartilhar__menu button:hover {
    background-color: var(--background-green-light-20);
    color: var(--background-green);
}

.acervo-compartilhar__menu .fa-whatsapp { color: #25d366; }
.acervo-compartilhar__menu .fa-facebook { color: #1877f2; }

.acervo-modal__texto dl {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.acervo-modal__texto dt {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--background-green-light);
    margin-bottom: 2px;
}

.acervo-modal__texto dd {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
}

.acervo-modal__descricao dd {
    white-space: pre-line;
}

/* Registro N.º: última informação, discreta */
.acervo-modal__registro {
    margin: 24px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--background-black-25);
    font-size: .8rem;
    color: var(--text-color-black-secondary);
    opacity: .7;
}

.acervo-modal__fechar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background-color: var(--background-white);
    color: var(--text-color-black);
    font-size: 1.2rem;
    box-shadow: var(--shadow-primary);
    cursor: pointer;
}

.acervo-modal__fechar:focus-visible {
    outline: 3px solid var(--background-green-light);
}

/* ---------- Responsivo ---------- */
@media (min-width: 992px) {
    .acervo-filtros__busca {
        flex-basis: 320px;
        flex-grow: 2;
    }
}

@media (max-width: 767px) {
    .acervo-filtros {
        padding: 16px;
    }

    .acervo-filtros__acoes,
    .acervo-filtros__acoes .acervo-btn {
        width: 100%;
    }

    .acervo-modal__conteudo {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .acervo-modal__imagem img {
        max-height: 55vh;
    }

    .acervo-modal__texto {
        overflow: visible;
        padding: 24px 20px;
    }
}
