/*
 * Tale page: ordinary tales in a green frame, and picture tales in a wide layout.
 * Old browsers (iOS 12) must be supported, see page.css.
 */

.page-content--wide {
    max-width: none;
}

/* ---- Green frame around the tale ---- */
.tale-frame {
    display: block;
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px;
    background:
        url("../img/tale/frame/SO.jpg") left top no-repeat,
        url("../img/tale/frame/SW.jpg") right top no-repeat,
        url("../img/tale/frame/NO.jpg") left bottom no-repeat,
        url("../img/tale/frame/NW.jpg") right bottom no-repeat,
        url("../img/tale/frame/h.jpg") left top repeat-x,
        url("../img/tale/frame/h.jpg") left bottom repeat-x,
        url("../img/tale/frame/v.jpg") left top repeat-y,
        url("../img/tale/frame/v.jpg") right top repeat-y;
}

/* Golden line */
.tale-rule {
    width: 70%;
    height: 1px;
    margin: 0 auto;
    border: 0;
    background: #ffd700;
}

/* ---- Navigation: previous tale, contents, next tale ---- */
.tale-nav {
    margin: 0 auto;
    padding: 4px 0;
}

.tale-nav a {
    display: inline-block;
    padding: 4px 40px;
    vertical-align: middle;
}

.tale-nav img {
    display: block;
}

/* ---- Tale text ---- */
.tale-text {
    max-width: 625px;
    margin: 0.618em auto 1.618em;
    font-size: 22px;
    line-height: 1.6;
    text-align: center;
}

.tale-text p {
    margin: 0 1em;
    text-align: justify;
    text-indent: 1.618em;
}

.tale-text p:first-of-type {
    text-indent: 0;
}

.tale-text h2 {
    margin: 2.014em 1em 0.475em; /* 2.618em and 0.618em of the text */
    color: #006916;
    font-size: 1.3em;
    font-weight: normal;
}

.tale-text h3 {
    margin: 1.471em 1em 0.562em; /* 1.618em and 0.618em of the text */
    color: #a05020;
    font-size: 1.1em;
    font-weight: normal;
}

.tale-text h4 {
    margin: 1.618em 1em 0.618em;
    color: #8b1a1a;
    text-align: left;
}

.tale-text b,
.tale-text strong {
    color: #191950;
}

.tale-text img {
    max-width: 100%;
    height: auto;
}

.tale-text hr {
    width: 70%;
    height: 1px;
    margin: 1em auto;
    border: 0;
    background: #ffd700;
}

.tale-ending {
    display: block;
    margin: 1em auto 1.618em;
}

/* Classes used in the tale texts written in the admin */
.tale-text .center,
.tale-text .centr {
    text-align: center;
}

.tale-text .centr-inline {
    display: inline-block;
    margin: 0 auto;
}

.tale-text .virsz {
    margin: 0.618em 0 0.618em 0.618em;
    text-align: left;
    text-indent: 0;
}

.tale-text .bukvycja {
    color: #ff34b3;
    font-size: 1.75em;
}

.tale-text .bukvycjaI {
    color: #ff34b3;
    font-size: 1.25em;
}

.tale-text .livyj {
    float: left;
    margin: 0 1em;
}

.tale-text .pravyj {
    float: right;
    margin: 0 1em;
}

.tale-text .w-100 {
    max-width: 100%;
}

.tale-text .prymitka,
.tale-text .prymitka-text {
    max-width: 400px;
    margin: 1em auto;
    color: #777;
    font-size: 90%;
    text-indent: 0;
}

.tale-text .prymitka-text {
    color: #77aacc;
    text-align: left;
}

.tale-text .feja-povidka {
    max-width: 620px;
    margin: 1em auto;
    border: 1px solid #ffd700;
    background: #ffc;
}

/* Text after floated pictures and drop caps starts below them */
.tale-text::after {
    content: "";
    display: block;
    clear: both;
}

/* ---- Drop cap: the first letter shown as a picture (the letter stays for readers) ---- */
.dropcap {
    display: block;
    float: left;
    width: 100px;
    height: 100px;
    overflow: hidden;
    background: 0 0 no-repeat;
    background-size: 100% 100%;
    text-indent: -1000em;
}

