:root {
    --spacing-block-startseite: 42px;
}

.path-frontpage #main-wrapper {
    /*damit Grafiken auf Startseite abgeschnitten werden und kein horizontales Scrollen verursachen */
    overflow: hidden;
}

.path-frontpage #main .view-header h2 {
    margin-block-end: 0;
}

.path-frontpage h1,
.path-frontpage h2,
.path-frontpage h2.block__title {
    margin: 2rem 0 0 0;
}

.path-frontpage .view,
.path-frontpage .view-content {
    gap: var(--spacing-l);
}

@media (min-width: 850px) {
    :root {
        --spacing-block-startseite: 64px;
    }
}

@media (min-width: 1000px) {
    :root {
        --spacing-block-startseite: 128px;
    }
}

/********* header  ************/

.startseite-header {
    display: grid;
    height: fit-content;
    position: relative;
    width: 100%;
    grid-template-rows: 1fr auto;
    margin-top: -25%;
}

.startseite-header h1 {
    color: var(--secondary-color);
    margin-top: 0;
}

.startseite-header .text-rot {
    color: var(--secondary-color);
    font-weight: 700;
}

.startseite-header::after {
    content: "";
    display: block;
    z-index: 1;
    height: 100%;
    min-height: 120vw;
    width: 200%;
    background-image: url("../images/startseite/grafik-header.svg");
    background-size: contain;
    background-repeat: no-repeat;
    margin-top: 0;
    margin-left: -15vw;
    margin-bottom: -50px;
    grid-row-start: 1;
    z-index: 1;
}
.startseite-header .text-content {
    grid-row-start: 2;
    z-index: 3;
}

@media (min-width: 615px) {
    .startseite-header::after {
        margin-left: 10vw;
        min-height: 80vw;
    }
}

@media (min-width: 1000px) {
    .startseite-header {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
        margin-top: 0;
        gap: var(--spacing-l);
    }

    .startseite-header .text-content {
        grid-row-start: 1;
    }
    .startseite-header::after {
        margin-top: -20%;
        height: 150%;
        width: 150%;
        grid-column-start: 2;
        margin-left: 0;
        min-height: unset;
    }
}

/* 90rem entsprechen max-width des Contents:
* falls sich maximal breite vom Content ändern (--max-width)
* muss das auch angepasst werde
*/
@media (min-width: 90rem) {
    .startseite-header {
        margin-bottom: calc(var(--spacing-block-startseite) * 1.5);
    }
    .startseite-header::after {
        margin-top: -25%;
        height: 200%;
    }
}

/******** Bereiche auf Startseite ********/
.path-frontpage .bereiche .view-content {
    /* grid-template-columns: 1fr 1fr 1fr 1fr;  */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-m);
}

.path-frontpage .bereiche .views-row {
    width: 100%;
    box-shadow: var(--box-shadow-more);
    border-radius: var(--border-radius-m);
    padding: 0 var(--spacing-m) var(--spacing-m) 0;
    height: 160px;
}

.path-frontpage .bereiche .views-field {
    height: 100%;
}

.path-frontpage .bereiche .field-content {
    display: grid;
    grid-template-columns: 33% calc(67% - 40px - var(--spacing-m) * 2) 40px;
    gap: var(--spacing-m);
    height: 100%;
    align-items: end;
    font-weight: bold;
    font-size: 1.2rem;
}

.path-frontpage .bereiche .field-content img {
    height: calc(100% + 16px);
    width: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-m) 0 0 var(--border-radius-m);
    margin-bottom: -16px;
}

.path-frontpage .bereiche .field-content a,
.path-frontpage .view-fokusthemen .views-field-nothing a.link-mit-pfeil {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--icon-button-background-color);
    background-image: url(../images/icons/pfeil-gross-rechts-icon.svg);
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s;
}

.path-frontpage .bereiche .field-content a:hover,
.path-frontpage .view-fokusthemen .views-field-nothing a.link-mit-pfeil:hover {
    background-color: var(--mo-background);
    background-image: url(../images/icons/pfeil-gross-rechts-icon-light.svg);
}

@media (min-width: 850px) {
    .path-frontpage .bereiche .views-row {
        height: 240px;
    }
}

/********** Was wir bewegen *********************/

