:root {
    --portfolio-bg: #FFFFFF;
    --portfolio-bg-muted: #F2F2F2;
    --portfolio-text: #8C8C8C;
    --portfolio-text-strong: #8C8C8C;
    --portfolio-accent: #F0AA64;
    --portfolio-quote-color: #b8b8b8;
    --portfolio-font: "Inter", sans-serif;
    --portfolio-display-font: "Cal Sans", "Inter", sans-serif;
    --portfolio-layout-width: 1240px;
    --portfolio-content-width: 928px;
}

html,
body {
    min-height: 100%;
    background: var(--portfolio-bg);
    color: var(--portfolio-text);
    font-family: var(--portfolio-font);
    font-size: 16px;
}

body {
    margin: 0;
}

a {
    color: inherit;
}

a:hover,
a:focus-visible {
    color: var(--portfolio-accent);
}

#page-wrapper {
    display: grid;
    grid-template-columns: max-content max-content;
    width: max-content;
    max-width: 100%;
    min-height: 100vh;
    margin-inline: auto;
    box-sizing: border-box;
}

#portfolio-sidebar {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: max-content;
    height: 100vh;
    max-height: 100vh;
    padding: 48px 12px 24px;
    overflow-y: auto;
    background: var(--portfolio-bg);
    color: var(--portfolio-text);
}

.portfolio-brand {
    flex: 0 0 auto;
    margin: 0 0 40px;
    padding: 0;
}

.mgg-brand {
    display: inline-block;
    margin: 0;
    padding: 0;
    color: var(--portfolio-text-strong);
    font-family: var(--portfolio-display-font);
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
}

.home .mgg-brand,
.mgg-brand:hover,
.mgg-brand:focus-visible {
    color: var(--portfolio-accent);
}

.portfolio-navigation {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    width: max-content;
    padding-right: 20px;
    box-sizing: border-box;
}

.portfolio-navigation .navigation-group-spacer {
    height: 1rem;
    margin: 0 !important;
    padding: 0 !important;
}

.portfolio-navigation ul {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.portfolio-navigation li {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    line-height: 1.5;
}

.portfolio-navigation li::before,
.portfolio-navigation li::marker {
    content: none !important;
    display: none !important;
}

.portfolio-navigation li > a {
    display: inline-block;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--portfolio-text);
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    text-decoration: none;
    text-indent: 0 !important;
    transition: color 150ms ease;
}

.portfolio-navigation li > a:hover,
.portfolio-navigation li > a:focus-visible,
.portfolio-navigation li > a.active {
    color: var(--portfolio-accent);
}

.portfolio-navigation .vita-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.portfolio-navigation .vita-link > a {
    display: inline-flex;
    width: auto;
    max-width: none;
}

.portfolio-navigation li:nth-child(6) > a {
    white-space: nowrap;
}

.portfolio-linkedin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    color: var(--portfolio-text);
    text-decoration: none;
    transition: color 150ms ease;
}

.portfolio-linkedin svg {
    display: block;
    width: 15px;
    height: 15px;
}

.portfolio-linkedin:hover,
.portfolio-linkedin:focus-visible {
    color: var(--portfolio-accent);
}

.portfolio-sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    margin-top: 30px;
    padding: 0;
    text-align: left;
}

.portfolio-copyright {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color: var(--portfolio-text);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

.portfolio-main {
    grid-column: 2;
    grid-row: 1;
    width: max-content;
    min-width: 0;
    margin: 0;
    padding: 0;
}

#body-wrapper {
    min-width: 0;
    margin: 0;
    padding: 24px 0;
    background: transparent;
}

#body-wrapper > .container {
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
}

#body-wrapper,
#body-wrapper > .container,
#body-wrapper > .container > .content-item,
#body-wrapper article.content-item {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#body-wrapper > .container > .content-item,
#body-wrapper article.content-item {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

