* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f2f3f4;
    --primary-color: #038801;
    --secondary-color: #A28031;
    --bg-color-secondary: #FAFAFA;
    --text-color: #1E1E1E;
    --primary-font: 'Poppins', sans-serif;
    --header-font: 'Merriweather', sans-serif;
}

/* KLASSER FÖR JAVASCRIPT NAV */
.nav-open {
    transform: translateY(0);
}

.rotate-bar {
    transform: rotateZ(45deg);
    position: absolute;
}

.rotate-bar:nth-child(2) {
    opacity: 0;
    visibility: hidden;
}

.rotate-bar:nth-child(3) {
    transform: rotateZ(-45deg);
}

main {
    margin-top: 118px;
}

section {
    width: 95%;
    margin: 4rem auto;
    scroll-margin-top: 118px;
    background-color: var(--bg-color-secondary);
    box-shadow: 0 .4rem 16px 4px rgb(234, 234, 234);
    border-radius: 1rem;
    padding: .5rem;
}

/* KLASS FÖR SEKTIONER */
.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
}

.gdpr-hidden {
    display: none !important;
}

.error {
    color: rgb(166, 23, 23);
}

.success {
    color: var(--primary-color);
    font-weight: 600;
}

.open {
    opacity: 1;
    visibility: visible;
    height: auto;
}

h3 {
    font-family: var(--header-font);
    margin: 1rem 0;
    color: var(--primary-color);
    padding: 0 .5rem;
    font-weight: 800;
}

body {
    background-color: var(--bg-color);
    font-family: var(--primary-font);
    color: var(--text-color);

    /* HEADER */
    header {
        background: url("../img/karstorp-header.png") no-repeat center;
        background-size: cover;
        width: 100%;
        display: grid;
        place-items: center;
        padding: .5rem 0;
        z-index: 3;
        position: fixed;
        top: 0;


        #header-content {
            background: rgba(255, 255, 255, 0.8);
            width: 95%;
            padding: .5rem;
            border-radius: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;

            h1 {
                color: var(--primary-color);
                font-family: var(--header-font);
                font-size: 1.7rem;
                width: 20%;
            }
        }

        /* HAMBURGERMENY */
        #burger {
            width: 30px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: .2rem;
            height: 22px;
            cursor: pointer;

            .bar {
                width: 28px;
                height: 4px;
                background-color: var(--primary-color);
                border-radius: 1rem;
                transition: .5s ease;

            }
        }
    }

    nav {
        background-color: var(--bg-color-secondary);
        transform: translateY(-100%);
        z-index: 2;
        width: 100%;
        transition: .5s ease;
        position: fixed;
        top: 102px;

        #main-nav {
            display: flex;
            flex-direction: column;
            margin: 0;
            padding-left: 0;
            list-style: none;

            li {
                border-left: 5px solid var(--bg-color-secondary);
                transition: .3s ease;
                position: relative;

                &.selected {
                    border-left: 5px solid var(--secondary-color);

                    a {
                        color: var(--secondary-color);
                    }
                }

                &.open {
                    >ul.dropdown {
                        display: block;
                        opacity: 1;
                        visibility: visible;
                        height: auto;
                    }
                }

                a {
                    display: flex;
                    gap: 1rem;
                    align-items: center;
                    padding: .8rem;
                    color: var(--primary-color);
                    text-decoration: none;
                    font-size: 1.3rem;
                    font-family: var(--header-font);
                    font-weight: 700;

                    &:hover {
                        color: var(--secondary-color);
                    }

                    .icon {
                        width: 30px;
                        display: flex;
                        justify-content: center;
                    }

                    .plus-icon {
                        margin-left: auto;
                    }
                }

                ul.dropdown {
                    opacity: 0;
                    height: 0;
                    overflow: hidden;
                    visibility: hidden;
                    margin-left: 40px;
                    transition: .5s ease;

                    li {
                        a {
                            font-size: 1.1rem;
                        }
                    }
                }
            }
        }
    }
}

/* SECTION START */
section#start {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: transparent;

    .card {
        width: 100%;
        background-color: var(--bg-color-secondary);
        box-shadow: 0 .4rem 16px 4px rgb(234, 234, 234);
        border-radius: 1rem;

        .card-img {
            img {
                border-top-left-radius: 1rem;
                border-top-right-radius: 1rem;
                width: 100%;
                aspect-ratio: 16/9;
                object-fit: cover;
            }
        }

        .card-wrapper {
            padding: .5rem;

            h2 {
                font-size: 1.3rem;
                letter-spacing: .5px;
                font-weight: 700;
                color: var(--primary-color);
                font-family: var(--header-font);
            }

            h3 {
                font-weight: 600;
                padding: 0;
                margin: .5rem 0;
                font-family: var(--primary-font);
                color: var(--text-color);
            }

            p.content {
                margin: .5rem 0;
                letter-spacing: .3px;
                line-height: 1.5;
                transition: all .5s ease;
            }

            p.created_at {
                font-style: italic;
                font-size: .9rem;
            }

            button {
                width: 100%;
                background-color: var(--secondary-color);
                border: none;
                color: var(--bg-color);
                font-size: 1rem;
                border-radius: .5rem;
                padding: .5rem;
                font-weight: 700;
                cursor: pointer;
                margin: 1rem 0;
            }
        }
    }
}

