*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --border-color:       #99908c;
    --bg-page:            whitesmoke;
    --bg-tab-active:      #e4e2da;
    --bg-tab-inactive:    #e4e2da;
    --bg-tab-sub:         #b9bdc2;
    --bg-tab-sub-active:  #b9bdc2;
    --bg-inset:           #ffffff;
    --bg-inset-header:    #e4e2da;
    --text-main:          #2a2a2a;
    --text-muted:         #777;
    --box-shadow:         0 0 30px #303030;
    --font-body:          Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    --content-width:      710px;
    --tab-width:          110px;
    --tab-gap:            4px;
}

body {
    background-image: url("img/bg.jpg");
    background-size: cover;        
    background-position: center;  
    background-repeat: no-repeat;
    background-attachment: fixed; 
    font-family: var(--font-body);
    font-size: 12.5px;
    line-height: 1.5em;
    color: var(--text-main);
    text-align: justify;
}

a { color: inherit; }
a:hover { font-style: italic; }
h2, h3, h4 { font-weight: bold; }
h2 a, h3 a, h4 a { text-decoration: none; }
img { display: block; max-width: 100%; }

.site-wrapper {
    width: calc(var(--tab-width) + var(--content-width));
    margin: 30px auto 50px auto;
    position: relative;
}

.banner {
    width: var(--content-width);
    margin-left: var(--tab-width);
    border: 4px double var(--border-color);
    border-bottom: none;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background: whitesmoke;
}

.banner img {
    width: 100%;
    display: block;
}

.notebook {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.tab-col {
    width: var(--tab-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--tab-gap);
    position: sticky;
    top: 20px;
    align-self: flex-start;
    padding-top: 8px;
}

.tab-col a {
    display: block;
    text-decoration: none;
    color: var(--text-main);
    border: 4px double var(--border-color);
    border-right: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: -4px 4px 10px rgba(0,0,0,0.35);
    transition: background 0.2s ease;
}

.tab-col a:hover { font-style: italic; }

.tab-col a.tab-main {
    padding: 7px 10px;
    font-size: 11.5px;
    background: var(--bg-tab-inactive);
}

.tab-col a.tab-main:hover:not(.active) {
    background: whitesmoke;
}

.tab-col a.tab-sub {
    padding: 5px 10px;
    font-size: 10.5px;
    background: var(--bg-tab-sub);
    color: #2a2a2a;
    margin-left: 12px;
    width: calc(var(--tab-width) - 12px);
}

.tab-col a.tab-sub:hover:not(.active) {
    background: whitesmoke;
}

.main-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-page);
    border: 4px double var(--border-color);
    padding: 8px;
    position: relative;
    box-shadow: var(--box-shadow);
}

