/**
 * Webueno Table for Elementor - base styles.
 *
 * This file only defines structure and sensible fallbacks. Colors, spacing and
 * typography are output by Elementor from the widget's Style tab, so avoid
 * hardcoding design decisions here.
 */

.wb-table__wrap {
	position: relative;
}

/**
 * Frame element: carries background, border, radius and shadow.
 *
 * These deliberately do NOT sit on the scroll container. When a border radius,
 * a border and overflow:auto share one element, the browser rasterises the
 * rounded corner together with the scrolling layer and the arc ends up looking
 * thinner and lighter than the straight edges. Splitting them keeps the corner
 * at full strength. overflow:hidden here also clips the cell borders cleanly
 * against the radius.
 */
.wb-table__frame {
	position: relative;
	overflow: hidden;
	background-clip: padding-box;
}

/* Horizontal scroll container. No border, no radius - see the note above. */
.wb-table__scroll {
	--wb-sb-size: 8px;
	--wb-sb-track: #f1f3f5;
	--wb-sb-thumb: #b7c0cb;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--wb-sb-thumb) var(--wb-sb-track);
}

/* The container is focusable (tabindex=0) so it can be scrolled by keyboard. */
.wb-table__scroll:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.wb-table__scroll::-webkit-scrollbar {
	height: var(--wb-sb-size);
}

.wb-table__scroll::-webkit-scrollbar-track {
	background: var(--wb-sb-track);
}

.wb-table__scroll::-webkit-scrollbar-thumb {
	background: var(--wb-sb-thumb);
	border-radius: 999px;
}

/* border-collapse: separate keeps the frame's rounded corners intact. */
.wb-table {
	--wb-line-color: #e2e5e9;
	--wb-line-width: 1px;
	--wb-line-v: none;
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: auto;
	background: transparent;
}

.wb-table > caption {
	caption-side: top;
	text-align: inherit;
	padding: 0 0 12px;
}

.wb-table th,
.wb-table td {
	vertical-align: middle;
	word-break: normal;
	overflow-wrap: anywhere;
}

.wb-table thead th {
	font-weight: 700;
	background-clip: padding-box;
}

/* Horizontal grid lines: top border on every body cell. */
.wb-table tbody tr > td,
.wb-table tbody tr > th {
	border-top: var(--wb-line-width) solid var(--wb-line-color);
}

/* Vertical grid lines: toggled from the Style tab by setting --wb-line-v. */
.wb-table tr > *:not(:last-child) {
	border-right: var(--wb-line-v);
}

/* Edge shadow hinting that more content is available to the right. It lives
   inside the frame so the radius clips it. The is-scrollable / is-end classes
   are toggled by webueno-table.js. */
.wb-table__wrap--hint.is-scrollable .wb-table__frame::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 34px;
	pointer-events: none;
	background: linear-gradient(to left, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
	opacity: 1;
	transition: opacity 0.2s ease;
}

.wb-table__wrap--hint.is-scrollable.is-end .wb-table__frame::after {
	opacity: 0;
}

/* Visually hidden caption (still announced by screen readers). */
.wb-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------------
 * Cell icons (v0.3.0)
 *
 * The wrapper only exists in cells that have an icon. inline-flex keeps the
 * cell's text-align working for the whole icon + text group.
 * ---------------------------------------------------------------------- */
.wb-table__cell-inner {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 14px;
	max-width: 100%;
	vertical-align: middle;
}

.wb-table__cell-text {
	min-width: 0;
}

.wb-table__icon {
	--wb-icon-size-fallback: 20px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--wb-icon-box, auto);
	height: var(--wb-icon-box, auto);
	line-height: 1;
	color: inherit;
}

.wb-table__icon i {
	font-size: var(--wb-icon-size, var(--wb-icon-size-fallback));
	line-height: 1;
}

.wb-table__icon svg {
	display: block;
	width: var(--wb-icon-size, var(--wb-icon-size-fallback));
	height: var(--wb-icon-size, var(--wb-icon-size-fallback));
}

/* SVGs without a root fill attribute follow the text color. Root elements
   with fill="none" (outline icons) are intentionally not matched. */
.wb-table__icon svg:not([fill]) {
	fill: currentColor;
}
