@import "_fonts.css";
@import "_resets.css";

/* Definition of base styles. */
:root {
    /* colors */
    --color-dark: #3A3F27;
    --color-green: #999F59;
    --color-light: #FFFBEB;
    --color-black: #000000;
    /* fonts */
    --font-body: "Anaheim", sans-serif;
    --font-display: "Amatic SC", cursive;
}

img,
video,
iframe {
    max-width: 100%;
}

/* Styling of all available layout components. */
/* ==============================
   HEADER
   ============================== */
/* ==============================
   HEADER
   ============================== */
   [data-layout="header"] {
    padding: 0 2.2%;
    min-height: 180px;
    box-sizing: border-box;
    background-color: var(--color-light);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 32px;

    /* Logo-Link */
    .site-logo {
        display: flex;
        align-items: center;
        flex-shrink: 0;

        .logo {
            display: block;
            width: auto;
            max-width: 80px;
            max-height: 65px;
            object-fit: contain;
        }
    }

    /* Hamburger-Button: auf dem Desktop ausgeblendet */
    .nav-toggle {
        display: none;
    }

    /* Navigation */
    .site-navigation {
        .nav {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            align-items: center;
            gap: clamp(24px, 3vw, 60px);
        }

        /* Einzelne Menüpunkte */
        .nav-item {
            a {
                display: inline-flex;
                align-items: baseline;
                gap: 8px;
                padding: 0.15em 0.6em;
                font-family: var(--font-body);
                font-size: 25px;
                font-weight: 400;
                line-height: 1.3;
                color: #000000;
                text-decoration: none;
                white-space: nowrap;
                transition: color 0.2s ease, background-color 0.2s ease;

                &:hover,
                &:focus-visible {
                    color: var(--color-green);
                }

                /* aktuelle Seite (muss nach :hover stehen) */
                &[aria-current="page"] {
                    background-color: var(--color-dark);
                    color: var(--color-light);
                }
            }

            /* Nummerierung 01, 02, 03 ... */
            .nav-number {
                color: var(--color-green);
                font-weight: 700;
            }

            /* Name des Menüpunktes */
            .nav-title {
                color: inherit;
            }
        }
    }

    /* Tastaturfokus für das Logo */
    .site-logo:focus-visible {
        outline: 2px solid var(--color-dark);
        outline-offset: 5px;
    }

    /* etwas kompakter, bevor das Hamburger-Menü übernimmt */
    @media (max-width: 1200px) {
        .site-navigation .nav {
            gap: clamp(12px, 2vw, 32px);
        }

        .site-navigation .nav-item a {
            font-size: 22px;
        }
    }

    /* Tablet und Handy: Hamburger-Menü */
    @media (max-width: 1024px) {
        min-height: 0;
        padding: 12px 5%;
        gap: 16px;

        .site-logo .logo {
            max-width: 64px;
            max-height: 52px;
        }

        .nav-toggle {
            display: inline-flex;
            flex-direction: column;
            justify-content: center;
            gap: 6px;
            width: 48px;
            height: 48px;
            padding: 10px;
            background: none;
            border: 0;
            cursor: pointer;
        }

        .nav-toggle:focus-visible {
            outline: 2px solid var(--color-dark);
            outline-offset: 2px;
        }

        .nav-toggle__bar {
            display: block;
            width: 100%;
            height: 3px;
            background-color: var(--color-dark);
            transition: transform 0.25s ease, opacity 0.25s ease;
        }

        /* Hamburger wird zum X */
        &.is-open .nav-toggle__bar:nth-child(1) {
            transform: translateY(9px) rotate(45deg);
        }

        &.is-open .nav-toggle__bar:nth-child(2) {
            opacity: 0;
        }

        &.is-open .nav-toggle__bar:nth-child(3) {
            transform: translateY(-9px) rotate(-45deg);
        }

        /* Menü als aufklappbares Feld unter dem Header */
        .site-navigation {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            max-height: calc(100vh - 80px);
            overflow-y: auto;
            padding: 8px 5% 20px;
            background-color: var(--color-light);
            border-top: 1px solid rgba(58, 63, 39, 0.15);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        }

        &.is-open .site-navigation {
            display: block;
        }

        .site-navigation .nav {
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            gap: 4px;
        }

        .site-navigation .nav-item a {
            padding: 0.3em 0.5em;
            font-size: 24px;
        }
    }
}

/* ==============================
   FOOTER
   ============================== */
