/* ════════════════════════════════════════════
   TOKENS & FONTS
   ════════════════════════════════════════════ */

:root {
    --orange: #ff6a00;
    --grey: #bbbbbb;
    --black: #222;
    --white: #ffffff;

    /* Two font sizes only */
    --font-size-s: 0.8rem;
    /* very small — nav, metadata, index list */
    --line-height-s: .8rem;
    --font-size: 1.5rem;
    /* normal — headings, body text */
    --line-height: 1.2;

    --regular: "Diatype-Regular", system-ui, -apple-system, sans-serif;
    --bold: "Diatype-Bold", system-ui, -apple-system, sans-serif;
}

@font-face {
    font-family: "Diatype-Regular";
    src: url(/assets/fonts/ABCDiatypeEdu-Regular.woff2) format("woff2");
}

@font-face {
    font-family: "Diatype-Bold";
    src: url(/assets/fonts/ABCDiatypeEdu-Bold.woff2) format("woff2");
}


/* ════════════════════════════════════════════
   RESET
   ════════════════════════════════════════════ */

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::-webkit-scrollbar {
    display: none;
}


/* ════════════════════════════════════════════
   BASE / TYPOGRAPHY
   ════════════════════════════════════════════ */

body {
    font-family: var(--bold);
    color: var(--black);
    background-color: var(--white);
    padding-left: 20px;
    padding-right: 20px;
}

body:not(.template-home) {
    padding-top: 0px;
}

h1,
h2,
h3,
p {
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-weight: normal;
}

h1,
h2 {
    max-width: 30ch;
    padding-bottom: 1.2em;
}

p {
    max-width: 65ch;
    text-wrap: balance;
}

.subtitle {
    color: var(--grey);
}

/* span uses the small size */
span {
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
    font-family: var(--regular);
}

a:hover {
    color: var(--orange);
}

/* English text uses the regular (lighter) weight */
.en :is(h1, h2, h3, p) {
    font-family: var(--regular);
}

html.lang-de .en {
    display: none !important;
}

html.lang-en .de {
    display: none !important;
}

#lang-de-btn,
#lang-en-btn {
    cursor: pointer;
}

html.lang-de #lang-de-btn {
    font-family: var(--bold);
    color: var(--black);
}

html.lang-en #lang-en-btn {
    font-family: var(--bold);
    color: var(--black);
}

html.lang-de #lang-en-btn {
    color: var(--grey);
}

html.lang-en #lang-de-btn {
    color: var(--grey);
}

main {
    margin-top: 10vh;
}


/* ════════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════════ */

nav {
    display: grid;
    grid-template-columns: 10% 1fr 1fr 1fr;
    margin: 0px 0px;
    padding: 5px 5px;
    background-color: transparent;
    transition: background-color 0.2s ease;
    font-family: var(--regular);
    position: fixed;
    top: 0;
    left: 20px;
    right: 20px;
    z-index: 100;

    a {
        text-decoration: none;
        color: var(--black);
        font-size: var(--font-size-s);
        line-height: var(--line-height-s);
    }
}

nav:hover {
    background-color: var(--grey);
}

.logo {
    grid-column: 1 / 3;
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--bold);
    color: var(--orange);
}

.logo-year {
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--regular);
    color: var(--black);
}

.lang-switch {
    position: absolute;
    right: 5px;
}

#nav-burger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
    font-family: var(--regular);
    color: var(--black);
    padding: 0;
}


/* ════════════════════════════════════════════
   PROJECT DETAIL VIEW  (project.php)
   ════════════════════════════════════════════ */

/* ── Image strip ────────────────────────── */
#project-imgs {
    display: flex;
    gap: 20px;
    height: 80vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;

    img {
        max-height: 80vh;
        height: auto;
        width: auto;
        flex-shrink: 0;
        object-fit: contain;
        filter: grayscale(0%);
    }

    img:hover {
        filter: grayscale(100%);
    }
}

