/* ========================================
   HYPOTHESIS WEBSITE - MAIN STYLESHEET
   ======================================== */

/* ========================================
   1. BASE STYLES & RESET
   ======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* STIX Two Text – selbst gehostet (variable Fonts) */
@font-face {
    font-family: "STIX Two Text";
    src: url("STIXTwoText-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "STIX Two Text";
    src: url("STIXTwoText-Italic-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

body {
    font-family: "STIX Two Text", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    color: #222;
    background: #ffffff;
    line-height: 1.4;
    overflow-x: hidden;
}

em {
    font-style: italic;
}

/* ========================================
   2. MAIN CONTENT LAYOUT
   ======================================== */

.top-container {
    margin-top: 15vh;
    margin-left: 2rem;
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    width: calc(100% - 10rem);
}

/* Homepage specific: larger margin to avoid marquee overlap */
.top-container#infos {
    margin-top: 60vh;
}

/* Add bottom padding for pages with footer (all except homepage) */
body:not(:has(.random-images-container)) {
    padding-bottom: 80px;
}

/* Two-column layout for About page */
.top-container.two-columns .column {
    flex: 1 1 45%;
    min-width: 250px;
}

/* About page specific: reduce paragraph spacing */
.top-container.two-columns .column p {
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 0.85rem; /* hier den Abstand zwischen Absätzen einstellen */
}

.column {
    flex: 1 1 30%;
    min-width: 250px;
    padding: 2.5rem;
}

h2 {
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
    font-weight: 600;
}

h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    font-weight: 400;
}

p {
    line-height: 1.6;
}
ul {
    padding-left: 1rem; /* so wählen, dass der Textbeginn unter dem normalen Text liegt */
}

.main-content {
    width: 100%;
}

.main-content p + p {
    margin-top: 1lh;
}
/* ========================================
   3. RESPONSIVE DESIGN
   ======================================== */

/* Tablet: 2 columns */
@media (max-width: 1200px) {
    .column {
        flex: 1 1 45%;
    }
}

@media (min-width: 768px) {
    .main-content {
        width: 50%;
    }
}

/* Mobile: 1 column with centered layout */
@media (max-width: 950px) {
    .column {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 1.25rem;
    }

    .top-container {
        flex-direction: column;
        margin-left: 2rem;
        margin-right: 2rem;
        width: calc(100% - 4rem);
    }

    /* Homepage specific: move content higher in viewport on mobile */
    .top-container#infos {
        margin-top: 40vh; /* Reduced from 60vh for better mobile visibility */
    }

    h2 {
        font-size: 1.4rem;
    }

    p {
        font-size: 1.1rem;
    }

    #infos h3 {
        font-size: 1rem;
    }

    /* Separator line between columns on About page (mobile) */
    .top-container.two-columns .column:first-child {
        border-bottom: 1px solid #ccc;
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }
}

/* ========================================
   4. LOGO
   ======================================== */

.logo,
.menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: #000;
    font-family: "STIX Two Text", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.logo {
    left: 2rem;
    right: auto;
}

.menu:hover {
    opacity: 0.5;
}

/* Mobile: larger logo */
@media (max-width: 950px) {
    .logo {
        font-size: 3rem;
    }
}

/* Small mobile: adjusted positioning */
@media (max-width: 400px) {
    .logo {
        font-size: 1.5rem;
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* ========================================
   5. NAVIGATION OVERLAY
   ======================================== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.overlay.active {
    display: flex;
}

.overlay-content {
    position: relative;
    width: min(90%, 400px);
    text-align: center;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(255, 255, 255, 0);
    border: 1px rgba(255, 255, 255, 0);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #f0f0f0;
}

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

.overlay-nav li {
    margin: 1rem 0;
}

.overlay-nav a {
    text-decoration: none;
    color: #000;
    font-size: 2rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.overlay-nav a:hover {
    opacity: 0.5;
}

/* Mobile: larger main navigation links */
@media (max-width: 950px) {
    .main-nav a {
        font-size: 4rem;
        font-weight: 400;
    }
}

/* Small mobile: adjusted link sizes */
@media (max-width: 350px) {
    .overlay-nav a {
        font-size: 1rem;
    }
}

/* ========================================
   6. RANDOM IMAGES ANIMATION (Homepage)
   ======================================== */

.random-images-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.random-image {
    position: absolute;
    width: 200px;
    height: 200px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.random-image.visible {
    opacity: 1;
}

/* ========================================
   7. SCROLLING TEXT MARQUEE (Homepage)
   ======================================== */

.marquee-container {
    position: fixed;
    top: 20vh;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.marquee-content {
    display: flex;
    animation: scroll-left 30s linear infinite;
    white-space: nowrap;
    width: max-content;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.marquee-text {
    font-family: "STIX Two Text", serif;
    font-size: 6rem;
    font-weight: 400;
    margin-right: 4rem;
    color: #222;
    flex-shrink: 0;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Mobile-specific marquee adjustments for better stability */
@media (max-width: 768px) {
    .marquee-container {
        height: 80px;
    }

    .marquee-text {
        font-size: 3rem;
        margin-right: 2rem;
    }

    .marquee-content {
        animation: scroll-left 20s linear infinite;
    }
}

/* ========================================
   8. FULL WIDTH IMAGE (Legacy)
   ======================================== */

.image-container {
    width: 100%;
    position: relative;
    margin-top: 4rem;
}

.full-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: cover;
}

/* ========================================
   9. FOOTER
   ======================================== */

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 1rem 2.5rem;
    z-index: 100;
}

.footer-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    max-width: calc(100% - 10rem);
    margin-left: 2rem;
}

.footer a {
    text-decoration: none;
    color: #222;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.5;
}

.footer-separator {
    color: #222;
    font-size: 0.9rem;
}

/* Homepage: no footer overlap with random images */
body:has(.random-images-container) .footer {
    z-index: 15; /* Above random images (z-index: 5) but below overlay (z-index: 1000) */
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    .footer {
        padding: 0.75rem 1rem;
    }

    .footer-content {
        margin-left: 1rem;
        max-width: calc(100% - 2rem);
    }

    .footer a {
        font-size: 0.8rem;
    }

    .footer-separator {
        font-size: 0.8rem;
    }
}