[data-layout="footer"] {
    box-sizing: border-box;
    width: 100%;
    padding: 40px 2.2%;
    background-color: var(--color-light);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 32px;

    /* Logo links */
    .footer-logo {
        display: flex;
        align-items: center;
        flex-shrink: 0;

        img {
            display: block;
            width: 85px;
            height: auto;
            max-height: 65px;
            object-fit: contain;
        }
    }

    /* Inhalt rechts */
    .footer-content {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 16px;
        text-align: right;
    }

    .footer-copyright {
        margin: 0;
        font-family: var(--font-body);
        font-size: 18px;
        color: #000000;
    }

    /* LinkedIn und E-Mail */
    .footer-socials {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 18px;

        a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--color-dark);
            text-decoration: none;
            transition: color 0.2s ease;

            &:hover,
            &:focus-visible {
                color: var(--color-green);
            }

            img {
                display: block;
                width: 28px;
                height: 28px;
                object-fit: contain;
            }
        }
    }

    /* Datenschutz und Impressum */
    .footer-navigation {
        .footer-nav {
            list-style: none;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 8px;
            margin: 0;
            padding: 0;

            a {
                font-family: var(--font-body);
                font-size: 16px;
                color: #000000;
                text-decoration: none;
                transition: color 0.2s ease;

                &:hover,
                &:focus-visible {
                    color: var(--color-green);
                }
            }
        }
    }

    .footer-logo:focus-visible {
        outline: 2px solid var(--color-dark);
        outline-offset: 5px;
    }
}

/* Mobile Darstellung */
@media (max-width: 600px) {
    [data-layout="footer"] {
        align-items: flex-start;
        gap: 24px;
        padding: 32px 5%;

        .footer-content {
            gap: 14px;
        }

        .footer-logo img {
            width: 65px;
            max-height: 50px;
        }

        .footer-copyright {
            font-size: 16px;
        }

        .footer-socials {
            gap: 14px;
        }

        .footer-navigation .footer-nav a {
            font-size: 15px;
        }
    }
}


/* Styling of all available page components. */
[data-page] {
    width: 100%;
    height: 100%;
}

[data-page="project"] {
    background-color: transparent;
    padding: 0;

    /* Kopfbereich */
    .project-hero {
        padding: clamp(2rem, 6vw, 5rem) 2.7vw clamp(2rem, 6vw, 4.5rem);
        background-color: var(--color-dark);
    }

    .category {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 0;
    }

    .category-item {
        display: inline-block;
        padding: 0.7em 1.1em;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(0.85rem, 1.4vw, 1.25rem);
        line-height: 1.2;
        color: var(--color-light);
        background-color: var(--color-green);
    }

    /* grosses "Projekt" */
    .preline {
        margin: clamp(1rem, 3vw, 2.5rem) 0 0;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(3rem, 12vw, 11rem);
        line-height: 1;
        text-transform: uppercase;
        color: var(--color-green);
    }

    /* Projektname */
    .title {
        max-width: 70%;
        margin: 1.25rem 0 0;
        font-family: var(--font-display);
        font-weight: 400;
        font-size: clamp(1.75rem, 4.5vw, 4rem);
        letter-spacing: 0.08em;
        line-height: 1.2;
        color: var(--color-light);
    }

    /* Lead und Fliesstext */
    .project-content {
        padding: clamp(2.5rem, 7vw, 6rem) 6.5vw;
        background-color: var(--color-light);
        font-family: var(--font-body);
        font-size: clamp(1.125rem, 1.6vw, 1.5rem);
        line-height: 1.55;
        color: var(--color-black);

        .lead {
            max-width: 28rem;
            margin: 0 0 clamp(1.5rem, 4vw, 3rem);
        }

        .text {
            max-width: 60rem;

            > :first-child {
                margin-top: 0;
            }

            > :last-child {
                margin-bottom: 0;
            }

            p {
                margin: 0 0 1em;
            }

            a {
                color: var(--color-dark);
                text-underline-offset: 0.15em;
            }

            ul,
            ol {
                margin: 0 0 1em;
                padding-left: 1.25em;
            }

            h2,
            h3,
            h4 {
                margin: 1.5em 0 0.5em;
                font-family: var(--font-display);
                font-weight: 400;
                line-height: 1.1;
                color: var(--color-dark);
            }
        }
    }

    @media (max-width: 600px) {
        .title {
            max-width: 100%;
        }
    }
}

/* Styling of all available module components. */
[data-module] {
    overflow: clip;
    position: relative;
    width: 100%;
}

/* ------------------------------
   Hero Startseite
   ------------------------------ */
