/* Content blocks (Bausteine) that need more than the rich text styles. Ported from the Blazor
   Hero, ArticlesAndAppointments and ClubSummary components. */

/*=================================*/
/*              Hero               */
/*=================================*/

#hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    background-color: var(--primary);

    h1 {
        width: 100%;
        background-image: var(--hero-section-image);
        background-size: cover;
        background-position: bottom;
        padding: 20vh 1rem 1rem 1rem;
        text-align: center;
        color: var(--light);
        text-shadow: #000 0 0 5px;
    }

    p {
        text-align: center;
        padding: 0 1rem;
        color: var(--light);
    }

    .button {
        margin: 0 1rem 1rem 1rem;
    }

    .hero-button-desktop {
        display: none;
    }
}

@media (min-width: 768px) {
    #hero {
        height: 50vh;
        background-image: var(--hero-section-image);
        background-size: cover;
        background-position: center;
        align-items: end;
        justify-content: flex-start;
        border-radius: 0 0 .5rem .5rem;
        padding: 2rem;

        h1 {
            background: none;
            text-align: end;
            text-shadow: none;
            padding: 0;
        }

        p {
            max-width: 50%;
            text-align: end;
            margin: 0;
            text-shadow: 0 0 10px var(--dark);
            padding: 0;
        }

        .button {
            margin: 0;
        }

        .hero-button-desktop {
            display: block;
        }

        .hero-button-mobile {
            display: none;
        }
    }
}

/*=================================*/
/*   Latest news / appointments    */
/*=================================*/

.home-news {
    display: flex;
    flex-direction: column-reverse;
    gap: 2rem;

    .news {
        flex: 2;
        display: flex;
        flex-direction: column;
    }

    .appointments {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .list {
            display: flex;
            flex-direction: column;
        }
    }

    .button-container {
        display: flex;
        justify-content: flex-end;
    }
}

@media (min-width: 992px) {
    .home-news {
        flex-direction: row;
        gap: 4rem;
    }
}

/*=================================*/
/*          Club summary           */
/*=================================*/

.club-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    .column {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .column-outer {
        justify-content: center;
    }

    .column-inner {
        justify-content: space-between;

        img {
            width: 256px;
            display: none;
        }
    }

    .tile {
        background-color: var(--secondary);
        padding: 32px;
        display: flex;
        flex-direction: column;
        text-align: center;
    }
}

@media (min-width: 1200px) {
    .club-summary {
        flex-direction: row;
        gap: 4rem;

        h2 {
            display: none;
        }

        .column {
            gap: 4rem;
        }

        .column-inner img {
            display: block;
        }
    }
}

/*=================================*/
/*   Contact form over the footer  */
/*=================================*/

/* As in the old app: the form reaches into the enlarged footer (whose top padding makes room) */
@media (min-width: 992px) {
    .site.footer-overlap main > .contact:last-child {
        position: relative;
        z-index: 1;
        margin-bottom: calc(-1 * (var(--section-gap) + 7.5rem));
    }

    .site.footer-overlap main > .contact:last-child .contact-form {
        box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    }
}

/*=================================*/
/*         Text with image         */
/*=================================*/

.text-image {
    display: flex;
    flex-direction: column;
    gap: 2rem;

    img {
        width: 100%;
        object-fit: cover;
    }

    .rte {
        flex: 1;
    }
}

@media (min-width: 992px) {
    .text-image {
        flex-direction: row;
        align-items: flex-start;
        gap: 4rem;

        img {
            width: 40%;
        }
    }

    .text-image.image-right {
        flex-direction: row-reverse;
    }
}

/*=================================*/
/*            Download             */
/*=================================*/

.download-block {
    display: flex;
}

/*=================================*/
/*          Single image           */
/*=================================*/

.image-block figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.image-block img {
    width: 100%;
}

.image-block.narrow img {
    max-width: 640px;
}

.image-block figcaption {
    font-style: italic;
    text-align: center;
}

/*=================================*/
/*         Tiles carousel          */
/*=================================*/

/* Cards side by side with scroll snapping: three on large screens, two on tablets, one with a peek of the
   next on phones. Any number of tiles and any text length; cards in view share the height of the tallest. */
.tiles-carousel {
    --carousel-gap: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    h2 {
        text-align: center;
    }

    .carousel-stage {
        position: relative;
    }

    .carousel-track {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 85%;
        gap: var(--carousel-gap);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        padding: .5rem .25rem 1rem;
        scrollbar-width: none;

        &::-webkit-scrollbar {
            display: none;
        }
    }

    .tile {
        scroll-snap-align: start;
        background-color: var(--secondary);
        padding: 2rem;
        display: flex;
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .tile-icon {
        font-size: 2.25rem;
    }

    .carousel-nav {
        display: none;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        padding: 0;
        font-size: 2.25rem;
        color: var(--primary);

        &:hover {
            box-shadow: none;
            color: var(--tertiary);
        }

        &:disabled {
            opacity: .25;
            cursor: default;
        }
    }

    .carousel-prev {
        left: -3rem;
    }

    .carousel-next {
        right: -3rem;
    }

    .carousel-dots {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .carousel-dot {
        width: .75rem;
        height: .75rem;
        padding: 0;
        border-radius: 50%;
        background: var(--secondary);

        &.active {
            background: var(--primary);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .tiles-carousel .carousel-track {
        scroll-behavior: auto;
    }
}

@media (min-width: 768px) {
    .tiles-carousel .carousel-track {
        grid-auto-columns: calc((100% - var(--carousel-gap)) / 2);
    }
}

@media (min-width: 1200px) {
    .tiles-carousel {
        .carousel-track {
            grid-auto-columns: calc((100% - 2 * var(--carousel-gap)) / 3);
        }

        .carousel-nav {
            display: block;
        }
    }
}
