:root {
    --text-color: black;
    --text-color-contrast: white;
    --image-background: white;
    --background-color: black;
    --aikido-red: #9F0002;
    --primary-color: var(--aikido-red);

    --section-gap: 16px;


    --padding-top: clamp(16px, 5vw, 60px);
    --padding-bottom: clamp(32px, 10vw, 80px);

    --p-padding-bottom: clamp(8px, 2vw, 20px);

    --max-container-width: 2000px;
}

@layer general, specific;

figure {
    margin: 0
}

@layer general {
    /* **** */
    /* MARK: General Styles
    /* **** */

    section {
        height: max-content;
    }

    html { scroll-behavior: smooth; }

    main {
        width: 100vw;
        max-width: var(--max-container-width);
    }

    body {
        overflow-x: clip;
        width: 100%;
        background: var(--aikido-red);
        display: grid;
        justify-items: center;
    }

    a {
        text-decoration: none;
        color: var(--text-color-contrast);
    }
    
    ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    iframe {
        max-width: 100%;
    }

    figure {
        overflow: clip;
    }

    img {
        max-width: 100%;
        object-fit: cover;
        height: 100%;
    }

    p, h2, h3, h4 {
        padding: 0;
        margin: 0;
    }

    header, footer, section {
        max-width: var(--max-container-width);
        box-sizing: border-box;
    }

    section, .footer-background, .footer-nav {
        padding: 16px 16px 32px 16px;

        @media (width >= 796px) {
            padding-left: clamp(3rem, 10vw, 10rem);
            padding-right: clamp(3rem, 10vw, 10rem);
        }
    }

    h2 {
        font-size: clamp(2rem, 2vw, 3rem);
        margin-bottom: 1rem;
    }

    p, address, a {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }
 
    /* **** */
    /* MARK: Center Background Images
    /* **** */
    
    .japanese-text, header, #wasistaikido, #training, .footer-background {
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
    }
    
    /* **** */
    /* MARK: Color
    /* **** */
    
    #ueberuns, #anfahrt, .training-table {
        background: var(--background-color);
        color: var(--text-color-contrast);
    }
    
    .button {
        color: var(--text-color-contrast);
        background: var(--primary-color);
    }

    #wasistaikido, #training, .footer-background {
        background: var(--image-background);
    }

    /* **** */
    /* MARK: Focus
    /* **** */

    button, .back-button, .button {
        transition: 0.1s;
        &:hover, &:focus-visible {
            scale: 1.1;
        }
    }

    a {
        transition: 0.1s;

        &:focus-visible {
            color: yellow;
        }

    }

    a:not(.button) {
        &:hover{
            color: yellow;
        }

    }

    button, a {
        &:focus-visible {
            outline: 2px dotted yellow;
        }
    }
}

/* **** */
/* MARK: Specific Layer
/* **** */

