body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
}

main {
    min-height: 100vh;
    padding-top: 50px;
}

body {
    background-color: #f0f0f0;
    overflow: auto;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: -10;
    background-color: #3566af;
    padding: 20px 0 10px;
}

header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #3566af;
    clip-path: polygon(100% 0, 0 100%, 0 0);
}

#rollierender-Subtext span {
    display: none;
}

#rollierender-Subtext span.active {
    display: inline-block;
}

.portfolio-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.portfolio-image {
    flex: 0 0 400px;
    margin-right: 20px;
    margin-top: -50px;
}

.portfolio-content {
    flex: 1;
}

.portfolio-container {
    margin: 0 15%;
}

.portfolio-head {
    text-align: right;
}

.portfolio-head h1 {
    font-size: 12em;
    font-family: 'Bebas Neue', "Century Gothic", sans-serif;
    font-weight: normal;
    line-height: 0.8em;
    color: #2e3a5591;
    margin: 0;
    text-align: left;
}

.portfolio-head h2 {
    color: #2e3a55;
    text-align: left;
    line-height: 0.5em;
    font-size: 2em;
}

.portfolio-head .h7 {
    color: #2e3a5591;
    text-align: left;
    font-size: 1.5em;
}


.grid-container h4 {
    color: #2e3a55;
    text-align: center;
    line-height: 1em;
    font-size: 1em;
}

.vita-container {
    text-align: left;
    max-width: 50%;
    margin: -15px auto 50px;
}

.vita-container p {
    color: #2e3a55;
    font-size: 1em;
    text-align: left;
}

.start {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: -20px;
    padding: 60px 5% 80px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.grid-container p {
    color: #2e3a55;
    font-size: 0.9em;
    text-align: left;
}

.square {
    cursor: pointer;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 250px;
    position: relative;
    transition: all 0s ease;
    background-color: #a1c4ec;
}

.leftSquare {
    justify-self: right;
}

.rightSquare {
    justify-self: left;
}

.square h2 {
    margin: 5px auto;
    padding: 10px;
    text-align: center;
    font-family: 'Bebas Neue', "Century Gothic", sans-serif;
    font-size: 2.5em;
    line-height: 1em;
    letter-spacing: 0.05em;
    color: #f9f9ff;
}

.square h3 {
    margin: 0;
    padding: 10px;
    text-align: center;
    font-size: 1.5em;
    font-weight: lighter;
    color: #2e3a55;
    position: absolute;
    bottom: 33%;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
}


.arrow {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #2e3a55;
    transition: transform 0s ease;
}

.square.active {
    max-width: none;
    width: calc(100% - 20px);
    height: auto;
    aspect-ratio: auto;
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 10px auto;
    padding: 20px;
    box-sizing: border-box;
}

.square.active h2 {
    position: static;
    text-align: center;
    display: block;
    padding: 10px;
}

.square.active h3 {
    position: static;
    text-align: center;
    display: block;
    padding: 10px;
}

.square.active .arrow {
    transform: rotate(180deg);
}

.square.active::before {
    display: none;
}

article {
    display: none;
    padding: 20px;
}

.square.active article {
    display: block;
}


.preview-container {
    display: flex;
    /* Use Flexbox for alignment */
    align-items: center;
    justify-content: center;
    /* Vertically center the items */
}

.automatisierung {
    align-items: center;
    margin: 80px;
}

.spacer {
    margin-top: 80px;
}


.preview-container img {
    width: 100px;
    /* Adjust image width as needed */
    height: auto;
    /* Maintain aspect ratio */
    margin-right: 15px;
    /* Add space between image and text */
}

.preview-container a {
    text-decoration: underline;
    /* Restore the underline */
    color: inherit;
    /* Use the default text color */
}

.preview-container a:hover {
    color: #f9f9fF;
    /* Change color on hover (e.g., blue) */
}


.thumbnail-grid {
    grid-template-columns: repeat(3, 200px);
}

.leseprobe-grid {
    grid-template-columns: repeat(1, 200px);
}


.thumbnail-grid,
.leseprobe-grid {
    display: grid;
    /*grid-template-columns: repeat(3, 200px);*/
    /* Fixed 4 columns, each 100px wide */
    gap: 10px;
    /* Distance between thumbnails */
    justify-content: center;
    /* Centers the entire grid horizontally */
    padding: 10px;
    /* Optional: Adds padding around the grid */
    width: fit-content;
    /* Ensures the grid only takes up as much space as needed */
    margin: auto;
    /* Centers the grid within its container */
}

.lphead {
    margin-top: 50px;
    margin-bottom: -10px;
}



.squ2.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}


/* Ensures incomplete rows are centered */
.thumbnail-grid::after,
.leseprobe-grid::after {
    content: "";
    width: 100px;
    /* Matches the width of a thumbnail */
    height: 0;
    /* Prevents the pseudo-element from taking up vertical space */
}