.site-footer {
    width: var(--content-width);
    margin-left: var(--tab-width);
    border: 4px double var(--border-color);
    border-top: none;
    box-shadow: var(--box-shadow);
    background: var(--bg-inset-header);
    padding: 6px 16px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.box {
    background: var(--bg-inset);
    border: 4px double var(--border-color);
    margin-bottom: 10px;
    overflow: hidden;
}

.box:last-child { margin-bottom: 0; }

.box-header {
    background: var(--bg-inset-header);
    border: 4px solid #ffffff;
    border-bottom: none;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .03em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.box-body { padding: 12px 14px;
          
    
    }

.box-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.box-row .box {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
}

.box-row .box.narrow { flex: 0 0 140px; }
.box-row .box.wide   { flex: 2; }

.small {
    font-size: 0.88em;
    color: var(--text-muted);
}

.cf::after { content: ""; display: table; clear: both; }

.scroll-box {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    background: var(--bg-inset);
}

.scroll-box-item {
    background: var(--bg-inset);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    font-size: 11.5px;
}

.note-box {
    border: 4px double var(--border-color);
    background: var(--bg-inset-header);
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 11.5px;
}

.collapsible {
    border: 4px double var(--border-color);
    background: var(--bg-inset-header);
    margin-bottom: 8px;
    overflow: hidden;
}

.collapsible summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 12px;
    background: var(--bg-inset-header);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    font-weight: bold;
}

.collapsible summary::-webkit-details-marker { display: none;
}

.collapsible[open] .arrow { transform: rotate(90deg);
transition: transform 0.2s ease;}

.collapsible .collapsible-body {
    padding: 12px 14px;
    border-top: 2px solid var(--border-color);
    background: var(--bg-inset);
}

        .char-layout {
            display: flex;
            gap: 8px;
            align-items: flex-start;
            margin-bottom: 8px;
        }

        /* left: stacked text section boxes */
        .char-sections {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .char-sections .box {
            margin-bottom: 0;
        }

        /* right: infobox column, fixed width */
        .char-infobox-col {
            width: 210px;
            flex-shrink: 0;
        }

        /* ---- infobox ---- */
        .char-box {
            background: var(--bg-inset);
            border: 4px double var(--border-color);
            font-size: 0.88em;
            line-height: 1.4em;
            width: 100%;
        }

        .char-name {
            text-align: center;
            font-weight: bold;
            padding: 7px 8px;
            background: var(--bg-inset-header);
            border-bottom: 1px solid var(--border-color);
            font-size: 1.1em;
            letter-spacing: .02em;
        }

        .char-image {
            width: 100%;
            display: block;
            border-bottom: 1px solid var(--border-color);
        }

        .char-caption {
            text-align: center;
            font-size: 0.85em;
            color: var(--text-muted);
            padding: 4px 6px;
            border-bottom: 1px solid var(--border-color);
            font-style: italic;
            background: var(--bg-inset);
        }

        .char-section {
            text-align: center;
            font-weight: bold;
            padding: 4px 8px;
            background: var(--bg-inset-header);
            border-bottom: 1px solid var(--border-color);
            
            font-size: 0.9em;
            letter-spacing: .03em;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .char-row {
            display: flex;
            border-bottom: 1px solid var(--border-color);
        }

        .char-row:last-child {
            border-bottom: none;
        }

        .char-label {
            width: 40%;
            padding: 4px 6px;
            font-weight: bold;
            border-right: 1px solid var(--border-color);
            background: var(--bg-inset-header);
            flex-shrink: 0;
            word-break: break-word;
        }

        .char-value {
            width: 60%;
            padding: 4px 6px;
            word-break: break-word;
        }

        .char-quote {
            border: 4px double var(--border-color);
            background: var(--bg-inset-header);
            padding: 10px 16px;
            margin-bottom: 8px;
            text-align: center;
            font-style: italic;
            font-size: 1.05em;
            line-height: 1.6em;
        }

        .char-quote .quote-source {
            display: block;
            margin-top: 5px;
            font-size: 0.82em;
            color: var(--text-muted);
            font-style: normal;
            text-align: right;
        }


        .flag {
            display: inline;
            width: 14px;
            height: auto;
            vertical-align: middle;
            margin-right: 2px;
        }
        
.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.divider-gal {
    border: none;
    border-top: 1px solid #858585;
    margin: 4px 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 8px;
    font-size: 10.5px;
    line-height: 1.4em;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-align: left;
    font-style: normal;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

.gallery-art {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
   gap: 4px; 
}

.gallery-art .gallery-item {
    aspect-ratio: 1;
}






.title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}
 
.book-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-color, inherit);
}
 
.words {
    font-size: 12px;
    color: var(--text-muted);
}
 
/* ── Author row: author left, language right ── */
 
.author-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
 
.author {
    font-size: 13px;
    color: var(--text-muted);
}
 
.lang {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}
 
/* ── Footer: badge | divider | dates ── */
 
.bottom {
     display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}
 
 
.badge {
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
 
.dates {
   display: flex;
    gap: 16px;
    justify-content: flex-end;
}
 
.date-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: right;
}
 
.date-key {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    opacity: 0.7;
}
 
.date-val {
    font-size: 13px;
    color: var(--text-color, inherit);
}

.stars {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--star-color, #BA7517);
    font-size: 13px;
    letter-spacing: 1px;
}

.stars img {
    width: 13px;
    height: 13px;
    vertical-align: middle;
}