/* ==========================================================
   STORY STRUCTURE DIRECTIVES

   Semantic classes are created by:

       assets/js/books/zcode-content-directives.js

   Authoring directives:

       STORYCONTEXT:
       STORYDEK:
       STORYSUB:
       STORYENDNOTE:

   These styles deliberately do not alter H2 / H3 or ordinary
   chapter titles. Those belong to Reader typography.

   These rules target the directive classes directly so they
   work in both Reader paths.
   ========================================================== */


/* ==========================================================
   COMMON RESET
   ========================================================== */

.fr-storyContext,
.fr-storyDek,
.fr-storySub,
.fr-storyEndNote {
    box-sizing: border-box;

    padding: 0 !important;

    text-indent: 0 !important;

    hyphens: none !important;
    -webkit-hyphens: none !important;

    overflow-wrap: normal;

    text-align-last: auto;
}


/* ==========================================================
   STORYCONTEXT

   About 1 point smaller than body
   Italic
   Centered
   Approximately 1/2 inch inset on left and right
   4rem below
   ========================================================== */

.fr-storyContext {
    margin:
            0
            4.8rem
            4rem
            4.8rem !important;

    font-family: inherit !important;

    font-size:
            calc(
                    1em -
                    0.13rem
            ) !important;

    font-weight: 400 !important;
    font-style: italic !important;
    line-height: inherit !important;

    text-align: center !important;
    text-align-last: center !important;
}


/* ==========================================================
   STORYDEK

   About 2 points larger than body.

   White space below: 2rem.
   ========================================================== */

.fr-storyDek {
    margin:
            0
            0
            2rem
            0 !important;

    font-family: inherit !important;

    font-size:
            calc(
                    1em +
                    0.27rem
            ) !important;

    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1.35 !important;

    text-align: left !important;
    text-align-last: auto !important;
}


/* ==========================================================
   STORYSUB

   Same size as body
   Bold
   Horizontally centered
   ========================================================== */

.fr-storySub {
    margin:
            calc(2.34em - 1rem)
            0
            calc(1.17em - 1rem)
            0 !important;

    font-family: inherit !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: inherit !important;

    text-align: center !important;
    text-align-last: center !important;
}


/* ==========================================================
   STORYENDNOTE

   Editorial source / provenance note.

   Slightly smaller than body copy
   Italic
   Full text width
   Left aligned
   Comfortable separation from the end of the story
   ========================================================== */

.fr-storyEndNote {
    width: 100%;
    max-width: none;

    margin:
            3.8rem
            0
            0
            0 !important;

    font-family: inherit !important;

    font-size:
            calc(
                    1em -
                    0.12rem
            ) !important;

    font-weight: 400 !important;
    font-style: italic !important;
    line-height: 1.4 !important;

    text-align: left !important;
    text-align-last: left !important;
}


/* ==========================================================
   STORYENDNOTE RULE

   Approximately 1.5 inches wide
   1px thick
   Left aligned
   ========================================================== */

.fr-storyEndNote::before {
    display: block;

    width: 1.5in;

    margin:
            0
            0
            2.2rem
            0;

    border-top:
            1px solid
            currentColor;

    content: "";

    opacity: 0.55;
}


/* ==========================================================
   PARAGRAPHS FOLLOWING STRUCTURAL ELEMENTS
   ========================================================== */

.fr-storyContext + p,
.fr-storyDek + p,
.fr-storySub + p,
.fr-storyEndNote + p {
    text-indent: 0 !important;
}


/* ==========================================================
   SMALL SCREENS
   ========================================================== */

@media (max-width: 700px) {

    .fr-storyContext {
        margin-right: 2.4rem !important;
        margin-left: 2.4rem !important;
    }

    .fr-storyEndNote {
        width: 100%;
    }

}