/*
 * Biz RankUp – SEO Results Table Widget Stylesheet
 *
 * Naming convention: .br-seo-table__*  (BEM, prefixed)
 * No external dependencies – pure CSS.
 *
 * Table of Contents:
 *  1. CSS Custom Properties (tokens)
 *  2. Container / wrapper
 *  3. Grid layout (desktop)
 *  4. Header row
 *  5. Data rows
 *  6. Cell atoms
 *     6a. Client column
 *     6b. Traffic column
 *     6c. Links column
 *     6d. Time column
 *     6e. Read More column
 *  7. Tablet breakpoint  (≤ 1024 px)
 *  8. Mobile breakpoint  (≤ 767 px)  – card layout
 *  9. Accessibility / focus styles
 */

/* ─────────────────────────────────────────────────────────────────────────
 * 1. CSS Custom Properties
 * ─────────────────────────────────────────────────────────────────────── */
.elementor-widget-br_seo_results_table {
	--br-seo-accent:          #ff8933;
	--br-seo-arrow-bg:        #ffe5cc;
	--br-seo-heading:         #26282c;
	--br-seo-text:            #444444;
	--br-seo-text-muted:      #6B7280;
	--br-seo-border:          #D9DCE3;
	--br-seo-row-height:      105px;
	--br-seo-header-height:   80px;
	--br-seo-cell-px:         16px;
	--br-seo-radius:          16px;
	--br-seo-arrow-radius:    6px;
	--br-seo-arrow-size:      30px;
}

/* ─────────────────────────────────────────────────────────────────────────
 * 2. Container / wrapper
 * ─────────────────────────────────────────────────────────────────────── */
