/* === Estils Crònica Breu - ESCRIPTORI === */

#wrapper {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

#sidebar-wrapper {
    width: 280px;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: 0;
    left: 0;
    background-color: white;
    transition: margin-left 0.3s ease;
    z-index: 1000;
}

#wrapper #page-content-wrapper {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: -280px;
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 48px;
}


/* === Detalls visuals === */

.chapter-title:not(:first-of-type) {
    margin-top: 1rem !important;
}

.sidebar-subchapter {
    padding-left: 25px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 0.95em;
    border: none !important;
}

.sidebar-heading {
    height: 100px;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    background-color: #ffffff;
}

.custom-title {
    font-size: 2.5rem;
    line-height: 1.2;
}

.smaller-author {
    font-size: 1rem;
}

.list-group-item.fw-bold {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    background-color: #f8f9fa !important;
    display: block;
    box-sizing: border-box;
}

.list-group-item {
    line-height: 1.3rem !important;
}

#sidebar-wrapper .list-group {
    width: 100% !important;
}

.navbar {
    min-height: 100px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.padding-sides {
    padding-left: 25px;
    padding-right: 25px;
}

.justify-text {
    text-align: justify;
}

/* === Tipografia i espaiat del llibre === */
.padding-sides.justify-text {
    font-size: 1.1rem;
    line-height: 2;
    letter-spacing: 0.015em;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

.padding-sides.justify-text p {
    margin-bottom: 1.75rem;
    margin-top: 0;
}

.padding-sides.justify-text h2 {
    font-size: 1.75rem !important;
    line-height: 1.4 !important;
    margin-top: 3.5rem !important;
    margin-bottom: 2rem !important;
    font-weight: bold !important;
    text-align: center !important;
}

.padding-sides.justify-text h2:first-of-type {
    margin-top: 0 !important;
}

/* Excluir el título de la portada del estilo general */
.padding-sides.justify-text h2.book-cover-title {
    font-size: 2.5rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
}

.padding-sides.justify-text h3 {
    font-size: 1.35rem;
    line-height: 1.5;
    margin-top: 3rem;
    margin-bottom: 2.5rem;
    font-weight: bold;
    text-align: center;
}

/* Estilo para el subtítulo del resumen crítico - mismo tamaño que h3 */
.padding-sides.justify-text > div > p.fw-bold.text-center {
    font-size: 1.35rem !important;
    line-height: 1.5 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* Portada del llibre - Disseny tipogràfic */
@font-face {
    font-family: 'Cinema Sunday';
    src: url('../assets/fonts/CinemaSunday.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.book-cover-text {
    background: white;
    padding: 1.5rem 2rem;
    margin: 1rem auto 2rem;
    max-width: 500px;
    text-align: center;
    font-family: inherit;
    color: #000;
    border: 1px solid transparent;
}

.book-cover-author {
    display: none;
}

.book-cover-title {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.75rem;
    text-align: center;
}

.book-cover-title-line2 {
    display: block;
    margin-top: 0.3em;
}

.book-cover-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.6;
    margin-top: 1rem;
}

.book-cover-subtitle-line {
    display: block;
}

/* Portada: imagen (título) + subtítulo - alineada con la columna del libro */
.book-cover-image-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 56rem;
    margin: 1.5rem auto 1.5rem;
    padding: 0;
    text-align: center;
}

.book-cover-image-wrap img {
    box-sizing: border-box;
    max-width: 100%;
    width: 380px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.book-cover-image-wrap .book-cover-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.6;
    margin-top: 1rem;
    margin-bottom: 0;
    max-width: 100%;
}

.book-cover-image-wrap .book-cover-subtitle-line {
    display: block;
}

@media (max-width: 768px) {
    .book-cover-image-wrap img {
        width: 280px;
        max-width: 100%;
    }
    .book-cover-image-wrap .book-cover-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .book-cover-image-wrap img {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .book-cover-text {
        padding: 2rem 1.5rem;
        margin: 1.5rem auto 2rem;
    }
    .book-cover-title {
        font-size: 2rem;
    }
    .book-cover-author {
        font-size: 0.75rem;
    }
    .book-cover-subtitle {
        font-size: 1rem;
    }
}

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

#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: none; /* ocult per defecte */
}


@media (max-width: 768px) {

    #wrapper {
        overflow-x: hidden;
        display: block;
        min-height: 100vh;
        position: relative;
    }
	
	#sidebar-wrapper {
        width: 250px;
        position: fixed;
        top: 0;
        height: 100vh;
        z-index: 1000;
    }
	
    #wrapper.toggled #sidebar-wrapper {
        left: 0;
    }

    #page-content-wrapper {
        margin-left: 0 !important;
        width: 100%;
        /* padding-left: 1rem; */
        /* padding-right: 1rem; */
    }

    #sidebarToggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1100;
    }

    .custom-title {
        text-align: center;
        font-size: 2rem;
        margin: 0.5rem auto 0;
    }

    .language-selector {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .language-selector select {
        margin: 0 auto;
    }
	
	.container-fluid.d-flex.flex-wrap {
        flex-direction: column;
        align-items: center !important;
    }

    .left-side {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .center-title {
        order: 2;
        width: 100%;
        text-align: center;
        margin-top: 1rem;
    }

    .language-selector {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }


}