@layer specific {
    

    /* **** */
    /* MARK: Header
    /* **** */
    
    header {
        width: 100vw;
        height: 80vh;
        background-image: url('../images/headerhintergrund.png');
        display: grid;
        place-items: center;
    
        position: relative;
        overflow-x: clip;
        z-index: 1000;
    
     
    }
    

    
    
    
    .h1-container {
        display: grid;
        justify-items: center;
        align-items: center;

        .japanese-text {
            width: clamp(11rem, 20vw ,25rem);
            max-width: 100%;
            height: auto;
            aspect-ratio: 546.58/207;
            background-image: url('../images/japanischertext.svg');
        }
    }
    
    h1 {
        color: var(--text-color-contrast);
        text-align: center;
        font-size: clamp(2.5rem, 4vw, 4rem);
    }
    
    /* Navigation */  
    .menu-button {
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 1000;
        appearance: none;
        border: none;
        background: none;

        display: grid;
        gap: 6px;
        width: 2rem;
        height: auto;
        padding: 0;
        aspect-ratio: 1.2/1;

        span {
            transform-origin: center left;
            height: 5px;
            width: 100%;
            border-radius: 20px;
            background: var(--text-color-contrast);
            transition: 0.5s;
        }

        &.menu-open {
            span:first-of-type {
                transform: rotate(45deg);
            }

            span:nth-of-type(2) {
                opacity: 0;
            }

            span:nth-of-type(3) {
                transform: rotate(-45deg);
            }

        }

        @media (width >= 674px) {
            display: none;
        }
    }

    .main-navigation {
        position: absolute;
        top: 0rem;
        right: 0rem;
        transform: translateX(100%);
        padding: 2rem 2rem 1rem 1rem;
        background: var(--aikido-red);
        border-bottom-left-radius: 2rem;
        transition: transform 0.2s, padding 0s, width 0.1s;
       
     


        &.menu-visible {
            transform: translateX(0%);
        }
        

       

        .menu-header-menu-container {
            height: 100%;
        
            ul {
                height: 100%;
                display: flex;
                flex-direction: column;
                gap: 0.5rem;

                @media (width >= 674px) {
                    width: 80vw;
                    max-width: calc(var(--max-container-width) * 0.8);
                    justify-content: space-between;
                    flex-direction: row;
                    gap: auto;

                    a:hover {
                        color: white;
                        scale: 1.1;
                    }

                    a:focus-visible {
                        color: yellow;
                        scale: 1.1;
                    }
                } 
        
                li {
                    max-height: 100%;
                    display: grid;
                    align-items: center;
                    justify-items: start;

                    a {
                        height: 4rem;
                        display: flex;
                        align-items: center;
                        justify-content: flex-start;
                        gap: 0.5rem;
                        font-size: clamp(1rem, 3vw, 1.5rem);

                        @media (width >= 674px) {
                            height: clamp(6rem, 12vw, 8rem);
                            flex-direction: column;
                            gap: 0;
                            font-size: clamp(1rem, 2vw, 2rem);
                        }

                        img {
                            height: 100%;
                        }

                    }
                }
            }
        }

        @media (width >= 674px) {
            display: block;
            --height: 6rem;
            transform: translateX(0%);
            top: auto;
            right: auto;
            height: var(--height);
            bottom: calc(var(--height) / -2);
            background: none;
            padding: 0;
            
        } 
    }
    
    /* **** */
    /* MARK: Was ist Aikido
    /* **** */
    
    #wasistaikido {
        position: relative;
        
        &::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url(../images/wasistaikidohintergrund.png);
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            opacity: 0.6;
            z-index: 0;
        }

        * {
            position: relative;
            z-index: 2;
        }
    }

    #wasistaikido {
        display: grid;
        gap: var(--section-gap);

        @media (width >= 609px) {
            grid-template-columns: 1fr 2fr;
            
        }

        @media (width >= 1370px) {
            grid-template-columns: 2fr 3fr;
        }

        @media (width >= 674px) {
            padding-top: clamp(6rem, 10vw, 10rem);
        }

        @media (width >= 807px) {
            padding-bottom: var(--padding-bottom);
        }

        
        p:first-of-type {
            padding-bottom: var(--p-padding-bottom)
        }
        

        figure {
            justify-self: center;
            aspect-ratio: 1;
            align-self: center;
            width: 100%;
            max-width: 20rem;
            min-width: 15rem;
        }
    }

    /* **** */
    /* MARK: Über uns
    /* **** */

    #ueberuns {
        display: grid;
        gap: var(--section-gap);

        @media (width >= 609px) {
            grid-template-columns: 2fr 1fr;
            padding-top: 0;
            padding-bottom: 0;
        }

        @media (width >= 1370px) {
            grid-template-columns: 3fr 2fr;
        }

        figure {
            max-width: max-content;
            border-radius: 2rem;
            justify-self: center;
            width: 100%;
            height: 100%;

            @media (width >= 609px) {
                border-radius: 0px;
            }
        }

        .ueberuns-content {
            @media (width >= 609px) {
                padding-top: 16px;
                padding-bottom: 32px;
            }

            @media (width >= 807px) {
                padding-bottom: var(--padding-bottom);
                padding-top: var(--padding-top);
            }

            
            p:first-of-type {
                padding-bottom: var(--p-padding-bottom)
            }
        

        }
    }
    
    /* **** */
    /* MARK: Training
    /* **** */
    
    #training {
        position: relative;
        
        &::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url(../images/traininghintergund.png);
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            opacity: 0.6;
            z-index: 0;
        }

        * {
            position: relative;
            z-index: 2;
        }

    }

    #training {
        display: grid;
        gap: var(--section-gap);

        @media (width >= 609px) {
            grid-template-columns: 3fr 2fr;
        }


        @media (width >= 807px) {
            padding-bottom: var(--padding-bottom);
            padding-top: var(--padding-top);
        }

        .training-content {
            display: grid;

            p, table {
                margin-bottom: 8px;
            }

          

            .table-container {
                display: grid;
                justify-content: start;
            }
        }

        .training-table {
            font-size: clamp(1.3rem, 3vw, 1.5rem);
            padding: clamp(8px, 2vw, 20px);
            border-radius: 4px;

            tr:not(:last-of-type) {
                margin-bottom: 8px;
            }
        }

        .button {
            font-size: 1.2rem;
            width: clamp(17rem, 80%, 19rem);
            display: grid;
            place-items: center;
            margin: 0.5rem 0;
            padding: 0.9rem 0.9rem 1.1rem 0.9rem;
            border-radius: 22px;
            box-sizing: border-box;
            text-align: center;
            justify-self: center;

            @media (width >= 609px) {
                justify-self: start;
            }
        }

        figure {
            justify-self: center;
            aspect-ratio: 1;
            align-self: center;
            
            width: 100%;
            max-width: 20rem;
            min-width: 15rem;
        }
    }

    /* **** */
    /* MARK: Anfahrt
    /* **** */

    #anfahrt {
        display: grid;
        gap: var(--section-gap);

        @media (width >= 609px) {
            grid-template-columns: 1fr 2fr;
            padding-top: 0;
            padding-bottom: 0;
        }

        @media (width >= 1370px) {
            grid-template-columns: 2fr 3fr;
        }

        iframe {
            height: 20rem;
            width: 100%;

            @media (width >= 609px) {
                height: 100%;
                width: auto;
                aspect-ratio: 1;
            }
        }

        .anfahrt-content {
            address {
                display: grid;
            }
            @media (width >= 609px) {
                padding-top: 16px;
                padding-bottom: 32px;
            }

            @media (width >= 807px) {
                padding-bottom: var(--padding-bottom);
                padding-top: var(--padding-top);
            }

          
            p:first-of-type, address {
                padding-bottom: var(--p-padding-bottom)
            }
            
        }
    }
    
    /* **** */
    /* MARK: Footer
    /* **** */
    
    footer {
        color: var(--text-color-contrast);
        width: 100vw;
    }
    
    .footer-background {
        position: relative;
        
        &::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url(../images/footerhintergrund.png);
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            z-index: 0;
        }

        * {
            position: relative;
            z-index: 2;
        }
    }

    .footer-background {
        display: grid;
        gap: var(--section-gap);

        @media (width >= 609px) {
            grid-template-columns: 1fr 1fr 1fr;
        }

        address {
            display: grid;
            gap: var(--section-gap);
        }

        .logo-container {
            display: grid;
            place-items: center;
            

            @media (width >= 609px) {
                align-self: center;
                max-height: max-content;
            }

            p {
                display: grid;
                place-items: center;
            }
        }

        .federation-container {
            display: grid;
            place-items: center;

            @media (width >= 609px) {
                align-self: center;
                max-height: max-content;
            }

            p {
                max-width: max-content;
                text-align: center;

                  @media (width >= 609px) {
                        text-align: left;
                    }
            }
        }
    }
    
    .footer-nav {
        background: var(--background-color);
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;

        #menu-footer-menu {
            display: grid;
        }

        a {
            display: block;
            padding: 0.5rem 0;
        }
    }






    /* **** */
    /* MARK: Templates
    /* **** */

    .template {
        background: white;
        position: relative;

        h2 {
            font-size: clamp(2rem, 5vw, 3rem);
        }
        
        &::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url(../images/wasistaikidohintergrund.png);
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            opacity: 0.6;
            z-index: 0;
        }

        * {
            position: relative;
            z-index: 2;
        }
    }

    .template {
        width: 100%;
        box-sizing: border-box;
        padding: 16px 16px 32px 16px;

        h2:not(:first-of-type) {
            margin-top: 1rem;
        }

        
        @media (width >= 796px) {
            padding-left: clamp(3rem, 10vw, 10rem);
            padding-right: clamp(3rem, 10vw, 10rem);
        }

         @media (width >= 674px) {
            padding-top: 3rem;
            padding-bottom: 3rem;
        }
    }


    /* Impressum */

    .impressum {
        display: grid;
        gap: var(--section-gap);

        iframe {
            width: 100%;
            height: 20rem;
        }

        @media (width >= 907px) {
            grid-template-columns: 2fr 1fr;

            .iframe {
                display: grid;
                place-items: center;
                iframe {
                    height: auto;
                    aspect-ratio: 1;
                }
            }
        }
    }    



    /* **** */
    /* MARK: secondary header
    /* **** */
    

    .back-button {
        width: 10rem;
        height: auto;
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        padding: 0;
        appearance: none;
        background: none;
        border: none;

        display: flex;
        color: var(--text-color-contrast);
        align-items: center;
        font-size: 1.4em;
        transition: 0.1s;

        

        svg {
            width: 50%;
        }
    }

    

}    