[data-module="hero_front"] {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    min-height: 42vw;
    background-color: var(--color-dark);
    overflow: hidden;

    .content {
        align-self: center;
        padding: 2rem 3vw;
    }

    .title {
        margin: 0;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(2.5rem, 11vw, 11rem);
        line-height: 1;
        text-transform: uppercase;
        color: var(--color-green);
    }

    .subline {
        margin: 1rem 0 0;
        font-family: var(--font-display);
        font-size: clamp(2rem, 6.5vw, 6.5rem);
        letter-spacing: 0.08em;
        line-height: 1.1;
        text-align: right;
        color: var(--color-light);
    }

    .image {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
        min-height: 0;

        .content {
            padding: 3rem 1.5rem 2rem;
        }

        .title {
            font-size: clamp(2.5rem, 15vw, 6rem);
        }

        .subline {
            font-size: clamp(1.25rem, 7vw, 2.5rem);
        }

        .image {
            height: auto;
            aspect-ratio: 3 / 4;
            max-height: 85vh;
            object-position: 50% 25%;
        }
    }
}


/* ------------------------------
   Hero Standard
   ------------------------------ */
[data-module="hero_default"] {
    min-height: 42vw;
    padding: clamp(2rem, 6vw, 7rem) 2.5vw 3rem;
    background-color: var(--color-dark);

    .content {
        width: fit-content;
        max-width: 100%;
    }

    .title {
        margin: 0;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(2.5rem, 9vw, 9rem);
        line-height: 1;
        text-transform: uppercase;
        color: var(--color-green);
    }

    .subline {
        margin: 1rem 0 0 clamp(2rem, 12vw, 10rem);
        font-family: var(--font-display);
        font-size: clamp(2rem, 6.5vw, 6.5rem);
        letter-spacing: 0.08em;
        line-height: 1.1;
        color: var(--color-light);
    }

    @media (max-width: 768px) {
        min-height: 0;
        padding: 3rem 1.5rem 2rem;

        .title {
            font-size: clamp(2.5rem, 16vw, 6rem);
        }

        .subline {
            margin-left: 1.5rem;
            font-size: clamp(1.25rem, 7vw, 2.5rem);
        }
    }
}

/* ------------------------------
   Übersicht Projekte (Startseite)
   und Meine Projekte (Unterseite)
   ------------------------------ */
