/*
Theme Name: Celler Presse
Author: Your Name
Description: A simple, clean, and responsive theme for a news site.
Version: 2.1
*/

body {
    font-family: 'Lato', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar {
    background-color: #f1f1f1;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #333;
}

.top-bar-left {
    float: left;
}

.top-bar-right {
    float: right;
}

#bf-accessibility-buttons {
    display: flex;
    gap: 10px;
}

#bf-accessibility-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

#bf-accessibility-buttons button:hover {
    color: #000;
}

header {
    background-color: #ffffff;
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

header .logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 20px; /* Abstand links für das Logo */
}

header .logo img {
    margin-bottom: 5px;
}

header .subtitle {
    font-family: 'Merriweather', serif;
    font-size: 14px;
    color: #666;
    text-align: left;
}

header .banner-widget {
    margin-right: 10px; /* Abstand rechts für das Header-Banner */
    margin-left: 10px; /* Abstand rechts für das Header-Banner */
}

nav {
    background-color: #333;
    padding: 10px 0;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: space-between; /* Verwendet Flexbox, um Platz zwischen den Navigationselementen und der Lupe zu schaffen */
    align-items: center; /* Zentriert die Lupe vertikal */
}

/* Desktop Menü bleibt gleich */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
}

nav ul li {
    position: relative;
}

nav ul li.has-children > a::after {
    content: '\25BC'; /* Pfeil nach unten für Submenü */
    font-size: 10px;
    margin-left: 5px;
    vertical-align: middle;
    color: #fff;
}

nav a {
    color: #ffffff;
    margin: 0 15px;
    text-decoration: none;
    padding: 10px 0;
    transition: color 0.3s ease;
    display: block;
    text-align: left;
}

nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #333;
    width: auto;
    padding: 0;
    z-index: 1000;
}

nav ul li ul li {
    width: 100%;
}

nav ul li ul li a {
    display: block;
    padding: 10px 15px;
    color: #ffffff;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

nav ul li ul li a:hover {
    background-color: var(--submenu-hover-bg);
    width: 100%;
}

nav ul li:hover ul {
    display: block;
    min-width: 200px;
}

/* Hamburger Menü Styling */
.menu-toggle {
    display: none; /* Standardmäßig ausblenden */
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: #fff; /* Farbe der Linien */
    margin: 6px 0;
    transition: 0.4s;
}

/* Mobile Ansicht: Hamburger Menü anzeigen */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Zeige den Toggle-Button nur in der mobilen Ansicht */
        position: relative;
        z-index: 1001;
    }

    /* Verstecke das normale Menü in der mobilen Ansicht */
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #333;
        padding: 0;
    }

    nav ul.open {
        display: flex; /* Menü anzeigen, wenn es geöffnet ist */
    }
    
    /* Optional: zentriere die Linien im mobilen Menü */
    .menu-toggle span {
        background-color: #333; /* Farbe der Linien ändern */
    }

    nav ul li {
        width: 100%;
    }

    nav ul li ul {
        position: relative;
    }

    nav ul li ul li a {
        padding-left: 20px;
    }

    nav a {
        padding: 10px;
    }
}

/* Lupe-Styling in der Navigation */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #ffffff;
    margin-left: auto; /* Schiebt die Lupe nach rechts */
    margin-right: 20px; /* Abstand von der rechten Seite */
    align-self: center; /* Zentriert die Lupe vertikal mit den anderen Navigationspunkten */
}

.search-toggle i {
    font-size: 18px;
}

/* Lightbox-Styling */
.search-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.search-lightbox.active {
    display: flex;
}

