﻿/* ===== book-pages.css (BookCore) – changes more often =====
   Favorites sort, check list, messages, paper, title page, contents, pages of the supplement. After book-base.css. */

/* ===== Favorites sort ===== */
.sort-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 4px 0 8px;
}

.sort-label {
    font-size: 14px;
    color: var(--muted);
}

.sort-btn {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #c9ced6;
    border-radius: 18px;
    background: #ffffff;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

    .sort-btn.active {
        background: #eef3fb;
        border-color: var(--bar);
        color: var(--bar);
        font-weight: 600;
    }

/* ===== Check list (☑) ===== */
.group-title {
    margin: 0;
    padding: 16px 0 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.check-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .check-list li {
        border-top: 1px solid #eef0f3;
    }

.check-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    color: var(--text);
    text-decoration: none;
}

    a.check-row:hover {
        background: #f8f9fb;
    }

.check-label {
    flex: 0 0 auto;
    min-width: 86px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bar);
}

    .check-label.no-nr {
        color: var(--red);
    }

.check-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.check-section,
.check-action {
    font-size: 13px;
    color: var(--muted);
}

.pill {
    display: inline-block;
    padding: 0 8px;
    border-radius: 10px;
    background: #eef0f3;
    color: #3d444d;
}

/* ===== Messages ===== */
.msg {
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 16px;
    font-size: 17px;
    line-height: 1.45;
}

    .msg p {
        margin: 0 0 8px;
    }

        .msg p:last-child {
            margin-bottom: 0;
        }

.msg-error {
    background: #fdecea;
    color: var(--red);
    border: 1px solid #f3b8b2;
}

.msg-hint {
    background: #eef3fb;
    color: var(--text);
    border: 1px solid #c9d8f0;
}

.msg-detail {
    font-size: 14px;
    color: var(--muted);
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* ===== Book paper (first page; with "Papier auf allen Seiten" every page): cream, fine embossed grain, faint fibres.
   Pure CSS/SVG, no image file. With "Papier auf allen Seiten" also the neighbour pages for swiping (.peek), otherwise they
   would come in white first. ===== */
.paper,
.paper-all .content-scroll,
.paper-all .peek {
    background-color: #f5ead9;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/%3E%3CfeDiffuseLighting lighting-color='%23fff' surfaceScale='2.2'%3E%3CfeDistantLight azimuth='45' elevation='55'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.55'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.05 0.3' numOctaves='2' seed='8'/%3E%3CfeColorMatrix values='0 0 0 0 0.62  0 0 0 0 0.48  0 0 0 0 0.30  0 0 0 -2.2 1.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.14'/%3E%3C/svg%3E");
    background-blend-mode: multiply, multiply;
}

    /* With paper on all pages the white boxes of the lists stay transparent */
    .paper-all .content-scroll .content {
        background: transparent;
    }

/* ===== First page (title page like in the printed book) ===== */
/* The page with the title page fills the visible area between the arrows and the lower edge, whatever the height of the
   window is at the moment (the phone shows and hides its address bar); taller content (phone held sideways) scrolls. */
.content:has(> .title-page) {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: 0;
}

.title-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 0 auto;
    box-sizing: border-box;
    margin: 0 -16px;
    padding: 60px 16px 70px;
    font-family: 'EB Garamond', var(--font-text);
    text-align: center;
    color: #222;
}

    .title-page p {
        margin: 0;
    }

.title-page__title {
    /* smaller on narrow phones, so that a long title (e.g. BAHÁ’Í-GEBETE) stays on one line */
    font-size: min(46px, 9.5vw);
    white-space: nowrap;
    letter-spacing: 0.04em;
    margin-bottom: 26px !important;
}

.title-page__author {
    font-size: 24px;
    margin-bottom: 44px !important;
}

.title-page__subtitle {
    font-size: 17px;
    line-height: 1.35;
}

.title-page__publisher {
    margin-top: auto !important;
    padding-top: 40px;
    font-size: 17px;
    letter-spacing: 0.08em;
}

/* ===== Contents (i1): parts, chapter groups, pages ===== */
.contents {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .contents li {
        border-top: 1px solid #eef0f3;
    }

.contents__link {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 11px 2px;
    font-family: var(--font-text);
    font-size: 19px;
    line-height: 1.3;
    color: var(--text);
    text-decoration: none;
}

    .contents__link:hover span:first-child {
        color: var(--bar);
    }

/* Part with chapter groups: the whole row is a button that opens / closes the groups */
.contents__link--toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.contents__link--group {
    padding: 7px 2px 7px 22px;
    font-size: 16.5px;
}

.contents__link--page {
    color: var(--bar);
}

.contents__range {
    margin-left: auto;
    white-space: nowrap;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--muted);
}

.contents__arrow {
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
}

.contents__range + .contents__arrow {
    margin-left: 0;
}

