/* Hilfsklassen für Textformatierung */
/*Überschrift Beiträge*/
.text-heading {
    padding: 0 5px 5px 5px;
}
.size-medium {
    font-size: 1.6rem;
}
/*Beiträge*/
.text-text {
    padding: 5px 5px 0 5px;
}
.size-small {
    font-size: 1.1rem;
}
.weight-400 {
    font-weight: 400;
}
/*Ausrichtung*/
.text-right {
    text-align: right;
}
.text-left {
    text-align: left;
}
.text-center {
    text-align: center;
}
/*Design*/
.text-light {
    color: #f7fae5;
}
.text-accent {
    color: #aecc24;
}
.weight-300 {
    font-weight: 300;
}
.weight-500 {
    font-weight: 500;
}
.weight-600 {
    font-weight: 600;
}
.size-big {
    font-size: 2rem;
}

/* =====================
 *  Responsive Base / Overflow Guard
 * ===================== */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

img,
video,
iframe {
    height: auto;
}

html.reference-modal-open,
body.reference-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

/* =====================
 *  Hero Image Fixed Background
 * ===================== */

.reference-hero {
    position: relative; /* nicht mehr fixed */
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 80vh; /* Höhe des Bildes */
    overflow: hidden;
}

.img-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
}

.section-image {
    position: fixed; /* bleibt stehen */
    top: 0;
    left: 0;
    z-index: -1; /* hinter dem Content */
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100vh; /* gleiche Höhe wie hero-section */
    object-fit: cover;
}

/* Slogan-Box */
.hero-slogan {
    position: absolute; /* bleibt innerhalb der Hero-Sektion */
    top: 300px;
    left: 0;
    z-index: 10;
    max-width: min(92%, 680px);
    padding: 10px 20px 10px 10px;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    background: rgba(85, 100, 18, 0.65);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.hero-slogan h1 {
    margin: 5px;
    font-size: 2.75rem;
    line-height: 1.1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    overflow-wrap: anywhere;
}

.hero-slogan p {
    margin: 5px;
    font-size: 1.5rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.hero-text-white {
    color: #ffffff;
}

.hero-text-highlight {
    color: #AECC24;
}

.backscroll {
    width: 100%;
    max-width: 100%;
    padding: 60px 0 40px;
    overflow-x: hidden;
    background-color: #F4F5F6;
    border-top: 30px solid #aecc24;
    border-bottom: 30px solid #aecc24;
}

/* =====================
 *  Main Content Area ab 90% Breite
 * ===================== */

.reference-wrapper {
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
    margin-top: 0; /* Abstand, damit Inhalt unter der Slideshow beginnt */
    background-color: #F4F5F6;
}

/* =====================
 *  Referenzen Grid
 * ===================== */

.reference-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px 15px;
    width: 100%;
    max-width: 100%;
}

.reference-item {
    min-width: 0;
}

.reference-item img {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s;
}

.reference-item img:hover {
    transform: scale(1.03);
}

/* =====================
 *  Modal
 * ===================== */

.reference-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding: 40px;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.75);
}

.reference-modal.active {
    display: flex;
}

.modal-content {
    display: flex;
    align-items: center; /* statt stretch */
    gap: 20px;
    width: 100%;
    max-width: 90%;
    min-width: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-content img {
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 3px;
}

/* =====================
 *  Modal Image Area
 * ===================== */

.modal-image-wrapper {
    position: relative;
    display: inline-block;
    flex: 0 1 auto;
    align-self: center;
    max-width: 100%;
    line-height: 0;
}

.modal-image-wrapper img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 3px;
}

/* =====================
 *  Modal Textbox
 * ===================== */

.modal-textbox {
    display: flex;
    flex: 0 0 320px;
    flex-direction: column;
    justify-content: flex-start;
    width: 320px;
    max-width: 100%;
    min-height: 80vh;
    padding: 30px;
    overflow-wrap: anywhere;
    background: #F4F5F6;
    border-radius: 3px;
}

.modal-textbox h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #556412;
}

