@import url(./fonts.css);
@import url(./colors.css);

:root {
    --lateral: 40px;
}
body {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 12pt;
    font-weight: 500;
    background-color: var(--grey-2);
    color: var(--grey-12);
    padding: 10px;
}

main {
    max-width: 800px;
    margin: auto;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

h1,
h2 {
    font-size: 24pt;
}
h3,
h4 {
    font-size: 14pt;
}

section,
.experience-list > li {
    background-color: var(--grey-1);
    padding: 20px var(--lateral);
    border-radius: 8px;
    outline: 1px solid var(--grey-8);
    outline-offset: -1px;
    box-shadow: var(--card-shadow);
}

a {
    color: inherit;
    text-decoration: none;
}

.no-section {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-left: var(--lateral);
    color: var(--grey-12);
}

.head {
    display: flex;
    flex-direction: column;
    gap: 16px;

    .head-main {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .summary {
        color: var(--grey-11);
    }

    .head-main > img {
        height: 100px;
        border-radius: 10000px;
        outline: 1px solid var(--grey-8);
        outline-offset: -1px;
        box-shadow: 0 0 10px solid black;

        @media (max-width: 700px) {
            height: 42px;
            align-self: flex-start;
        }
    }

    .bio {
        display: flex;
        flex-direction: column;
        gap: 4px;

        .name-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }

        /* only shown in print, where the page URL isn't otherwise visible */
        .web-link {
            display: none;
            align-items: center;
            gap: 0.6em;
            padding: 0.4em 0.8em;
            border: 1px solid var(--grey-8);
            border-radius: 6px;
            background-color: var(--grey-2);
            color: var(--grey-10);
            font-size: 0.85em;
            font-weight: 400;
            line-height: 1.3;

            .icon {
                width: 1.2em;
                height: 1.2em;
                margin: 0;
                color: var(--grey-12);
            }
        }

        .web-link-text {
            display: flex;
            flex-direction: column;
        }

        .web-link-label {
            color: var(--grey-12);
        }

        & .ref {
            display: flex;
            gap: 140px;
            color: var(--grey-10);
            font-weight: 400;

            div {
                display: flex;
                flex-direction: column;
            }

            @media (max-width: 700px) {
                gap: 0;
                flex-direction: column;
            }
        }
    }
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    list-style: none;
    padding: 0;
}

.company-head,
.role-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.company-head {
    justify-content: space-between;
}

.role-head > h4,
.bio > h3 {
    color: var(--accent-10);
}

.date {
    color: var(--grey-10);
    font-weight: 300;
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    list-style-type: disc;
    padding-left: 12px;
    margin-top: 8px;

    & > li:not(:last-of-type) {
        position: relative;
        &::before {
            content: " ";
            display: block;
            width: 1px;
            position: absolute;
            left: -11px;
            top: 30px;
            bottom: -15px;
            background-color: var(--grey-8);
        }
    }
}

.role-desc {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--grey-11);

    a {
        text-decoration: underline;
    }
}

.company-desc {
    color: var(--grey-11);
}

/* body copy in Regular, lighter than the Medium used for the rest of the page */
.summary,
.company-desc,
.role-desc,
.about-text {
    font-weight: 400;
}

.about-text {
    color: var(--grey-11);
}

/* a grouping label rather than an employer, so it sits a step below "Mavenoid" */
.earlier-title {
    color: var(--grey-11);
}

.earlier-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 8px 0 0;

    .role-head {
        flex-wrap: wrap;

        /* employer in the default color, job title in the accent, like Mavenoid */
        > h4 {
            color: inherit;
        }

        > span:not(.date) {
            color: var(--accent-10);
        }
    }
}

.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 40px;

    h3 {
        margin-bottom: 8px;
        color: var(--accent-10);
    }

    .school {
        color: var(--grey-10);
    }

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

.languages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 20px;
    list-style: none;
    padding: 0;
    margin: 0;

    li {
        display: flex;
        flex-direction: column;
    }

    span {
        color: var(--grey-10);
    }
}

/* favicon-sized company logos next to employer names */
.logo {
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    border-radius: 3px;
    vertical-align: -0.12em;
}

/* for dark logos with a transparent background, so they stay visible in dark mode */
.logo-on-white {
    background-color: white;
}

/* inline SVGs filled with currentColor, so they follow the text color and theme */
.icon {
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.4em;
    vertical-align: -0.1em;
}

@page {
    size: A4;
    margin: 0;
}

@media print {
    :root {
        /* tighter padding inside the boxes */
        --lateral: 24px;
    }

    body {
        /* keep the theme's background instead of letting the browser drop it */
        print-color-adjust: exact;
        /* more room around the boxes */
        padding: 10px 24px;
        font-size: 14px;
    }

    .no-section {
        font-size: 16pt;
    }

    h3,
    h4 {
        font-size: 12pt;
    }

    .experience-list {
        gap: 40px;
    }

    .head .head-main {
        gap: 20px;
    }

    .head .bio {
        /* stretch up to the photo so the web link sits at the right */
        flex: 1;

        .web-link {
            display: flex;
        }
    }

    section,
    .role-list > li,
    .earlier-list > li {
        break-inside: avoid;
    }

    /* on paper the link target is invisible, so show the username */
    a[data-handle]::after {
        content: " (" attr(data-handle) ")";
    }
}
