/* Estilos Globais */
:root {
    --primary-color: #c62828;     /* Vermelho escuro */
    --secondary-color: #37474f;   /* Cinza azulado escuro */
    --accent-color: #ff8f00;      /* Laranja */
    --light-bg: #f5f5f5;          /* Fundo claro */
    --dark-bg: #263238;           /* Fundo escuro */
    --text-dark: #212121;         /* Texto escuro */
    --text-light: #ffffff;        /* Texto claro */
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Espaçamento corrigido para o conteúdo principal */
main {
    padding-top: 80px !important; /* Reduzido de 100px para 80px e adicionado !important para sobrescrever estilos inline */
}

/* Regras gerais para imagens */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Forçar redimensionamento para imagens inline */
.publication-item img,
#articles-container img,
.paper-item img,
[class*="paper"] img,
[class*="article"] img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Redimensionamento para imagens nos modais */
#modalArticleImage img,
#modalBookImage img,
#modalPaperImage img,
#modalVideoImage img,
.modal-body img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 400px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

/* Cabeçalho e Navegação */
.navbar {
    background-color: var(--secondary-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 60px;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
}

.dropdown-item:hover {
    background-color: rgba(198, 40, 40, 0.1);
    color: var(--primary-color);
}

/* Seção Hero */
.hero {
    padding: 5rem 0;
    background-color: var(--light-bg);
    position: relative;
}

.hero h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero .lead {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero img {
    border: 5px solid #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #b71c1c;
    border-color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Seções de Conteúdo */
section {
    padding: 4rem 0;
}

section h2 {
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

section h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Estilos para os Destaques na Página Principal */
.featured {
    background-color: var(--light-bg);
    padding: 4rem 0;
}

.featured .card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

.featured .card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
    z-index: 2;
}

.featured .card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.featured .card-img-container {
    height: 200px;
    overflow: hidden;
    position: relative;
}

/* Estilos específicos para orientação de imagens */
.featured .vertical-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 240px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px 8px 0 0;
}

.featured .vertical-image {
    height: 100%;
    width: auto !important;
    max-height: 100%;
    max-width: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.featured .card:hover .vertical-image {
    transform: scale(1.08);
}

.featured .horizontal-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.featured .horizontal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured .square-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    overflow: hidden;
}

.featured .square-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured .destaque-img {
    transition: transform 0.5s ease;
}

.featured .card:hover .destaque-img {
    transform: scale(1.05);
}

.featured .card-body {
    padding: 1.5rem;
}

.featured .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.featured .destaque-descricao {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.featured .vertical-container + .card-body .destaque-descricao {
    -webkit-line-clamp: 2; /* Menos linhas para cards com imagens verticais */
}

.featured .card:hover .card-title {
    color: var(--accent-color);
}

.featured .btn-primary {
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.featured .card:hover .btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.hover-shadow:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-8px);
}

/* Placeholders de imagem para modais */
.no-image-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border-radius: 0.5rem;
    color: #aaa;
    padding: 2rem;
    margin-bottom: 1rem;
}

.no-image-placeholder i {
    font-size: 3rem;
}

.card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Seção de Publicações */
.publications .card {
    background-color: #fff;
}

.list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem;
    transition: background-color 0.3s ease;
}

.list-group-item:hover {
    background-color: rgba(198, 40, 40, 0.05);
}

/* Rodapé */
footer {
    background-color: var(--dark-bg) !important;
    color: var(--text-light);
}

footer h5 {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0 1rem;
}

footer .fas {
    color: var(--accent-color);
}

/* Responsividade */
@media (max-width: 992px) {
    .navbar-collapse {
        background-color: var(--secondary-color);
        padding: 1rem;
        border-radius: 0.25rem;
        margin-top: 0.5rem;
    }
    
    .hero {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero img {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .lead {
        font-size: 1.2rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .featured .card-img-container,
    .featured .horizontal-container,
    .featured .square-container {
        height: 180px;
    }
    
    .featured .vertical-container {
        height: 220px;
    }
    
    .featured .card-body {
        padding: 1.25rem;
    }
    
    .featured .card-title {
        font-size: 1.1rem;
    }
    
    .publication-item img, 
    #articles-container img,
    .paper-item img,
    [class*="paper"] img,
    [class*="article"] img {
        max-width: 100% !important;
    }
    
    .book-card img,
    .book-cover {
        max-height: 250px;
        margin: 0 auto 1rem;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero .btn {
        display: block;
        width: 100%;
    }
    
    .featured .card-img-container,
    .featured .horizontal-container,
    .featured .square-container {
        height: 160px;
    }
    
    .featured .vertical-container {
        height: 200px;
    }
    
    footer .col-md-4 {
        margin-bottom: 2rem;
    }
}

/* Estilos para páginas internas */
.page-header {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--accent-color);
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.8);
}

/* Estilos para listas de publicações */
.publication-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.publication-item:last-child {
    border-bottom: none;
}

.publication-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.publication-meta {
    color: #757575;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.publication-meta span {
    margin-right: 1rem;
}

.publication-meta i {
    margin-right: 0.25rem;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pdf-link:hover {
    color: #b71c1c;
}

.pdf-link i {
    margin-right: 0.5rem;
}

/* Estilos para a página de contato */
.contact-info {
    margin-bottom: 2rem;
}

.contact-info i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 1rem;
    width: 30px;
    text-align: center;
}

.map-container {
    height: 400px;
    margin-bottom: 2rem;
}

.contact-form label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(198, 40, 40, 0.25);
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Botão Voltar ao Topo */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    text-align: center;
    line-height: 45px;
    padding: 0;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* Estilos para redes sociais */
.btn-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.btn-social:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Estilos para accordions */
.accordion-button:not(.collapsed) {
    background-color: rgba(198, 40, 40, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(198, 40, 40, 0.25);
    border-color: rgba(198, 40, 40, 0.5);
}

/* Estilos para opacidade inicial de elementos com fade-in */
.opacity-0 {
    opacity: 0;
}

.visible {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Dimensões específicas para imagens por tipo de página */
.publication-item img, 
#modalArticleImage img,
.card-img-top,
[class*="artigos"] .card img,
[class*="artigo"] img,
.paper-item img,
#modalPaperImage img,
[class*="papeis"] img,
.book-card img,
#modalBookImage,
[class*="livros"] img,
[class*="livro"] img {
    width: 150px;
    height: 225px;  /* Resolução para artigos, papéis e agora também livros */
    object-fit: cover;
    aspect-ratio: 2/3;
    display: block;
    margin: 0 auto;
}

/* Correção específica para as imagens na página de artigos técnicos */
.artigos-tecnicos img,
[class*="artigo"] img {
    width: 150px !important;
    height: 225px !important;
    object-fit: cover !important;
    display: block;
    margin: 0 auto;
}

/* Correção específica para as imagens na página de papéis técnicos */
.papeis-tecnicos img,
[class*="papel"] img,
.papers img {
    width: 150px !important;
    height: 225px !important;
    object-fit: cover !important;
    display: block;
    margin: 0 auto;
}

/* Estilos para posicionar o rodapé na parte inferior */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Adiciona espaçamento mínimo entre o conteúdo e o rodapé */
section.py-5 {
    min-height: 70vh;
}

/* Estilos para parceiros e logos */
.card a img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* Contentor específico para logótipos de parceiros */
.parceiros-logo {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.parceiros-logo img {
    max-width: 100%;
    width: auto;
    height: auto;
}

/* Força dimensões específicas para imagens de livros */
.books-container img,
.book-item img,
.book-cover img,
[class*="livro"] img,
div.book-card img,
.books img,
img.book-img,
.publication-item.book img {
    width: 150px !important;
    height: 225px !important;  
    object-fit: cover !important;
    aspect-ratio: 2/3 !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Corrige páginas específicas que podem ter sobrescrições */
body .book img, 
body [class*="books"] img {
    max-width: 150px !important;
    max-height: 225px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Estilos para o rodapé centralizado */
footer.bg-dark {
    text-align: center;
}

footer.bg-dark ul.list-unstyled {
    display: inline-block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

footer.bg-dark ul.list-unstyled li {
    text-align: center;
}

footer.bg-dark .col-md-4,
footer.bg-dark .col-md-6 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Melhorias para o lightbox (imagens ampliadas) */
.lb-outerContainer, .lb-image {
    max-width: 90vw !important;
    max-height: 80vh !important;
    width: auto !important;
    height: auto !important;
}

.lb-image {
    max-height: 75vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.lightbox .lb-image {
    border: 10px solid white;
    border-radius: 5px;
}

/* Correção da barra branca na galeria - controles de imagem em tela cheia */
.lb-dataContainer {
    width: 100% !important;
    max-width: 90vw !important;
    padding-top: 10px;
    margin: 0 auto !important;
    position: relative !important;
    text-align: center !important;
}

.lb-closeContainer {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
}

/* Posicionamento do botão de fechar (cruz) */
.lb-close {
    position: fixed !important;
    top: 20px !important;
    right: 50% !important;
    transform: translateX(50%) !important;
    z-index: 9999 !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
}

.lb-close:hover {
    opacity: 1 !important;
}

#lightbox {
    width: 100% !important;
    text-align: center;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.lb-outerContainer {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: transparent !important;
    box-shadow: none !important;
    margin: 0 auto !important;
}

.lb-container {
    padding: 0 !important;
}

.lightboxOverlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
    z-index: 9999 !important;
}

/* Estilo para o título/legenda da imagem */
.lb-data .lb-caption {
    font-size: 16px !important;
    font-weight: normal !important;
    color: white !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
    position: fixed !important;
    bottom: 20px !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 20px !important;
}

.lb-data .lb-number {
    display: block !important;
    text-align: center !important;
    margin: 0 auto !important;
    position: fixed !important;
    bottom: 50px !important;
    left: 0 !important;
    right: 0 !important;
    color: #999 !important;
} 