/*
 * Book page. Old browsers (iOS 12) must be supported, see page.css.
 */

/* ---- Descriptions of the book and its chapters (HTML written in the admin) ---- */
.book-description {
    max-width: 400px;
    margin: 0.618em auto 1em;
    color: #777;
    font-size: 90%;
    text-align: justify;
}

.book-description p {
    margin: 0 1em;
    text-indent: 1.618em;
}

.book-description h3 {
    margin: 1.294em 1em 0.494em; /* 1.618em and 0.618em of the text */
    color: #a05020;
    font-size: 1.25em;
    font-weight: normal;
    text-align: center;
}

.book-description img {
    max-width: 100%;
    height: auto;
}

/* Verse with a decorated first letter (lullaby book) */
.book-description .virsz {
    margin: 0.618em 0 0.618em 0.618em;
    text-align: left;
    text-indent: 0;
}

.book-description .bukvycja {
    color: #ff34b3;
    font-size: 1.75em;
}

/* ---- Chapters, separated by a golden line ---- */
.chapter {
    margin-top: 2.618em;
}

.chapter::before {
    content: "";
    display: block;
    width: 70%;
    margin: 0 auto;
    border-top: 1px solid #ffd700;
}

.chapter__title {
    margin: 1.294em 1em 0.494em; /* 1.618em and 0.618em of the text */
    color: #a05020;
    font-size: 1.25em;
    font-weight: normal;
}

.chapter__tales {
    max-width: 440px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    text-align: left;
}

/* ---- Tale: leaf, number, leaf, title, acorn (notes: title only, aligned) ---- */
.tale {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.tale__icon,
.tale__acorn {
    display: block;
    flex: none;
}

.tale__icon {
    width: 24px;
    height: 24px;
}

.tale__number {
    flex: none;
    width: 2em;
    text-align: center;
}

.tale__title {
    flex: 1 1 auto;
    padding: 0 8px;
}

/* ---- Copyright notice of third-party books ---- */
.rights-notice {
    max-width: 400px;
    margin: 2.618em auto 1em;
    color: #777;
    font-size: 90%;
}

/* ---- Mobile: full-width texts, tales separated by dotted lines ---- */
@media (max-width: 599px) {
    .book-description,
    .rights-notice {
        margin: 1em 4px;
    }

    /* Left-aligned: a phone line is too short for even word spaces */
    .book-description {
        text-align: left;
    }

    .book-description p {
        margin: 0;
        text-indent: 1em;
    }

    .chapter {
        margin-top: 1.618em;
    }

    .chapter__title {
        margin: 1.294em 4px 0.494em;
    }

    .tale {
        padding: 8px 4px;
        border-bottom: 1px dotted #ffd700;
    }

    .tale:last-child {
        border-bottom: 0;
    }
}

/* ---- Saving the book for reading without internet (js/book-save.js) ---- */
.book-save {
    margin: 1em auto;
    text-align: center;
    font-size: 90%;
}

.book-save[hidden],
.book-save [hidden] {
    display: none;
}

.book-save__button {
    margin: 0.382em;
    padding: 0.382em 1em;
    border: 1px solid #4682b4;
    border-radius: 6px;
    background: #fff;
    color: #4682b4;
    font: inherit;
    cursor: pointer;
}

.book-save__button:disabled {
    border-color: #ccc;
    color: #999;
    cursor: default;
}

.book-save__status {
    display: inline-block;
    margin: 0.382em;
    color: #777;
}

.book-save__remove {
    margin: 0.382em;
    padding: 0;
    border: 0;
    background: none;
    color: #777;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
