:root {
    --color-aba-1: #5f2323;
    --color-aba-2: #732a2a;
    --color-aba-3: #873333;
    --color-aba-4: #a54444;
    --color-aba-5: #c06666;
    --color-cinza-1: #303030;
    --color-cinza-2: #606060;
    --color-cinza-3: #a0a0a0;
    --color-cinza-4: #d0d0d0;
    --color-cinza-5: #f0f0f0;
    --color-white: #ffffff;
    --color-dark: #000000;
}

body {
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    background-image: url("../../../public/assets/images/background-full.jpg");
}

a:link {
    color: var(--color-aba-1);
    text-decoration: none;
}

a:hover {
    color: var(--color-cinza-2);
}

a:visited {
    color: var(--color-aba-1);
}

.card {
    box-shadow: 0 4px 6px var(--color-cinza-3);
    border: 1px solid transparent;
    border-radius: 5px;
    transition: transform 0.3s, box-shadow 0.3s;
}

#top-portal {
    border-bottom: 3px solid var(--color-aba-1);
}

/* Redes sociais - Início */
a.icon-sm {
    color: var(--color-cinza-1);
    padding: 0px 5px;
}

a.icon-sm:hover {
    color: var(--color-cinza-3);
}

/* Redes sociais - Fim */

/* Menu navbar - Início */
/* Logo fixo à esquerda sem atrapalhar a centralização */
.navbar .logo {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* Espaço extra para não colidir mobile com o logo */
@media (max-width: 991px) {
    .navbar .navbar-toggler {
        margin-left: auto;
    }
}

/* Links do menu */
.navbar .nav-link {
    position: relative;
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: color .2s ease-in-out;
    color: var(--color-cinza-1);
}

.navbar .nav-link:hover {
    font-weight: 400;
    border-radius: 8px;
    background: var(--color-cinza-5);
}

.dropdown-menu {
    border-radius: 0.5rem;
    padding: 0.4rem 0;
    width: 320px;
    box-shadow: 0 6px 15px var(--color-cinza-3);
    border: none !important;
    margin-top: 0.3rem;
    overflow: hidden;
}

.dropdown-menu .dropdown-item {
    position: relative;
    /* necessário para o ::after posicionar corretamente */
    overflow: hidden;
    /* opcional, evita artefatos */
    color: var(--color-cinza-1);
}

.dropdown-menu .dropdown-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    /* grossura da linha */
    width: 0;
    background: var(--color-cinza-4);
    /* herda a cor do texto */
    transition: width 0.8s ease;
    /* “de forma lenta”: ajuste 0.8s para mais lento ou 1s+ */
}

.dropdown-menu .dropdown-item:hover {
    font-weight: 600;
}

.dropdown-menu .dropdown-item:hover::after {
    width: 100%;
    /* traça da esquerda para a direita */
}

/* Ajuste da collapse para manter centralizado mesmo com logo absoluto */
.navbar-collapse {
    flex: 1 1 auto;
}

/* Mobile: fundo leve no menu colapsado para separação visual */
@media (max-width: 991px) {
    .navbar-collapse {
        background: #fff;
        margin-top: .5rem;
        padding: .75rem 1rem;
        border-radius: .5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    }
}

/* Menu navbar - Fim */

/* No mobile, reverte para fluxo normal para que o logo não sobreponha o toggler */
@media (max-width: 991px) {
    .navbar .logo {
        margin-top: 30px;
        position: static;
        margin-right: auto;
    }
}

/* Menu navbar - Fim */

.hero-section {
    background: linear-gradient(135deg, var(--color-aba-1), #34495e);
    color: white;
    padding: 5rem 0;
    margin-bottom: 3rem;
}

/* Título de sessão - Início */
h2.section-title {
    position: relative;
    margin-bottom: 2.5rem;
    color: var(--color-aba-1);
    font-weight: 600;
}

h5.section-title {
    position: relative;
    color: var(--color-aba-1);
    font-weight: 600;
}

h2.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background-color: var(--color-aba-2);
}

h2.section-title-small {
    position: relative;
    color: var(--color-aba-1);
    font-weight: 600;
}

/* Título de sessão - Fim */

/* Índices link - Início */
a.link-index {
    color: var(--color-cinza-1);
    text-decoration: none;
    font-weight: 600;
    padding: 2px 6px;
}

a.link-index:hover {
    text-decoration: underline;
    font-weight: 500;
    color: var(--color-cinza-3);
}

.link-index.disabled {
    pointer-events: none;
    cursor: default;
    color: red;
    text-decoration: none;
    opacity: 0.6;
}

/* Índices link - Fim */

/* Sessão de destaques :: Home - Início */
.book-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 10px 5px;
    background-color: var(--color-white);
    box-shadow: var(--box-shadow);
    transition: var(--transition-full);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card img {
    box-shadow: 0 10px 20px var(--color-cinza-2);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--color-cinza-1);
}

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

.book-cover {
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
    cursor: pointer;
    float: left;
}

