/* responsive-override.css - Für kstv-arminia.de - Finale Korrekturen */
/* Diese Datei macht das Layout von 2010 responsiv */

@media only screen and (max-width: 860px) {
    /* Grundlegende Anpassungen für kleine Bildschirme */
    body {
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }
    
    /* Titelbild-Container anpassen - randlos */
    #titelbild {
        width: 100vw;
        height: 0;
        padding-bottom: 43.7%; /* 350/801 = 0.437 */
        position: relative;
        overflow: hidden;
        margin: 0;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        border: none;
    }
    
    /* Titelbilder überlappend positionieren */
    #titelbild img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin-left: 0;
        opacity: 0;
        transition: opacity 1s ease-in-out;
        border: none;
        object-fit: cover;
    }
    
    /* Erstes Bild sichtbar */
    #titelbild img:first-child {
        opacity: 1;
    }
    
    /* Wappen absolut auf dem Titelbild positionieren - Z-Index erhöhen */
    #wappen {
        position: absolute;
        left: 50%;
        top: 30px;
        transform: translateX(-135%);
        z-index: 100; /* Erhöht für bessere Sichtbarkeit */
        margin: 0;
        width: auto;
    }
    
    #wappen img {
        width: 120px;
        height: auto;
        border: none;
    }
    
    /* Schriftzug absolut auf dem Titelbild positionieren - Z-Index erhöhen */
    #arminia {
        position: absolute;
        left: 50%;
        top: 80px;
        transform: translateX(-22%);
        z-index: 100; /* Erhöht für bessere Sichtbarkeit */
        margin: 0;
        width: auto;
    }
    
    #arminia img {
        width: 200px;
        height: auto;
        border: none;
    }
    
    /* HR-Elemente auf kleinen Bildschirmen ausblenden */
    #navtop, #navbottom {
        display: none !important;
    }
    
    /* Navigation zentrieren und unter dem Titelbild platzieren */
    #navigation {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        width: 90%;
        margin: 20px 0 10px 0;
        padding: 0;
        top: auto;
    }
    
    #navigation li {
        display: inline-block;
        margin: 5px 2%;
    }
    
    /* Container anpassen mit größeren Rändern */
    #container {
        position: relative;
        width: 100%; /* Verringerte Breite für größere Ränder */
        left: auto;
        margin: 0 auto;
        top: auto;
        padding: 0; /* Erhöhtes Padding für symmetrische Ränder */
        box-sizing: border-box;
    }
    
    #shadow-top, #shadow-bottom {
        width: 100%;
        background-size: 100% 50px;
    }
    
    #shadow-side {
        width: 100%;
        padding: 0;
        box-sizing: border-box;
        background-size: 100% 100%;
    }
    
    /* Content-Bereich anpassen mit größeren Rändern */
    #content {
        padding: 0 35px 0 35px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        margin-top: -30px; 
        overflow: hidden;
    }
    
    #left, #right {
        float: none;
        width: 100%;
        margin: 20px 0 0 0;
        box-sizing: border-box;
        padding: 0;
    }
    
    #right {
        margin-left: 0;
    }
    
    /* Infoboxen anpassen mit begrenzter Breite */
    .infobox {
        margin-bottom: 15px;
        width: 100%;
        box-sizing: border-box;
        padding: 0; /* Zusätzliches Padding für inneren Abstand */
    }
    
