/* Import variables from common.css */
@import url('/assets/css/common.css');

/* Resume page styles */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background: var(--almost-white);
    overflow-y: auto;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    overflow-y: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    position: static;
    width: auto;
}

/* Keep clear of the home page's fixed sidebar (max 240px) when shown in its frame */
@media (min-width: 769px) {
    .container {
        margin-left: max(250px, calc((100% - 800px) / 2));
    }
}

/* Resume content */
.resume {
    padding-bottom: 40px;
    text-align: left;
    display: block;
    width: 100%;
    clear: both;
}

.resume-header {
    margin-bottom: 40px;
}

.resume-header h1 {
    font-size: large;
    font-weight: normal;
    margin: 0 0 15px 0;
}

.contact {
    font-size: 14px;
    color: var(--secondary-text);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.contact a {
    color: var(--secondary-text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.contact a:hover {
    border-bottom: 1px solid var(--highlight-color);
}

/* Divider */
.resume-divider {
    border-top: 1px solid var(--border-color);
    margin: 40px 0;
    width: 100%;
    clear: both;
}

/* Sections */
.section {
    margin-bottom: 32px;
}

/* Section labels in the same style as the home page's menu categories, over a dashed rule */
.section h2 {
    font-size: 10px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 14px 0;
    border-bottom: 1px dashed var(--secondary-text);
    padding-bottom: 4px;
    color: var(--secondary-text);
}

.section p {
    margin: 0 0 4px 0;
    font-size: 14px;
}

/* Entry styling */
.entry {
    display: flex;
    margin-bottom: 12px;
}

.year {
    flex: 0 0 60px;
    font-weight: normal;
    color: var(--secondary-text);
    font-size: 14px;
}

.details {
    flex: 1;
}

.details .title {
    margin-bottom: 5px;
    font-size: 14px;
}

.details .description {
    color: var(--secondary-text);
    font-size: 14px;
}

strong {
    font-weight: normal;
    color: var(--text-color);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .entry {
        flex-direction: column;
    }
    
    .year {
        flex: none;
        margin-bottom: 5px;
    }
    
    body, .container {
        height: auto;
        overflow-y: auto;
    }
    
    .resume {
        padding-bottom: 100px;
    }
}
/* Links inside entries (project pages, sites) */
.details a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--secondary-text);
}

.details a:hover {
    border-bottom-color: var(--text-color);
}

/* English / 日本語 switch */
.lang-switch {
    font-size: 14px;
    color: var(--secondary-text);
    margin-bottom: 24px;
}

.lang-switch button {
    font: inherit;
    color: var(--secondary-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.lang-switch button.active {
    color: var(--text-color);
    border-bottom: 1px solid var(--text-color);
}

.resume[hidden] {
    display: none;
}

/* Small images under key entries */
.entry-imgs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 4px;
}

.entry-imgs img {
    height: 110px;
    width: auto;
    border: 1px solid rgba(128, 128, 128, 0.25);
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* Images with a small caption under each (function → screen) */
.entry-imgs figure {
    margin: 0;
    display: table;
}

.entry-imgs.captioned {
    align-items: flex-start;
}

.entry-imgs.captioned img {
    height: 190px;
}

.entry-imgs figcaption {
    display: table-caption;
    caption-side: bottom;
    font-size: 10px;
    line-height: 1.3;
    margin-top: 3px;
    color: var(--secondary-text);
}

/* Mobile: the page scrolls up-down, app screens scroll left-right */
@media screen and (max-width: 899px) {
    /* common.css locks html at screen height with overflow hidden; the body grows to its full length, so let the page itself scroll */
    html {
        height: auto;
        overflow-y: auto;
    }

    .entry-imgs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .entry-imgs > * {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

/* Desktop: like the gallery pages, the page runs left-right in columns, app screens scroll up-down */
@media screen and (min-width: 900px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 0;
        height: 100vh;
    }

    .lang-switch {
        position: fixed;
        top: 20px;
        left: 250px;
        z-index: 2;
        margin: 0;
    }

    .resume:not([hidden]) {
        display: flex;
        gap: 48px;
        box-sizing: border-box; /* width is 100%: without this the side padding made it 298px wider than the window and the last column was cut off */
        height: 100vh;
        padding: 64px 48px 36px 250px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: none;
    }

    /* Bottom-aligned like the gallery pages. Entries flow into columns of their own;
       a project with screens gets a whole column that scrolls up-down by itself */
    .resume-header {
        flex: 0 0 26rem;
        align-self: flex-end;
    }

    .section {
        flex: 0 0 auto;
        height: 100%;
        margin: 0;
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-content: flex-start;
        column-gap: 48px;
        position: relative;
        padding-bottom: 30px;
    }

    .section > * {
        width: 26rem;
    }

    /* The section label runs under all of its columns, like a caption line */
    .section > h2 {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        margin: 0;
        border-bottom: none;
        border-top: 1px dashed var(--secondary-text);
        padding: 4px 0 0;
    }

    .section .entry {
        flex-direction: column;
    }

    .section .entry .details {
        flex: none;
    }

    .section .entry:has(.entry-imgs) {
        height: 100%;
        overflow-y: auto;
        scrollbar-width: thin;
        justify-content: safe flex-end;
    }

    .year {
        flex: none;
        margin-bottom: 2px;
    }

    .entry-imgs {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .entry-imgs img,
    .entry-imgs.captioned img {
        height: auto;
        width: auto;
        max-width: 100%;
        max-height: 70vh;
    }
}

@media print {
    .section > * { display: revert !important; }
    .lang-switch { display: none; }
}