#body-wrapper h1 {
    margin: 0 0 1.5rem;
    color: var(--portfolio-text-strong);
    font-family: var(--portfolio-display-font);
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
}

#body-wrapper h2 {
    margin-top: 2rem;
    color: var(--portfolio-text-strong);
    font-family: var(--portfolio-display-font);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0;
}

#body-wrapper h2::before {
    display: none;
}

#body-wrapper h3 {
    font-family: var(--portfolio-display-font);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.25;
}

#body-wrapper p,
#body-wrapper li,
#body-wrapper dl {
    font-size: 1rem;
    line-height: 1.5;
}

#body-wrapper dt {
    opacity: 0.6;
}

.project-images {
    width: 100%;
    max-width: 100%;
    margin-top: 3rem;
}

.project-images figure {
    max-width: 100%;
    margin: 0 0 2rem;
}

.project-images img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

.portfolio-project-grid {
    display: grid;
    grid-template-columns: repeat(3, 272px);
    gap: 24px;
    align-items: start;
    width: max-content;
    max-width: 100%;
    margin-inline: 0;
}

.portfolio-project-card {
    width: 272px;
    min-width: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.portfolio-project-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.portfolio-project-link img,
.portfolio-project-link .portfolio-project-placeholder {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin: 0;
    box-sizing: border-box;
}

.portfolio-project-link .portfolio-project-placeholder {
    background: var(--portfolio-bg-muted);
}

.portfolio-project-link h2.portfolio-project-title {
    margin: 4px 0 0 !important;
    padding: 0;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    font-weight: 600;
    overflow-wrap: anywhere;
    color: var(--portfolio-text);
    transition: color 0.15s ease;
}

.portfolio-project-link:hover h2.portfolio-project-title,
.portfolio-project-link:focus-visible h2.portfolio-project-title {
    color: var(--portfolio-accent) !important;
}

.portfolio-project-link:hover img.portfolio-project-image,
.portfolio-project-link:focus-visible img.portfolio-project-image {
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

@media (max-width: 1200px) {
    .portfolio-project-grid {
        grid-template-columns: repeat(2, 272px);
    }
}

@media (max-width: 900px) {
    .portfolio-project-grid {
        grid-template-columns: 272px;
    }
}

@media (max-width: 640px) {
    #page-wrapper {
        display: block;
        width: 100%;
        max-width: none;
        min-height: 100vh;
    }

    #portfolio-sidebar {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        max-height: none;
        padding: 24px;
        overflow: visible;
    }

    .portfolio-brand {
        margin-bottom: 20px;
    }

    .portfolio-sidebar-bottom {
        margin-top: 2rem;
    }

    .portfolio-main {
        width: 100%;
        margin: 0;
    }

    #body-wrapper {
        padding: 0 0 24px;
    }

    #body-wrapper > .container {
        width: 100%;
        max-width: 608px;
        margin-inline: auto;
        padding: 16px;
    }

    #portfolio-sidebar .portfolio-navigation li:nth-child(6) > a {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 360px) {
    #portfolio-sidebar {
        padding: 20px 16px;
    }

    #body-wrapper > .container {
        padding: 16px;
    }

    .mgg-brand {
        font-size: 2.25rem;
    }
}

@media (max-width: 320px) {
    .portfolio-project-grid {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .portfolio-project-card {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Projektseiten: Breite an das Startseiten-Kachelraster anpassen */

body.project {
    --project-content-width: 896px;
}

body.project .portfolio-main {
    width: var(--project-content-width);
}

body.project #body-wrapper {
    width: 100%;
}

body.project #body-wrapper > .container {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

body.project .project-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.project .project-page p {
    overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
    body.project {
        --project-content-width: 600px;
    }
}

@media (max-width: 900px) {
    body.project {
        --project-content-width: 304px;
    }
}

@media (max-width: 640px) {
    body.project .portfolio-main {
        width: 100%;
    }

    body.project #body-wrapper > .container {
        width: 100%;
        max-width: 608px;
        margin-inline: auto;
    }
}

/* Projektinformationen */

.project-header {
    margin: 0 0 3rem;
    padding-top: 8px;
    text-align: right;
}

.project-title {
    margin: 0 0 2.5rem !important;
    color: var(--portfolio-text-strong);
    font-family: var(--portfolio-display-font);
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
}

.project-meta {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--portfolio-text);
}