.br-seo-table {
	width: 100%;
	/* No default background – inherits from the page/section background */
	border-radius: var(--br-seo-radius, 16px);
	overflow: hidden;
	font-family: inherit;
	color: var(--br-seo-text, #444444);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

.br-seo-table *,
.br-seo-table *::before,
.br-seo-table *::after {
	box-sizing: inherit;
}

/* ─────────────────────────────────────────────────────────────────────────
 * 3. Grid layout (desktop)
 *    Grid-template-columns mirrors the spec:
 *    Client 27% | Traffic 32% | Links 14% | Time 18% | Read More 9%
 * ─────────────────────────────────────────────────────────────────────── */
.br-seo-table__header,
.br-seo-table__row {
	display: grid;
	grid-template-columns: 27fr 32fr 14fr 18fr 9fr;
	align-items: center;
}

/* ─────────────────────────────────────────────────────────────────────────
 * 4. Header row
 * ─────────────────────────────────────────────────────────────────────── */
.br-seo-table__header {
	min-height: var(--br-seo-header-height, 80px);
	border-bottom: 1px solid var(--br-seo-border, #D9DCE3);
}

.br-seo-table__header-cell {
	padding: 0 var(--br-seo-cell-px, 16px);
	font-size: 21px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--br-seo-heading, #26282c);
}

/* ─────────────────────────────────────────────────────────────────────────
 * 5. Data rows
 * ─────────────────────────────────────────────────────────────────────── */
.br-seo-table__row {
	min-height: var(--br-seo-row-height, 105px);
	border-bottom: 1px solid var(--br-seo-border, #D9DCE3);
	transition: background-color 0.15s ease;
}

.br-seo-table__row:last-child {
	border-bottom: none;
}

.br-seo-table__row:hover {
	background-color: rgba(0, 0, 0, 0.018);
}

/* ─────────────────────────────────────────────────────────────────────────
 * 6. Cell atoms
 * ─────────────────────────────────────────────────────────────────────── */
.br-seo-table__cell {
	padding: 12px var(--br-seo-cell-px, 16px);
	display: flex;
	align-items: center;
}

/* ── 6a. Client column ─────────────────────────────────────────────────── */
.br-seo-table__client-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.br-seo-table__client-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--br-seo-accent, #ff8933);
	flex-shrink: 0;
	line-height: 1;
}

.br-seo-table__client-icon i,
.br-seo-table__client-icon svg {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: var(--br-seo-accent, #ff8933);
	fill: var(--br-seo-accent, #ff8933);
	display: block;
}

.br-seo-table__client-name {
	font-size: 20px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--br-seo-text, #444444);
}

/* ── 6b. Traffic column ────────────────────────────────────────────────── */
.br-seo-table__traffic-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Arrow badge (small square with icon) */
.br-seo-table__arrow-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--br-seo-arrow-size, 30px);
	height: var(--br-seo-arrow-size, 30px);
	min-width: var(--br-seo-arrow-size, 30px);
	background-color: var(--br-seo-arrow-bg, #DDD9FF);
	border-radius: var(--br-seo-arrow-radius, 6px);
	flex-shrink: 0;
	line-height: 1;
}

.br-seo-table__arrow-badge i,
.br-seo-table__arrow-badge svg {
	font-size: 13px;
	width: 13px;
	height: 13px;
	color: var(--br-seo-accent, #ff8933);
	fill: var(--br-seo-accent, #ff8933);
	display: block;
}

/* Traffic data: percentage + range stacked */
.br-seo-table__traffic-data {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.br-seo-table__percentage {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--br-seo-heading, #26282c);
}

.br-seo-table__traffic-range {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--br-seo-text-muted, #6B7280);
	white-space: nowrap;
}

/* ── 6c. Links column ──────────────────────────────────────────────────── */
.br-seo-table__links {
	font-size: 20px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--br-seo-text, #444444);
}

/* ── 6d. Time column ───────────────────────────────────────────────────── */
.br-seo-table__time-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.br-seo-table__time-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 1;
}

.br-seo-table__time-icon i,
.br-seo-table__time-icon svg {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: var(--br-seo-text-muted, #6B7280);
	fill: var(--br-seo-text-muted, #6B7280);
	display: block;
}

.br-seo-table__time-text {
	font-size: 20px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--br-seo-text, #444444);
	white-space: nowrap;
}

/* ── 6e. Read More column ──────────────────────────────────────────────── */
.br-seo-table__col-read-more {
	justify-content: flex-start;
}

.br-seo-table__read-more {
	font-size: 20px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--br-seo-accent, #ff8933);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, opacity 0.15s ease;
	cursor: pointer;
}

.br-seo-table__read-more:hover,
.br-seo-table__read-more:focus-visible {
	border-bottom-color: var(--br-seo-accent, #ff8933);
	opacity: 0.82;
}

/* ─────────────────────────────────────────────────────────────────────────
 * 7. Tablet breakpoint  (≤ 1024 px)
 * ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {

	.br-seo-table__header,
	.br-seo-table__row {
		grid-template-columns: 30fr 34fr 12fr 16fr 8fr;
	}
}

/* ─────────────────────────────────────────────────────────────────────────
 * 8. Mobile breakpoint  (≤ 767 px) – card layout
 * ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

	/* Hide the desktop column header */
	.br-seo-table__header {
		display: none;
	}

	/* Single-column card layout per row */
	.br-seo-table__row {
		display: grid;
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto auto auto;
		grid-template-areas:
			"client"
			"traffic"
			"links"
			"time"
			"read-more";
		min-height: unset;
		padding: 20px var(--br-seo-cell-px, 16px);
		border-bottom: 1px solid var(--br-seo-border, #D9DCE3);
		gap: 12px 0;
	}

	.br-seo-table__row:last-child {
		border-bottom: none;
	}

	/* Reset cell padding */
	.br-seo-table__cell {
		padding: 0;
		align-items: center;
	}

	/* Grid area assignments */
	.br-seo-table__col-client    { grid-area: client; }
	.br-seo-table__col-traffic   { grid-area: traffic; }
	.br-seo-table__col-links     { grid-area: links; }
	.br-seo-table__col-time      { grid-area: time; }
	.br-seo-table__col-read-more {
		grid-area: read-more;
		justify-content: flex-start;
		align-items: flex-start;
	}

	/* Client cell – thin separator underneath */
	.br-seo-table__col-client {
		align-items: center;
		padding-bottom: 10px;
		border-bottom: 1px solid var(--br-seo-border, #D9DCE3);
		margin-bottom: 2px;
	}

	/* Auto data-label above each data cell via CSS */
	.br-seo-table__cell[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 13px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: var(--br-seo-text-muted, #6B7280);
		margin-right: 10px;
	}

	/* No label on client (name already visible) */
	.br-seo-table__col-client::before {
		display: none;
	}

	/* No label on Read More – link text serves as its own label */
	.br-seo-table__col-read-more::before {
		display: none !important;
	}

	.br-seo-table__col-read-more {
		align-items: flex-start;
		padding-top: 0;
	}
}

/* ─────────────────────────────────────────────────────────────────────────
 * 9. Accessibility / focus styles
 * ─────────────────────────────────────────────────────────────────────── */
.br-seo-table__read-more:focus-visible {
	outline: 2px solid var(--br-seo-accent, #ff8933);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Ensure SVG icons used via Elementor inherit colour correctly */
.br-seo-table__client-icon svg path,
.br-seo-table__arrow-badge svg path,
.br-seo-table__time-icon svg path {
	fill: currentColor;
}