/* Programmpunkt-Layout für Responsive Design */
.programmpunkt {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.datum, .zeit, .ho {
    flex: 0 0 auto;
    margin-right: 15px;
    color: #a52323;
}

.datum {
    width: 70px;
}

.zeit {
    width: 90px;
}

.ho {
    width: 35px;
}

.titel {
    flex: 1 0 100%; /* Erzwingt einen Zeilenumbruch */
    margin-top: 5px;
    width: 100%;
}

.monat {
	border-bottom: 1px solid #e0e0e0;
	margin-bottom: 15px;
}

/* DMV-Anzeige responsiv */
    table.dmvview {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }
    
    /* Zeilen als Flex-Container für inline-Anordnung */
    table.dmvview tr {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 10px;
        align-items: center;
    }
    
    /* Label-Zellen - linksbündig und mit fester Breite */
    table.dmvview td.label {
        flex: 0 0 25%;
        text-align: left;
        font-weight: bold;
        color: #a52323;
        padding: 6px 10px 6px 0;
        box-sizing: border-box;
        font-size: 14px;
    }
    
    /* Eingabefeld-Zellen */
    table.dmvview td:not(.label) {
        flex: 1 0 75%;
        padding: 6px 0;
        box-sizing: border-box;
    }
    
    /* Zellen mit colspan - volle Breite */
    table.dmvview td[colspan="3"],
    table.dmvview td[colspan="4"] {
        flex: 1 0 75%;
        text-align: left;
    }
    
    /* Input-Felder anpassen */
    table.dmvview input[type="text"] {
        width: 100%;
        box-sizing: border-box;
        padding: 8px 10px;
        border: 1px solid #e0e0e0;
        font-family: Rosario, sans-serif;
        font-size: 15px;
        border-radius: 3px;
    }
    
    /* Besonders lange Input-Felder */
    table.dmvview input.lang {
        width: 100%;
    }
    
    /* Leere Zeilen mit Abstand reduzieren */
    table.dmvview tr:has(td[colspan="4"]:empty) {
        margin-bottom: 3px;
        height: 5px;
    }
    
    /* Einheitliches Button-Styling für alle Buttons */
    table.dmvview a.mailtellink,
    table.dmvview a.kartenlink,
    .dmv input[type="submit"],
    .dmv input[type="button"] {
        display: inline-block;
        padding: 10px 15px;
        background-color: #a52323 !important;
        color: white !important;
        text-decoration: none;
        border-radius: 4px;
        border: none;
        font-family: Rosario, sans-serif;
        font-size: 15px;
        cursor: pointer;
        text-align: center;
        margin: 5px 0;
        transition: background-color 0.2s ease;
    }
    
    table.dmvview a.mailtellink:hover,
    table.dmvview a.kartenlink:hover,
    .dmv input[type="submit"]:hover,
    .dmv input[type="button"]:hover {
        background-color: #8a1c1c !important;
    }
    
    /* Telefon- und E-Mail-Links */
    table.dmvview td:contains("anrufen") {
        padding-left: 25%;
        font-size: 14px;
    }
    
    /* Button vCard herunterladen - oben rechts */
    .dmv #vcard {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 0 0 20px auto !important;
        text-align: right;
        width: auto;
    }
    
    .dmv #vcard input[type="submit"] {
        width: auto;
        padding: 10px 20px;
        display: inline-block;
    }
    
    /* Button "Änderungen an Phil-XX melden" */
    .dmv input[type="button"] {
        width: 100%;
        max-width: 300px;
        margin: 15px auto;
        display: block;
    }
    
    /* Spezielle Anpassung für die Zeile mit "anrufen" Links */
    table.dmvview tr:has(td:contains("anrufen")) {
        margin-top: -5px;
        margin-bottom: 15px;
    }
   
    /* Container für Thumbnails - wichtig für Clearfix */
    .ce_text {
        overflow: hidden; /* Erzeugt neuen Blockformatierungskontext */
    }
    
    /* Thumbnails für Übersichtsseite - 2 pro Zeile */
    .thumbnail {
        float: left;
        width: calc(50% - 10px) !important;
        height: auto !important;
        margin: 0 20px 20px 0;
        padding: 0;
        box-sizing: border-box;
        text-align: center;
        min-height: 180px;
    }
    
    .thumbnail:nth-child(2n) {
        margin-right: 0;
    }
    
    /* Clear für jede zweite Zeile bei Übersichtsseite */
    .thumbnail:nth-child(2n+1) {
        clear: left;
    }
    
    .thumbnail img {
        width: 100% !important;
        height: auto !important;
        max-width: 140px;
        margin: 0 auto;
        display: block;
    }
    
    .thumbnail p.name,
    .thumbnail p.info {
        margin: 5px 0;
        font-size: 14px;
        text-align: center;
        line-height: 1.3;
    }
    
    /* Thumbnails für Galerieseite - FLEXBOX statt float für bessere Kontrolle */
.ce_text:has(.thumbnailingal) {
    display: block !important; /* Flexbox entfernen */
}

