/**
 * Advanced Table Builder — style frontend.
 * Autor: Michał Wacławski / MW GROWTH
 * Style scopowane do .atb-wrap, aby nie kolidować z motywami (Astra, GeneratePress, OceanWP, Divi, Hello Elementor).
 */

.atb-wrap { margin: 1.25em 0; max-width: 100%; }
.atb-wrap * { box-sizing: border-box; }

/* Pasek narzędzi */
.atb-wrap .atb-toolbar {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 8px;
}
.atb-wrap .atb-toolbar-bottom { margin-top: 8px; margin-bottom: 0; }
.atb-wrap .atb-search {
	flex: 1 1 220px;
	max-width: 360px;
	padding: 8px 12px;
	border: 1px solid #cbd5e0;
	border-radius: 6px;
	font-size: 14px;
}
.atb-wrap .atb-copy-btn {
	border: 0;
	border-radius: 6px;
	padding: 8px 16px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.2;
	transition: opacity 0.15s ease;
}
.atb-wrap .atb-copy-btn:hover { opacity: 0.9; }
.atb-wrap .atb-copy-btn.atb-copied { opacity: 1; }

/* Caption */
.atb-wrap .atb-caption { line-height: 1.4; }

/* Tabela bazowa */
.atb-wrap table.atb-table { margin: 0; }
.atb-wrap table.atb-table th,
.atb-wrap table.atb-table td { word-break: break-word; vertical-align: middle; }

/* Ikony dekoracyjne */
.atb-ic { display: inline-block; line-height: 1; font-style: normal; }
.atb-ic-check { color: #2f855a; font-weight: 700; }
.atb-ic-cross { color: #c53030; font-weight: 700; }
.atb-ic-star  { color: #d69e2e; }
.atb-prio { font-size: 0.85em; }
.atb-prio-hi  { color: #e53e3e; }
.atb-prio-mid { color: #dd6b20; }
.atb-prio-lo  { color: #38a169; }
.atb-ic-num { font-weight: 700; }

/* Sortowanie — wskaźnik */
.atb-wrap th.atb-sortable:focus-visible { outline: 2px solid #3182ce; outline-offset: -2px; }

/* Responsywność: scroll */
.atb-resp-scroll .atb-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Responsywność: none (skalowanie) — nic dodatkowego, tabela width:100% */

/* Responsywność: card view */
@media ( max-width: 640px ) {
	.atb-resp-card table.atb-table thead { display: none; }
	.atb-resp-card table.atb-table,
	.atb-resp-card table.atb-table tbody,
	.atb-resp-card table.atb-table tr,
	.atb-resp-card table.atb-table td { display: block; width: 100%; }
	.atb-resp-card table.atb-table tr {
		margin-bottom: 12px;
		border: 1px solid rgba( 0, 0, 0, 0.12 );
		border-radius: 6px;
		overflow: hidden;
	}
	.atb-resp-card table.atb-table td {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		text-align: right;
		border: 0;
		border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	}
	.atb-resp-card table.atb-table td:last-child { border-bottom: 0; }
	.atb-resp-card table.atb-table td::before {
		content: attr( data-label );
		font-weight: 700;
		text-align: left;
		flex: 0 0 45%;
		opacity: 0.85;
	}
	.atb-resp-card table.atb-table td[data-label=""]::before { content: ""; }
}
