/**
 * Contao CMS Custom Stylesheet
 * Optimiert für Contao-spezifische Klassen und Strukturen
 */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* === CONTAO LAYOUT WRAPPER === */
#wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
}

/* === HEADER === */
#header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

/* === NAVIGATION === */
.mod_navigation,
.mod_quicknav {
    margin: 1rem 0;
}

.mod_navigation ul,
.mod_quicknav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mod_navigation li,
.mod_quicknav li {
    position: relative;
}

.mod_navigation a,
.mod_quicknav a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mod_navigation a:hover,
.mod_quicknav a:hover,
.mod_navigation .active a {
    background-color: #3498db;
    color: #fff;
}

/* Dropdown Navigation */
.mod_navigation .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.mod_navigation li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mod_navigation .submenu li {
    width: 100%;
}

.mod_navigation .submenu a {
    border-radius: 0;
    border-bottom: 1px solid #f0f0f0;
}

/* === MAIN CONTENT === */
#main {
    margin: 2rem 0;
    display: grid;
    gap: 2rem;
}

/* Responsive Grid für Contao Columns */
.inside {
    display: grid;
    gap: 2rem;
}

.col_1,
.col_2,
.col_3,
.col_4,
.col_6,
.col_8,
.col_9,
.col_12 {
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .inside {
        grid-template-columns: repeat(12, 1fr);
    }
    
    .col_1 { grid-column: span 1; }
    .col_2 { grid-column: span 2; }
    .col_3 { grid-column: span 3; }
    .col_4 { grid-column: span 4; }
    .col_6 { grid-column: span 6; }
    .col_8 { grid-column: span 8; }
    .col_9 { grid-column: span 9; }
    .col_12 { grid-column: span 12; }
}

/* === CONTENT ELEMENTS === */
.ce_text,
.ce_headline,
.ce_image,
.ce_gallery,
.ce_list,
.ce_table,
.ce_accordion,
.ce_download,
.ce_downloads {
    margin-bottom: 2rem;
}

/* Headlines */
.ce_headline h1,
.ce_headline h2,
.ce_headline h3,
.ce_headline h4,
.ce_headline h5,
.ce_headline h6 {
    margin-bottom: 1rem;
    color: #2c3e50;
    line-height: 1.2;
}

.ce_headline h1 { font-size: 2.5rem; }
.ce_headline h2 { font-size: 2rem; }
.ce_headline h3 { font-size: 1.75rem; }
.ce_headline h4 { font-size: 1.5rem; }
.ce_headline h5 { font-size: 1.25rem; }
.ce_headline h6 { font-size: 1.1rem; }

/* Text Elements */
.ce_text p {
    margin-bottom: 1rem;
}

.ce_text ul,
.ce_text ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.ce_text li {
    margin-bottom: 0.5rem;
}

/* Images */
.ce_image {
    text-align: center;
}

.ce_image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.image_container {
    display: inline-block;
    position: relative;
}

.caption {
    margin-top: 0.5rem;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Gallery */
.ce_gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ce_gallery .image_container {
    overflow: hidden;
    border-radius: 8px;
}

.ce_gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ce_gallery img:hover {
    transform: scale(1.05);
}

/* Tables */
.ce_table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.ce_table th,
.ce_table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.ce_table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.ce_table tr:hover {
    background-color: #f8f9fa;
}

/* Downloads */
.ce_download,
.ce_downloads {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.ce_download a,
.ce_downloads a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.ce_download a:hover,
.ce_downloads a:hover {
    text-decoration: underline;
}

/* === FORMS === */
.mod_form {
    max-width: 600px;
    margin: 2rem 0;
}

.widget {
    margin-bottom: 1.5rem;
}

.widget label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.widget input[type="text"],
.widget input[type="email"],
.widget input[type="tel"],
.widget input[type="password"],
.widget textarea,
.widget select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.widget input:focus,
.widget textarea:focus,
.widget select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.widget .mandatory {
    color: #e74c3c;
}

.submit {
    background: #3498db;
    color: #fff;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit:hover {
    background: #2980b9;
}

/* === SIDEBAR === */
#left,
#right {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.mod_newslist,
.mod_eventlist,
.mod_search {
    margin-bottom: 2rem;
}

.mod_newslist h3,
.mod_eventlist h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.layout_short {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.layout_short:last-child {
    border-bottom: none;
}

/* === FOOTER === */
#footer {
    background: #2c3e50;
    color: #fff;
    padding: 2rem 0;
    margin-top: 4rem;
}

#footer a {
    color: #3498db;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #container {
        padding: 0 15px;
    }
    
    .mod_navigation ul,
    .mod_quicknav ul {
        flex-direction: column;
    }
    
    .ce_headline h1 { font-size: 2rem; }
    .ce_headline h2 { font-size: 1.75rem; }
    .ce_headline h3 { font-size: 1.5rem; }
    
    .ce_table {
        overflow-x: auto;
    }
    
    .mod_navigation .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin-top: 0.5rem;
    }
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.invisible { display: none; }
.block { display: block; }
.inline { display: inline; }

/* === CONTAO SPECIFIC === */
.mod_breadcrumb {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #666;
}

.mod_breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.mod_breadcrumb a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination .current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}