/*
 *
 * Newspapers
 * ================================================
 * All styles for newspaper specials like
 * calendar and issue views
 *
 */

/* ==============[ general settings for newspaper related things ]======================== */
.tx-dfgviewer-newspaper-years,
.tx-dfgviewer-newspaper-calendar {
    padding: 20px 20px 100px 20px;
    max-height: 100%;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==============[ all issues of this newspapers (boxy year navigation) ]================= */
.tx-dfgviewer-newspaper-years {
    ul {
        li {
            margin: 20px;
            a {
                display: block;
                background: lighten(@light-blue, 20%);
                padding: 10px;
                border-radius: 40px;
            }
        }
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        padding: 140px;
        vertical-align: middle;
        ul {
            li {
                display: inline-block;
                a {
                    width: 80px;
                    height: 80px;
                    line-height: 60px;
                    .no-touchevents & {
                        .transition();
                        &:hover {
                            .transform(scale(1.2));
                        }
                    }
                }
            }
        }
    }
}
/* ==============[ monthly navigation with day dropdowns ]================================ */
.tx-dfgviewer-newspaper-calendar {
    text-align: left;
    .calendar-list-selection, .list-view {
        display: none;
    }
    .year-anchor {
        border-bottom: 1px solid @light-blue;
        line-height: 1.4;
        font-size: 12px;
    }
    .year {
        font-weight: bold;
        line-height: 1.4;
        a {
            color: @base-blue;
        }
    }
    .calendar-view {
        position: relative;
        margin: 30px 0 0 0;
        table {
            width: 100%;
            margin: 50px 0;
            text-align: center;
            border-bottom: 1px solid fade(@light-blue,30%);
            caption {
                color: @base-blue;
                font-weight: bold;
                text-align: left;
                border-bottom: 1px solid fade(@light-blue,30%);
                font-size: 12px;
                text-transform: uppercase;
            }
            tr {
                td, th {
                    width: 14.285%;
                    padding: 6px;
                }
                th {
                    color: @light-blue;
                }
                td {
                    color: @light-blue;
                    .contains-issues {
                        position: relative;
                        color: @base-blue;
                        font-weight: bold;
                        display: block;
                        .transition();
                        &:before {
                            position: absolute;
                            top: 19px;
                            left: 50%;
                            margin-left: -5px;
                            width: 0;
                            height: 0;
                            border: 5px solid transparent;
                            border-top-width: 0;
                            border-bottom-color: fade(@base-blue,90%);
                            content: " ";
                            opacity: 0;
                            .transform(translateY(15px));
                            .transition();
                        }
                        .no-touchevents & {
                            cursor: pointer;
                        }
                    }
                    ul.issues {
                        position: absolute;
                        left: 0;
                        right: 0;
                        padding: 10px;
                        margin-top: 10px;
                        background: fade(@base-blue,90%);
                        opacity: 0;
                        .transform(scaleY(0));
                        .transition();
                        transform-origin: center top;
                    }
                    &.open {
                        .contains-issues {
                            .transform(scale(1.2));
                            &:before {
                                opacity: 1;
                                .transform(translateY(0));
                            }
                        }
                        ul.issues {
                            opacity: 1;
                            // In the calendar view, with an open day, display date above the underlying text completely.
                            z-index: 100;
                            .transform(scaleY(1));
                            li {
                                margin: 10px 0;
                                a {
                                    color: #fff;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    @media screen and (min-width: @tabletLandscapeViewportWidth) {
        position: relative;
        height: 100%;
        padding: 100px 30px 30px 30px;
        .calendar-list-selection {
            display: block;
        }
        .calendar-list-selection {
            position: absolute;
            top: 106px;
            right: 35px;
            a {
                position: relative;
                background: @light-blue;
                color: #fff;
                font-size: 12px;
                padding: 4px 10px;
                border-radius: 30px;
                display: inline-block;
                margin-left: 5px;
                .no-touchevents & {
                    cursor: pointer;
                }
                &.active {
                    background: @base-blue;
                    &:before {
                        position: absolute;
                        bottom: -5px;
                        left: 50%;
                        margin-left: -5px;
                        width: 0;
                        height: 0;
                        border: 5px solid transparent;
                        border-bottom-width: 0;
                        border-top-color: @base-blue;
                        content: " ";
                    }
                }
            }
        }
        .year-anchor {
        }
        .year {
            font-weight: normal;
            font-size: 30px;
        }
        .list-view {
            position: absolute;
            top: 160px;
            right: 30px;
            left: 30px;
        }
        .calendar-view, .list-view {
            opacity: 0;
            .transform(translateY(-100px) scaleY(0));
            .transition();
            display: block;
            pointer-events: none;
            padding-bottom: 60px;
            height: 0;
            &.active {
                .transform(translateY(0) scaleY(1));
                opacity: 1;
                pointer-events: all;
            }
        }
        .calendar-view {
            .clearfix();
            margin: 0 -30px;
            .month {
                position: relative;
                padding: 30px;
                width: 50%;
                float: left;
                // does not display the link box for day in last line of a month completely
                // overflow: hidden;
                // displays the link box for the day in the last line of a month completely
                overflow: inherit;
                table {
                    width: 100%;
                    margin: 0;
                    tr {
                        td {
                            &.open {
                                .contains-issues {
                                    .transform(scale(1.4));
                                    &:before {
                                        top: 16px;
                                        opacity: 1;
                                        .transform(translateY(0));
                                    }
                                }
                                ul.issues {
                                    left: 30px;
                                    right: 30px;
                                }
                            }
                        }
                    }
                }
            }
        }
        .list-view {
            ul {
                li {
                    padding: 10px;
                    margin: 10px 0;
                    background: fade(@light-blue, 15%);
                    border-radius: 40px;
                    text-align: right;
                    .transition();
                    .date {
                        position: absolute;
                        left: 10px;
                        font-size: 12px;
                        color: @base-blue;
                        line-height: 25px;
                    }
                    a {
                        background: fade(@light-blue, 30%);
                        display: inline-block;
                        border-radius: 20px;
                        padding: 5px 10px;
                        margin: 0 5px;
                        .transition();
                        &:last-child {
                            margin-right: 0;
                        }
                        .no-touchevents & {
                            &:hover {
                                background: fade(@light-blue, 50%);
                            }
                        }
                    }
                    &:hover {
                        .transform(scale(1.02));
                    }
                }
            }
        }
    }
    @media screen and (min-width: @desktopViewportWidth) {
        .calendar-view {
            .month {
                width: 33.3333333%;
            }
        }
    }
    @media screen and (min-width: 1500px) {
        .calendar-view {
            .month {
                width: 25%;
            }
        }
    }
}
