﻿@charset "UTF-8";
/* ***********************************************************************
 *
 *  File:   custom.css
 *
 *  Brief:  Table of contents of the novel: popup tree view (custom.js),
 *          styled like the dictionary TOC. Page, header and typography
 *          come from docs/assets/css/common.css.
 *
 *  Author: Jomar Hønsi, 2026
 *
 * ************************************************************************/

/* The flat list is replaced by the popup tree (custom.js);
keep it hidden so it never flashes, and show it without JavaScript (see osudy_obsah.html)
*/
nav#obsah {
    display: none;
}

nav#obsah ul {
    list-style: none;
    padding-left: 1.2em;
}

nav#obsah>ul {
    padding-left: 0;
}

nav#obsah li.v {
    margin-top: .6em;
    font-weight: bold;
}

/* Sticky header; opaque so the text doesn't show through while scrolling */
header.page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-bottom: 72px;
    background: linear-gradient(var(--bg-header), var(--bg-header)), var(--bg-container);
}

header.page-header .header-title h1 {
    font-size: min(1.65em, 3.15vw);
    white-space: nowrap;
}

@media (max-width: 760px) {
    header.page-header .header-title {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    header.page-header .header-title h1 {
        font-size: min(0.875rem, 3.75vw);
    }
}

/* Keep anchor targets clear of the sticky header (height set by custom.js) */
html {
    scroll-padding-top: calc(var(--osudy-header-h, 150px) + 8px);
}

/* Rule above the TOC launcher */
hr.osudy-toc-rule {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 54px;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border-header);
}

/* TOC launcher: a plain link inside the header, at the bottom, horizontally centred */
button.osudy-toc-btn {
    position: absolute;
    left: 20px;
    bottom: 12px;
    box-sizing: border-box;
    height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    background: var(--header-btn-bg);
    box-shadow: none;
    color: var(--header-btn-fg);
    font-family: var(--main-font);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

/* Current volume/chapter, centred between the TOC launcher and the paragraph navigator */
span.osudy-here {
    position: absolute;
    left: 290px;
    right: 290px;
    bottom: 12px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000;
    font-family: var(--main-font);
    font-size: 16px;
    line-height: 28px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Previous/next newly discovered paragraph, opposite the TOC launcher */
div.osudy-rukopis-nav {
    position: absolute;
    right: 20px;
    bottom: 12px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg-link);
    font-family: var(--main-font);
    font-size: 10px;
    line-height: 12px;
}

div.osudy-rukopis-nav button svg {
    width: 12px;
    height: 12px;
    transition: transform 0.15s;
}

div.osudy-rukopis-nav button {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

div.osudy-rukopis-nav button.prev:hover:not(:disabled) svg {
    transform: translateX(-3px);
}

div.osudy-rukopis-nav button.next:hover:not(:disabled) svg {
    transform: translateX(3px);
}

div.osudy-rukopis-nav button:disabled {
    opacity: 0.3;
    cursor: default;
}

button.osudy-toc-btn:hover,
button.osudy-toc-btn[aria-expanded="true"] {
    background: var(--header-btn-bg-hover);
    box-shadow: var(--header-btn-shadow-hover);
}

/* Positioned by custom.js directly below the header, centred on it */
div.osudy-toc-panel {
    position: fixed;
    transform: translateX(-50%);
    z-index: 29;
    box-sizing: border-box;
    width: min(560px, calc(100vw - 16px));
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px 10px 10px;
    background-color: var(--bg-container);
    border: 1px solid #3a5080;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

div.osudy-toc-panel[hidden] {
    display: none;
}

div.osudy-toc-panel div.toc-head {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 48px;
    padding: 0 8px;
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.3;
}

div.osudy-toc-panel div.toc-head>b {
    font-family: var(--heading-font);
    color: var(--fg-header-title);
}

div.osudy-tree div.cindex-node {
    margin: 4px 0;
}

div.osudy-tree div.collapse1 {
    padding: 5px;
    margin-left: 20px;
    margin-right: 0;
}

div.osudy-tree div.index {
    padding: 5px;
    margin: 5px 0;
    border: 1px outset #ccc;
    background-color: #faf9f5;
}

div.osudy-tree img.folder {
    padding: 0;
    margin: 0 4px 5px 0;
    vertical-align: middle;
    cursor: pointer;
}

div.osudy-tree a.cindex {
    font-size: 13px;
    color: #336;
}

div.osudy-tree div.cindex-node>a.cindex {
    font-weight: bold;
}

div.osudy-tree a.cindex:hover {
    text-decoration: underline;
}

.container p {
    text-align: justify;
    margin: .5em 0;
}

p.rukopis {
    background-color: #fff8c4;
    border-left: 3px solid #e0c46a;
    padding-left: 5px;
    cursor: help;
    position: relative;
}

p.rukopis::after,
p.rukopis::before {
    position: absolute;
    left: 1.5em;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    transform: translateY(4px);
    z-index: 20;
}

p.rukopis::after {
    content: attr(data-tip);
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 22em;
    padding: .6em .9em;
    border-radius: 6px;
    background: #3b3320;
    color: #fff8e1;
    font: normal 13px/1.45 'Segoe UI', Helvetica, Arial, sans-serif;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

/* Arrow pointing from the tooltip to the paragraph */
p.rukopis::before {
    content: '';
    bottom: 100%;
    margin-left: 1em;
    border: 8px solid transparent;
    border-top-color: #3b3320;
    border-bottom-width: 0;
}

p.rukopis:hover::after,
p.rukopis:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
