/* TYPO3 Fluid Styled Content - Theme-Overrides & Responsiveness */
/* 1. Responsive Galerie & Spalten-Steuerung (Überschreibt Core Float-Layout mit Flexbox) */
.ce-gallery img,
.ce-gallery figure {
    max-width: 100%;
    height: auto;
    display: block;
}

.ce-gallery .ce-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.ce-gallery .ce-column {
    flex: 0 0 auto;
    margin-right: 0 !important;
}

/* Exakte Prozentbreiten je nach eingestellter Spaltenanzahl im Backend (imagecols) */
.ce-gallery[data-ce-columns="1"] .ce-column {
    width: 100%;
}

.ce-gallery[data-ce-columns="2"] .ce-column {
    width: calc(50% - 5px);
}

.ce-gallery[data-ce-columns="3"] .ce-column {
    width: calc(33.333% - 6.66px);
}

.ce-gallery[data-ce-columns="4"] .ce-column {
    width: calc(25% - 7.5px);
}

.ce-gallery[data-ce-columns="5"] .ce-column {
    width: calc(20% - 8px);
}

.ce-gallery[data-ce-columns="6"] .ce-column {
    width: calc(16.666% - 8.33px);
}

.ce-gallery[data-ce-columns="7"] .ce-column {
    width: calc(14.285% - 8.57px);
}

.ce-gallery[data-ce-columns="8"] .ce-column {
    width: calc(12.5% - 8.75px);
}

/* Mobile Optimierung: Auf Smartphones 1-spaltig */
@media (max-width: 576px) {
    .ce-gallery[data-ce-columns] .ce-column {
        width: 100% !important;
    }
}

/* 2. Überschriften */
.ce-header {
    margin-bottom: 1rem;
}

/* 3. Modernes Tabellendesign (Erweitert Core .ce-table) */
.ce-table table {
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.ce-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.ce-table td,
.ce-table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* 4. Modernes Download-Karten-Design (.ce-uploads) */
.ce-uploads li {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 5. Aufzählungen */
.ce-bullets ul,
.ce-bullets ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}


/* text neben bild */
/* Text & Bilder – Standard */
.ce-intext .ce-gallery {
    width: 40%;
    max-width: 40%;
}

.ce-intext .ce-gallery img,
.ce-intext .ce-gallery figure {
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Bild rechts */
.ce-intext.ce-right .ce-gallery {
    float: right;
    margin-left: 20px;
}

/* Bild links */
.ce-intext.ce-left .ce-gallery {
    float: left;
    margin-right: 20px;
}

/* Tablet */
@media (max-width: 991.98px) {
    .ce-intext .ce-gallery {
        width: 45%;
        max-width: 45%;
    }
}

/* Smartphone: Bild über dem Text */
@media (max-width: 767.98px) {
    .ce-intext .ce-gallery {
        float: none;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 20px;
    }
}