$epub-video: true !default;
@if $epub-video {

    // Video
    // Works specifically with our video includes

    .video {
        font-family: $font-text-secondary;
        margin: $line-height-default 0;
        position: relative;

        img {
            width: 100%;
        }

        .video-link {
            display: block;
            height: 100%;
        }

        .video-description {
            margin-top: $line-height-default;
            text-align: left;
        }

        .video-wrapper {
            position: relative;

            a {
                // Show URL on e-ink devices
                @include show-url();
            }

            // Create placeholder with 16:9 aspect ratio
            // when there is no image to display
            &.video-no-image {
                aspect-ratio: 16/9;
                background-color: $color-accent;
                border-radius: $box-border-radius;
                width: 100%;
            }

            // JS will add an iframe here; when it does:
            &.contains-iframe {
                aspect-ratio: 16/9;
                float: none;
                clear: both;
                width: 100%;

                iframe {
                    // position: absolute; // not supported in epub yet
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                }
            }
        }

        // Don't indent a paragraph after a video.
        & + p {
            text-indent: 0;
        }

        .video-options {
            color: $color-text-secondary;
            font-size: 0.8em;
            margin: ($line-height-default / 2) $paragraph-indent 0 $paragraph-indent;
            position: relative;

            .video-options-label {
                font-weight: bold;
            }

            .video-options-content {

                > :last-child {
                    margin-bottom: 0;
                }
            }
        }
    }
}