[data-module="overview_projects"],
[data-module="projects"] {
    padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 3vw, 2.5rem);
    background-color: var(--color-dark);

    .header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
        margin-bottom: clamp(2rem, 5vw, 4.5rem);
    }

    .title {
        margin: 0;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(2.25rem, 6vw, 5.5rem);
        line-height: 1.05;
        color: var(--color-green);
    }

    .button {
        flex-shrink: 0;
        padding: 0.6em 1.2em;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(0.95rem, 1.4vw, 1.25rem);
        text-decoration: none;
        color: var(--color-light);
        background-color: var(--color-green);
        transition: background-color 0.2s, color 0.2s;

        &:hover,
        &:focus-visible {
            background-color: var(--color-light);
            color: var(--color-dark);
        }
    }

    .projects {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: clamp(1.5rem, 3vw, 3rem);
    }

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

    .media {
        position: relative;
        aspect-ratio: 4 / 5;
        background-color: #D9D9D9;

        img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }

    .label {
        position: absolute;
        top: 0;
        left: 1.5rem;
        max-width: 50%;
        padding: 0.6em 1em;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: 1rem;
        line-height: 1.25;
        color: var(--color-light);
        background-color: var(--color-dark);
    }

    .project-title {
        margin: 1rem 0 1.5rem;
        font-family: var(--font-display);
        font-weight: 400;
        font-size: clamp(1.75rem, 3vw, 2.75rem);
        letter-spacing: 0.08em;
        text-align: center;
        color: var(--color-light);
    }

    .project-text {
        font-family: var(--font-body);
        font-size: 1.125rem;
        line-height: 1.6;
        color: var(--color-light);
    }

    @media (max-width: 900px) {
        .projects {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (max-width: 600px) {
        .header {
            flex-direction: column;
            align-items: flex-start;
        }

        .projects {
            grid-template-columns: 1fr;
        }
    }
}

/* Nur Unterseite "Meine Projekte": Filter, grösserer Spaltenabstand, kein Beschreibungstext */
[data-module="projects"] {
    .header {
        flex-wrap: nowrap;
        align-items: center;
    }

    .title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: clamp(2.25rem, 5vw, 4.5rem);
    }

    .filter {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-left: auto;
    }

    .filter__row {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .filter__button {
        padding: 0.5em 1.1em;
        font-family: var(--font-body);
        font-weight: 800;
        font-size: clamp(0.9rem, 1.2vw, 1.1rem);
        white-space: nowrap;
        color: var(--color-green);
        background-color: transparent;
        border: 2px solid var(--color-green);
        cursor: pointer;
        transition: background-color 0.2s, color 0.2s;

        &:hover,
        &:focus-visible,
        &[aria-pressed="true"] {
            background-color: var(--color-green);
            color: var(--color-light);
        }
    }

    .projects {
        column-gap: clamp(1.5rem, 6vw, 6rem);
        row-gap: clamp(1.5rem, 3.6vw, 3.5rem);
    }

    /* ausgeblendete Projekte: ohne diese Regel würde display: block das hidden-Attribut überschreiben */
    .project[hidden] {
        display: none;
    }

    .project-title {
        margin: 0.75rem 0 0;
    }

    .project-text {
        display: none;
    }

    /* kleinere Bildschirme: Filter unter den Titel */
    @media (max-width: 1000px) {
        .header {
            flex-wrap: wrap;
        }

        .filter {
            margin-left: 0;
        }
    }
}
    /* ausgeblendete Projekte: ohne diese Regel würde display: block das hidden-Attribut überschreiben */
    .project[hidden] {
        display: none;
    }

    .project-title {
        margin: 0.75rem 0 0;
    }

    .project-text {
        display: none;
    }

    @media (max-width: 600px) {
        .filter {
            justify-content: flex-start;
        }
    }


/* ------------------------------
   Text
   ------------------------------ */
[data-module="text"] {
    background-color: var(--color-light);
    padding: clamp(3rem, 8vw, 6rem) 1.5rem;

    .inner {
        max-width: 38rem;
        margin: 0 auto;
    }

    .title {
        margin: 0 0 clamp(1.5rem, 4vw, 3rem);
        font-family: var(--font-display);
        font-weight: 400;
        font-size: clamp(3rem, 8vw, 6.5rem);
        line-height: 1;
        letter-spacing: 0.08em;
        text-align: center;
        color: var(--color-dark);
    }

    .text {
        font-family: var(--font-body);
        font-size: clamp(1.125rem, 1.6vw, 1.5rem);
        line-height: 1.55;
        text-align: left;
        color: #000000;

        > :first-child {
            margin-top: 0;
        }

        > :last-child {
            margin-bottom: 0;
        }

        p {
            margin: 0 0 1em;
        }

        a {
            color: var(--color-dark);
            text-underline-offset: 0.15em;
        }

        ul,
        ol {
            margin: 0 0 1em;
            padding-left: 1.25em;
        }

        h2,
        h3,
        h4 {
            margin: 1.5em 0 0.5em;
            font-family: var(--font-display);
            font-weight: 400;
            line-height: 1.1;
            color: var(--color-dark);
        }
    }
}

/* ------------------------------
   Bilder
   ------------------------------ */
[data-module="images"] {
    padding: clamp(3rem, 11vw, 8rem) clamp(1.5rem, 16vw, 12rem);
    background-color: var(--color-dark);

    .images {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: clamp(1.5rem, 9vw, 6rem);
    }

    .images__item {
        flex: 0 1 clamp(14rem, 29vw, 22rem);

        img {
            display: block;
            width: 100%;
            height: auto;
        }
    }

    @media (max-width: 600px) {
        padding: 3rem 1.5rem;

        .images {
            gap: 1.5rem;
        }

        .images__item {
            flex-basis: 100%;
        }
    }
}

/* Videos aus dem Editor */
.wp-video {
    width: 100% !important; /* überschreibt die feste Breite aus dem Shortcode */
    max-width: 24rem;       /* Hochkant-Videos nicht übergross darstellen */
    margin: 1.5em 0;
}

.wp-video video {
    display: block;
    width: 100%;
    height: auto;
}

.video-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5em 0;
}

.video-row .wp-video {
    flex: 1 1 10rem;
    width: auto !important;
    min-width: 0;
    max-width: none;
    margin: 0;
}

/* Eingebettete Videos (YouTube) im Text */
.text iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 1.5em 0;
    border: 0;
}

/* Styling of all available teaser components. */

/* Styling of utility classes, can be added anywhere in the project. */

/* BREAKPOINT: 3xl */
@media (max-width: 1514px) {}

/* BREAKPOINT: xl */
@media (max-width: 1280px) {}

/* BREAKPOINT: lg */
@media (max-width: 1024px) {}

/* BREAKPOINT: md */
@media (max-width: 768px) {}

/* BREAKPOINT: sm */
@media (max-width: 640px) {}

/* BREAKPOINT: xs */
@media (max-width: 425px) {}

/* BREAKPOINT: xxs */
@media (max-width: 400px) {}