/* SECTION KOLONIST > ORDNINGSREGLER */
section#ordningsregler {
    ol {
        width: 95%;
        margin: 0 auto;
        list-style-position: inside;

        li {
            letter-spacing: .5px;
            margin-bottom: 1rem;
            letter-spacing: .5px;
        }
    }
}


/* SECTION FÖRENINGEN > STYRELSEN */
section#styrelsen {
    .board-card {
        border-bottom: 2px solid var(--secondary-color);

        &:last-child {
            border: none;
        }

        table {
            width: 100%;
            padding: .5rem;

            tr {

                th {
                    text-align: left;
                    width: 50%;
                    font-weight: 600;
                }
            }

        }
    }
}

/* SECTION FÖRENINGEN > STADGAR */
section#stadgar {
    ol {
        width: 95%;
        margin: 0 auto;
        list-style-position: inside;

        li {
            letter-spacing: .5px;
            margin-bottom: 1rem;
            letter-spacing: .5px;
        }
    }
}

/* SECTION HISTORIA */
section#historia {

    h2 {
        font-family: var(--header-font);
        color: var(--primary-color);
        margin: .5rem 0;
    }

    h3 {
        margin: 0;
        padding: 0;
        color: var(--text-color);
        font-family: var();
    }

    p {
        margin: 1rem auto;
    }
}

section#kopa-stuga {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background-color: transparent;

    h3 {
        margin: 0;
    }

    .card {
        background-color: var(--bg-color-secondary);
        box-shadow: 0 .4rem 16px 4px rgb(234, 234, 234);
        border-radius: .5rem;

        .card-img {
            display: flex;
            max-width: 600px;
            position: relative;
            overflow: hidden;
            transition: transform 0.5s ease;

            .img-wrap {
                display: flex;
                transition: transform 0.5s ease;
                width: 100%;

                /* Om 3 bilder, 100% * antal */
                img {
                    width: 100%;
                    aspect-ratio: 1/1;
                    object-fit: cover;
                    border-top-left-radius: .5rem;
                    border-top-right-radius: .5rem;
                    flex-shrink: 0;
                }
            }

        }

        .btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: var(--primary-color);
            color: #fff;
            border: none;
            padding: .5rem;
            font-size: 1rem;
            cursor: pointer;
            border-radius: 50%;
            display: grid;
            place-content: center;
        }

        .prev {
            left: 5px;
            width: 2rem;
            height: 2rem;
        }

        .next {
            right: 5px;
            width: 2rem;
            height: 2rem;


        }

        .card-wrapper {
            padding: .5rem;
            display: flex;
            flex-direction: column;

            span.address,
            p.description {
                font-weight: 600;
            }

            p {
                white-space: pre-line;
            }

            p.published {
                font-style: italic;
                align-self: flex-end;
            }
        }
    }

}

/* SECTION LOGIN */
section#login {
    background-color: transparent;
    padding: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 1rem;

    p {
        font-weight: 700;
    }

    #login-ul {
        background-color: var(--bg-color-secondary);
        padding: .5rem;
        border-radius: 1rem;

        li {
            list-style: none;
        }
    }

    form {

        .form-wrapper,
        button {
            width: 95%;
        }
    }
}