.book-title {
    height: 90px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-book-cover {
    max-height: 300px;
    object-fit: contain;
    box-shadow: 0 10px 20px var(--color-cinza-2);
}

.view-book-cover {
    box-shadow: 0 10px 20px var(--color-cinza-2);
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

/* Para celulares pequenos (até 480px) */
@media (max-width: 480px) {
    .view-book-cover {
        max-width: 100%;
        float: none;
    }
}

.modal-body {
    font-size: 0.9rem;
}

/* Sessão de destaques :: Home - Fim */

/* Sessão de downloads - Início */
.book-download {
    font-size: 0.9rem;
}

/* Sessão de downloads - Fim */

/* Botões - Início */
.btn-primary {
    font-size: 0.8rem;
    border: 1px solid var(--color-aba-1);
    background-color: var(--color-aba-1);
    color: var(--color-white);
    padding: 5px 15px;
    border-radius: 2px;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.5s;
}

.btn-primary:hover {
    background-color: var(--color-aba-3);
    box-shadow: 0px 5px 10px var(--color-cinza-2);
    transform: translateY(-2px);
    /* opcional: dá um efeito "levantar" */
}

/* Botões - Fim */

/* Botão Download - Início */
a.btn-download {
    text-decoration: none;
    display: inline-block;
    padding: 10px 0px;
    font-weight: 600;
    text-transform: uppercase;
}

a.btn-download:hover {
    color: var(--color-aba-2);
}

a.btn-download:visited {
    color: var(--color-aba-1);
}

a.btn-download-null {
    text-decoration: none;
    display: inline-block;
    padding: 10px 0px;
    font-weight: 600;
    pointer-events: none;
    color: red;
    font-style: italic;
}

/* Botão Download - Fim */

/* Card de evento com altura mínima e layout flexível */
.evento-card {
    min-height: 380px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-title {
    font-weight: 500;
    text-align: center;
    line-height: 18px;
}

/* Imagem com corte proporcional */
.evento-card img {
    max-height: auto;
    object-fit: cover;
    width: 100%;
}

/* Corpo do card se expande */
.evento-card .card-body {
    flex-grow: 1;
    height: 130px;
}

/* Rodapé centralizado */
.evento-card .card-footer {
    text-align: center;
    padding-top: 0.5rem;
    background-color: var(--color-white);
}

/* Efeito ao passar o mouse */
.evento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--color-cinza-1);
    cursor: pointer;
}

.evento-card:hover img {
    filter: brightness(0.95);
}

footer {
    background-color: #e6e6e6;
    padding: 2rem 0;
    margin-top: 3rem;
    box-shadow: 0 4px 12px var(--color-cinza-4);
}

footer .main {
    padding: 10px 80px;
    line-height: 20px;
}

footer h5 {
    color: var(--color-cinza-2);
}

footer h6 {
    color: var(--color-cinza-2);
}

footer p {
    color: var(--color-cinza-2);
}

footer ul.list-unstyled li a {
    color: var(--color-cinza-2);
}

footer ul.list-unstyled a:hover {
    color: var(--color-aba-1)
}

footer hr {
    border-color: var(--color-cinza-3);
}

footer ul.list-unstyled li {
    color: var(--color-cinza-2);
    line-height: 20px;
    font-size: 0.9rem;
}

footer socialMediaall {
    color: var(--color-cinza-2);
    font-size: 0.8rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-aba-2);
    border: none;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-cinza-2);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--color-cinza-2);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top i {
    transition: transform 0.2s;
}

.back-to-top:hover i {
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }

    .book-cover-container {
        height: 180px;
    }

    .book-cover {
        max-height: 180px;
    }

    .mega-menu {
        width: 100%;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    footer {
        text-align: center;
        padding: 10px 5px;
    }
}

/* Página de publicação - Início */
.chapter-item {
    position: relative;
    padding: 0.5rem 0;
    border-bottom: none;
}

.chapter-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-aba-1);
    transition: width 0.3s ease;
}

.chapter-item:hover::after {
    width: 100%;
}

.chapter-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-cinza-4);
    transition: margin-left 0.3s ease;
}

.chapter-group {
    margin-bottom: 1rem;
}

.chapter-sub-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-cinza-1);
    border-left: 2px solid var(--color-aba-1);
    padding-left: 10px;
}

.chapter-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-cinza-5);
    transition: margin-left 0.3s ease;
}

.chapter-item.with-subtitle {
    margin-left: 30px;
}

.chapter-item.no-subtitle {
    margin-left: 0;
}

.chapter-title {
    font-size: 1rem;
    font-weight: 500;
}

.chapter-authors {
    font-size: 0.9rem;
    color: var(--color-cinza-2);
}

#icon-chapter {
    margin-right: 5px;
}

/* Página de publicação - Início */

/* Fundo da área de conteúdo das tabs */
.tab-content {
    background-color: var(--color-white);
    /* cor clara */
    box-shadow: 0 0 10px var(--color-cinza-2);
    /* sombra suave */
    border-radius: 0 0 8px 8px;
    /* cantos arredondados inferiores */
}

