/* =========================
   GRUNDINSTÄLLNINGAR
========================= */

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#wrapper {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
    box-sizing: border-box;
}

/* =========================
   BAKGRUNDSBILD
========================= */

#bakgrund {
    width: 100%;
    height: 100%;
    grid-column: 1 / 6;
    grid-row: 1 / 6;
    object-fit: cover;
}

/* =========================
   LOGGOR
========================= */

#bildkeeper {
    grid-column: 1 / 6;
    grid-row: 4;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;

    gap: clamp(20px, 5vw, 70px);
    width: 100%;
}

.loggor {
    width: clamp(90px, 14vw, 270px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        filter 0.35s ease;

    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.4),
        0 0 25px rgba(241, 242, 242, 0.3);
}

.loggor:hover {
    transform: scale(1.1) rotate(3deg);
    filter: brightness(1.2);

    box-shadow:
        0 0 10px #f7f8f8,
        0 0 25px #eef1f1,
        0 0 50px #e9eaeb,
        0 0 80px rgba(220, 221, 222, 0.7);
}

.loggor:active {
    transform: scale(0.95);
}

/* =========================
   TILLBAKA-KNAPP
========================= */

.back-button {
    grid-row: 1;
    grid-column: 1;

    justify-self: start;
    align-self: start;

    width: fit-content;
    height: auto;
    padding: 10px 20px;
    box-sizing: border-box;

    color: #ffffff;
    background: rgba(0, 0, 0, 0.4);

    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 5px;

    font-family: Georgia, serif;
    font-size: 16px;
    letter-spacing: 1px;

    text-decoration: none;
    backdrop-filter: blur(4px);

    position: relative;
    z-index: 5;

    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    transform: translateX(-3px);
}

/* =========================
   RUBRIKER
========================= */

.h11 {
    grid-column: 2 / 5;
    grid-row: 1;

    color: blue;
    font-size: clamp(24px, 4vw, 36px);
    text-align: center;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

.h12 {
    grid-column: 2 / 5;
    grid-row: 2 / 4;

    color: blue;
    font-size: clamp(18px, 2.5vw, 25px);
    line-height: 1.6;
    text-align: center;

    width: 100%;
    max-width: 800px;
    justify-self: center;
    align-self: center;

    margin: 0;
    padding: 15px;
    box-sizing: border-box;

    overflow-wrap: break-word;
}

/* =========================
   ABOUT ME / CONTACT ME
   Ingen scrollning
========================= */

html:has(body.contact-page) {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body.contact-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.contact-page #wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 15px;
    box-sizing: border-box;
}

/* Bakgrund på About Me och Contact Me */

body.contact-page #bakgrund {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    z-index: -1;
    pointer-events: none;
}

/* About Me-text */

body.contact-page p.h12 {
    grid-column: 2 / 5;
    grid-row: 2 / 4;

    width: 100%;
    max-width: 800px;
    justify-self: center;
    align-self: center;

    color: white;
    font-size: clamp(18px, 2.5vw, 28px);
    line-height: 1.6;
    text-align: center;

    padding: 15px;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Contact Me-rubrik högst upp */

body.contact-page h1.h12 {
    grid-column: 2 / 5;
    grid-row: 1;

    justify-self: center;
    align-self: start;

    width: 100%;
    max-width: 800px;

    margin: 0;
    padding: 25px 10px 10px;

    color: white;
    font-family: Georgia, serif;
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.3;
    text-align: center;

    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* Kontaktuppgifter nere till höger */

body.contact-page .contactinfo {
    grid-column: 4 / 6;
    grid-row: 4 / 6;

    justify-self: end;
    align-self: end;

    width: 100%;
    max-width: 420px;
    margin: 0;
    padding: 15px 20px 25px 10px;

    box-sizing: border-box;

    color: white;
    font-family: Georgia, serif;
    font-size: clamp(15px, 1.8vw, 23px);
    line-height: 1.6;
    text-align: right;

    overflow-wrap: anywhere;
    position: relative;
    z-index: 2;
}

body.contact-page .contactinfo p {
    margin: 6px 0;
}

/* =========================
   PROJECTS
   Scrollning tillåten
========================= */

html:has(body.projects-page) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body.projects-page {
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;

    overflow-x: hidden;
    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
}

.projects-page #wrapper {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 100vh;

    display: block;
    padding-top: 1px;
    box-sizing: border-box;
    overflow: visible;
}

/* Bakgrund på Projects */

.projects-page #bakgrund {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

/* Tillbaka-knapp på Projects */

.projects-page .back-button {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 3;

    width: auto;
    height: auto;
    padding: 10px 20px;

    color: white;
    background: rgba(0, 0, 0, 0.35);

    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;

    font-family: Georgia, serif;
    font-size: 16px;
    text-decoration: none;

    backdrop-filter: blur(5px);
}

/* Projekt-rutor */

.projects-page .project-container {
    position: relative;
    z-index: 2;

    width: 88%;
    max-width: 1450px;
    margin: 0 auto;

    padding: 100px 0 60px;
    box-sizing: border-box;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 160px);

    gap: 35px;
    align-content: center;
}

/* Projektens utseende */

.projects-page .project-box {
    box-sizing: border-box;
    width: 100%;
    height: 160px;
    padding: 25px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    color: white;
    font-family: Georgia, serif;

    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(230, 240, 255, 0.8);
    border-radius: 10px;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.25),
        inset 0 0 10px rgba(255, 255, 255, 0.08);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        background 0.35s ease;
}

/* Projektrubriker */

.projects-page .project-box h2 {
    margin: 0 0 12px;
    font-size: 25px;
    font-weight: normal;
}

/* Projektbeskrivningar */

.projects-page .project-box p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

/* Hover-effekt */

.projects-page .project-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);

    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(220, 235, 255, 0.25);
}

/* =========================
   SURFPLATTA
========================= */

@media (max-width: 900px) {
    .projects-page .project-container {
        width: 85%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: 160px;
        gap: 25px;
        padding-top: 100px;
    }
}

/* =========================
   MOBIL
========================= */

@media (max-width: 550px) {

    /* Projects: en kolumn */

    .projects-page .project-container {
        width: 82%;
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-rows: 150px;
        gap: 20px;
        padding-top: 100px;
        padding-bottom: 60px;
        align-content: start;
    }

    .projects-page .project-box {
        height: 150px;
        padding: 20px;
    }

    /* Contact Me-rubrik på mobil */

    body.contact-page h1.h12 {
        grid-column: 2 / 6;
        grid-row: 1;

        font-size: 25px;
        line-height: 1.3;
        padding: 25px 8px 10px;
    }

    /* Kontaktuppgifter nere till höger på mobil */

    body.contact-page .contactinfo {
        grid-column: 2 / 6;
        grid-row: 4 / 6;

        width: 100%;
        max-width: 100%;
        padding: 10px 12px 20px 5px;

        font-size: 15px;
        line-height: 1.5;
        text-align: right;
    }

    /* About Me-text på mobil */

    body.contact-page p.h12 {
        grid-column: 1 / 6;
        grid-row: 2 / 5;

        font-size: 20px;
        line-height: 1.6;
        padding: 20px;
    }

    /* Back-knappen ska ligga ovanpå */

    body.contact-page .back-button {
        position: relative;
        z-index: 5;
        padding: 8px 12px;
        font-size: 14px;
    }
}