/* ── Info column ────────────────────────── */
#project-info-column {
    margin-top: 20px;
}

.project-author-block {
    display: flex;
}

.project-courses-block {
    display: flex;
}

.project-courses-block p {
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
}

.project-credits {
    margin-bottom: 20px;
}

/* ── Content sections (DE / EN) ─────────── */
.project-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;
}

/* ── Meta (supervisors etc.) ────────────── */
.meta-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;

    p {
        font-size: var(--font-size-s);
        line-height: var(--line-height-s);
    }
}

ul.supervisors {
    list-style: none;
    padding: 0;
}

ul.supervisors li {
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
}




/* ════════════════════════════════════════════
   PROJECTS HERO  (projects.php)
   ════════════════════════════════════════════ */

#projects-hero {
    width: 100vw;
    margin-left: -20px;
    margin-bottom: 40px;
}

#projects-hero canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* ════════════════════════════════════════════
   PROJECTS LIST VIEW  (projects.php)
   ════════════════════════════════════════════ */

/* ── Shared table grid ──────────────────── */
.projects-table {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

/* ── Sort bar — inherits columns from parent */
.sort-bar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    margin-bottom: 10px;
    font-family: var(--regular);
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
}

.sort-course-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.sort-btn {
    color: var(--black);
    border: none;
    background-color: transparent;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
    font-family: var(--regular);
}

.sort-btn:hover,
.sort-btn.active {
    color: var(--orange);
}

.sort-arrow {
    font-size: var(--font-size-s);
}

/* ── Grid — inherits columns from parent ── */
.projects-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    list-style: none;
}

.project-item {
    display: contents;
    /* li is transparent — children join parent grid */
}

.project-item a {
    border-top: 1px solid var(--grey);
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    text-decoration: none;
    color: var(--black);
}

.project-item a:hover {
    color: var(--orange);
    background-color: var(--grey);
}

.project-item img,
.project-item .placeholder-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    background-color: var(--grey);
    margin-bottom: 10px;
}

.project-item a:hover img {
    filter: grayscale(100%);
}

.project-item h2,
.project-item p {
    padding-bottom: 0;
    font-size: var(--font-size);
    line-height: var(--line-height);
}

/* Spans inside project items must inherit — not be overridden by global span rule */
.project-item h2 span,
.project-item p span {
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
}

/* ── Card metadata ──────────────────────── */
.project-item .project-card-author,
.project-card-course {
    font-family: var(--regular);
}

.project-card-course {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: var(--font-size-s) !important;
    line-height: var(--line-height-s);
}

/* ── Hover image preview ────────────────── */
.project-hover-img {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1000;
    max-width: 300px;
}

.project-hover-img.visible {
    opacity: 1;
}

.project-hover-img img {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(100%);
    opacity: .8;
}


/* ════════════════════════════════════════════
   HOME VIEW
   ════════════════════════════════════════════ */

/* ── Slideshow ──────────────────────────── */
#home-slideshow {
    position: relative;
    width: 100vw;
    margin-left: -20px;
    height: 80vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-nav {
    position: absolute;
    top: 0;
    width: 30%;
    height: 100%;
    z-index: 20;
}

#slide-prev {
    left: 0;
    cursor: w-resize;
}

#slide-next {
    right: 0;
    cursor: e-resize;
}

#slide-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--black);
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.dot.active {
    background: var(--black);
}

/* ── Intro Block ────────────────────────── */
#home-intro {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
}

.home-intro-text {
    max-width: 650px;
    font-size: var(--font-size);
    line-height: var(--line-height);
}

.home-intro-meta {
    text-align: right;
    font-family: var(--regular);
}

.home-tagline span {
    font-size: var(--font-size);
    line-height: var(--line-height);
}

/* ── Links ──────────────────────────────── */
#home-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0 80px;
}

.home-link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid var(--black);
    border-bottom: 1px solid transparent;
    text-decoration: none;
    color: var(--black);
}

