:root {
    --headerHeight: 60px;
    --sideBarWidth: 100px;
    --sideBarToolsWidth: 65px;
    --articleControlsWidth: 90px;
    --contextualModalWidth: 250px;
    --contextualModalHeight: 95px;
}

*{
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--white) var(--blue);
}

header{
    position: fixed;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    height: var(--headerHeight);
    left: 0;
    top: 0;
    background-color: var(--grey);
    padding: 0 var(--generalSpace);
    z-index: 998;
}

main, footer{
    position: relative;
    width: calc(100% - var(--sideBarWidth));
    left: var(--sideBarWidth);
}

main{
    height: calc(100% - var(--headerHeight));
    top: var(--headerHeight);
    padding: var(--generalSpace) calc(var(--generalSpace) * 6) var(--generalSpace) calc(var(--generalSpace) * 3);
}

#where{
    width: 90%;
    font-size: var(--xsmall);
    font-family: var(--futuraBold);
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Sidebar */
#sidebar-container{
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sideBarWidth);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
}

#sidebar-tools{
    width: var(--sideBarToolsWidth);
    height: 100%;
    background-color: var(--blue);
}

#sidebar-logo{
    width: var(--sideBarToolsWidth);
    background-color: var(--white);
    padding: calc(var(--generalSpace) / 2);
    margin-bottom: var(--generalSpace);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0 0 calc(var(--borderRadius) * 2) calc(var(--borderRadius) * 2);
}

#sidebar-logo img{
    width: 100%;
    height: auto;
}

.sidebar-tool{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: calc(var(--generalSpace) / 3) calc(var(--generalSpace) / 1.2);
    cursor: pointer;
    border-top: solid 1px var(--blueDark);
}

.sidebar-tool:last-child{
    border-bottom: solid 1px var(--blueDark);
}

.sidebar-tool-icon{
    width: 24px;
    height: 24px;
    margin-bottom: calc(var(--generalSpace) / 4);
}

.sidebar-tool-icon img{
    width: 100%;
    height: auto;
}

.sidebar-tool-label{
    color: var(--white);
    font-size: var(--xxsmall);
}

.sidebar-tool:hover{
    background-color: var(--blueDark);
}

#sidebar-handle{
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sideBarToolsWidth));
    height: 20%;
    cursor: pointer;
}

#sidebar-handle img{
    width: 100%;
    height: auto;
}

#muestra {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 150px;
}

.highlight{
	background-color: lightblue;
	font-weight: bold;
}

.oculto{
	display: none;
}

/* PRE Content */
#document-cover{
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: calc(100vh - var(--headerHeight) - var(--generalSpace) * 2);
	margin-bottom: calc(var(--generalSpace) * 4);
}

#document-cover img{
	width: auto;
	height: 100%;
}

#cover-page{
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	width: 100%;
	height: 100vh;
	text-align: center;
	font-weight: bold;
	font-family: var(--futuraBold);
	margin-bottom: calc(var(--generalSpace) * 3);
}

#cover-page-title{
	font-size: x-large;
}

#cover-page-editor{
	font-size: small;
	margin-top: calc(var(--generalSpace) * 1);
}

#legal-page-container{
	margin-bottom: calc(var(--generalSpace) * 3);
}

#legal-page{
	font-size: x-small;
	text-transform: uppercase;
}

#legal-page-title{
	font-weight: bold;
	font-family: var(--futuraBold);
}

#bibliographical_record, #presentation, #observations, #bibliography, #recitals, #signatories{
    padding-top: calc(var(--generalSpace) * 4);
    padding-bottom: calc(var(--generalSpace) * 2);
}

/* Content */
.container_book, .container_tfp {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    min-height: 50vh;
    font-size: var(--xxlarge);
    font-family: var(--futuraBold);
    /* margin-bottom: calc(var(--generalSpace) * 4); */
}

.container_title, .container_thp {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    min-height: 25vh;
    font-size: var(--xlarge);
    font-family: var(--futuraBold);
    /* margin-bottom: calc(var(--generalSpace) * 3); */
}

.container_titleSection, .container_tqp {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    min-height: 12vh;
    font-size: var(--large);
    font-family: var(--futuraBold);
    /* margin-bottom: calc(var(--generalSpace) * 2); */
}

