:root {
    --primary-color: #9d253d;
    --secondary-color: #f0a04b;
    --light-bg-color: #fef0df;
    --dark-text-color: #333;
    --light-gray-bg: #f2f2f2;
    --border-color: #e0e0e0;
    --icon-border-color: #ccc;
}

* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    margin: 0;
    color: var(--dark-text-color);
    background-color: var(--light-bg-color);
}

a {
    color: var(--dark-text-color);
    text-decoration: none;
}

header {
    background-color: var(--light-bg-color);
    padding: 0px;
}

.header-image {
    position: relative;
    overflow: hidden;
}

nav {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 20px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    margin-left: 30px;
}

nav a:hover {
    text-decoration: underline;
}

.header-image img {
    width: 100%;
    height: auto;
    display: block;
}

.keyword-bar {
    background-color: var(--light-gray-bg);
    text-align: center;
    padding: 10px 0;
    font-size: 0.9em;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.container {
    max-width: 1000px; 
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.keyword-bar p {
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.keyword-bar span {
    display: inline-block;
    transition: width 0.7s ease-in-out, opacity 0.7s ease-in-out;
}

.keyword-bar span:first-child::before {
    content: "·";
    margin: 0 0.5em;
}

.keyword-bar span::after {
    content: "·";
    margin: 0 0.5em;
}

.keyword-bar span.collapsing {
    width: 0 !important;
    opacity: 0;
    font-size: 0;
    margin: 0 !important;
}

main {
    padding: 20px 0;
    background-color: var(--primary-color);
}

#services {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background-color: var(--light-bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

.card-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--icon-border-color);
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.full-width-section {
    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 2rem;
    background-color: var(--light-bg-color);
    
}

.full-width-section h2 {
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    font-size: 2rem;

}

.full-width-section p {
    font-size: 1.1em;
    line-height: 1.6;
}

.two-column-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.two-column-section-column {
    flex: 1 1 420px;
    text-align: left;
    margin-bottom: 2rem;
}

/* Zweite Spalte als abgesetzte weiße Box */
.two-column-section-column:last-child {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0;
}

/* Auf kleineren Screens: zweite Spalte nach unten */
@media (max-width: 767px) {
    .two-column-section-column {
        flex: 1 1 100%;
    }
    .two-column-section > .main-column {
        flex: 1 1 100%;
    }
    .two-column-section > .secondary-column {
        flex: 1 1 100%;
    }
}

.image-container-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.image-container-row > .image-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid white;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0;
    position: relative;
}

.round-corners {
    border-radius: 12px !important;
}

/* On mobile, show stacked */
@media (max-width: 767px) {
    .image-container-row {
        grid-template-columns: 1fr;
    }
    
    .main-image,
    .secondary-image,
    .image-container.portrait {
        grid-column: span 1;
    }
    
    .image-container img {
        max-height: none;
    }
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    padding: 1rem;
    max-height: 600px;
    object-fit: contain;
}

.image-container p {
    margin: 0;
    padding: 1rem;
    font-size: 0.9em;
    line-height: 1.2;
    text-align: left;
    color: var(--dark-text-color);
    background: transparent;
}

/* Copyright-Info in der rechten unteren Ecke des Bildes */
.image-container .image-copyright {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.75em;
    border-radius: 4px 0 0 0;
    margin: 0;
    line-height: 1.2;
}

.main-image {
    grid-column: span 2;
}

.secondary-image {
    grid-column: span 1;
}

/* Hochformatige Bilder: weniger Spalten einnehmen */
.image-container.portrait {
    grid-column: span 1;
}

.image-container.portrait img {
    max-height: 500px;
}

/* Wenn main-image vorhanden ist, können portrait-Bilder angepasst werden */
.image-container-row:has(.main-image) .image-container.portrait {
    grid-column: span 1;
}

.image-container-row:has(.main-image) .image-container.portrait img {
    max-height: 400px;
}

.two-column-section-container {
    max-width: 1100px;
    margin: 0 auto;
    line-height: 1.6;
}


.two-column-section ul {
    padding-left: 1.2rem;
    margin-top: 0.8rem;
}

.two-column-section-quote {
    margin-top: 1rem;
}

.two-column-section-bottom {
    margin-top: 2rem;
}

.two-column-section-bottom p {
    margin-top: 1rem;
}

.two-column-section-bottom p {
    margin-top: 2rem;
    font-size: 1.1em;
    line-height: 1.6;
    text-align: left;
}

.two-column-section-column h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 15px;
}

.two-column-section > .main-column {
    flex: 1 1 420px;
}

.two-column-section > .secondary-column {
    flex: 1 1 320px;
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0;
}

.two-column-section > .secondary-column h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 15px;
}

.two-column-section > .secondary-column ul {
    padding-left: 1.2rem;
    margin-top: 0.8rem;
}