.was-wir-bewegen {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 120vw;
    align-items: center;
    position: relative;
    height: fit-content;
    margin-block: var(--spacing-block-startseite);
    margin-top: calc(var(--spacing-block-startseite) * 2);
}

.was-wir-bewegen .text-content {
    box-shadow: var(--box-shadow-more);
    border-radius: var(--border-radius-m);
    padding: var(--spacing-l);
    background: white;
    z-index: 1;
    height: fit-content;
}

#main .was-wir-bewegen .text-content h3 {
    margin-top: 0;
}

.was-wir-bewegen::after {
    content: "";
    background-image: url(../images/startseite/was-wir-bewegen-v4.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 150%;
    height: 100%;
    margin-left: -20%;
    margin-top: -20%;
}

@media (min-width: 850px) {
    .path-frontpage .main-content__container {
        /*damit Grafiken auf Startseite abgeschnitten werden und kein horizontales Scrollen verursachen */
        overflow: visible;
    }

    .was-wir-bewegen {
        margin: 20% 0;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }

    .was-wir-bewegen::after {
        margin-right: -10%;
        margin-left: -20%;
        width: 150%;
        height: 150%;
    }
}

@media (min-width: 1300px) {
    .was-wir-bewegen::after {
        margin-right: -10%;
        margin-left: -40%;
        width: 200%;
        height: 200%;
        margin-top: 0;
    }
}
/************ Fokusthemen ***************/

.path-frontpage .view-fokusthemen {
    margin-block: var(--spacing-block-startseite);
}

.startseite-fokusthemen .views-row {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.startseite-fokusthemen .views-field-nothing {
    position: relative;
    box-shadow: var(--box-shadow-more);
    border-radius: var(--border-radius-m);
    padding: var(--spacing-m);
    z-index: 1;
    background: white;
    margin-top: -16px;
    width: 90%;
}

.startseite-fokusthemen .views-field-nothing .field-content {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    font-size: 1.5rem;
}

.startseite-fokusthemen .views-field-nothing a.link-mit-pfeil {
    align-self: end;
}

.startseite-fokusthemen .views-field-field-bild {
    margin-left: 32px;
}

.startseite-fokusthemen {
    position: relative;
}

.fokus-link {
    text-decoration: none;
}

@media (min-width: 850px) {
    .startseite-fokusthemen .views-field-field-bild {
        margin-left: 0;
    }

    .startseite-fokusthemen .view-content {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
        position: relative;
        height: 100%;
    }

    .startseite-fokusthemen .views-row {
        grid-column: 1/5;
        flex-direction: row;
    }

    .startseite-fokusthemen .views-row:nth-of-type(2) {
        grid-column: 1/5;
        flex-direction: row-reverse;
    }

    .startseite-fokusthemen .views-field-nothing {
        height: fit-content;
        margin-top: var(--spacing-l);
        width: 33%;
        margin-left: -16px;
    }

    .startseite-fokusthemen .views-row:nth-of-type(2) .views-field-nothing {
        margin-right: -16px;
        margin-left: 0;
    }
}

@media (min-width: 90rem) {
    .startseite-fokusthemen .view-content::before {
        content: "";
        display: block;
        position: absolute;
        width: 100vw;
        max-width: unset;
        background-image: url(/themes/custom/kastaniecustom/images/startseite/grafik-roter-faden.png);
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-position: top left;
        height: 100%;
        top: 0;
        left: calc((100vw - 90rem) / -2 - 2rem);
        display: block;
    }

    .startseite-fokustheme .views-row {
        grid-column: 1/4;
        flex-direction: row;
    }

    .startseite-fokustheme .views-row:nth-of-type(2) {
        grid-column: 2/5;
        flex-direction: row-reverse;
    }
}

/***** Aktuelles *******/
.path-frontpage .view-aktuelles:not(.listenansicht) {
    margin-block: var(--spacing-block-startseite);
    height: fit-content;
    position: relative;
    overflow: visible;
}

.path-frontpage .view-aktuelles:not(.listenansicht)::before {
    /* blauer hintergrund */
    content: "";
    position: absolute;
    width: 100vw;
    height: 120%;
    background-image: url(../images/startseite/hintergrund-blau.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto 100%;
    left: -1.25rem;
    top: -10%;
    z-index: -1;
}

#aktuelles_front_textbox {
    position: relative;
    box-shadow: var(--box-shadow-more);
    border-radius: var(--border-radius-m);
    padding: var(--spacing-l);
    z-index: 1;
    background: white;
    margin-top: -16px;
}

#aktuelles_front_textbox h2 {
    margin: 0;
}

#aktuelles_front_textbox .field--name-field-bereich {
    margin-bottom: var(--spacing-m);
}

