/* AF_EDITORIAL_TABLES_V1
 * AF_EDITORIAL_TABLES_V11
 * Editorial Tables v1.1
 * Weniger Tabellenkalkulation, mehr Magazin: klare Kopfzeile, horizontale Führung,
 * keine Zebra-Streifen, kein Hover und keine automatische Silbentrennung.
 */

.single-post .entry-content .wp-block-table {
    margin: 1.65rem 0 2rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) {
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.65rem 0 2rem !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    overflow: hidden;
    background: #fff !important;
    border: 1px solid #e1e1e1 !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .045) !important;
    color: #2d3748;
    font-size: 1rem !important;
    line-height: 1.55;
}

.single-post .entry-content .wp-block-table table:not([class*="atkp"]):not(.shop_table) {
    margin: 0 !important;
}

.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) th,
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) td {
    padding: 15px 16px !important;
    vertical-align: top !important;
    text-align: left;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    border: 0 !important;
    border-bottom: 1px solid #e8e8e8 !important;
    background: #fff !important;
}

.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) thead th,
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tr:first-child > th {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    background: #171717 !important;
    color: #fff !important;
    font-weight: 700 !important;
    line-height: 1.35;
    border-bottom: 3px solid var(--af-color-accent, #ff7518) !important;
}

/* Keine Zebra-Zeilen und bewusst kein Hover-Effekt. */
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:nth-child(even) > td,
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:hover > td,
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:focus-within > td {
    background: #fff !important;
}

.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:last-child > td,
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tr:last-child > th {
    border-bottom: 0 !important;
}

.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) caption {
    padding: 0 0 .65rem;
    color: #666;
    font-size: .9rem;
    line-height: 1.45;
    text-align: left;
    caption-side: top;
}

/* Nur lange Links dürfen notfalls umbrechen; normaler Text bleibt unangetastet. */
.single-post .entry-content table:not([class*="atkp"]):not(.shop_table) a {
    overflow-wrap: anywhere;
}

/* Dark Mode. */
html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) {
    background: var(--af-bg-card, #202020) !important;
    border-color: var(--af-border, #3b3b3b) !important;
    color: var(--af-text-body, #e7e7e7) !important;
    box-shadow: none !important;
}

html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) th,
html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) td {
    color: var(--af-text-body, #e7e7e7) !important;
    border-bottom-color: var(--af-border, #3b3b3b) !important;
    background: var(--af-bg-card, #202020) !important;
}

html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) thead th,
html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tr:first-child > th {
    background: #111 !important;
    color: #fff !important;
    border-bottom-color: var(--af-primary, #ff7518) !important;
}

html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:nth-child(even) > td,
html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:hover > td,
html.dark-mode .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) tbody tr:focus-within > td {
    background: var(--af-bg-card, #202020) !important;
}

/* Mobil: lieber sauber horizontal scrollen als Wörter zerlegen. */
@media (max-width: 700px) {
    .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) {
        display: block;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) th,
    .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) td {
        padding: 12px 14px !important;
    }

    .single-post .entry-content table:not([class*="atkp"]):not(.shop_table):has(tr > :nth-child(3)) {
        min-width: 620px;
    }

    .single-post .entry-content table:not([class*="atkp"]):not(.shop_table):has(tr > :nth-child(4)) {
        min-width: 720px;
    }
}

@media print {
    .single-post .entry-content table:not([class*="atkp"]):not(.shop_table) {
        box-shadow: none !important;
    }
}


/*
 * AF_EDITORIAL_TABLES_V12_MOBILE_SCROLL
 *
 * Mobile Tabellen horizontal scrollbar statt abgeschnitten.
 */

@media (max-width: 768px) {

	.single-post .entry-content .af-table-scroll {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-inline: contain;
		scrollbar-width: thin;
	}

	/*
	 * Tabelle darf breiter als der Textbereich sein.
	 */
	.single-post .entry-content .af-table-scroll > table,
	.single-post .entry-content .af-table-scroll table {
		width: max-content !important;
		min-width: 100% !important;
		max-width: none !important;
		table-layout: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/*
	 * Ab drei Spalten nicht mehr brutal in 360–400px quetschen.
	 */
	.single-post .entry-content
	.af-table-scroll--wide > table,

	.single-post .entry-content
	.af-table-scroll--wide table {
		min-width: 680px !important;
	}

	/*
	 * Keine absurden Wortumbrüche mehr.
	 */
	.single-post .entry-content
	.af-table-scroll th,

	.single-post .entry-content
	.af-table-scroll td {
		overflow-wrap: normal !important;
		word-break: normal !important;
		hyphens: none !important;
	}

	/*
	 * Erste Spalte etwas kompakter,
	 * restliche Spalten dürfen mehr Raum bekommen.
	 */
	.single-post .entry-content
	.af-table-scroll--wide th:first-child,

	.single-post .entry-content
	.af-table-scroll--wide td:first-child {
		min-width: 150px;
	}

	.single-post .entry-content
	.af-table-scroll--wide th:not(:first-child),

	.single-post .entry-content
	.af-table-scroll--wide td:not(:first-child) {
		min-width: 210px;
	}
}