/* Botões das abas */
.nav-tabs .nav-link {
    background-color: var(--color-cinza-4);
    border: 1px solid #dee2e6;
    margin-right: 2px;
    border-radius: 8px 8px 0 0;
    color: var(--color-cinza-1);
    transition: all 0.2s ease-in-out;
}

/* Aba ativa */
.nav-tabs .nav-link.active {
    background-color: var(--color-white);
    border-bottom-color: transparent;
    font-weight: 500;
}

/* Efeito hover */
.nav-tabs .nav-link:hover {
    background-color: var(--color-cinza-3);
    color: var(--color-cinza-5);
    font-weight: 600;
}

/* Lista de eventos - Início */
.evento-titulo {
    color: var(--color-cinza-1);
    font-weight: 600;
}

.data-evento,
.data-publicacao {
    color: var(--color-cinza-2);
    font-size: 0.9rem;
}

/* Lista de eventos - Fim */

/* Diversos - Inicio */
.text-error {
    color: red;
}

.break {
    clear: both;
}

/* Diversos - Fim */

/* Acessibilidade - Início*/
.accessibility-btn {
    position: fixed;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 15%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(66, 153, 225, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-btn:hover {
    background: #3182ce;
    box-shadow: 0 6px 25px rgba(66, 153, 225, 0.6);
}

.accessibility-panel {
    position: fixed;
    top: 50%;
    left: 50px;
    transform: translateY(-50%) translateX(-320px);
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 300px;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    visibility: hidden;
}

.accessibility-panel.active {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    visibility: visible;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #718096;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.accessibility-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.accessibility-option:hover {
    background: #f7fafc;
}

.option-label {
    font-weight: 500;
    color: #4a5568;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #cbd5e0;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #4299e1;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(26px);
}

.font-size-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.font-btn {
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.font-btn:hover {
    background: #cbd5e0;
}

.font-btn.active {
    background: #4299e1;
    color: white;
}

.reset-btn {
    background: var(--color-aba-1);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: var(--color-cinza-4);
    color: var(--color-cinza-1);
}

/* Estados de acessibilidade */
body.high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast .content,
body.high-contrast header {
    background: #1a1a1a !important;
    color: #fff !important;
}

body.high-contrast h1,
body.high-contrast .subtitle {
    color: #fff !important;
}

body.negative-contrast {
    filter: invert(1) hue-rotate(180deg);
}

body.grayscale {
    filter: grayscale(100%);
}

body.light-background {
    background: #f7fafc !important;
    color: #2d3748 !important;
}

body.light-background .content,
body.light-background header {
    background: #ffffff !important;
    color: #2d3748 !important;
}

body.light-background h1,
body.light-background .subtitle {
    color: #2d3748 !important;
}

body.underlined-links a {
    text-decoration: underline !important;
}

body.readable-font {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
}

body.font-size-1 {
    font-size: 0.8em;
}

body.font-size-2 {
    font-size: 0.9em;
}

body.font-size-3 {
    font-size: 1em;
}

body.font-size-4 {
    font-size: 1.1em;
}

body.font-size-5 {
    font-size: 1.2em;
}

body.font-size-6 {
    font-size: 1.3em;
}

body.font-size-7 {
    font-size: 1.4em;
}

body.font-size-8 {
    font-size: 1.5em;
}

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

@media (max-width: 768px) {
    .accessibility-panel {
        width: 280px;
        left: 70px;
        transform: translateY(-50%) translateX(-300px);
        opacity: 0;
        visibility: hidden;
    }

    .accessibility-panel.active {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .accessibility-btn {
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    h1 {
        font-size: 2rem;
    }
}

/* Acessibilidade - Fim */

/** ----------------------------------------------------- */
/* PUBLICAÇÕES EM DESTAQUE */
/** ----------------------------------------------------- */
.carousel-section {
    width: 100%;
}

.carousel-container {
    max-width: 1400px;
    margin: 0 auto;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
}

.carousel-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 10;
    background: var(--color-aba-3);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.carousel-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
}

.book-card-carousel {
    flex: 0 0 calc((100% - 72px) / 4);
    min-width: 0;
}

.book-card-carousel .card-home {
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.book-card-carousel .card-home:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.book-card-carousel .card-body {
    padding: 20px;
    background: white;
}

.book-card-carousel .card-body img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.book-card-carousel .card-home:hover img {
    transform: scale(1.05);
}

.book-card-carousel .card-footer {
    padding: 12px 16px;
    font-size: 14px;
}

.book-card-carousel .book-download {
    font-size: 13px;
}

.book-card-carousel .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.book-card-carousel .read-more-link:hover .arrow {
    transform: translateX(4px);
}

/* Responsividade */
@media (max-width: 1024px) {
    .book-card-carousel {
        flex: 0 0 calc((100% - 48px) / 3);
    }

    .carousel-title {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .book-card-carousel {
        flex: 0 0 calc((100% - 24px) / 2);
    }

    .carousel-button {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .carousel-section {
        padding: 32px 16px;
    }
}

@media (max-width: 480px) {
    .book-card-carousel {
        flex: 0 0 100%;
    }

    .carousel-wrapper {
        gap: 10px;
    }

    .carousel-track {
        gap: 10px;
    }
}