.container_chapter, .container_tep {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    min-height: 6vh;
    font-size: var(--medium);
    font-family: var(--futuraBold);
    /* margin-bottom: calc(var(--generalSpace) * 2); */
}

.container_chapterSection, .container_tsp {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    min-height: 3vh;
    font-family: var(--futuraBold);
    /* margin-bottom: calc(var(--generalSpace) * 2); */
}

.content_container{
    display: flex;
}

.content_container:hover .content_name{
    background-color: var(--blue);
	color: var(--white);
}

.content_container.yellow { background-color: var(--highlightYellow); }
.content_container.green { background-color: var(--highlightGreen); }
.content_container.blue { background-color: var(--highlightBlue); }
.content_container.red { background-color: var(--highlightRed); }
.content_container.orange { background-color: var(--highlightOrange); }

.content_header{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: calc(var(--generalSpace) / 2);
}

.content_controls{
    display: flex;
    justify-content: flex-start;
    width: var(--articleControlsWidth);
    min-height: var(--generalSpace);
    margin-left: calc(var(--generalSpace) / 2);
    /* text-align: center; */
    padding: calc(var(--generalSpace) / 4) 0;
    transition: var(--transitionAll);
}

.content_controls span{
    display: inline-block;
    margin-left: calc(var(--generalSpace) / 4);
    cursor: pointer;
}

.content{
    /* width: calc(100% - var(--articleControlsWidth)); */
    height: 100%;
    padding: calc(var(--generalSpace) / 2);
    overflow-y: auto;
}

.content_name, .result-name{
    display: inline-block;
    padding: calc(var(--generalSpace) / 6) calc(var(--generalSpace) / 4);
    margin-bottom: calc(var(--generalSpace) / 6);
    color: var(--black);
	background-color: var(--blueDarkOpacity3);
    border-radius: calc(var(--borderRadius) / 2);
    font-family: var(--futuraBold);
    /* font-size: var(--xsmall); */
    cursor: pointer;
}

.content_body p, .content_body li, .result-content p, .result-content li{
    text-align: justify;
}

.content_body p:last-child, .content_body li:last-child, .result-content p:last-child, .result-content li:last-child {
    margin-bottom: 0;
}

#document-content{
    position: relative;
}

#no-itas{
    position: absolute;
    width: 100%;
    height: 200px;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    background: rgb(255,255,255);
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(246,246,246,1) 75%);
}

/* Select text styles */
#contextual-modal {
    display: none;
    position: absolute;
    z-index: 1;
    background-color: var(--white);
    width: var(--contextualModalWidth);
    height: var(--contextualModalHeight);
    border-radius: calc(var(--borderRadius));
    box-shadow: 0 8px 6px -6px var(--black);
    overflow: hidden;
    transition: var(--transitionAll);
}

#contextual-modal-close {
    position: absolute;
    top: calc(var(--generalSpace) / 8);
    right: calc(var(--generalSpace) / 2);
    color: #aaa;
    float: right;
    font-size: 20px;
    font-weight: bold;
}

#contextual-modal-content {
    padding: 10px;
}

#contextual-modal-close:hover,
#contextual-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#btn-comment, #btn-bookmark{
    cursor: pointer;
}

#article-btns{
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

#article-btns span{
    margin-right: calc(var(--generalSpace) / 3);
}

#article-btns span:last-child{
    margin-right: 0;
}

#article-highlight-colors{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(var(--contextualModalWidth) - 20%);
    height: 100%;
    margin-bottom: calc(var(--generalSpace) / 2);
}

.highlight-color{
    width: calc(var(--generalSpace) * 1.5);
    height: calc(var(--generalSpace) * 1.5);
    border-radius: calc(var(--borderRadius)) / 2;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transitionAll);
}

.highlight-color.yellow { background-color: var(--highlightYellow); }
.highlight-color.green { background-color: var(--highlightGreen); }
.highlight-color.blue { background-color: var(--highlightBlue); }
.highlight-color.red { background-color: var(--highlightRed); }
.highlight-color.orange { background-color: var(--highlightOrange); }
.highlight-color:hover{ opacity: 1; }

/* Index */
.index-link{
	color: var(--black);
    cursor: pointer;
	transition: var(--transitionAll);
}

.index-link:hover{
	color: var(--blue);
}

