@use 'responsive.scss' as r;
@use './schedule.scss';
@use './colors.scss' as *;

/* Variables */
$total-width: 95%;
$gap-columns-persons: 25px;
$left-menu-width: 180px;


/* Mixins */

@mixin menu-style() {
    font-family: 'Open Sans Condensed', sans-serif;
    color: black;
    text-decoration: none;

    &.active, &:hover {
        color: $color-red;
    }
}


/* main styling */

body {
    padding: 0;
    margin: 0;
    background-color: #ececec;
    font: 90% 'Open Sans', sans-serif;
    height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: $color-red;
    font-family: 'Droid Serif',serif;
    font-weight: normal;
}

h1 {
    font-size: 233%;
    margin-top: 0;
}

#wrapper {
    width: 100%;
    min-height: 100.5vh;
    max-width: 1280px;
    margin: auto;
    background-color: #fcfcfc;
    overflow: auto;

    
    .main {
        width: $total-width;
        display: flex;
        margin: auto;

        > .left-side {
            flex: auto 0 0;
            flex-direction: column;
            margin-right: 40px;
            display: none;
            width: $left-menu-width;
            

            @include r.media-large {
                display: flex;
            }

            .announcements {
                margin-top: 20px;
                background-color: #ececec;

                .entry {
                    margin: 25px 0;
                    padding: 0 15px;

                    &:first-child {
                        margin-top: 15px;
                    }

                    &:last-child {
                        margin-bottom: 15px;
                    }

                    .time {
                        font-weight: bold;
                    }

                    a {
                        color: black;
                    }
                }
            }
        }

        .left-menu {
            display: flex;
            flex-direction: column;

            > a {
                text-decoration: none;
                height: 35px;
                margin: 2px 0;
                display: flex;
                flex-direction: column;
                justify-content: center;
                padding: 0 15px;
                font: 1.5em 'Open Sans Condensed', sans-serif;
                color: black;
                background-color: #ececec;

                &.active, &:hover {
                    background-color: $color-red;
                    color: white;
                }
            }
        }

        #content {
            flex: 100% 0 1;
            text-align: justify;
            max-width: 100%;
            hyphens: auto;

            

            // @include schedule.legacy;
            
            .float-right {
                float: right;
                margin: 7px 0 7px 15px;
            }

            a {
                color: black;

                &[href^="http"] , &.download {
                    &::before {
                        margin: 0 5px 0 0;
                        top: 3px;
                        position: relative;
                        content: url('img/download.png');
                    }
                }
            }

            img {
                max-width: 100%;
            }

            h1, h2, h3, h4, h5, h6 {
                text-align: left;
            }

            .to-top {
                margin: 45px 0 0;
            }

            .disclaimer {
                font-size: 75%;
            }
        }
    }
 
}

table {
    width: 100%;
    border-collapse: collapse;
    
    td, th {
        padding: 5px;
        border: none;
        text-align: left;
    }

    tr {
        background-color: #dedede;

        &:nth-of-type(2n) {
            background-color: #f7f7f7;
        }
    }

    thead > tr {
        background-color: $color-red;
        color: white;
        text-align: left;
    }
}

// @include schedule.legacy;

#header {
    border-bottom: 2px solid rgba(173, 173, 173, 50%);
    margin: 0 auto 30px;
    width: 100%;
    
    > .logo-row {
        display: flex;
        justify-content: space-between;
        width: 100%;

        .logo {
            margin: 15px 30px 10px;

            img {
                max-width: 100%;
            }
        }

        .logo-vfl {
            margin: 12px 45px 0 0;

            img {
                max-width: 100%;
            }
        }
    }

    > .slider {
        width: calc(100% - 60px);

        // visibility: hidden;
        // height: 250px;
        display: none;

        padding: 0 10px;
        border-right: 20px solid $color-red;
        border-left: 20px solid $color-red;
        position: relative;

        @include r.media-large {
            display: flex;
        }


        > img {
            width: calc(100% - 20px);

            // display: block;
            position: absolute;
            z-index: 0;
            opacity: 1;
            
            &.animated {
                transition: opacity 2.5s ease-in-out;
            }

            &.hidden {
                opacity: 0;
            }

            &.placeholder {
                position: static;
                visibility: hidden;
                width: 100%;
            }
        }

        .dots {
            position: absolute;
            width: 95%;
            z-index: 1;
            left: 0;
            bottom: 10%;
            display: flex;
            justify-content: end;

            .dot {
                width: 10px;
                height: 10px;
                margin: 0 10px 0 0;
                border-radius: 5px;
                background-color: #eee;
                border: 1.5px solid #444;

                &.active {
                    background-color: #444;
                    border: 1.5px solid #ccc;
                }
            }
        }
    }

    > .nav {
        width: $total-width;
        height: 30px;
        margin: 5px auto 0;
        font: 1.5em 'Open Sans Condensed', sans-serif;
        display: none;

        @include r.media-large {
            display: block;
        }

        nav {
            display: flex;
            height: 100%;
            justify-content: flex-start;
            align-items: center;

            a {
                margin: 0 40px 0 0;

                // height: 100%;
                @include menu-style;
            }
        }
    }
}


