/* ==========================================
   BASIS
   ========================================== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background-image: url('../media/hintergrund.jpg');
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    color: #333333;
}

.main-wrapper {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 15px;
    background-color: rgba(255, 255, 255, 0.90);
    border-radius: 15px;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   LOGO
   ========================================== */
.logo-static {
    text-align: center;
    padding: 20px 0 10px 0;
}
.logo-static img {
    max-width: 100%;
    height: auto;
    width: 400px;
    display: inline-block;
}
.sub-logo-text {
    text-align: center;
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    color: #4a6b82;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

/* ==========================================
   DIASHOW – HIER IST DIE ÄNDERUNG!
   ========================================== */
.banner-slideshow {
    position: relative;
    width: 100%;
    padding-top: 33.3%;
    overflow: hidden;
    background: transparent; /* keine weißen Ränder */
}
.banner-slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* <-- das ist die wichtige Änderung */
    opacity: 0;
    animation: bildWechsel 24s linear infinite;
}
.banner-slideshow img:nth-child(1) { animation-delay: 0s; }
.banner-slideshow img:nth-child(2) { animation-delay: 3s; }
.banner-slideshow img:nth-child(3) { animation-delay: 6s; }
.banner-slideshow img:nth-child(4) { animation-delay: 9s; }
.banner-slideshow img:nth-child(5) { animation-delay: 12s; }
.banner-slideshow img:nth-child(6) { animation-delay: 15s; }
.banner-slideshow img:nth-child(7) { animation-delay: 18s; }
.banner-slideshow img:nth-child(8) { animation-delay: 21s; }

@keyframes bildWechsel {
    0% { opacity: 0; }
    2% { opacity: 1; }
    12% { opacity: 1; }
    15% { opacity: 0; }
    100% { opacity: 0; }
}

/* ==========================================
   NAVIGATION
   ========================================== */
.main-navigation {
    margin-top: 10px;
    margin-bottom: 30px;
    text-align: center;
}
.main-navigation ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px 30px;
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 2px dashed #b0d0e0;
    border-bottom: 2px dashed #b0d0e0;
}
.main-navigation a {
    display: block;
    padding: 15px 5px;
    text-decoration: none;
    color: #4a6b82;
    font-weight: bold;
    font-size: 1.1rem;
}
.main-navigation a:hover,
.main-navigation a.active {
    color: #e67e22;
}

/* ==========================================
   INHALTSBEREICH
   ========================================== */
.content-area {
    padding: 20px 30px 40px 30px;
    clear: both;
}
.content-area-books {
    padding: 20px 30px 40px 30px;
    clear: both;
    width: 100%;
    box-sizing: border-box;
}
.start-page-spacer {
    margin-top: 20px;
}

/* ==========================================
   HEADLINE
   ========================================== */
.headline-container {
    max-width: 500px;
    margin: 0 auto 30px auto;
    padding: 0 10px;
    text-align: center;
    background-image: url('../media/ueberschrift_bg.png');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    min-height: 60px;
    position: relative;
}
.page-headline {
    color: #4a6b82;
    font-size: 1.5rem;
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    margin: 0;
    padding: 10px 0 5px 0;
    text-align: center;
    word-wrap: break-word;
}

/* ==========================================
   BUCH-SEITE
   ========================================== */
.book-page-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 10px;
}
.book-sidebar {
    flex: 1 1 200px;
    max-width: 100%;
    border-right: 2px dashed #b0d0e0;
    padding-right: 20px;
    box-sizing: border-box;
}
.book-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.book-sidebar li {
    margin-bottom: 15px;
}
.book-sidebar a {
    font-family: 'Comic Sans MS', sans-serif;
    color: #4a6b82;
    text-decoration: none;
    font-size: 1.05rem;
    display: block;
    transition: all 0.2s ease;
}
.book-sidebar a:hover,
.book-sidebar a.active-book {
    color: #e67e22;
    font-weight: bold;
    transform: translateX(5px);
}
.book-content {
    flex: 2 1 300px;
    max-width: 100%;
    padding-left: 5px;
    box-sizing: border-box;
}

/* ==========================================
   BUCH-INHALT
   ========================================== */
.book-title-header {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    color: #2b7bb2;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.3;
    margin: 0 0 5px 0;
    padding: 0;
}
.book-chapter-header {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    color: #4a6b82;
    font-size: 1.0rem;
    font-weight: normal;
    line-height: 1.3;
    margin: 0 0 25px 0;
    padding: 0;
}
.book-story-image {
    float: right;
    margin-left: 25px;
    margin-bottom: 20px;
    max-width: 260px;
}
.book-story-image img {
    width: 100%;
    height: auto;
    display: block;
}
.book-story-text {
    font-family: 'Comic Sans MS', sans-serif;
    line-height: 1.6;
    color: #555555;
}

/* ==========================================
   STORY-BLOCKS
   ========================================== */
.story-block {
    margin-bottom: 40px;
    padding-bottom: 30px;
    clear: both;
    text-align: left;
}
.story-block + .story-block {
    border-top: 2px dashed #b0d0e0;
    padding-top: 40px;
}
.story-headline {
    color: #4a6b82;
    font-family: 'Comic Sans MS', sans-serif;
    font-size: 1.4rem;
    margin: 0 0 5px 0;
    padding: 0;
}
.story-date {
    font-family: 'Comic Sans MS', sans-serif;
    color: #99abc0;
    font-size: 0.95rem;
    margin: 0 0 20px 0;
    padding: 0;
}
.story-content {
    display: block;
    width: 100%;
}
.story-image {
    max-width: 220px;
    margin-bottom: 15px;
}
.story-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.align-left {
    float: left;
    margin-right: 25px;
}
.align-right {
    float: right;
    margin-left: 25px;
}
.story-text {
    overflow: hidden;
    font-family: 'Comic Sans MS', sans-serif;
    line-height: 1.6;
    color: #555555;
}

