/**
 * Defaults CSS - Standard-Formatierungen für WordPress und Elementor
 * Stadt Dorsten Theme
 */

/* =======================
   ALLGEMEINE RESET-STYLES
   ======================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-size: .975em;
    line-height: 1.5;
    /* Primäre Schrift laut Vorgabe */
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* =======================
   WORDPRESS STANDARD-STYLES
   ======================= */

/* Ausrichtungsklassen */
.alignleft {
    float: left;
    margin: 0 1.5em 1.5em 0;
}

.alignright {
    float: right;
    margin: 0 0 1.5em 1.5em;
}

.aligncenter {
    display: block;
    margin: 0 auto 1.5em;
    text-align: center;
}

.alignwide {
    margin: 0 -2vw 1.5em; /* Reduziert von -5vw auf -2vw */
    max-width: calc(100% + 4vw); /* Angepasst entsprechend */
    width: auto;
}

.alignfull {
    margin: 0 calc(-50vw + 50%) 1.5em; /* Sicherere Berechnung */
    max-width: 100vw;
    width: 100vw;
    box-sizing: border-box; /* Verhindert Overflow */
}

/* Responsive Bilder */
img {
    max-width: 100%;
    height: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    margin: 0.5em 0;
}

/* WordPress Gallery */
.gallery {
    margin-bottom: 1.5em;
    display: grid;
    grid-gap: 1em;
}

.gallery-columns-1 { grid-template-columns: repeat(1, 1fr); }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }

.gallery-item {
    text-align: center;
}

.gallery-caption {
    font-size: 0.8em;
    color: #666;
    margin-top: 0.5em;
}

/* WordPress Blockquotes */
blockquote {
    border-left: 4px solid #007cba;
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: #f9f9f9;
    font-style: italic;
}

blockquote cite {
    display: block;
    margin-top: 1em;
    font-size: 0.9em;
    font-style: normal;
    color: #666;
}

/* =======================
   ELEMENTOR STANDARD-STYLES
   ======================= */

/* Container-Verbesserungen */
.elementor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.elementor-section {
    position: relative;
}

/* Spalten-Verbesserungen */
.elementor-column {
    display: flex;
    flex-direction: column;
}

.elementor-column-wrap {
    flex: 1;
}

.elementor-widget-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Text-Widget Verbesserungen */
.elementor-text-editor {
    line-height: 1.6;
}

.elementor-text-editor h1,
.elementor-text-editor h2,
.elementor-text-editor h3,
.elementor-text-editor h4,
.elementor-text-editor h5,
.elementor-text-editor h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.elementor-text-editor p {
    margin-bottom: 1em;
}

/* Button Standardisierung */
.elementor-button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.elementor-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Image-Widget Verbesserungen */
.elementor-image,
.elementor-widget-image {
    max-width: 100%;
    /* Ausrichtung vom Elterncontainer übernehmen (Elementor steuert dort text-align) */
    text-align: inherit;
}

.elementor-image img,
.elementor-widget-image img {
    /* Keine erzwungene 100%-Breite, damit Zentrierung/Rechtsbündigkeit funktionieren */
    max-width: 100%;
    width: auto;
    display: inline-block;
    height: auto;
}

/* =======================
   RESPONSIVE DESIGN
   ======================= */

/* Tablet */
@media (max-width: 1024px) {
    .elementor-container {
        padding: 0 20px;
    }

    .alignwide {
        margin: 0 -2.5vw 1.5em;
        max-width: calc(100% + 5vw);
    }

    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .elementor-container {
        padding: 0 15px;
    }

    /* Lange URLs und Wörter umbrechen statt horizontal overflow */
    .entry-content,
    .elementor-widget-container,
    .site-main {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .alignleft,
    .alignright {
        float: none;
        display: block;
        margin: 0 auto 1.5em;
    }

    .alignwide,
    .alignfull {
        margin: 0 -15px 1.5em;
        max-width: calc(100% + 30px);
        width: calc(100% + 30px);
    }

    .gallery-columns-2,
    .gallery-columns-3,
    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: repeat(1, 1fr);
    }

    blockquote {
        padding: 0.5em 1em;
        margin: 1em 0;
    }

    .elementor-button {
        width: 100%;
        text-align: center;
    }
}

/* =======================
   BARRIEREFREIHEIT
   ======================= */

/* Fokus-Stile */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Screen Reader Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* =======================
   CLEARFIX UTILITY
   ======================= */

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* =======================
   PRINT STYLES
   ======================= */

@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    blockquote {
        border-left: 4px solid #000;
        page-break-inside: avoid;
    }

    img {
        page-break-inside: avoid;
    }
}