:root {
    --main-color: #ce3d22;
    --topbar-bg: #fff;
    --topbar-text-color: #ce3d22;
    --topbar-text-color-hover: rgba(255, 255, 255, 0.4);
    --topbar-picto-background: #ce3d22;
    --outils-bg: #ce3d22;
    --sommaire-bg: #5d0815;
    --sommaire-h2-color: #fff;
    --sommaire-title-color: #ce3d22;
    --sommaire-title-after-color: #bddbd4;
    --sommaire-a-color: #252323;
    --sommaire-a-hover-color: linear-gradient(90deg, rgba(206, 61, 34, 0.3) 0%, rgba(206, 61, 34, 0.3) 100%);
    --bottom-page-number-bg: #ce3d22;
    --bottom-page-number-color: white;
    --filter-bg: rgba(0, 0, 0, 0.7);
    --share-text-color: white;
    --share-svg-color: white;
    --share-cross-color: white;
    --scrollbar-bg: linear-gradient(180deg, #ce3d22 0%, #ce3d22 100%);
    --new-tag-bg: white;
    --new-tag-color: white;
}

@font-face {
    font-family: 'Museo Sans';
    src: url('../fonts/MuseoSans-500.woff2') format('woff2'), url('../fonts/MuseoSans-500.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Museo Sans';
    src: url('../fonts/MuseoSans-700.woff2') format('woff2'), url('../fonts/MuseoSans-700.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Museo Sans';
    src: url('../fonts/Museo500-Regular-webfont.woff2') format('woff2'), url('../fonts/Museo500-Regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Museo Sans';
    src: url('../fonts/Museo700-Regular-webfont.woff2') format('woff2'), url('../fonts/Museo700-Regular-webfont.woff2') format('woff');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Museo Sans';
}

h1 {
    margin-block: 0;
    font-size: 1.4rem;
    margin-left: 30px;
}

img {
    image-rendering: -webkit-optimize-contrast;
    will-change: transform;
}

.logo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 160px;
    object-fit: cover;
}

#topbar {
    background: var(--topbar-bg);
    padding: 17px 20px;
    color: var(--topbar-text-color);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 3px 10px rgb(0 0 0 / 16%);
    z-index: 10;
}

#canvas {
    max-width: calc(100vw - 300px);
    margin-left: auto;
    /* background: #ececec; */
}

#topbar #logo {
    height: 35px;
    margin-left: 20px;
}

@media only screen and (max-width: 1650px) {
    #topbar #logo {
        height: 22px;
    }
}

#topbar .left-part {
    display: flex;
    align-items: center;
    gap: 10px;
}

#topbar .right-part {
    display: flex;
    align-items: center;
    gap: 10px;
}

#topbar .picto {
    background: var(--topbar-picto-background);
    height: 47px;
    width: 47px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#topbar .picto:hover {
    transform: scale(1.1);
}

#topbar .picto svg {
    width: 25px;
    height: 25px;
}

@media only screen and (max-width: 1650px) {
    #topbar .picto {
        width: 35px !important;
        height: 35px !important;
    }

    #topbar .picto svg {
        width: 20px !important;
        height: 20px !important;
    }
}

#topbar .picto#menu-btn,
#topbar .picto#close-btn {
    display: flex;
    justify-content: center;
    align-items: center;
}

#topbar .picto#close-btn {
    display: none;
}

@media only screen and (min-width: 1650px) {
    #topbar .picto#menu-btn {
        display: none;
    }
}

#topbar #menu {
    display: flex;
    gap: 5px;
    align-items: center;
}

#topbar #menu a {
    color: var(--topbar-text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s;
    padding: 6px 18px;
    border-radius: 10px;
}

#topbar #menu a.active,
#topbar #menu a:hover {
    background: var(--topbar-text-color-hover);
}

@media only screen and (max-width: 1650px) {
    #topbar #menu {
        display: none;
        position: absolute;
        top: 69px;
        left: 0;
        right: 0;
        background: var(--topbar-bg);
        z-index: 10;
    }

    #topbar #menu a {
        display: block;
        margin: 10px 0;
    }
}

#outils {
    position: absolute;
    top: 59px;
    right: 15px;
    text-align: center;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    z-index: 2;
    background: var(--outils-bg);
    padding: 10px;
}

#outils span {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    font-family: inherit;
}

#outils span:hover svg {
    transition: 0.3s;
    transform: scale(1.2);
}

#outils svg {
    transition: 0.3s;
    width: 20px;
    height: 20px;
}

.section-right {
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: center;
    justify-content: center;
    position: relative;
}

#sommaire {
    display: flex;
    flex-direction: column;
    width: 300px;
    max-width: 300px;
    max-height: calc(100vh - 81px);
    min-height: calc(100vh - 81px);
    background: var(--sommaire-bg);
    gap: 2px;
    clip-path: inset(0px -15px 0px 0px);
    transition: 0.5s;
    transform: translateX(-100%);
    overflow-y: scroll;
}

::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: #5d0815;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-bg);
    opacity: 0.9;
}
::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