.thumbnail,
.thumbnaillp {
    width: 200px;
    /* Fixed width */
    height: 200px;
    /* Fixed height */
    background-size: contain;
    /* Ensures the entire image fits within the thumbnail */
    background-position: center;
    /* Centers the image */
    background-repeat: no-repeat;
    /* Prevents the image from repeating */
    cursor: pointer;
    position: relative;
    /* Required for the backdrop */
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.3);
}

.thumbnail::before,
.thumbnaillp::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /*background-color: rgba(255, 255, 255, 0.3);*/
    /* White backdrop at 30% opacity */
    z-index: -1;
    /* Ensures the backdrop is behind the image */
}

.thumbnail:hover,
.thumbnaillp:hover {
    box-shadow: inset 0 0 0 3px #2e3a5591;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 90vmin;
    /* Scales up to 90% of the smaller viewport dimension */
    height: 90vmin;
    /* Ensures the popup remains square */
    max-width: 900px;
    /* Limits the maximum width to 900px */
    max-height: 900px;
    /* Limits the maximum height to 900px */
    overflow: hidden;
    /* Prevents the image from overflowing the popup */
}

.popup.active {
    display: block;
    /* Shows the popup when active */
}

.full-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centers the image */
    max-width: 100%;
    /* Ensures the image fits within the popup */
    max-height: 100%;
    /* Ensures the image fits within the popup */
    object-fit: contain;
    /* Maintains the image's aspect ratio */
    border-radius: 5px;
    /* Optional: Adds rounded corners to the image */
}

.arrow-left,
.arrow-right,
.arrow-left-lp,
.arrow-right-lp {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: white;
    cursor: pointer;
    user-select: none;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.arrow-left,
.arrow-left-lp {
    left: 10px;
}

.arrow-right,
.arrow-right-lp {
    right: 10px;
}



.leseprobe-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.full-img-lp {
    max-width: 90%;
    max-height: 90%;
    cursor: grab;
    user-select: none;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #3566af;
    cursor: pointer;
    z-index: 1001;
}

.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.zoom-in,
.zoom-out {
    background-color: rgba(53, 102, 175, 0.7);
    border: none;
    color: white;
    font-size: 1rem;
    padding: auto;
    cursor: pointer;
    width: 30px;
    height: 30px;
}


.radio-grid-container {
    background-color: #f9f9ff;
    width: 100%;
    margin-top: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: calc(100vh - 85px);
    flex-grow: 1;
}

.radio-grid-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #f9f9ff;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.radio-grid-container h3 {
    color: #2e3a55;
    font-size: 3em;
    text-align: center;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 0;
    padding-bottom: 0;
}

.radio-grid-container h6 {
    color: #3566af;
    font-size: 1em;
    margin-top: 0;
}

#radio-grid {
    display: grid;
    grid-template-columns: repeat(50, auto);
    gap: 1px;
    width: fit-content;
    margin: 0 auto 10px;
}

#clear-button {
    margin: 0 auto 10px;
    ;
}

#radio-grid input[type="checkbox"] {
    appearance: none;
    width: 10px;
    height: 10px;
    border: 1px solid #999;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

#radio-grid input[type="checkbox"]:checked {
    background-color: #334195;
}

footer {
    background-color: #f9f9ff;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    position: fixed;
    bottom: 0;
    z-index: 15;
}

.footer-menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.footer-menu li {
    display: inline-block;
    margin: 0 10px;
}

.footer-menu a {
    text-decoration: none;
    color: #2e3a55;
}

.impressum {
    padding-bottom: 80px;
}




@media screen and (max-width: 768px) {

    .portfolio-container {
        flex-direction: column;
        align-items: center;
    }

    .portfolio-image {
        flex: 0 0 75%;
        max-width: 75%;
        margin-top: -200px;
        margin-bottom: -100px;
        margin-left: -150px;
        transform: scale(0.5);
    }

    .portfolio-head h1 {
        font-size: 15vw;
    }

    .portfolio-head h2 {
        font-size: 6vw;
        line-height: 6vw;
    }

    .portfolio-head .h7 {
        font-size: 3vw;
    }

    .vita-container {
        max-width: 70%;
    }

    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        justify-items: center;
        /* Center items in the grid */
    }

    .leftSquare,
    .rightSquare {
        justify-self: center;
    }

    .square.active {
        max-width: 100%;
        width: 100%;
        margin: 0;
        grid-column: 1;
        grid-row: auto;
        overflow-wrap: break-word;
    }

    .square.active img,
    .square.active video,
    .square.active iframe {
        max-width: 100%;
        height: auto;
    }

    .automatisierung {
        align-items: center;
        margin: 80px 10px;
    }

    #radio-grid {
        display: grid;
        grid-template-columns: repeat(50, auto);
        gap: 1px;
        width: min(549px, 80vw);
        aspect-ratio: 1 / 1;
        margin: 0 auto 20px;
    }

    #radio-grid input[type="checkbox"] {
        width: 100%;
        height: 100%;
        min-width: 1px;
        min-height: 1px;
    }

    .thumbnail-grid,
    .leseprobe-grid {
        grid-template-columns: repeat(1, 200px);
        /* 2 columns on smaller screens */
    }

}