.search-lightbox-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.search-lightbox input[type="text"] {
    padding: 10px;
    font-size: 18px;
    width: calc(100% - 40px); /* Passt die Breite an, um Padding und Border zu berücksichtigen */
    margin-bottom: 10px;
    box-sizing: border-box; /* Sorgt dafür, dass Padding und Border in die Breite einbezogen werden */
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-lightbox button {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.search-lightbox button:hover {
    background-color: #555;
}

/* Styling für das Suchfeld */
.search-form {
    display: inline-block;
    position: relative;
    margin-left: 20px;
}

.search-form input[type="text"] {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.search-form button {
    background: none;
    border: none;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.search-form button i {
    color: #333;
}

.header-widgets {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 0;
    justify-content: space-between;
}

.content {
    width: 68%;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    padding: 15px;
    box-sizing: border-box;
}

.sidebar {
    width: 28%;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    padding: 15px;
    box-sizing: border-box;
    margin-left: 2%;
}

/* Sicherstellen, dass alle Sidebar-Elemente innerhalb der Begrenzung bleiben */
.sidebar .widget,
.sidebar .widget * {
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box; /* Padding und Border werden in der Breite berücksichtigt */
    overflow: hidden; /* Verhindert Überlauf */
}

.sidebar .widget iframe,
.sidebar .widget embed,
.sidebar .widget object {
    max-width: 100%; /* Eingebettete Inhalte innerhalb der Sidebar begrenzen */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: auto; /* Seitenverhältnis beibehalten */
}

/* Spezifische Anpassung für Shortcodes */
.sidebar .widget [class^="shortcode"],
.sidebar .widget [class*=" shortcode"] {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.sidebar .widget {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    box-sizing: border-box;
}

/* Zusätzliche Feinanpassung für besondere Widgets, falls notwendig */
.sidebar .widget h3,
.sidebar .widget p {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.sidebar .widget * {
    max-width: 100%;
}

/* Styling for articles on the homepage */
.article {
    display: flex;
    align-items: flex-start; /* Bild und Überschrift oben ausrichten */
    width: 100%;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    padding: 15px;
    box-sizing: border-box;
}

.article-thumbnail {
    margin-right: 20px; /* Abstand zwischen Bild und Text */
}

.article-thumbnail img {
    width: 300px;
    height: 200px;
    object-fit: cover;
}

.article-content {
    flex: 1;
    max-width: 100%; /* Stellt sicher, dass der Inhalt innerhalb der Begrenzung bleibt */
    padding-right: 15px; /* Abstand nach rechts */
}

/* Sicherstellen, dass Text und Überschriften innerhalb der Begrenzung bleiben */
.article-content h2,
.article-content p {
    box-sizing: border-box; /* Inklusive Padding und Border */
    word-wrap: break-word; /* Bricht lange Wörter */
    overflow: hidden; /* Verhindert Überlauf */
    text-overflow: ellipsis; /* Zeigt "..." an, wenn Text abgeschnitten wird */
}

.article-content h2 {
    margin: 0 0 5px 0; /* Verringerter Abstand zur Kategorie */
    font-size: 1.5em;
    color: #333;
    text-decoration: none;
}

.article-content h2 a {
    color: #333; /* Überschrift Links in Schwarz */
    text-decoration: none;
}

.article-content p.date-category {
    margin: 0 0 5px 0; /* Verringerter Abstand zum Textauszug */
    font-size: 0.9em;
    color: #666; /* Graue Schrift für Datum und Kategorie */
}

.article-content p.date-category a {
    color: #666; /* Graue Schrift für Kategorie-Link */
    text-decoration: none;
}

.article-content p.date-category a:hover {
    text-decoration: underline; /* Unterstreichung bei Hover */
}

.article-content p.excerpt {
    margin: 0;
    color: #333;
}

/* Spezifische Regel für mobile und Tablet-Ansichten */
@media (max-width: 1024px) {
    .article-content h2,
    .article-content p {
        padding-right: 10px; /* Reduziert den Abstand nach rechts auf kleineren Bildschirmen */
    }

    /* Teaser Artikel Bilder für Tabletansicht */
    .article-thumbnail img {
        width: 100% !important; /* Bild nimmt die volle Breite des Containers ein */
        height: auto !important; /* Höhe passt sich proportional an */
        display: block; /* Vermeidet potenzielle Anzeigeprobleme */
        object-fit: cover; /* Stellt sicher, dass das Bild gut skaliert */
    }

    .article {
        flex-direction: column; /* Wechsel zu Spalten-Layout */
    }

    .article img {
        width: 100%; /* Bild nimmt die volle Breite bei mobiler Ansicht ein */
        height: auto;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .content {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .sidebar {
        width: 100%;
    }

    .header-widgets {
        flex-direction: column;
        align-items: center;
    }

    .footer {
        flex-direction: column;
        align-items: center;
    }

    .footer .footer-widget {
        width: 100%; /* Widget nimmt die volle Breite des Bildschirms ein */
        margin-bottom: 20px;
        box-sizing: border-box; /* Stellt sicher, dass Padding und Border in die Breite einbezogen werden */
        padding-left: 15px; /* Fügt innen links Padding hinzu */
        padding-right: 15px; /* Fügt innen rechts Padding hinzu */
    }
}

/* Header-Banner-Anpassungen für die mobile Ansicht */
@media (max-width: 768px) {
    /* Container, der das Bild enthält */
    .header .banner-widget {
        width: 100%; /* Container auf volle Breite */
        text-align: center; /* Zentriere den Inhalt */
        margin: 0 auto; /* Zentriere den Container */
    }

    /* Link, der das Bild enthält */
    .header .banner-widget a {
        display: block; /* Block-Element für den Link */
        width: 100%; /* Nimmt die volle Breite des Containers ein */
    }

    /* Bild selbst */
    .header .banner-widget img {
        max-width: 100%; /* Beschränkt die maximale Breite des Bildes auf die Containerbreite */
        height: auto; /* Proportional zur Breite skalieren */
        width: 100%; /* Nimmt die volle Breite des Containers ein */
        display: block; /* Block-Element für das Bild */
    }

    /* Sicherstellen, dass der Container keine zusätzliche Breite hat */
    .header .banner-widget span {
        display: block; /* Block-Element für "Anzeige" */
        width: 100%; /* Nimmt die volle Breite des Containers ein */
        text-align: center; /* Zentriere den Text */
    }

    /* Logo in der mobilen Ansicht zentriert */
    header .logo-container {
        align-items: center; /* Logo zentriert */
        margin-left: 0; /* Entfernung des linken Abstands */
        width: 100%; /* Volle Breite für zentrierte Anzeige */
        text-align: center; /* Zentriert den Text */
    }

    header .logo img {
        margin: 0 auto; /* Zentriert das Logo-Bild */
    }

    /* Schriftgröße in der mobilen Ansicht vergrößern */
    body, h1, h2, h3, h4, h5, h6, p, a, li, td, input, textarea, select, button {
        font-size: 1.1em; /* Leicht vergrößerte Schriftgröße */
    }

    /* Footer-Container in mobiler Ansicht untereinander darstellen */
    .footer .footer-widget {
        width: 75%; /* Vergrößert die Breite der Footer-Widgets in der mobilen Ansicht */
        margin-bottom: 20px;
        padding: 0 15px; /* Fügt links und rechts Padding hinzu */
    }
}

/* Sicherstellen, dass der cp-ad-container und das darin enthaltene Bild in der mobilen Ansicht korrekt skaliert werden */
@media (max-width: 768px) {
    /* Container, der die Anzeige enthält */
    .cp-ad-container {
        width: 100%; /* Container auf volle Breite setzen */
        text-align: center; /* Zentriere den Inhalt */
        margin: 0 auto; /* Zentriere den Container */
        box-sizing: border-box; /* Beachtet Padding und Border in der Breite */
    }

    /* Link, der das Bild enthält */
    .cp-ad-container a {
        display: block; /* Block-Element für den Link */
        width: 100%; /* Nimmt die volle Breite des Containers ein */
        text-align: center; /* Zentriere den Link-Inhalt */
    }

    /* Bild selbst */
    .cp-ad-container img {
        max-width: 100%; /* Beschränkt die maximale Breite des Bildes auf die Containerbreite */
        height: auto; /* Proportional zur Breite skalieren */
        width: 100%; /* Nimmt die volle Breite des Containers ein */
        display: block; /* Block-Element für das Bild */
        margin: 0 auto; /* Zentriert das Bild innerhalb des Containers */
    }

    /* Sicherstellen, dass "Anzeige" korrekt zentriert ist */
    .cp-ad-container span {
        display: block; /* Block-Element für "Anzeige" */
        width: 100%; /* Nimmt die volle Breite des Containers ein */
        text-align: center; /* Zentriere den Text */
        margin-bottom: 5px; /* Etwas Abstand nach unten */
    }
}

/* Pagination Styling */
.pagination {
    text-align: center;
    margin: 20px 0;
    width: 100vw; /* Nutzung der gesamten Bildschirmbreite */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 10px 0;
}

.pagination ul {
    list-style: none;
    padding: 0;
    display: inline-flex;
    justify-content: center;
    gap: 5px;
    width: 100%;
    margin: 0;
}

.pagination li {
    margin: 0;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #e5e5e5;
    background-color: #f9f9f9;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 4px;
    font-size: 14px;
}

.pagination a:hover {
    background-color: #333;
    color: #fff;
}

.pagination .current {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.pagination .disabled {
    color: #aaa;
    pointer-events: none;
    border-color: #ddd;
}

/* Pagination Styling für mobile Ansicht */
@media (max-width: 768px) {
    .pagination ul {
        flex-wrap: wrap; /* Zeilenumbruch ermöglichen */
        gap: 2px; /* Reduziert den Abstand zwischen den Buttons */
        justify-content: center; /* Zentriert die Pagination */
    }

    .pagination a,
    .pagination .current {
        padding: 8px 12px; /* Reduziert die Größe der Buttons */
        font-size: 12px; /* Kleinere Schriftgröße für die mobile Ansicht */
    }

    .pagination {
        padding: 5px 0;
        width: 100%; /* Nutzung der gesamten Bildschirmbreite ohne Überlauf */
        margin-left: 0;
        margin-right: 0;
        position: static; /* Entfernt die absolute Positionierung */
        left: auto;
        right: auto;
    }
}

/* Additional CSS for single post */
.post-content h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333;
    flex: 1;
    max-width: 100%; /* Stellt sicher, dass der Inhalt innerhalb der Begrenzung bleibt */
    padding-right: 15px; /* Abstand nach rechts */
}

.post-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px; /* Abstand zwischen Meta-Informationen und Beitragsbild */
}

.post-meta .post-category a {
    color: #666666; /* Graue Schrift für Kategorie-Link im Beitrag */
    text-decoration: none;
}

.post-meta .post-category a:hover {
    text-decoration: underline; /* Unterstreichung bei Hover */
}

.post-thumbnail {
    width: 100%;
    margin-bottom: 20px; /* Abstand zwischen Beitragsbild und Inhalt */
}

.post-thumbnail img {
    width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .post-thumbnail img {
        width: 100%; /* Bild nimmt die volle Breite bei mobiler Ansicht ein */
        height: auto; /* Höhe passt sich proportional an */
    }
}

.post-text {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}

.post-tags {
    margin-top: 20px;
    font-size: 0.9em;
    font-weight: bold; /* Fett geschrieben */
    color: #000; /* Schwarze Schrift */
    background-color: transparent; /* Kein Hintergrund */
    display: flex; /* Flexbox für nebeneinander liegende Schlagwörter */
    flex-wrap: wrap; /* Ermöglicht den Umbruch, wenn der Platz knapp ist */
}

.post-tags span {
    margin-right: 10px; /* Abstand zwischen dem Wort "Schlagwörter:" und den eigentlichen Schlagwörtern */
    margin-bottom: 2px; /* Gleicher Margin wie bei den Tags */
}

.post-tags a {
    color: #ffffff; /* Weiße Schrift für Schlagwort-Links */
    background-color: #003366; /* Marineblauer Hintergrund */
    padding: 5px 10px; /* Innenabstand */
    border-radius: 3px; /* Abgerundete Ecken */
    margin: 2px; /* Äußerer Abstand zwischen den Schlagwörtern */
    text-decoration: none;
    display: inline-block; /* Sorgt dafür, dass jedes Schlagwort ein eigener Block ist */
}

.post-tags a:hover {
    text-decoration: underline; /* Unterstreichung bei Hover */
}

.footer {
    display: flex;
    justify-content: space-around;
    background-color: #333;
    color: #ffffff;
    padding: 20px 15px; /* Fügt Padding hinzu, um sicherzustellen, dass der Inhalt nicht an den Bildschirmrand stößt */
    flex-wrap: wrap;
}

.footer .footer-widget {
    width: 30%;
    padding: 0 10px;
}

.footer a {
    color: #ffffff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Footer Anpassungen für Tablet- und mobile Ansichten */
@media (max-width: 768px) {
    .footer .footer-widget {
        width: 75%; /* Vergrößert die Breite der Footer-Widgets in der mobilen Ansicht */
        margin-bottom: 20px;
        padding: 0 15px; /* Fügt links und rechts Padding hinzu */
    }
}

.content.full-width {
    width: 100%; /* Volle Breite des Containers */
    background-color: #fff;
    border: 1px solid #e5e5e5;
    padding: 15px;
    box-sizing: border-box;
}

/* Customizer-Option für Submenü-Hintergrundfarbe */
:root {
    --submenu-hover-bg: #00ccff;
}

/* Submenü Styling für mobile Ansicht */
@media (max-width: 768px) {
    nav ul li ul {
        padding-left: 20px; /* Abstand von 20px für die Submenüpunkte */
    }

    nav ul li ul li a {
        display: block;
        padding: 10px 15px;
        color: #ffffff;
        text-decoration: none;
        white-space: normal; /* Erlaubt das Umbrechen langer Submenüpunkte */
        word-wrap: break-word; /* Bricht lange Wörter in Submenüpunkten */
    }

    nav ul li ul li {
        border-bottom: 1px solid #444; /* Optionale Trennlinie zwischen den Submenüpunkten */
    }

    nav ul li {
        padding-left: 0;
    }

    nav ul li:hover > ul {
        display: block; /* Sicherstellen, dass das Submenü beim Hover angezeigt wird */
    }

    nav ul li ul {
        display: none;
        position: relative;
        background-color: #333; /* Hintergrundfarbe der Submenüs */
        width: 100%;
    }

    nav ul li ul li a:hover {
        background-color: #444; /* Hintergrundfarbe beim Hover über einem Submenüpunkt */
    }
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 768px) {
    .article-content h2, .post-content h1 {
        font-size: 1.8em; /* Adjusts font size for smaller screens */
        word-break: break-word; /* Ensures long words break appropriately */
        hyphens: auto; /* Enables automatic hyphenation */
        text-align: left; /* Centers text for better readability */
    }

    .article-content p, .post-text {
        word-break: break-word; /* Ensures proper word breaking in text */
        hyphens: auto; /* Adds hyphens to break longer words */
    }
}

.search-results-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.search-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.search-result-item {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.no-results {
    text-align: center;
    padding: 20px;
}

.no-results-title {
    font-size: 24px;
    color: #d9534f;
}

.no-results-animation p {
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    animation: bounce 1.5s infinite;
    color: #337ab7;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.archive-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.archive-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
}

.archive-description {
    font-size: 1.2em;
    color: #666;
}