#footer {
    width: 100%;
    margin: 30px auto 0;
    padding: 4px 10px 0;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid $color-hor-line;
    box-sizing: border-box;

    .first-entry {
        font: 1em 'Open Sans Condensed', sans-serif;
    }
    
    .facebook {
        width: 20px;
        height: 20px;
        display: block;
        background-image: url("img/facebook.jpg");
    }

    .meta-menu {
        max-width: 70%;

        > ul {
            padding: 0;
            margin: 0;
            display: flex;
            flex-wrap: wrap;
            font: 1.4em 'Open Sans Condensed', sans-serif;

            > li {
                list-style: none;
                margin-left: 1em;

                a  {
                    @include menu-style;
                }
            }
        }
    }
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    z-index: 10;

    &.hidden {
        display: none;
    }

    .background {
        width: 100%;
        height: 100%;
        position: absolute;
        z-index: -10;
        background-color: lightgrey;
        opacity: 0.5;
    }

    .spacer {
        flex: auto 1 0;
    }

    .dialog-column {
        flex: 0 1 1;
        display: flex;
        flex-direction: column;
        justify-content: center;

        .dialog {
            background-color: white;
            padding: 10px;
            flex: 30% 0 0;

            // height: 30%;

            img {
                max-width: 100%;
            }
        }
    }
}

.person-list {
    display: flex;
    flex-wrap: wrap;
    gap: $gap-columns-persons;
    margin: 0 0 $gap-columns-persons;
}