.index-link.deep-book, .index-link.deep-tfp{
    font-size: 18px;
    font-weight: bold;
    margin: calc(var(--generalSpace) / 1) 0 calc(var(--generalSpace) / 2) 0;
    padding-bottom: calc(var(--generalSpace) / 4);
    border-bottom: dashed 1px var(--grey);
    text-transform: uppercase;
}

.index-link.deep-book:first-child, .index-link.deep-tfp:first-child{
    margin-top: 0;
}

.index-link.deep-title, .index-link.deep-thp{
    font-size: 17px;
    margin-bottom: calc(var(--generalSpace) / 4);
    padding-left: calc(var(--generalSpace) / 2);
}

.index-link.deep-titleSection, .index-link.deep-tqp{
    font-size: 16px;
    margin-bottom: calc(var(--generalSpace) / 6);
    padding-left: calc(var(--generalSpace) / 1);
}

.index-link.deep-chapter, .index-link.deep-tep{
    font-size: 15px;
    margin-bottom: calc(var(--generalSpace) / 8);
    padding-left: calc(var(--generalSpace) * 1.5);
}

.index-link.deep-chapterSection, .index-link.deep-tsp{
    font-size: 14px;
    margin-bottom: calc(var(--generalSpace) / 10);
    padding-left: calc(var(--generalSpace) * 2);
}

/* Tools */
.style-btn{
    width: auto;
    height: calc(var(--generalSpace) * 2.5);
    display: inline-block;
    padding: calc(var(--generalSpace) / 3);
    border: solid 1px transparent;
    transition: var(--transitionAll);
}

.style-btn:hover{
    border: solid 1px var(--grey);
    box-shadow: 0 8px 6px -6px var(--black);
}

.style-btn:active {
    background-color: var(--grey);
}

/* Search text */
#search-results{
	padding: calc(var(--generalSpace) / 2) 0 0 0;
}

#results-number{
    font-size: 12px;
    text-align: right;
    margin: calc(var(--generalSpace) / 2) 0;
}

.result{
    padding: calc(var(--generalSpace) / 2);
    margin-bottom: calc(var(--generalSpace) / 2);
    border-bottom: solid 1px var(--grey);
    background-color: var(--greyLight);
	cursor: pointer;
	transition: all 0.3s;
}

.result:hover{
    border-bottom: solid 1px var(--greyMedium);
	background-color: var(--grey);
}

.result:last-child{
	border-bottom: none;
    margin-bottom: none;
}

/* Remove handles number input */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Dark mode styles */
.content_name.dark-mode{
    background-color: var(--black);
    color: var(--white);
}
.content_body.dark-mode p, .content_body.dark-mode li, .result-content.dark-mode p, .result-content.dark-mode li{
    color: var(--white);
}
.content_container.green .content_body.dark-mode p, .content_container.green .content_body.dark-mode li, .content_container.green .result-content.dark-mode p, .content_container.green .result-content.dark-mode li{
    color: var(--black);
}
.content_container.yellow .content_body.dark-mode p, .content_container.yellow .content_body.dark-mode li, .content_container.yellow .result-content.dark-mode p, .content_container.yellow .result-content.dark-mode li{
    color: var(--black);
}
#where.dark-mode{
    color: var(--white);
}

@media screen and (max-width: 600px) {
	main{
		height: calc(100% - var(--headerHeight));
        width: 100%;
        left: 0;
		top: var(--headerHeight);
		padding: calc(var(--generalSpace) * 1);
	}
	
	#document-cover img{
		width: 100%;
		height: auto;
	}

    .content_header{
        justify-content: space-between;
    }

    .content_controls{
        justify-content: flex-end;
    }

    #sidebar-container{
        top: unset;
        bottom: 0;
        width: 100%;
        height: 60px;
    }
    
    #sidebar-logo{
        height: 100%;
        border-radius: 0 0 0 0;
        padding: calc(var(--generalSpace) / 4);
    }

    #sidebar-logo img{
        width: auto;
        height: 45px;
    }

    #sidebar-tools{
        display: flex;
        width: 100%;
        height: 60px;
    }

    .sidebar-tool{
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        border-top: none;
        border-bottom: none;
        border-right: solid 1px var(--blueDark);
    }

    .sidebar-tool:last-child{
        border-right: none;
        border-bottom: none;
    }

    .sidebar-tool-icon{
        width: 24px;
        height: 24px;
        margin-bottom: 0;
    }

    #sidebar-handle {
        display: none;
    }
}