.dropcap--aa { background-image: url("../img/tale/letters/aa.jpg"); }
.dropcap--bb { background-image: url("../img/tale/letters/bb.jpg"); }
.dropcap--cc { background-image: url("../img/tale/letters/cc.jpg"); }
.dropcap--ch { background-image: url("../img/tale/letters/ch.jpg"); }
.dropcap--cz { background-image: url("../img/tale/letters/cz.jpg"); }
.dropcap--dd { background-image: url("../img/tale/letters/dd.jpg"); }
.dropcap--hh { background-image: url("../img/tale/letters/hh.jpg"); }
.dropcap--ii { background-image: url("../img/tale/letters/ii.jpg"); }
.dropcap--ja { background-image: url("../img/tale/letters/ja.jpg"); }
.dropcap--je { background-image: url("../img/tale/letters/je.jpg"); }
.dropcap--ji { background-image: url("../img/tale/letters/ji.jpg"); }
.dropcap--kk { background-image: url("../img/tale/letters/kk.jpg"); }
.dropcap--ll { background-image: url("../img/tale/letters/ll.jpg"); }
.dropcap--mm { background-image: url("../img/tale/letters/mm.jpg"); }
.dropcap--nn { background-image: url("../img/tale/letters/nn.jpg"); }
.dropcap--oo { background-image: url("../img/tale/letters/oo.jpg"); }
.dropcap--pp { background-image: url("../img/tale/letters/pp.jpg"); }
.dropcap--rr { background-image: url("../img/tale/letters/rr.jpg"); }
.dropcap--sc { background-image: url("../img/tale/letters/sc.jpg"); }
.dropcap--ss { background-image: url("../img/tale/letters/ss.jpg"); }
.dropcap--tt { background-image: url("../img/tale/letters/tt.jpg"); }
.dropcap--uu { background-image: url("../img/tale/letters/uu.jpg"); }
.dropcap--vv { background-image: url("../img/tale/letters/vv.jpg"); }
.dropcap--zh { background-image: url("../img/tale/letters/zh.jpg"); }
.dropcap--zz { background-image: url("../img/tale/letters/zz.jpg"); }

/* ---- Picture tales: menu around the book navigation, wide picture, text below ---- */
.picture-menu {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 0 0 8px;
}

.picture-menu__group {
    margin: 0;
    padding: 0;
    list-style: none;
}

.picture-menu__group.tale-nav a {
    padding: 4px 8px;
}

.picture-menu__logo img {
    width: 280px;
    height: auto;
}

.picture-tale {
    margin: 13px auto;
}

.picture-tale .tale-text {
    max-width: none;
    margin: 0;
    font-size: 1em;
    line-height: 1.4;
}

.picture-tale .controls {
    display: none;
}

.picture-tale #tekst {
    max-width: 940px;
    margin: 1em auto;
    font-size: 85%;
    -webkit-column-count: 2;
    column-count: 2;
    -webkit-column-gap: 40px;
    column-gap: 40px;
}

.picture-tale #tekst[hidden] {
    display: none;
}

.picture-tale #tekst h1 {
    -webkit-column-span: all;
    column-span: all;
}

.picture-tale .avtor {
    text-align: right;
    font-style: italic;
}

.text-toggle {
    display: block;
    width: 85%;
    margin: 0.5em auto;
    padding: 7px;
    border: 1px solid #eee;
    border-width: 1px 0;
    background: none;
    color: #000;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    cursor: pointer;
}

.text-toggle:hover,
.text-toggle:focus {
    border-color: #ffd700;
    color: #00f;
}

.picture-footer {
    padding: 16px 12px;
}

/* ---- Tablet: navigation scaled; picture tale text always shown, in one column ---- */
@media (max-width: 999px) {
    .tale-nav a {
        padding: 4px 3vw;
    }

    .tale-nav img {
        width: 12vw;
        height: auto;
    }

    .tale-nav .tale-nav__contents img {
        width: 8vw;
    }

    .picture-menu__group--book {
        -webkit-box-ordinal-group: 0;
        -webkit-order: -1;
        order: -1;
        width: 100%;
    }

    .picture-menu__group--book .picture-menu__logo img {
        width: 28vw;
    }

    .text-toggle {
        display: none;
    }

    .picture-tale #tekst,
    .picture-tale #tekst[hidden] {
        display: block;
        -webkit-column-count: 1;
        column-count: 1;
    }
}

/* ---- Mobile: thinner frame, smaller text and pictures ---- */
@media (max-width: 599px) {
    .tale-frame {
        padding: 22px;
        background-size: 22px 22px, 22px 22px, 22px 22px, 22px 22px, auto 22px, auto 22px, 22px auto, 22px auto;
    }

    .tale-nav img {
        width: 18vw;
    }

    .tale-nav .tale-nav__contents img {
        width: 12vw;
    }

    .tale-text {
        margin: 0.618em auto 1em;
        font-size: 1em;
    }

    /* Away from the frame; left-aligned: a phone line is too short for even word spaces */
    .tale-text p {
        margin: 0 0.618em;
        text-align: left;
        text-indent: 1em;
    }

    .tale-text .virsz {
        margin: 0.618em 0;
    }

    .dropcap {
        width: 60px;
        height: 60px;
    }

    .tale-ending {
        width: 85px;
        height: auto;
    }

    .picture-menu__group--book .picture-menu__logo img {
        width: 40vw;
    }

    .picture-tale #tekst {
        font-size: 100%;
    }
}
