html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

body {
    margin: auto;
    font-family: Arial, Helvetica, sans-serif;
    margin-bottom: 20vh;
    background-color: #cccccc;
}

details {
    cursor: pointer;
}

a {
    color: #0000cb;
}

main > h1 {
    margin-bottom: -0.5rem;
}

code {
    font-size: large;
}

ul {
    list-style: "- ";
}

img {
    width: 16px;
    height: 16px;
}

img.medium {
    width: 32px;
    height: 32px;
}

img.large, a.skill-icon > img {
    width: 48px;
    height: 48px;
}

img.auto {
    width: unset;
    height: unset;
}

/* remove space from both a paragraph and the list elements if a list comes after a p */

p:has(+ ul, + ol) {
    margin-bottom: 0px;
}

p + ul, p + ol {
    margin-top: 0px;
}

/* page layout */

.gridbox {
    display: grid;
    grid-template-columns: 1fr minmax(auto, 1200px) 1fr;
    align-items: start;
}

.sidebar {
    grid-column: 1;
    justify-self: end;
    position: sticky;
    top: 5px;
    padding: 5px;
}

.mainbox {
    grid-column: 2;
    padding: 10px;
}

.gridbox > * + * {
    border-left: none;
}

/* quest stuff */

.act {
    text-align: center;
    font-weight: bold;
    font-size: x-large;
}

.quest-infocard {
    margin-bottom: 1.5rem;
}

.quest-infocard img {
    vertical-align: -2px;
}

.quest-header {
    display: flex;
    gap: 5px;
    margin-bottom: 4px;
    align-items: flex-end;
}

.quest-header span {
    font-weight: bold;
}

.quest-grid {
    display: grid;
    grid-template-columns: auto auto;
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    width: fit-content;
}

.quest-item {
    box-sizing: border-box; 
    padding: 2px 5px 2px 2px;
    border-bottom: 1px solid #000000;
    border-right: 1px solid #000000;
}

.quest-item.full-width {
    grid-column: 1 / -1;
}

.label {
    font-weight: bold;
    width: 100px;
    flex-shrink: 0;
}

div.quest-grid + p {
    margin-top: 0.25rem;
}

/* skill trees */

.class-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: 1rem repeat(6, 48px);
    gap: 16px 24px;
    background-size: cover;
    background-position: center;
    background-color: white;
    padding: 8px;
}

.skill-grid > a {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.25s ease-out, filter 0.5s ease-out;

    & > img {
        display: block;
        width: 48px;
        height: 48px;
    }
}

.skill-grid > a:hover {
    transform: scale(1.5);
    filter: brightness(1.75);
}

.skill-icon.full-width {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
}


/* media queries have to be at the bottom (hierarchical) */

@media (769px <= width <= 1080px) {
    .mainbox{
        width: calc(100vw - 200px);
    }

    .class-container {
        flex-direction: column;
        align-items: center;
        gap: 64px;
    }
}

@media (max-width: 768px) {
    .gridbox {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-column: 1;
        justify-self: start;
        position: static;
    }

    .mainbox {
        grid-column: 1;
    }

    .quest-grid {
        grid-template-columns: 1fr;
    }

    .class-container {
        flex-direction: column;
        align-items: center;
        gap: 64px;
    }
}