.project-meta strong {
    font-weight: 600;
    margin-right: 0.75em;
}

/* Projektbeschreibung als Blocksatz */

.project-page p {
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: justify;
    hyphens: auto;
}

/* Default-Seite: Typografie und Listen */

body:not(.home):not(.project) #body-wrapper h1 {
    text-align: right;
    margin-bottom: 2.5rem;
}

body:not(.home):not(.project) #body-wrapper p,
body:not(.home):not(.project) #body-wrapper li {
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: left;
}

/* Äußere Bulletpoints entfernen */

body:not(.home):not(.project) #body-wrapper > .container > .content-item > ul {
    list-style: none;
    padding-left: 0;
}

/* Untergeordnete Listen */

body:not(.home):not(.project) #body-wrapper li > ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-top: 0.25rem;
}

/* Abstände zwischen beruflichen Stationen */

body:not(.home):not(.project) #body-wrapper > .container > .content-item > ul > li {
    margin-bottom: 0.75rem;
}

/* Default-Seite: vertikale Position */

body:not(.home):not(.project) #body-wrapper {
    padding-top: 32px;
}

/* Default-Seite: Breite wie Start- und Projektseite */

body:not(.home):not(.project) {
    --default-content-width: 896px;
}

body:not(.home):not(.project) .portfolio-main {
    width: var(--default-content-width);
}

body:not(.home):not(.project) #body-wrapper {
    width: 100%;
}

body:not(.home):not(.project) #body-wrapper > .container {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

@media (max-width: 1200px) {
    body:not(.home):not(.project) {
        --default-content-width: 600px;
    }
}

@media (max-width: 900px) {
    body:not(.home):not(.project) {
        --default-content-width: 304px;
    }
}

@media (max-width: 640px) {
    body:not(.home):not(.project) .portfolio-main {
        width: 100%;
    }

    body:not(.home):not(.project) #body-wrapper > .container {
        width: 100%;
        max-width: 608px;
        margin-inline: auto;
    }
}


/* Vita: Berufserfahrung und Ausbildung */

/* Hauptstationen */
body:not(.home):not(.project) .content-item > ul {
    list-style: none;
    padding-left: 0;
}

body:not(.home):not(.project) .content-item > ul > li {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 0;
    list-style: none;
}

/* Jahreszahl und Tätigkeit */
body:not(.home):not(.project) .content-item > ul > li > strong {
    display: inline-block;
    width: 100px;
    vertical-align: top;
}

/* Zeitachsen-Segment pro Station */
body:not(.home):not(.project) .content-item > ul > li::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1.2rem;
    bottom: -0.8rem;
    width: 1px;
    background:var(--portfolio-quote-color);
}

/* Letzte Station ohne nachlaufende Linie */
body:not(.home):not(.project) .content-item > ul > li:last-child::before {
    display: none;
}

/* Unterpunkte */
body:not(.home):not(.project) .content-item > ul > li > ul {
    list-style: none;
    padding-left: 0;
    margin-left: 80px;
    margin-top: 0.75rem;
    width: calc(100% + 80px);
    box-sizing: border-box;
    text-wrap: pretty;
}

body:not(.home):not(.project) .content-item > ul > li > ul > li {
    list-style: none;
    margin-bottom: 0.5rem;
}

/* Keine Aufzählungszeichen */
body:not(.home):not(.project) .content-item > ul > li > ul > li::marker {
    content: "";
}