.ce_text:has(.thumbnailingal) > p {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
}
    
    .thumbnailingal {
        flex: 0 0 calc(50% - 8px) !important; /* 2 pro Zeile mit gap */
        height: auto !important;
        padding: 0;
        box-sizing: border-box;
        text-align: center;
        margin: 0 0 15px 0 !important; /* Margin nur nach unten */
    }
    
    .thumbnailingal img {
        width: 100% !important;
        height: auto !important;
        max-width: 136px;
        margin: 0 auto;
        display: block;
    }
    
    /* Clearfix für umschließendes Element */
    .ce_text:after {
        content: "";
        display: table;
        clear: both;
    }

    /* Infobox-Anpassung damit sie nicht in Thumbnails ragt */
    .infobox {
        clear: both;
        margin-top: 30px;
    }

    /* Mobile Links auf kleinen Bildschirmen anzeigen */
    .mobile-intern-links {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 25px;
        justify-content: center;
    }
    
    /* Button-Styling */
    .intern-button {
        display: inline-block;
        padding: 10px 15px;
        background-color: #a52323 !important;
        color: white !important;
        text-decoration: none;
        border-radius: 4px;
        border: none;
        font-family: Rosario, sans-serif;
        font-size: 15px;
        cursor: pointer;
        text-align: center;
        margin: 5px 0;
        transition: background-color 0.2s ease;
    }
    
    /* Button-Titel */
    .button-title {
        display: block;
        font-weight: normal;
    }
    
    .button-title em {
        font-style: normal;
    }
    
    /* Hover-Effekt */
    .intern-button:hover {
        background-color: #8a1c1c !important;
    }
    
    /* DMV-Tabellen anpassen */
    .dmvpagination {
        width: 100%;
        box-sizing: border-box;
    }
    
    .dmv table {
        width: 100%;
        box-sizing: border-box;
    }

    /* Tabelle in ein Karten-Layout umwandeln */
    table.dmvlist {
        width: 100%;
        border-collapse: collapse;
        display: block;
        margin: 0 auto;
        padding: 0;
        box-sizing: border-box;
    }

	/* TBody als Block-Element für die Zentrierung */
	table.dmvlist > tbody {
	    display: block;
	    width: 100%;
	}
    
    /* Tabellenkopf ausblenden */
    table.dmvlist #kopfzeile {
        display: none !important;
    }
    
    /* Zeilen als kompakte, klickbare Karten darstellen */
    table.dmvlist > tbody > tr {
        display: block;
        width: calc(100%);
        margin: 0 auto 10px auto;
        padding: 12px;
        border: 1px solid #e0e0e0;
        border-radius: 5px;
        background-color: #fdf9ee;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        position: relative;
        transition: all 0.2s ease;
        box-sizing: border-box;
        cursor: pointer;
        max-width: 800px;
    } 
    
     
    table.dmvlist > tbody > tr:active {
        background-color: #f5f0e3;
        transform: translateY(1px);
    }
    
    /* Zellen anpassen - INLINE für Emoji-Daten */
    table.dmvlist td {
        padding: 0;
        border: none;
        box-sizing: border-box;
    }
    
    /* Erste Zeile: Nachname, Vorname */
    table.dmvlist td:nth-child(1),
    table.dmvlist td:nth-child(2) {
        display: inline;
    }
    
    table.dmvlist td:nth-child(1)::after {
        content: ", ";
    }
    
    /* Zeilenumbruch nach Vorname */
    table.dmvlist td:nth-child(2)::after {
        content: "";
        display: block;
        margin-bottom: 6px;
    }
    
    /* Zweite Zeile: Geburtstag, Eintritt, PLZ mit Emojis - INLINE */
    table.dmvlist td:nth-child(3),
    table.dmvlist td:nth-child(4),
    table.dmvlist td:nth-child(5) {
        display: inline !important;
        margin: 0 15px 0 0;
        padding: 0;
    }
    
    table.dmvlist td:nth-child(3)::before {
        content: "🎂 ";
    }
    
    table.dmvlist td:nth-child(4)::before {
        content: "🎓 ";
    }
    
    table.dmvlist td:nth-child(5)::before {
        content: "📮 ";
    }
    
    /* Links anpassen */
    table.dmvlist td a {
        display: inline;
        color: #313131;
        text-decoration: none;
        font-weight: normal;
        pointer-events: none;
    }
    
    /* Pfeil-Icon für Klickbarkeit hinzufügen */
    table.dmvlist > tbody > tr::after {
        content: "→";
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #a52323;
        font-size: 16px;
        opacity: 0.7;
    }
    
    /* Pagination anpassen */
    ul.dmvpagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        list-style: none;
        padding: 0;
        margin: 15px 0;
        box-sizing: border-box;
        width: 100%;
    }
    
    ul.dmvpagination li {
        margin: 4px 2px;
    }
    
    ul.dmvpagination a {
        display: block;
        padding: 6px 10px;
        background-color: #a52323;
        color: white !important;
        text-decoration: none;
        border-radius: 3px;
        font-size: 13px;
        text-align: center;
        min-width: 36px;
        box-sizing: border-box;
    }
    
    ul.dmvpagination a:hover {
        background-color: #8a1c1c;
    }
    
    
    /* IE-spezifische Anpassungen deaktivieren */
    #ie7 #navigation {
        top: auto;
        margin-left: 0;
    }

    /* Weitere Anpassungen für sehr kleine Bildschirme */
    body {
        font-size: 14px;
    }

    #navigation li {
        display: inline;
        margin: 12px;
    }
    
    #navigation {
        font-size: 16px;
        line-height: 30px;
        width: 400px;
    }
    
    .infobox {
        font-size: 13px;
    }
    
    .infobox h2 {
        font-size: 16px;
    }

}

@media only screen and (min-width: 481px) and (max-width: 860px) {
    /* Für mittlere Bildschirme 3 pro Zeile in der Galerie */
    .thumbnailingal {
        flex: 0 0 calc(33.333% - 10px) !important;
    }
}