.two-column-section > .secondary-column ul li {
    margin-bottom: 0.5rem;
}
#icon-vermittlung { transform: scale(1.3) translate(3px, 1px); }
#icon-foerderung { transform: scale(1.3) translate(1px, 1px); }
#icon-wissen { transform: scale(1.3) translate(6px, 1px); }
#icon-aktionen { transform: scale(1.3) translate(1px, 1px); }
#icon-beratung { transform: scale(1.3) translate(6px, 1px); }
#icon-spenden { transform: scale(1.3) translate(2px, 2px); }

.card-content {
    text-align: left;
}

.card h3 {
    font-size: 1.2em;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    #services {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .card {
        width: 450px;
    }
}

section {
    margin-bottom: 40px;
    margin-top: 40px;
}

h2 {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

footer {
    background-color: var(--light-bg-color);
    padding: 0;
    text-align: left;
    border-top: 1px solid var(--border-color);
    color: var(--dark-text-color);
}

.logo-bar {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: #f9f9f9;
}

.logo-bar .container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-bar img {
    max-height: 50px;
    max-width: 150px;
    height: auto;
    width: auto;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 40px 0;
}

.contact-text {
    /* flex: 1; */
}

.contact-text .name {
    font-size: 2em;
    color: var(--primary-color);
    font-weight: bold;
    margin: 0 0 5px 0;
}

.contact-text .title {
    font-size: 1.2em;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.contact-text .address {
    font-size: 1em;
    line-height: 1.6;
}

.contact-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--icon-border-color);
}

.signature-container {
    padding-bottom: 20px;
}

.signature-image {
    height: 60px;
    width: auto;
}

.footer-legal {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.9em;
}

.footer-legal a {
    text-decoration: none;
}
.footer-legal a:hover {
    text-decoration: underline;
}

nav.main-nav {
    padding-top: 20px;
    padding-bottom: 10px;
}

nav.main-nav ul li a {
    font-size: 1.1em;
}

.sticky-nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--light-bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .contact-info {
        margin-left: 5%;
    }
}

.header-svg {
    width: 100%;
    height: auto;
    max-height: 300px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.header-svg.loaded {
    opacity: 1;
}

/* SVG Animationen */
.header-svg svg {
    width: 100%;
    height: auto;
}

#hand-links, #hand-rechts {
    opacity: 0;
}

/* Hände Animation */
#hand-links {
    animation: handLeftMove 2s ease-in-out 0.5s forwards;
    transform-origin: center;
}

#hand-rechts {
    animation: handRightMove 2s ease-in-out 0.5s forwards;
    transform-origin: center;
}



#hand-links path, #hand-rechts path {
    fill: var(--secondary-color);
}

/* Titel Animation */
#titel-z1, #titel-z2, #titel-z3 {
    opacity: 0;
    animation: titleFadeIn 4s ease-in-out 1s forwards;
}

/* Hintergrund-Kreis Animation */
#hintergrund-kreis {
    opacity: 0;
    animation: backgroundFadeIn 4s ease-in-out 0.5s forwards;
}

/* Keyframes für die Animationen */
@keyframes handLeftMove {
    0% {
        opacity: 0;
        transform: translateX(-50px) rotate(-5deg);
    }
    2% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

@keyframes handRightMove {
    0% {
        opacity: 0;
        transform: translateX(50px) rotate(5deg);
    }
    2% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

@keyframes titleFadeIn {
    0% {
        opacity: 0;
        
    }
    100% {
        opacity: 1;
        
    }
}

@keyframes backgroundFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes menschenSlideIn {
    0% {
        right: -var(--width);
    }
    2% {
        right: -var(--width);
    }
    100% {
        right: 200px;
    }
}

#header-svg-container {
    transform: translateX(-20%);
}

.menschen-image {
    position: absolute;
    top: 25%;
    right: -200px;
    transform: translateY(-50%);
    transform: translateX(50%);
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    z-index: 10;
    animation: menschenSlideIn 4s ease-in-out 0.5s forwards;
} 

freinet-ergebnisliste > div {
    background-color: var(--light-bg-color);
    margin-left: 1em;
    margin-right: 1em;
    margin-bottom: 1em;
    padding-left: 1em;
    padding-right: 1em;
    border-bottom-left-radius: 1em;
    border-bottom-right-radius: 1em;
}

freinet-suchformular > div {
    background-color: var(--light-bg-color);
    margin-left: 1em;
    margin-right: 1em;
    border-top-left-radius: 1em;
    border-top-right-radius: 1em;
}

FreinetFilterForm > fieldset {
    background-color: var(--light-bg-color) !important;
}

#fn_content .fieldset_filter {
    background-color: var(--light-bg-color) !important;
}

#fn_content .watchlist-button {
    border: 2px solid var(--light-bg-color) !important;
    border-top-right-radius: 1em;
    margin-bottom: -5px;
}

freinet-suchformular input:hover {
    background-color: var(--light-bg-color) !important;
    color: var(--primary-color);
}

freinet-suchformular input:focus {
    background-color: var(--light-bg-color) !important;
    color: var(--primary-color);
    border: 2px solid var(--secondary-color) !important;
}

freinet-suchformular a:hover {
    text-decoration: none;
}