#main .view-aktuelles .listenansicht .views-row {
    background-color: white;
}

.path-frontpage #main .view-aktuelles .node--type-aktuelles .field--name-title h2,
.path-frontpage #main .view-aktuelles .node--type-paritaetinform-artikel .field--name-title h2 {
    font-size: 1.25rem;
    margin: var(--spacing-s) 0 0 0;
    line-height: normal;
}

.path-frontpage #main .view-aktuelles  .node--type-aktuelles .field--name-field-datum,
.path-frontpage #main .view-aktuelles  .node--type-paritaetinform-artikel .field--name-field-datum {
    margin-bottom: var(--spacing-s);
}

.path-frontpage #main .view-aktuelles .field--type-datetime {
    display: inline-block;
    font-weight: normal;
    color: #707074;
    margin-block-end: 0;
}

@media (min-width: 850px) {
    .view-aktuelles {
        grid-template-columns: 100%;
        gap: var(--spacing-l);
    }

    .view-aktuelles .view-header {
        grid-row: 1;
        grid-column: 1/3;
    }

    #aktuelles_front_textbox {
        width: 90%;
        margin-left: 10%;
        margin-top: -32px;
    }

    .view-aktuelles .views-field-field-bild {
        width: 90%;
    }

    .path-frontpage .view-aktuelles .view-content {
        flex-direction: row;
    }

    .path-frontpage .view-aktuelles .listenansicht .view-content .views-row {
        width: unset;
    }
}

@media (min-width: 1100px) {
    #aktuelles_front_textbox {
        width: 80%;
        margin-left: 20%;
    }

    .view-aktuelles {
        grid-template-columns: calc(70% - var(--spacing-m)) calc(
                30% - var(--spacing-m)
            );
        gap: var(--spacing-l);
    }

    .view-aktuelles .views-field-field-bild {
        width: 80%;
    }

    .path-frontpage .view-aktuelles .view-content {
        flex-direction: column;
        flex-wrap: unset;
    }
}

@media (min-width: 90rem) {
    .path-frontpage .view-aktuelles:not(.listenansicht)::before {
        left: calc((100vw - 90rem) / -2 - 2rem);
    }
}

/**** Gemeinsam aktiv für Veränderung ********/
.was-wir-bewegen + h2 {
    margin-bottom: var(--spacing-l);
}

.white-box.mitmachen,
.white-box.karriere {
    display: block;
}

.white-box.mitmachen .white-box-img,
.white-box.karriere .white-box-img {
    background-image: url("../images/startseite/image-mitmachen.png");
    background-size: cover;
    background-position: 0% 30%;
    background-repeat: no-repeat;
    width: calc(100% + (var(--spacing-l) * 2));
    height: 150px;
    margin-top: calc(var(--spacing-l) * -1);
    margin-left: calc(var(--spacing-l) * -1);
    border-radius: var(--border-radius-m) var(--border-radius-m) 0 0;
    margin-bottom: var(--spacing-m);
}
.white-box.karriere .white-box-img {
    background-image: url("../images/startseite/image-karriere.jpg");
}

@media (min-width: 850px) {
    .white-box.mitmachen,
    .white-box.karriere {
        display: grid;
        grid-template-columns: 150px max(calc(100% - 150px - var(--spacing-m)));
        gap: var(--spacing-m);
        padding-left: 0;
    }
    .white-box.mitmachen .white-box-img,
    .white-box.karriere .white-box-img {
        background-image: url("../images/startseite/image-mitmachen.png");
        background-position: 42%;
        background-size: auto 100%;
        width: 150px;
        height: calc(100% + (var(--spacing-l) * 2));
        margin-top: calc(var(--spacing-l) * -1);
        border-radius: var(--border-radius-m) 0 0 var(--border-radius-m);
        margin-left: 0;
        margin-bottom: 0;
    }

    .white-box.karriere .white-box-img {
        background-image: url("../images/startseite/image-karriere.jpg");
        background-position: 68%;
    }
}
