/* ====================================
   Layout wrapper
==================================== */

#content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    max-width: 90%;
    margin: 4em auto 4em auto;
    padding: 0 1em;
    gap: 2em;
}

/* ====================================
   Sidebar
==================================== */

aside,
.translation-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5em;
}

aside {
    position: sticky;
    top: 6em;
    max-height: min(60vh, 500px);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

aside h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.2em;
    margin-bottom: 1em;
    color: #4A5A3D;
}

.toc-scroll {
    position: relative;
    min-height: 0;
    padding-right: 12px;
    overscroll-behavior: contain;
    overflow: hidden;
}

.toc-scroll > ul {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.toc-scroll > ul::-webkit-scrollbar {
    display: none;
}

.faux-scrollbar {
    position: absolute;
    top: 0;
    right: 4px;
    width: 8px;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s;
}

.toc-scroll:hover .faux-scrollbar {
    opacity: 1;
    pointer-events: auto;
}

.faux-scrollbar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 4px;
    bottom: 4px;
    border-radius: 6px;
    background: transparent;
}

.faux-thumb {
    position: absolute;
    left: 1px;
    right: 1px;
    width: auto;
    border-radius: 6px;
    background: rgba(120, 120, 120, 0.9);
    transition: background .12s, opacity .12s;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toc-scroll:hover .faux-thumb {
    background: rgba(100, 100, 100, 0.95);
}

.no-select {
    user-select: none !important;
    -webkit-user-select: none !important;
}

aside li {
    position: relative;
    width: 100%;
    margin-bottom: 0.2em;
}

aside a {
    display: block;
    position: relative;
    padding: 0.3em 3em 0.3em 0.5em;
    color: var(--text);
}

aside a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.1em;
    height: 2px;
    background-color: #2B3D2F;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease, height 0.3s ease, background-color 0.3s ease;
}

aside a:hover::after,
aside a.active::after {
    transform: scaleX(1);
    height: 3px;
    background-color: var(--accent);
}

aside a.active {
    color: var(--accent);
    font-weight: 600;
    background-color: #f3f0e6;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

/* ====================================
   Translation Section
==================================== */

.translations {
    flex: 1;
}

.translation-block {
    padding: 2em;
    display: none;
}

.translation-block.active {
    display: block;
}

.translation-block h3 {
    border-bottom: 1px solid rgba(76, 107, 71, 0.6);
    padding-bottom: 0.3em;
}

.dialogue {
    opacity: 0;
}

.context {
    font-style: italic;
    margin: 1rem 0 0.5rem 0;
}

/* ====================================
   Dialogue boxes
==================================== */

.box {
    padding: 2em 1em;
    background-color: #f3f0e6;
    border-radius: 4px;
    border-left: 4px solid var(--text);
    opacity: 1;
    transition: opacity 0.4s ease;
    text-align: justify;
}

.box p {
    margin-bottom: 1.5rem;
}

.box p:last-child {
    margin-bottom: 0;
}

/* ====================================
   Separator between dialogues
==================================== */

.separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    margin: 3rem 0;
    opacity: 0.8;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1;
    height: 2px;
}

.separator::before {
    background: linear-gradient(to right, transparent, #4C6B47);
}

.separator::after {
    background: linear-gradient(to right, #4C6B47, transparent);
}

.separator span {
    color: #4C6B47;
    font-size: 1.1em;
    transform: translateY(-0.1em);
}