/* ==========================================
   FLEX-LAYOUT
   ========================================== */
.flex-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.story-image.side-left,
.story-image.side-right {
    flex: 0 0 200px;
    max-width: 200px;
    margin: 0;
}
.story-text.text-middle {
    flex: 1;
    overflow: hidden;
}

/* ==========================================
   GALERIE
   ========================================== */
.gallery-row-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    margin-top: 15px;
    box-sizing: border-box;
}
.gallery-item {
    flex: 1 1 150px;
    max-width: 100%;
}
.gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* ==========================================
   BUTTONS
   ========================================== */
.link-wrapper {
    margin-top: 15px;
}
.news-button {
    display: inline-block;
    padding: 10px 18px;
    font-family: 'Comic Sans MS', sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.news-button.web-link {
    background-color: #4a6b82;
    color: #ffffff;
}
.news-button.web-link:hover {
    background-color: #e67e22;
}
.news-button.pdf-link {
    background-color: #eaf2f8;
    color: #2b7bb2;
    border: 2px dashed #b0d0e0;
}
.news-button.pdf-link:hover {
    background-color: #2b7bb2;
    color: #ffffff;
    border-style: solid;
}

/* ==========================================
   KONTAKT
   ========================================== */
.custom-contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    width: 100%;
}
.form-group-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}
.form-group-item label {
    font-family: 'Comic Sans MS', sans-serif;
    color: #4a6b82;
    font-weight: bold;
    font-size: 0.95rem;
}
.form-group-item input[type="text"],
.form-group-item input[type="email"],
.form-group-item textarea {
    font-family: 'Comic Sans MS', sans-serif;
    padding: 10px;
    border: 2px solid #b0d0e0;
    border-radius: 8px;
    background-color: #fcfdfe;
    color: #555555;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-group-item input:focus,
.form-group-item textarea:focus {
    outline: none;
    border-color: #e67e22;
    background-color: #ffffff;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer-area {
    text-align: center;
    padding: 20px 0;
    font-family: 'Comic Sans MS', sans-serif;
    font-size: 0.85rem;
    color: #99abc0;
}
.footer-area a {
    color: #99abc0;
    text-decoration: none;
}

/* ==========================================
   MEDIA QUERIES
   ========================================== */
@media screen and (max-width: 1024px) {
    .main-wrapper {
        margin: 10px auto;
        border-radius: 10px;
        padding: 0 10px;
    }
    .content-area {
        padding: 15px 20px 30px 20px !important;
    }
    .content-area-books {
        padding: 15px 20px 30px 20px !important;
    }
    .book-page-layout {
        flex-direction: column;
        padding: 0;
    }
    .book-sidebar {
        flex: 1 1 auto !important;
        max-width: 100% !important;
        border-right: none;
        border-bottom: 2px dashed #b0d0e0;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    .book-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 20px;
        justify-content: center;
    }
    .book-sidebar li {
        margin-bottom: 0;
    }
    .book-content {
        flex: 1 1 auto !important;
        max-width: 100% !important;
        padding-left: 0;
    }
    .headline-container {
        max-width: 90%;
        min-height: 50px;
        background-size: contain;
    }
    .page-headline {
        font-size: 1.3rem;
    }
    .gallery-item {
        flex: 1 1 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
    .sub-logo-text {
        font-size: 1rem;
        margin-top: 10px;
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 768px) {
    .main-wrapper {
        margin: 5px auto;
        border-radius: 8px;
        padding: 0 10px;
    }
    .main-navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        border-top: none;
        border-bottom: none;
    }
    .main-navigation a {
        font-size: 0.95rem;
        padding: 8px 12px;
        border-bottom: 1px dashed #b0d0e0;
        width: 100%;
    }
    .main-navigation li:last-child a {
        border-bottom: none;
    }
    .content-area {
        padding: 10px 15px 20px 15px !important;
    }
    .content-area-books {
        padding: 10px 15px 20px 15px !important;
    }
    .page-headline {
        font-size: 1.1rem !important;
    }
    .headline-container {
        max-width: 100%;
        min-height: 40px;
        margin-bottom: 15px;
    }
    .gallery-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .sub-logo-text {
        font-size: 0.9rem;
        margin-top: 8px;
        margin-bottom: 10px;
    }
    .logo-static img {
        width: 80% !important;
    }
    .book-story-image {
        float: none;
        margin: 0 auto 15px auto;
        max-width: 200px;
        display: block;
    }
    .story-image.align-left,
    .story-image.align-right {
        float: none;
        margin: 0 auto 15px auto;
        max-width: 80%;
        display: block;
    }
    .flex-layout {
        flex-direction: column;
        align-items: center;
    }
    .story-image.side-left,
    .story-image.side-right {
        flex: 0 0 auto;
        max-width: 80%;
        margin-bottom: 15px;
    }
    .banner-slideshow {
        padding-top: 50%;
    }
    .book-title-header {
        font-size: 1.1rem;
    }
    .book-chapter-header {
        font-size: 0.9rem;
    }
}