.home-link-card:hover {
    color: var(--orange);
    border-top-color: var(--orange);
}

.home-link-label {
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-family: var(--bold);
}

.home-link-arrow {
    font-size: var(--font-size);
    line-height: var(--line-height);
}

.home-link-sub {
    font-size: var(--font-size-s);
    line-height: var(--line-height-s);
    font-family: var(--regular);
}


/* ════════════════════════════════════════════
   RESPONSIVE STYLING (MOBILE)
   ════════════════════════════════════════════ */
@media screen and (max-width: 768px) {

    /* Font sizes unchanged on mobile — same two-size system */
    :root {
        --font-size-s: .8rem;
        --line-height-s: 1rem;
        --font-size: 1.2rem;
        --line-height: 1.2;
    }

    /* Base spacing adjustments */
    body {
        padding-left: 10px;
        padding-right: 10px;
    }

    body:not(.template-home) {
        padding-top: 0px;
        /* Accounts for stacked nav */
    }

    /* Navigation */
    nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 6px 10px;
        margin: 0px;
        background-color: var(--white);
        /* Solid bg for mobile readability */
    }

    .logo {
        grid-column: auto;
        padding-right: 50px;
        /* leaves room for burger button */
    }

    .logo-year {
        display: block;
    }

    nav {
        left: 0;
        right: 0;
        width: 100vw;
        padding-left: 10px;
        padding-right: 10px;
    }

    nav:hover {
        background-color: var(--white);
        /* Disable hover effect on mobile */
    }

    #nav-burger {
        display: block;
        position: static;
        margin-left: auto;
        align-self: flex-start;
        font-size: var(--font-size);
        line-height: var(--line-height);
    }

    .nav-item {
        display: none;
        width: 100%;
        font-size: var(--font-size);
        line-height: var(--line-height);
    }

    /* Active expanded menu */
    nav.open {
        background-color: var(--white);
        box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
        padding-bottom: 10px;
    }

    nav.open .nav-item {
        display: block;
    }

    /* Remove previously absolute-positioned lang-switch */
    .lang-switch {
        position: static;
    }

    /* Home View */
    #home-slideshow {
        margin-left: -10px;
        width: 100vw;
    }

    #home-intro {
        flex-direction: column;
        gap: 20px;
    }

    .home-intro-meta {
        text-align: left;
    }

    #home-links {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .home-link-card {
        padding: 15px 0;
    }

    /* Project Detail View */
    .project-info-section,
    .meta-section {
        grid-template-columns: 1fr;
        text-wrap: balance;
    }

    #project-view {
        margin-top: 10vh;
    }

    #project-imgs {
        width: 100%;
        height: auto;
        z-index: -1;
        opacity: 0.1;
        filter: grayscale(100%);
        overflow: hidden;
        /* display: none; */
    }

    #project-imgs img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* Projects List View — keep desktop grid on mobile */

    /* Hide degree/course column and its sort buttons */
    .project-card-courses,
    .sort-course-block {
        display: none;
    }

    /* Single column list — override subgrid layout */
    .projects-table {
        display: block;
    }

    .sort-bar {
        display: flex;
        gap: 15px;
        margin-bottom: 10px;
    }

    .projects-grid {
        display: block;
    }

    .project-item {
        display: list-item;
        list-style: none;
    }

    .project-item a {
        display: block;
    }

    .project-item h2,
    .project-item p {
        font-size: var(--font-size);
        line-height: var(--line-height);
    }


    /* Column visibility — controlled by data-column on #projects-list */
    /* Default / title selected: show title, hide authors */
    #projects-list[data-column="title"] .project-card-authors {
        display: none;
    }

    /* Author selected: show authors, hide title */
    #projects-list[data-column="author"] .project-title {
        display: none;
    }

    /* Disable hover preview images on touch devices */
    .project-hover-img {
        display: none !important;
    }

    .project-item a:hover {
        background-color: transparent;
    }
}