.modal-bullet-list {
    margin: 0;
    padding-left: 20px;
}

.modal-bullet-list li {
    margin-bottom: 12px;
    color: #333333;
}

/* =====================
 *  Nav Arrows
 * ===================== */

.nav-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    height: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 15%;
    min-width: 44px;
    padding: 0;
    font-size: clamp(2rem, 5vw, 50px);
    color: white;
    font: inherit;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.25);
    border: 0;
    transition: background 0.2s;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.4);
}

.reference-thumb:focus-visible,
.nav-arrow:focus-visible {
    outline: 3px solid #aecc24;
    outline-offset: 3px;
}

.nav-arrow.left {
    left: 0;
}

.nav-arrow.right {
    right: 0;
}

/* =====================
 *  Referenz-Klick vorübergehend deaktiviert
 *  Wird automatisch aktiv, wenn REFERENCE_CLICK_ENABLED in der JS-Datei false ist.
 * ===================== */

html.reference-click-disabled .reference-thumb,
body.reference-click-disabled .reference-thumb {
    cursor: default;
}

html.reference-click-disabled .reference-thumb:hover,
body.reference-click-disabled .reference-thumb:hover {
    transform: none;
}

html.reference-click-disabled .reference-thumb:focus-visible,
body.reference-click-disabled .reference-thumb:focus-visible {
    outline: none;
}

/* =====================
 *  Tablet: 768px bis 1024px
 * ===================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .reference-hero {
        height: 65vh;
    }

    .hero-slogan {
        top: clamp(120px, 18vh, 180px);
        max-width: 88vw;
        padding: 10px 20px 10px 10px;
    }

    .backscroll {
        padding: 45px 0 35px;
        border-top-width: 22px;
        border-bottom-width: 22px;
    }

    .reference-wrapper {
        width: min(94%, 960px);
    }

    .reference-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .reference-modal {
        padding: 24px;
    }

    .modal-content {
        gap: 16px;
        max-width: 100%;
    }

    .modal-image-wrapper img,
    .modal-content img {
        max-height: 72vh;
    }

    .modal-textbox {
        flex: 0 0 280px;
        width: 280px;
        min-height: 72vh;
        padding: 24px;
    }
}

/* =====================
 *  Mobile: bis 767px
 * ===================== */

@media (max-width: 767px) {
    .reference-hero {
        height: 58vh;
    }

    .section-image {
        width: 100%;
        height: 100vh;
        max-width: 100%;
    }

    .hero-slogan {
        top: clamp(95px, 20vh, 150px);
        left: 0;
        max-width: calc(100% - 18px);
        padding: 10px 20px 10px 10px;
        border-top-right-radius: 15px;
        border-bottom-right-radius: 15px;
    }

    .hero-slogan h1 {
        margin: 5px;
        font-size: 2.75rem;
        line-height: 1.1;
    }

    .hero-slogan p {
        margin: 5px;
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .backscroll {
        padding: 32px 0 28px;
        border-top-width: 16px;
        border-bottom-width: 16px;
    }

    .reference-wrapper {
        width: calc(100% - 24px);
    }

    .reference-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .reference-item img:hover {
        transform: none;
    }

    .reference-modal {
        align-items: flex-start;
        padding: 12px;
    }

    .modal-content {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .modal-image-wrapper {
        width: 100%;
        max-width: 100%;
        display: inline-flex;
        align-self: center;
    }

    .modal-image-wrapper img,
    .modal-content img {
        width: 100%;
        max-width: 100%;
        max-height: 58vh;
        object-fit: contain;
    }

    .modal-textbox {
        flex: 0 1 auto;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 18px;
    }

    .modal-textbox h2 {
        margin-bottom: 12px;
        font-size: 1.35rem;
    }

    .modal-bullet-list li {
        margin-bottom: 8px;
        line-height: 1.45;
    }

    .nav-arrow {
        top: 0;
        bottom: 0;
        height: auto;
        width: 44px;
        min-width: 44px;
        font-size: 2rem;
        background: rgba(0, 0, 0, 0.35);
    }
}