section#change_ownership {
    select {
        padding: .5rem;
        border: 1px solid #ccc;
        border-radius: .5rem;
        font-size: 1rem;
    }
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--bg-color-secondary);
    padding: .5rem 0;
    border-radius: 1rem;

    .form-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0 auto;


        label {
            font-weight: 600;
        }

        input {
            padding: .5rem;
            border-radius: .5rem;
            border: 1px solid #ccc;
            font-size: 1rem;
            outline: none;
            color: rgb(67, 67, 67);

            &:focus {
                box-shadow: 0 0 5px var(--primary-color);
                transition: box-shadow 0.3s, border-color 0.3s;
            }
        }

        textarea {
            height: 10rem;
            border-radius: .5rem;
            border: none;
            border: 1px solid #ccc;
            padding: .5rem;
            font-size: 1rem;
            color: rgb(67, 67, 67);

            outline: none;

            &:focus {
                box-shadow: 0 0 5px var(--primary-color);
                transition: box-shadow 0.3s, border-color 0.3s;
            }
        }

        .custom-select {
            border-radius: .5rem;
            border: 1px solid #ccc;
            font-size: 1rem;
            outline: none;
            background-color: #fff;
            position: relative;

            &:focus {
                box-shadow: 0 0 5px var(--primary-color);
                transition: box-shadow 0.3s, border-color 0.3s;
            }
        }

        select {
            appearance: none;
            background-color: transparent;
            border: none;
            margin: 0;
            width: 100%;
            font-family: inherit;
            font-size: inherit;
            cursor: inherit;
            line-height: inherit;
            height: 38px;
            grid-area: select;
            z-index: 1;
            outline: none;

            option {
                font-size: 1rem;
                background-color: #fff;
            }

            &::-ms-expand {
                display: none;
            }

        }

        .select {
            display: grid;
            grid-template-areas: "select";
            align-items: center;
            position: relative;
            width: 100%;
            border: 1px solid #ccc;
            background-color: #fff;
            font-size: 1rem;
            cursor: pointer;
            max-height: 38px;
            border-radius: .5rem;
            color: rgb(67, 67, 67);
            padding: 0 .5rem;

            &::after {
                content: "";
                justify-self: end;
                background-color: var(--primary-color);
                width: .8rem;
                height: .5rem;
                clip-path: polygon(100% 0%, 0 0%, 50% 100%);
                grid-area: select;
            }

        }

        select:focus+.focus {
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            box-shadow: 0 0 5px var(--primary-color);
            transition: box-shadow 0.3s, border-color 0.3s;
            border-radius: inherit;
        }
    }

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

        input[type="file"] {
            display: none;
        }

        .custom-file-upload {
            background-color: var(--bg-color-secondary);
            cursor: pointer;
            font-size: 1rem;
            border-radius: .5rem;
            border: 2px solid var(--secondary-color);
            color: var(--secondary-color);
            text-align: center;
            font-weight: 600;
            letter-spacing: .5px;
            max-height: 36px;
            padding: .2rem;
        }
    }

    button {
        width: 100%;
        margin: 0 auto;
        background-color: var(--secondary-color);
        border: none;
        color: var(--bg-color);
        font-size: 1rem;
        border-radius: .5rem;
        padding: .5rem;
        font-weight: 700;
        cursor: pointer;
    }

    .gdpr {
        label {
            display: flex;
            gap: 1rem;

            input[type="checkbox"] {
                background-color: #fff;
                appearance: none;
                border: 1px solid #ccc;
                width: 1.5rem;
                height: 1.5rem;
                /* transform: translateY(.25rem); */
                border-radius: .25rem;

                display: grid;
                place-content: center;
            }

            input[type="checkbox"]::before {
                content: "";
                width: 1rem;
                height: 1rem;
                clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
                transform: scale(0);
                transform-origin: bottom left;
                transition: 120ms transform ease-in-out;
                box-shadow: inset 1em 1em var(--primary-color);
                /* Windows High Contrast Mode */
                background-color: CanvasText;
            }

            input[type="checkbox"]:checked::before {
                transform: scale(1);
            }
        }
    }

    p.gdpr-modal span {
        color: var(--primary-color);
        cursor: pointer;
        text-decoration: underline;

    }
}

#login-nav {
    background-color: var(--primary-color);
    color: var(--bg-color-secondary);
    font-weight: 600;
    padding: .5rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;

    a {
        color: white;
        font-size: 1.1rem;
    }
}

section#profile {
    background-color: var(--bg-color);
    box-shadow: none;

    nav {
        position: inherit;
        transform: translateY(0);

        ul {
            display: flex;
            gap: 1rem;
            background-color: #f2f3f4;
            place-items: center;
            box-shadow: 0;


            li {
                border-radius: .5rem;
                background-color: var(--bg-color-secondary);
                border: 1px solid var();
                text-align: center;
                width: 100%;
                /* box-shadow: -4px -4px 8px 4px rgb(255, 255, 255), 4px 4px 8px 4px rgb(189, 189, 189); */
                box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);



                a {
                    font-size: 1.1rem;
                    text-decoration: underline;
                    color: var(--primary-color);
                    letter-spacing: .5px;
                    font-family: var(--primary-font);
                    font-weight: 500;

                    .nav-text {
                        text-align: center;
                        width: 100%;
                    }
                }
            }
        }
    }
}

section#edit_user {
    background-color: transparent;

    .result-user_amount {
        display: flex;

        p.search_result {
            flex-basis: 100%;
        }

        .user_amount {
            display: flex;
            justify-content: flex-end;
            width: 100%;
        }
    }

    form {
        padding: .5rem;
        margin-bottom: 1rem;

        input[type="search"] {
            padding: .5rem;
            font-size: 1rem;
            border: 1px solid #ccc;
            border-radius: .5rem;
        }

    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    th,
    tr:nth-child(1) {
        display: none;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid #ccc;
        border-radius: 8px;
        background-color: var(--bg-color-secondary);
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: .4rem;

    }

    button {
        width: 100%;
        margin: 0;
        background-color: var(--secondary-color);
        border: none;
        color: var(--bg-color);
        font-size: 1rem;
        border-radius: .5rem;
        padding: .5rem;
        font-weight: 700;
        cursor: pointer;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
    }
}

section#integrity_policy {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    ul {
        margin: 0 1rem;
    }
}