/* Vita: schmale Bildschirme */
@media (max-width: 640px) {
    body:not(.home):not(.project) .content-item > ul > li > strong {
        width: 120px;
    }

    body:not(.home):not(.project) .content-item > ul > li > ul {
        margin-left: 120px;
        padding-left: 0;
    }
}

/* Vita: Abstand nach einer Hauptliste */

body:not(.home):not(.project) .content-item > h1 + ul {
    margin-block-end: 4rem;
}

/* Projektseiten: Zitate */
body.project #body-wrapper blockquote {
    margin-left: 1rem;
    margin-right: 0;
    padding-left: 1rem;
    padding-right: 0;
    border-left: 1px solid var(--portfolio-quote-color);
}


/* Projektgalerie: horizontaler Slider */

.project-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "track track"
        "prev next";
    row-gap: 4px;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0 0;
}

.project-gallery__track {
    grid-area: track;
    display: flex;
    gap: 24px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.project-gallery__track::-webkit-scrollbar {
    display: none;
}

.project-gallery__item {
    display: block;
    flex: 0 0 272px;
    width: 272px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-snap-align: start;
}

.project-gallery__item img {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin: 0;
}

.project-gallery__arrow {
    position: static;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--portfolio-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.project-gallery__arrow--prev {
    grid-area: prev;
    justify-self: start;
}

.project-gallery__arrow--next {
    grid-area: next;
    justify-self: end;
}

.project-gallery__arrow:hover {
    color: var(--portfolio-accent);
}

.project-gallery__arrow[hidden] {
    display: none;
}

/* Abstand zwischen Galerie-Pfeilen und folgendem Text */
.project-gallery + p {
    margin-top: 0.5rem;
}

/* Lightbox */

.project-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.92);
}

.project-lightbox[hidden] {
    display: none;
}

.project-lightbox__image {
    display: block;
    width: 90vw;
    max-width: 90vw;
    height: auto;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.project-lightbox__caption {
    margin: 0;
    padding: 0 24px;
    max-width: 90vw;
    font-family: var(--portfolio-font);
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
    text-align: center;
    overflow-wrap: anywhere;
    color: #fff;
    text-decoration: none;
}

.project-lightbox__close,
.project-lightbox__prev,
.project-lightbox__next {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: #999;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: color 0.15s ease;
}

.project-lightbox__close {
    top: 20px;
    right: 24px;
    font-size: 2.25rem;
}

.project-lightbox__prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.project-lightbox__next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.project-lightbox__close:hover,
.project-lightbox__prev:hover,
.project-lightbox__next:hover {
    color: var(--portfolio-accent) !important;
}

body.project-lightbox-open {
    overflow: hidden;
}

/* Galerie: Bilder nicht per Rechtsklick oder Drag öffnen/speichern */

.project-gallery img,
.portfolio-project-link img {
    user-select: none;
    -webkit-user-drag: none;
}

/* Galerie: Pläne vollständig und mit weißem Hintergrund anzeigen */

.project-gallery__item--plan {
    background: #fff;
}

.project-gallery__item--plan img {
    object-fit: contain;
    background: #fff;
}

/* Galerie: Titel unter den Bildern */

.project-gallery__item {
    text-decoration: none !important;
}

.project-gallery__caption {
    display: block;
    margin: 4px 0 0;
    padding: 0;
    font-family: var(--portfolio-font);
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
    overflow-wrap: anywhere;
    color: var(--portfolio-text);
    text-decoration: none;
}

/* Initiale am Anfang des Projekttextes */

.project-page p::first-letter {
    float: left;
    font-size: 3.2em;
    line-height: 0.8;
    padding-right: 0.12em;
    padding-top: 0.04em;
}

/* Lightbox: Fokusrahmen am Schließen-Button entfernen */

.project-lightbox__close:focus,
.project-lightbox__close:focus-visible {
    outline: none;
    box-shadow: none;
}

