/* global styles */

:root {
    --primary: #1f3a5f;
    --secondary: #2b6cb0;
    --background: #f5f7fa;
    --text: #1a1a1a;
    --white: #ffffff;
    --hover: #1e4e8c;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Times';
    background-color: var(--background); 
    margin: 0;
    color: var(--text);
}

main {
    margin-top: 14px;
    margin-bottom: 14px;
    margin-left: 74px;
    margin-right: 74px;
    flex: 1;
}

nav {
    background-color: var(--primary);
    padding: 8px;
}

header {
    position: sticky;
    top: 0;
}

#meny {
    justify-content: center;
}

#meny li {
    padding-right: 5%;
    padding-left: 5%;
}

nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
}

nav a {
    text-decoration: none;
    font-size: larger;
    color: var(--white);
    font-weight: bold;
}

nav a:hover {
    color: #cbd5e1;
}

footer {
    display: flex;
    justify-content: center;
    background-color: var(--primary);
    color: var(--white);
    padding: 8px;
}

footer * {
    padding-right: 3%;
    margin: 1%;
    color: var(--white);
}

/* index styles */

#index-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;

    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

#index-text-div {
    flex: 1;
    max-width: 600px;
    line-height: 1.6;
}

#index-image-div {
    flex: 1;
    display: flex;
    justify-content: center;
}

#index-image-div img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* projekt styles */

#projekt-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px auto;
    padding: 0 20px;
    max-width: 1000px;
}

.projekt-button {
    display: block;
    background-color: var(--secondary);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: var(--white);
    transition: transform 0.2s, box-shadow 0.2s;
}

.projekt-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background-color: var(--hover);
}

/* kontakt styles */

#kontakt-section {
    text-align: center;
    margin: 50px 0;
}

.kontakt-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.kontakt-link {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    background-color: var(--secondary);
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s, background-color 0.2s;
}

.kontakt-link:hover {
    transform: translateY(-3px);
    background-color: var(--hover);
}

/* form */

form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

button {
    background-color: var(--secondary);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
}

button:hover {
    background-color: var(--hover);
}

/* media queries */

@media (max-width: 1024px) {

    main {
        margin-left: 30px;
        margin-right: 30px;
    }

    #index-section {
        gap: 1.5rem;
        padding: 1.5rem;
    }

    #projekt-section {
        grid-template-columns: repeat(2, 1fr);
    }

    nav ul {
        gap: 10px;
    }
}

@media (max-width: 768px) {

    main {
        margin-left: 15px;
        margin-right: 15px;
    }

    #index-section {
        flex-direction: column;
        text-align: center;
    }

    #index-image-div img {
        max-width: 250px;
    }

    #projekt-section {
        grid-template-columns: 1fr;
    }

    #meny {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {

    nav a {
        font-size: 16px;
    }

    h2 {
        font-size: 24px;
    }

    p {
        font-size: 14px;
    }

    #index-image-div img {
        max-width: 200px;
    }
}