#sommaire.active {
    transform: translateX(0);
}

#sommaire h2 {
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--sommaire-h2-color);
    font-weight: 600;
    margin-top: 30px;
    font-family: inherit;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
}

#sommaire .dropdown {
    position: relative;
    background: white;
    margin-inline: 10px;
}

#sommaire .dropdown:not(:first-of-type) {
    /* margin-top: 20px; */
}

#sommaire .dropdown:last-of-type {
    /* padding-bottom: 20px; */
}

#sommaire .dropdown-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    color: var(--sommaire-title-color);
    padding: 10px;
    font-size: 16px;
    line-height: 18px;
    font-weight: 600;
    transition: 0.3s;
    text-align: left;
    cursor: pointer;
}

#sommaire .dropdown-title svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    transition: 0.15s;
    cursor: pointer;
}

#sommaire .dropdown-content {
    display: none;
    position: absolute;
    z-index: 1;
}

#sommaire .dropdown.active {
    padding-bottom: 5px;
}

#sommaire .dropdown.active .dropdown-title svg {
    rotate: 90deg;
}

#sommaire .dropdown.active .dropdown-content {
    display: block;
    position: relative;
}

#sommaire span.title:not(:first-of-type) {
    margin-top: 16px;
}

#sommaire span.title::after {
    content: '';
    height: 3px;
    width: 100%;
    background: var(--sommaire-title-after-color);
    position: absolute;
    bottom: 0;
    left: 0;
    margin-left: 10px;
}

#sommaire a {
    font-family: inherit;
    color: var(--sommaire-a-color);
    padding: 8px 10px;
    text-decoration: none;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    transition: 0.3s;
    margin: 0 10px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

#sommaire a:hover {
    background: var(--sommaire-a-hover-color);
    /* border-radius: 10px; */
}

span.new {
    width: fit-content;
    position: relative;
    color: var(--new-tag-color);
    padding: 1px 5px;
    font-size: 9px;
    margin-right: 8px;
}

span.new::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--new-tag-bg);
    z-index: -1;
}

#sommaire a span.page {
    min-width: 38px;
    text-align: right;
}

#pages-container {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50px);
    font-family: inherit;
    user-select: none;
}

#pages-container #max-pages {
    font-weight: bold;
}

#page {
    background: var(--bottom-page-number-bg);
    color: var(--bottom-page-number-color);
    border: none;
    border-radius: 20px;
    width: 60px;
    text-align: center;
    padding: 5px 10px;
}

#filter {
    display: none;
    height: 100%;
    width: 100%;
    background: var(--filter-bg);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

#partage {
    position: absolute;
    display: flex;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 50px;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
}

#partage .share {
    font-family: inherit;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--share-text-color);
    text-decoration: none;
}

#partage .share svg {
    width: 75px;
    height: 75px;
    fill: var(--share-svg-color);
}

#partage .cross {
    position: absolute;
    width: 25px;
    height: 25px;
    right: -50px;
    top: -50px;
    cursor: pointer;
    fill: var(--share-cross-color);
}

.magazine {
    cursor: zoom-in;
}

.magazine.zoom {
    cursor: zoom-out;
}

.magazine .next-button svg,
.magazine .previous-button svg {
    color: var(--main-color);
}

@media screen and (max-width: 1100px) {
    #topbar {
        align-items: center;
        gap: 10px;
    }

    .logo {
        left: 50%;
        transform: translateX(-50%);
    }

    .section-right {
        grid-template-columns: 1fr;
        height: calc(100vh - 78px);
    }

    #sommaire {
        position: absolute;
        width: 100%;
        max-width: 100%;
        z-index: 2;
        transform: translateX(0);
        min-height: 100%;
        max-height: 100%;
    }

    #sommaire.active {
        transform: translateX(-100%);
    }

    #outils {
        padding: 0;
        width: 100%;
        left: 0;
        right: initial;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        top: 90px;
    }

    #outils span {
        font-size: 12px;
    }

    #outils svg {
        width: 25px;
        height: 25px;
    }

    #outils #zoom {
        display: none;
    }

    #partage {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .magazine-viewport .container {
        position: relative;
    }

    .magazine-viewport .next-button,
    .magazine-viewport .previous-button {
        width: 25px !important;
        height: 25px !important;
    }

    #canvas .magazine-viewport .next-button.mobile,
    #canvas .magazine-viewport .previous-button.mobile {
        display: flex !important;
        width: fit-content !important;
        gap: 15px;
        justify-content: flex-end;
        top: -30px;
    }

    #canvas .magazine-viewport .next-button.mobile svg,
    #canvas .magazine-viewport .previous-button.mobile svg {
        margin-top: 0;
    }

    .magazine-viewport .next-button {
        right: 0 !important;
    }

    .magazine-viewport .previous-button {
        left: 0px !important;
    }
}

@media screen and (min-width: 700px) {
    #outils svg {
        width: 20px;
        height: 20px;
    }
}

.event-dbclick {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1000;
}