.person {
    width: 100%;

    height: 80px;

    // margin: 10px 25px 10px 0;
    display: flex;
    
    @include r.media-large {
        width: calc(50% - #{$gap-columns-persons} / 2);
    }

    > .image {
        flex: 60px 0 0;

        img {
            width: 100%;
        }
    }

    > .content {
        flex: 1px 1 0;
        margin-left: 10px;
    }

    > .content-vorstand {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;

        > .role {
            font-weight: bold;
        }

        > .name {
            img {
                margin: 0 10px 0 0;
            }
        }
    }
}

.news-blog {
    max-width: 100%;

    .blog-entry {
        max-width: 100%;

        .header {
            max-width: 100%;
            margin: 5px 0 10px;
            text-align: left;

            a {
                font-size: larger;
            }
        }

        .details {
            display: flex;

            // min-height: 240px;
            margin-right: 2px;
            flex-direction: column;

            @include r.media-large{
                flex-direction: row;
            }

            .teaser-image {
                flex: auto 0 0;
                display: block;
                height: 190px;

                @include r.media-large{
                    flex: 33% 1 0;
                }
                
                img {
                    width: 90%;
                    height: 100%;
                    display: block;
                    margin: 0 auto;
                    object-fit: contain;
                    object-position: left top;
                }
            }

            .right-side {
                flex: 66% 1 1;
                display: flex;
                flex-direction: column;

                .intro {
                    padding-right: 40px;
                }

                .more {
                    // float: right;
                    margin-top: 20px;
                    text-align: right;
                }
            }

        }

    }

    .pagination {
        display: flex;
        list-style: none;
        padding: 0;
        max-width: 400px;
        margin: auto;

        .page-item {
            flex: auto 1 0;
            margin: 5px;

            .page-link {
                display: block;
                text-align: center;
                width: 100%;
                height: 100%;
                padding: 5px 0;
            }
        }

        .disabled {
            visibility: hidden;
        }
    }
}

.mobile-menu {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 30px 0;
    padding: 30px 5% 0;
    box-sizing: border-box;

    border-top: 1px solid $color-hor-line;

    @include r.media-large {
        display: none;
    }
    
    .level-1 {
        width: 100%;

        a {
            background-color: $color-background-mobile-menu-header;
        }
    }

    .level-2 {
        width: 50%;

        a {
            background-color: $color-background-mobile-menu;
        }
    }

    .level-1, .level-2 {
        display: flex;
        padding: 3px;
        box-sizing: border-box;
        
        a {
            width: 100%;
            height: 100%;
            padding: 5px;
            box-sizing: border-box;

            @include menu-style;

            &.active {
                color: white;
                background-color: $color-red;
            }
        }
    }
}

.mobile-menu-link {
    display: block;
    border: 1px solid black;
    width: max-content;
    padding: 5px 75px 5px 15px;
    margin: 5px 0 5px 20px;

    @include menu-style;

    @include r.media-large {
        display: none;
    }
}

.announcement-list {
    .entry {
        margin: 0 30px;

        .time {
            font-weight: bold;
            margin-right: 10px;
        }
    }
}

.tsc-image {
    margin: 0 auto;
    width: fit-content;

    img {
        display: block;
        margin: 0 auto;
    }
}

.tsc-gallery {
    display: grid;
    place-items: center center;
    grid-template-columns: 1fr;
    gap: 15px;

    @include r.media-large {
        &.cols-2 {
            grid-template-columns: 1fr 1fr;
        }

        &.cols-3 {
            grid-template-columns: 1fr 1fr 1fr;
        }

        &.cols-4 {
            grid-template-columns: 1fr 1fr 1fr 1fr;
        }
    }

    .tsc-gallery-img {
        margin: 5px 0;
    }
}

.tsc-image, .tsc-gallery-img {
    .credits {
        font-style: italic;
        float: right;
    }
}

.youtube-video {
    max-width: 100%;
}

.internal-video {
    max-width: 100%;
}

.room {
    .image {
        max-width: 70%;
    }

    @include r.media-large {
        display: flex;
        align-items: start;

        .image {
            flex: 50% 0 1;
        }

        .address {
            margin-left: 10px;
        }

        p {
            margin: 0;
        }
    }
}

:root {
    --color-vhvorne: #{$color-vh-vorne};
    --color-vhmitte: #{$color-vh-mitte};
    --color-vhhinten: #{$color-vh-hinten};
}

.calendar-color-legend {
    display: flex;
    flex-direction: row;
    margin: 10px;

    .vorne {
        background-color: var(--color-vhvorne);
    }

    .mitte {
        background-color: var(--color-vhmitte);
    }

    .hinten {
        background-color: var(--color-vhhinten);
        color: white;
    }

    .vorne, .mitte, .hinten {
        margin-right: 20px;
        padding: 5px 10px;
    }
}

.archive-short-links {
    display: flex;
    flex-flow: row wrap;
    padding: 0;

    li {
        display: block;
        padding: 5px;
    }
}

.archive-year-list {
    display: flex;
    margin: 5px 0;
    align-items: baseline;

    @include r.mouse-available {
        margin: 0;
    }

    .date {
        font-weight: bold;

        // height: 100%;
    }

    .title {
        margin: 0 0 0 10px;
        text-align: left;

        a {
            display: block;
            padding: 6.5px 0;

            @include r.mouse-available {
                padding: 3px 0;
            }
        }
    }
}

table.time {
    // width: 100%;
    display: flex;
    flex-direction: column;

    tr {
        display: flex;
        flex-direction: column;
        width: 100%;

        td:nth-child(1) {
            font-weight: bold;
        }
        
    }

    tr:first-child {
        display: none;
    }

    &.time-no-age {
        td:nth-child(3)::before {
            content: "Uhrzeit: ";
        }

        td:nth-child(4)::before {
            content: "Ort: ";
        }
    }
    
    &.time-age {
        td:nth-child(2)::before {
            content: "Jahrgang: ";
        }

        td:nth-child(4)::before {
            content: "Uhrzeit: ";
        }

        td:nth-child(5)::before {
            content: "Ort: ";
        }
    }

    @include r.media-large {
        display: table;
        
        tr {
            display: table-row;

            &:first-child {
                display: table-row;
            }

        }
        
        &.time-age, &.time-no-age {
            tr td:nth-child(n)::before {
                content: none;
            }
        }
    }
}

.turniermeldungen-group-list {
    .day {
        .date {
            font-weight: bold;
            margin: 10px 0 0;
        }

        .participation {
            margin: 0 0 0 2em;
        }
    }
}

.turnier-details {
    .title {
        font-weight: 600;
    }

    .turnier {
        font-weight: bold;

        .nummer {
            font-weight: normal;
            font-style: italic;
        }
    }

    .verein {
        margin: 20px 0 0;
    }

    .contact {
        font-style: italic;
    }
}

.press-articles {
    margin: 0 0 2em;

    .press-article {
        border-bottom: solid 1px $color-hor-line;
        margin: 0 0 3em;
        padding: 0 0 3em;

        h2 {
            margin-bottom: 5px;
        }

        &:nth-last-of-type(1) {
            border-bottom: none;
            padding: 0;
            margin: 0;
        }

        .press-img img {
            display: block;
            margin: 1em auto;
        }

        .metadata {
            span {
                display: block;

                &.date {
                    font-weight: bold;
                }
            }
        }
    }
}

.iframe-generic {
    display: block;
    width: 100%;
    height: 800px;
    max-height: 75vh;
}

@font-face{
    font-family: 'Open Sans Condensed';
    font-style: normal;
    font-weight: 400;
    src: url("ttf/OpenSans_Condensed-Light.ttf")  format('truetype');
} 

@font-face{ 
    font-family: 'Droid Serif';
    font-style: normal;
    font-weight: normal;
    src: url('ttf/DroidSerif.ttf') format('truetype')
}