/* Heading of a chapter group on the page of a part (focus = jumped to) */
.part-group:focus {
    outline: none;
}

/* ===== Pages of the supplement: Vorwort, Erläuterungen, Literatur ===== */
.extra-page {
    font-family: var(--font-text);
    color: var(--text);
}

.glossary-intro {
    margin: 4px 0 16px;
    font-size: 17px;
    line-height: 1.5;
}

.glossary {
    margin: 0;
}

    .glossary dt {
        margin-top: 16px;
        font-size: 19px;
        scroll-margin-top: 12px;
    }

        .glossary dt:focus {
            outline: none;
            color: var(--bar);
        }

    .glossary dd {
        margin: 3px 0 0 18px;
        font-size: 17px;
        line-height: 1.5;
    }

.sup-ref {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    color: var(--bar);
    cursor: pointer;
}

.sup-ref--missing {
    color: inherit;
    cursor: default;
}

.extra-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .extra-list li {
        padding: 6px 0 6px 18px;
        text-indent: -18px;
        font-size: 17px;
        line-height: 1.45;
    }

/* Switch "Papier auf allen Seiten" in Info ▾ */
.paper-switch__box {
    display: inline-block;
    width: 1.2em;
    margin-right: 4px;
    color: var(--bar);
    font-weight: 600;
}

/* ===== Reading mode (▶ on the text page; Info ▾ → Lesen) ===== */
/* The marked word: colored layer over the word (reading.js; the same in every browser); color from Info ▾ → Lesen */
.reading-layer {
    position: fixed;
    z-index: 5;
    border-radius: 4px;
    background: var(--reading-color, #ffe27a);
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* ▶ and ☆ in the arrow row: together, without the gap of the row between them */
.text-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* ▶ with the tempo window (long press) below it */
.read-wrap {
    position: relative;
    display: inline-flex;
}

.read-btn {
    /* long press: no text selection, no context menu on the phone */
    -webkit-touch-callout: none;
    user-select: none;
    touch-action: manipulation;
}

.read-pop__shade {
    position: fixed;
    inset: 0;
    z-index: 70;
}

.read-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 71;
    width: 250px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    font-family: var(--font-ui);
    font-size: 14px;
}

.read-pop__title {
    margin-bottom: 8px;
    font-weight: 600;
}

.read-pop__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .read-pop__row input[type=range] {
        flex: 1 1 auto;
        min-width: 0;
    }

.read-pop__step {
    flex: 0 0 32px;
    height: 32px;
    border: 1px solid #d5dbe6;
    border-radius: 50%;
    background: #ffffff;
    color: var(--bar);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.read-pop__reset {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bar);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.read-pop__hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.read-btn svg {
    fill: #8a929c;
    stroke: #8a929c;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.read-btn.on {
    background: var(--bar);
}

    .read-btn.on svg {
        fill: #ffffff;
        stroke: #ffffff;
        stroke-width: 3;
        stroke-linecap: round;
    }

    .read-btn.on:hover {
        background: var(--bar);
    }

/* Narrow phones: ▶ and ☆ a little narrower, so the search field keeps room */
@media (max-width: 419px) {
    .star-btn {
        width: 40px;
    }
}

.read-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 14px 10px 26px;
    font-size: 14px;
}

.read-menu__row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.read-menu__label {
    flex: 0 0 auto;
    min-width: 48px;
    color: var(--muted);
}

.read-menu__row input[type=range] {
    flex: 1 1 100px;
    min-width: 90px;
}

.read-menu__value {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.read-menu__swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #c9d2e0;
    cursor: pointer;
}

    .read-menu__swatch.on {
        box-shadow: 0 0 0 2px var(--bar);
    }

.read-menu__picker {
    width: 36px;
    height: 28px;
    padding: 0;
    border: 1px solid #c9d2e0;
    border-radius: 6px;
    background: transparent;
}

.read-menu__hex {
    width: 82px;
    padding: 4px 6px;
    border: 1px solid #c9d2e0;
    border-radius: 6px;
    font: inherit;
    font-family: ui-monospace, Consolas, monospace;
}

.read-menu__bad {
    color: #b32121;
    font-size: 12px;
}

/* ===== Search everywhere: hits outside the texts (Kategorie, Teil, Erläuterung …) in the search list ===== */
.hit-row .text-row-label.hit-label {
    width: auto;
    min-width: 52px;
    max-width: 110px;
    font-size: 13.5px;
    color: #8a5a00;
    overflow-wrap: anywhere;
}

.hit-snippet {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.4;
    color: var(--muted);
}

.hit-arrow {
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
    padding-left: 6px;
    color: var(--muted);
}

    .hit-arrow svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
    }

/* Search word in the title of the bar (page opened from a hit) */
.top-bar-title mark.hit {
    color: #1d2733;
}

/* Place of the supplement jumped to from a hit (focus only for scrolling) */
.extra-page [tabindex="-1"]:focus {
    outline: none;
}
