/* ==========================================================================
   Design System & Tokens
   ========================================================================== */

:root {
	/* Colors - From Theme Settings */
	--bw-fg-primary: var(--bw-setting-heading-color, #111827);
	--bw-fg-secondary: var(--bw-setting-text-color, #4b5563);

	--bw-bg-base: var(--bw-setting-site-background, #ffffff);
	--bw-bg-elevated: var(--bw-setting-content-background, #f9fafb);

	--bw-bg-elevated-hover: var(--bw-setting-content-hover-background, #f3f4f6);

	--bw-brand-base: var(--bw-setting-brand-color, #3b82f6);
	--bw-brand-strong: var(--bw-setting-brand-strong, #1d4ed8);
	--bw-content-link: var(--bw-setting-content-link-color, #2563eb);
	--bw-content-link-hover: var(--bw-setting-content-link-hover-color, #1d4ed8);
	--bw-border-strong: var(--bw-setting-border-color, #e4e4e7);
	--bw-border-subtle: var(--bw-setting-border-color, #e4e4e7);
	--bw-header-bg: var(--bw-setting-header-background, #f9fafb);
	--bw-header-text: var(--bw-setting-header-text-color, #111827);
	--bw-header-nav: var(--bw-setting-header-nav-color, #4b5563);
	--bw-header-nav-hover: var(--bw-setting-header-nav-hover-color, #111827);
	--bw-header-dropdown-border: var(--bw-setting-header-dropdown-border, #e4e4e7);
	--bw-footer-bg: var(--bw-setting-footer-background, #f9fafb);
	--bw-footer-text: var(--bw-setting-footer-text-color, #4b5563);
	--bw-footer-link: var(--bw-setting-footer-link-color, #3b82f6);
	--bw-footer-link-hover: var(--bw-setting-footer-link-hover-color, #1d4ed8);
	--bw-button-bg: var(--bw-setting-button-background, #3b82f6);
	--bw-button-text: var(--bw-setting-button-text-color, #ffffff);
	--bw-button-bg-hover: var(--bw-setting-button-hover-background, #1d4ed8);
	--bw-button-text-hover: var(--bw-setting-button-hover-text-color, #ffffff);
	--bw-font-sans: var(--bw-setting-font-family-base, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
	--bw-font-heading: var(--bw-setting-font-family-heading, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
	--bw-font-weight-base: var(--bw-setting-font-weight-base, 400);
	--bw-base-font-size: var(--bw-setting-font-size-base, 16px);
	--bw-base-font-size-mobile: var(--bw-setting-font-size-base-mobile, 15px);
	--bw-h1-size: var(--bw-setting-h1-size, 42px);
	--bw-h2-size: var(--bw-setting-h2-size, 34px);
	--bw-h3-size: var(--bw-setting-h3-size, 28px);
	--bw-h4-size: var(--bw-setting-h4-size, 24px);
	--bw-h5-size: var(--bw-setting-h5-size, 20px);
	--bw-h6-size: var(--bw-setting-h6-size, 18px);
	--bw-base-font-size-tablet: var(--bw-setting-font-size-base-tablet, 16px);
	--bw-h1-size-tablet: var(--bw-setting-h1-size-tablet, 36px);
	--bw-h2-size-tablet: var(--bw-setting-h2-size-tablet, 30px);
	--bw-h3-size-tablet: var(--bw-setting-h3-size-tablet, 24px);
	--bw-h4-size-tablet: var(--bw-setting-h4-size-tablet, 22px);
	--bw-h5-size-tablet: var(--bw-setting-h5-size-tablet, 18px);
	--bw-h6-size-tablet: var(--bw-setting-h6-size-tablet, 16px);
	--bw-h1-size-mobile: var(--bw-setting-h1-size-mobile, 32px);
	--bw-h2-size-mobile: var(--bw-setting-h2-size-mobile, 28px);
	--bw-h3-size-mobile: var(--bw-setting-h3-size-mobile, 24px);
	--bw-h4-size-mobile: var(--bw-setting-h4-size-mobile, 20px);
	--bw-h5-size-mobile: var(--bw-setting-h5-size-mobile, 18px);
	--bw-h6-size-mobile: var(--bw-setting-h6-size-mobile, 16px);
	--bw-h1-weight: var(--bw-setting-h1-weight, 700);
	--bw-h2-weight: var(--bw-setting-h2-weight, 700);
	--bw-h3-weight: var(--bw-setting-h3-weight, 700);
	--bw-h4-weight: var(--bw-setting-h4-weight, 700);
	--bw-h5-weight: var(--bw-setting-h5-weight, 700);
	--bw-h6-weight: var(--bw-setting-h6-weight, 700);
	--bw-shadow-sm: 0 1px 2px 0 var(--bw-setting-shadow-sm, rgba(75, 85, 99, 0.08));
	--bw-shadow-md: 0 4px 6px -1px var(--bw-setting-shadow-md, rgba(75, 85, 99, 0.14));
	--bw-button-shadow-soft: 0 4px 6px -1px var(--bw-setting-button-shadow-soft, rgba(59, 130, 246, 0.2));
	--bw-button-shadow-strong: 0 10px 15px -3px var(--bw-setting-button-shadow-strong, rgba(59, 130, 246, 0.32));

	/* Layout & Spacing - From Theme Settings */
	--bw-container-max: var(--bw-setting-container-width, 1200px);
	--radius-base: var(--bw-setting-border-radius, 12px);
	--bw-image-radius: var(--bw-setting-image-border-radius, 8px);
	--bw-border-soft: color-mix(in srgb, var(--bw-border-strong) 65%, white);
	--archive-grid-cols: var(--bw-archive-grid-cols, 2);

	/* Spacing */
	--bw-space-1: 4px;
	--bw-space-2: 8px;
	--bw-space-3: 12px;
	--bw-space-4: 16px;
	--bw-space-5: 24px;
	--bw-space-6: 32px;
	--bw-space-8: 48px;
	--bw-space-10: 64px;

	/* Layout */
	--bw-container-padding: 24px;
	--bw-header-height: 80px;

	/* Transitions */
	--bw-transition-smooth: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--bw-font-sans);
	font-size: var(--bw-base-font-size);
	font-weight: var(--bw-font-weight-base);
	background-color: var(--bw-bg-base);
	color: var(--bw-fg-secondary);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--bw-fg-primary);
	margin-top: 0;
	margin-bottom: 0;
	line-height: 1.2;
	font-family: var(--bw-font-heading);
}

h1 {
	font-size: var(--bw-h1-size);
	font-weight: var(--bw-h1-weight);
}

h2 {
	font-size: var(--bw-h2-size);
	font-weight: var(--bw-h2-weight);
}

h3 {
	font-size: var(--bw-h3-size);
	font-weight: var(--bw-h3-weight);
}

h4 {
	font-size: var(--bw-h4-size);
	font-weight: var(--bw-h4-weight);
}

h5 {
	font-size: var(--bw-h5-size);
	font-weight: var(--bw-h5-weight);
}

h6 {
	font-size: var(--bw-h6-size);
	font-weight: var(--bw-h6-weight);
}

@media screen and (max-width: 768px) {
	body {
		font-size: var(--bw-base-font-size-mobile);
	}

	h1 {
		font-size: var(--bw-h1-size-mobile);
	}

	h2 {
		font-size: var(--bw-h2-size-mobile);
	}

	h3 {
		font-size: var(--bw-h3-size-mobile);
	}

	h4 {
		font-size: var(--bw-h4-size-mobile);
	}

	h5 {
		font-size: var(--bw-h5-size-mobile);
	}

	h6 {
		font-size: var(--bw-h6-size-mobile);
	}
}

a {
	color: var(--bw-content-link);
	text-decoration: none;
	transition: color var(--bw-transition-smooth);
}

a:hover {
	color: var(--bw-content-link-hover);
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.button {
	background-color: var(--bw-button-bg);
	color: var(--bw-button-text);
	border: 1px solid var(--bw-border-strong);
	border-radius: calc(var(--radius-base) - 2px);
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.button:hover {
	background-color: var(--bw-button-bg-hover);
	color: var(--bw-button-text-hover);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ==========================================================================
   Layout Utils
   ========================================================================== */

.bw-container {
	max-width: var(--bw-container-max);
	margin: 0 auto;
	padding: 0 var(--bw-container-padding);
}

@media screen and (max-width: 768px) {
	.bw-container {
		padding: 0 16px;
	}
}

.bw-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.bw-site-header {
	background-color: var(--bw-header-bg);
	border-bottom: 1px solid var(--bw-border-strong);
	z-index: 100;
}

body.has-sticky-header .bw-site-header {
	position: sticky;
	top: 0;
}

.bw-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--bw-header-height);
}

.bw-site-branding {
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.custom-logo-link {
	display: block;
	line-height: 0;
}

.custom-logo {
	display: block;
	width: var(--bw-setting-logo-width, 200px);
	height: auto;
}

@media (max-width: 991px) {
	.custom-logo {
		width: var(--bw-setting-logo-width-tablet, 150px);
	}
}

@media (max-width: 767px) {
	.custom-logo {
		width: var(--bw-setting-logo-width-mobile, 120px);
	}
}

.bw-site-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.025em;
}

.bw-site-title a {
	color: var(--bw-header-text);
}

.bw-site-title a:hover {
	color: var(--bw-header-nav-hover);
}

.bw-site-description {
	margin: 0;
	font-size: 0.875rem;
	color: var(--bw-fg-secondary);
}

/* Main Navigation */

.bw-main-navigation {
	display: flex;
	align-items: center;
}

.bw-menu-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--bw-header-nav);
	padding: 4px;
	cursor: pointer;
	transition: color var(--bw-transition-smooth);
	line-height: 0;
}

.bw-menu-toggle:hover {
	color: var(--bw-header-nav-hover);
	background: none;
}

.bw-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--bw-space-5);
	align-items: center;
}

.bw-menu-list li {
	position: relative;
}

.bw-menu-list a {
	display: block;
	color: var(--bw-header-nav);
	font-weight: 500;
	font-size: 17px;
	padding: var(--bw-space-2) 0;
}

.bw-menu-list a:hover,
.bw-menu-list .current-menu-item>a {
	color: var(--bw-header-nav-hover);
}

/* ---- Dropdown / Sub-menu (Desktop) ---- */

/* Flex on parent link so chevron stays vertically centered */
.bw-menu-list li.menu-item-has-children>a {
	display: flex;
	align-items: center;
	gap: 5px;
}

/* Static chevron — no animation */
.bw-menu-list li.menu-item-has-children>a::after {
	content: '';
	display: block;
	width: 5px;
	height: 5px;
	flex-shrink: 0;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.45;
	margin-top: -2px;
}

/* Dropdown panel — styled as one card */
.bw-menu-list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 6px;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	margin-top: 8px;
	background: var(--bw-setting-header-dropdown-bg, var(--bw-bg-elevated));
	border: 1px solid var(--bw-header-dropdown-border);
	border-radius: var(--radius-base);
	box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.13);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.14s ease, visibility 0.14s;
	z-index: 1000;
}





/* Invisible hover bridge — fills the margin gap above the panel */
.bw-menu-list .sub-menu::before {
	content: '';
	position: absolute;
	top: -10px;
	left: 0;
	right: 0;
	height: 10px;
}

/* Show on hover — parent li hover keeps sub-menu alive */
.bw-menu-list li.menu-item-has-children:hover>.sub-menu,
.bw-menu-list li.menu-item-has-children.is-open>.sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Right-align last items to prevent overflow */
.bw-menu-list li:last-child>.sub-menu,
.bw-menu-list li:nth-last-child(2)>.sub-menu {
	left: auto;
	right: 0;
}

/* Sub-menu links — border-radius clips hover bg inside panel */
.bw-menu-list .sub-menu a {
	display: block;
	padding: 9px 14px;
	font-size: 15px;
	font-weight: 400;
	color: var(--bw-setting-header-dropdown-text, var(--bw-header-nav));
	white-space: nowrap;
	border-radius: calc(var(--radius-base) - 3px);
	transition: background 0.1s ease, color 0.1s ease;
}

.bw-menu-list .sub-menu a:hover {
	background: var(--bw-setting-header-dropdown-hover-bg, var(--bw-bg-elevated-hover));
	color: var(--bw-setting-header-dropdown-hover-text, var(--bw-header-nav-hover));
}

/* No inherited chevron on sub-items */
.bw-menu-list .sub-menu li>a {
	display: block;
}

.bw-menu-list .sub-menu li>a::after {
	display: none;
}

/* Mega menu panel */
.bw-menu-list li.mega-menu>.sub-menu {
	min-width: 400px;
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: 2px;
	padding: 10px;
}

.bw-menu-list li:last-child.mega-menu>.sub-menu {
	left: auto;
	right: 0;
}

.bw-menu-list li.mega-menu .sub-menu a {
	white-space: normal;
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
	.bw-site-header {
		position: relative;
		--bw-header-height: 60px;
	}

	.bw-menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
		z-index: 10000;
	}

	.bw-main-navigation .bw-menu-list {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		background-color: var(--bw-header-bg);
		flex-direction: column;
		align-items: stretch;
		/* ensures all items stretch full width */
		justify-content: flex-start;
		padding: 80px var(--bw-container-padding) var(--bw-space-5);
		gap: 0;
		z-index: 9999;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.bw-main-navigation.is-toggled .bw-menu-list {
		display: flex;
	}

	/* ALL li items — full width, left aligned */
	.bw-menu-list li {
		width: 100%;
		text-align: left;
	}

	/* ALL top-level nav links in mobile overlay */
	.bw-menu-list>li>a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 15px 0;
		border-bottom: 1px solid rgba(128, 128, 128, 0.15);
		font-size: 17px;
		font-weight: 500;
		color: var(--bw-header-nav);
		border-radius: 0;
		text-align: left;
	}

	.bw-menu-list>li:last-child>a {
		border-bottom: none;
	}

	/* Chevron — bigger, flex-aligned */
	.bw-menu-list li.menu-item-has-children>a::after {
		width: 8px;
		height: 8px;
		margin-top: 0;
		flex-shrink: 0;
		opacity: 0.45;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
	}

	/* Sub-menu — clean accordion, no desktop card styles */
	.bw-menu-list .sub-menu {
		position: static;
		margin-top: 0;
		left: auto;
		box-shadow: none;
		border: none;
		border-radius: 0;
		background: transparent;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		display: none;
		padding: 0 0 0 12px;
		min-width: 0;
	}

	.bw-menu-list .sub-menu::before {
		display: none;
	}

	.bw-menu-list li.is-open>.sub-menu {
		display: block;
	}

	/* Sub-menu links */
	.bw-menu-list .sub-menu>li>a {
		display: block;
		font-size: 15px;
		font-weight: 400;
		padding: 11px 0;
		border-radius: 0;
		border-bottom: 1px solid rgba(128, 128, 128, 0.12);
		background: transparent !important;
		color: var(--bw-header-nav);
		white-space: normal;
		text-align: left;
		justify-content: flex-start;
		opacity: 0.85;
	}

	.bw-menu-list .sub-menu>li:last-child>a {
		border-bottom: none;
	}

	/* Mega menu reset on mobile */
	.bw-menu-list li.mega-menu>.sub-menu {
		display: block !important;
		min-width: 0;
		padding: 0 0 0 12px;
	}
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.bw-site-main {
	padding-top: var(--bw-space-6);
	padding-bottom: var(--bw-space-6);
}

@media screen and (max-width: 768px) {
	.bw-site-main {
		padding-top: var(--bw-space-4);
		padding-bottom: var(--bw-space-4);
		overflow-x: hidden;
		/* contain table scroll — prevents page from growing wide */
	}
}

.bw-post-article {
	background-color: var(--bw-bg-elevated);
	border: 1px solid var(--bw-border-strong);
	border-radius: var(--radius-base);
	padding: var(--bw-space-6);
	margin-bottom: var(--bw-space-6);
	box-shadow: var(--bw-shadow-sm);
	transition: background var(--bw-transition-smooth);
}

.bw-post-article:hover {
	background: var(--bw-setting-content-hover-background);
}

.archive .site-main>article,
.tax-category .site-main>article,
.tax-post_tag .site-main>article,
.taxonomy .site-main>article {
	background-color: var(--bw-bg-elevated);
	border: 1px solid var(--bw-border-strong);
	border-radius: var(--radius-base);
	padding: var(--bw-space-5);
	margin-bottom: var(--bw-space-5);
	transition: background var(--bw-transition-smooth);
}

.archive .site-main>article:hover,
.tax-category .site-main>article:hover,
.tax-post_tag .site-main>article:hover,
.taxonomy .site-main>article:hover {
	background: var(--bw-setting-content-hover-background);
}

.bw-entry-title {
	font-size: var(--bw-h1-size);
	font-weight: 800;
	margin-bottom: 12px;
	color: var(--bw-fg-primary);
}

.bw-entry-content a {
	color: var(--bw-content-link);
}

.bw-entry-content a:hover {
	color: var(--bw-content-link-hover);
}

/* Typography Elements (Lists, Quotes, Tables, Images) */
.bw-entry-content h1,
.bw-entry-content h2,
.bw-entry-content h3,
.bw-entry-content h4,
.bw-entry-content h5,
.bw-entry-content h6 {
	margin-top: 20px;
	margin-bottom: 20px;
	line-height: 1.3;
}

.bw-entry-content ul,
.bw-entry-content ol {
	margin: 0 0 var(--bw-space-5) 24px;
	padding: 0;
}

.bw-entry-content li {
	margin-bottom: var(--bw-space-2);
}

.bw-entry-content li:last-child {
	margin-bottom: 0;
}

.bw-entry-content blockquote {
	margin: var(--bw-space-5) 0;
	padding: var(--bw-space-4) var(--bw-space-5);
	background: var(--bw-bg-elevated);
	border-left: 4px solid var(--bw-brand-base);
	border-radius: 0 var(--radius-base) var(--radius-base) 0;
	font-style: italic;
	color: var(--bw-fg-secondary);
}

.bw-entry-content blockquote p {
	margin-bottom: 0;
}

.bw-entry-content blockquote p:last-child {
	margin-bottom: 0;
}

/* ---- Tables ---- */

/* Block editor table: the figure IS the scroll container */
.bw-entry-content .wp-block-table {
	display: block;
	/* enables overflow to work on a figure element */
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: var(--bw-space-5) 0;
	border-radius: var(--radius-base);
	box-shadow: var(--bw-shadow-sm);
}

/* Table base */
.bw-entry-content table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
}

/* Cells — no background, just borders */
.bw-entry-content th,
.bw-entry-content td {
	padding: 12px 16px;
	border-right: 1px solid var(--bw-border-strong);
	border-bottom: 1px solid var(--bw-border-strong);
	text-align: left;
	vertical-align: middle;
	word-break: break-word;
	background: transparent;
}

/* First column left border */
.bw-entry-content th:first-child,
.bw-entry-content td:first-child {
	border-left: 1px solid var(--bw-border-strong);
}

/* First row top border */
.bw-entry-content tr:first-child th,
.bw-entry-content tr:first-child td {
	border-top: 1px solid var(--bw-border-strong);
}

/* Header row — only this gets a background */
.bw-entry-content thead th,
.bw-entry-content thead td,
.bw-entry-content table:not(:has(thead)) > tbody > tr:first-child > th,
.bw-entry-content table:not(:has(thead)) > tbody > tr:first-child > td {
	background: var(--bw-bg-elevated);
	font-weight: 700;
	color: var(--bw-fg-primary);
}

/* Classic bare <table> (not inside .wp-block-table figure) */
.bw-entry-content>table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--radius-base);
	box-shadow: var(--bw-shadow-sm);
}

/* Mobile: prevent text from wrapping inside cells so the table
   keeps its natural width and the wrapper scrolls horizontally */
@media (max-width: 768px) {

	.bw-entry-content th,
	.bw-entry-content td {
		padding: 10px 12px;
		font-size: 0.875rem;
		white-space: nowrap;
		/* forces table to stay wide → wrapper scrolls */
	}

	.bw-entry-content .wp-block-table {
		border-radius: 8px;
	}

	.bw-entry-content>table {
		border-radius: 8px;
	}
}




.bw-entry-content>img,
.bw-entry-content p>img,
.bw-entry-content figure>img {
	max-width: 100%;
	height: auto;
	border-radius: var(--bw-image-radius, 8px);
	margin: var(--bw-space-5) 0;
	display: block;
}

/* Clean responsive table override */
.bw-entry-content .wp-block-table,
.bw-entry-content>table {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: var(--bw-space-5) 0;
	border: 1px solid var(--bw-border-strong);
	border-radius: var(--radius-base);
	background: var(--bw-bg-base);
	box-shadow: var(--bw-shadow-sm);
}

.bw-entry-content .wp-block-table table,
.bw-entry-content>table {
	width: 100%;
	min-width: 640px;
	display: table;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
	background: transparent;
}

.bw-entry-content th,
.bw-entry-content td {
	padding: 14px 16px;
	border-top: 0;
	border-right: 0;
	border-left: 0;
	border-bottom: 1px solid var(--bw-border-strong);
	text-align: left;
	vertical-align: middle;
	word-break: normal;
	background: transparent;
}

.bw-entry-content th:first-child,
.bw-entry-content td:first-child {
	border-left: 0;
}

.bw-entry-content th+th,
.bw-entry-content td+td {
	border-left: 1px solid color-mix(in srgb, var(--bw-border-strong) 70%, white);
}

.bw-entry-content thead th,
.bw-entry-content thead td,
.bw-entry-content table:not(:has(thead)) > tbody > tr:first-child > th,
.bw-entry-content table:not(:has(thead)) > tbody > tr:first-child > td {
	border-top: 0;
	background: var(--bw-bg-elevated);
	font-weight: 700;
	color: var(--bw-fg-primary);
}

.bw-entry-content tbody tr:nth-child(even) td {
	background: color-mix(in srgb, var(--bw-bg-elevated) 55%, white);
}

.bw-entry-content tbody tr:last-child td,
.bw-entry-content tbody tr:last-child th,
.bw-entry-content table tr:last-child td,
.bw-entry-content table tr:last-child th {
	border-bottom: none;
}

@media (max-width: 768px) {
	.bw-entry-content .wp-block-table,
	.bw-entry-content>table {
		border-radius: 8px;
	}

	.bw-entry-content .wp-block-table table,
	.bw-entry-content>table {
		min-width: 560px;
		table-layout: auto;
	}

	.bw-entry-content th,
	.bw-entry-content td {
		padding: 11px 12px;
		font-size: 0.875rem;
		white-space: nowrap;
	}
}

/* Final table system */
.bw-entry-content .wp-block-table,
.bw-entry-content .bw-table-scroll {
	width: 100%;
	max-width: 100%;
	margin: var(--bw-space-5) 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--bw-border-strong);
	border-radius: var(--radius-base);
	background: var(--bw-bg-base);
	box-shadow: var(--bw-shadow-sm);
}

.bw-entry-content .wp-block-table table,
.bw-entry-content .bw-table-scroll table {
	width: 100%;
	min-width: 720px;
	margin: 0;
	border-collapse: collapse !important;
	border-spacing: 0 !important;
	table-layout: fixed;
	background: transparent;
}

.bw-entry-content .wp-block-table tbody,
.bw-entry-content .bw-table-scroll tbody {
	background: color-mix(in srgb, var(--bw-bg-base) 92%, var(--bw-bg-elevated));
}

.bw-entry-content .wp-block-table th,
.bw-entry-content .wp-block-table td,
.bw-entry-content .bw-table-scroll th,
.bw-entry-content .bw-table-scroll td {
	padding: 14px 16px;
	border: 0 !important;
	border-bottom: 1px solid var(--bw-border-strong) !important;
	text-align: left;
	vertical-align: top;
	word-break: break-word;
	overflow-wrap: anywhere;
	background: transparent;
	font-weight: 500;
	color: var(--bw-fg-primary);
}

.bw-entry-content .wp-block-table th + th,
.bw-entry-content .wp-block-table td + td,
.bw-entry-content .bw-table-scroll th + th,
.bw-entry-content .bw-table-scroll td + td {
	border-left: 1px solid color-mix(in srgb, var(--bw-border-strong) 70%, white) !important;
}

.bw-entry-content .wp-block-table thead th,
.bw-entry-content .wp-block-table thead td,
.bw-entry-content .bw-table-scroll thead th,
.bw-entry-content .bw-table-scroll thead td {
	background: color-mix(in srgb, var(--bw-bg-elevated) 85%, white);
	color: var(--bw-fg-primary);
	font-weight: 700;
	border-top: 0 !important;
}

.bw-entry-content .wp-block-table table:has(thead) tbody tr:first-child th,
.bw-entry-content .wp-block-table table:has(thead) tbody tr:first-child td,
.bw-entry-content .bw-table-scroll table:has(thead) tbody tr:first-child th,
.bw-entry-content .bw-table-scroll table:has(thead) tbody tr:first-child td {
	background: transparent !important;
	font-weight: 500 !important;
	color: var(--bw-fg-primary) !important;
}

.bw-entry-content .wp-block-table table:not(:has(thead)) tbody tr:first-child td,
.bw-entry-content .bw-table-scroll table:not(:has(thead)) tbody tr:first-child td {
	background: color-mix(in srgb, var(--bw-bg-elevated) 85%, white) !important;
	font-weight: 700 !important;
}

.bw-entry-content .wp-block-table tbody tr:nth-child(even) td,
.bw-entry-content .bw-table-scroll tbody tr:nth-child(even) td {
	background: color-mix(in srgb, var(--bw-bg-base) 96%, var(--bw-bg-elevated));
}

.bw-entry-content .wp-block-table tbody tr:last-child td,
.bw-entry-content .wp-block-table tbody tr:last-child th,
.bw-entry-content .bw-table-scroll tbody tr:last-child td,
.bw-entry-content .bw-table-scroll tbody tr:last-child th {
	border-bottom: 0 !important;
}

@media (max-width: 768px) {
	.bw-entry-content .wp-block-table,
	.bw-entry-content .bw-table-scroll {
		border-radius: 8px;
	}

	.bw-entry-content .wp-block-table table,
	.bw-entry-content .bw-table-scroll table {
		min-width: 560px;
		table-layout: auto;
	}

	.bw-entry-content .wp-block-table th,
	.bw-entry-content .wp-block-table td,
	.bw-entry-content .bw-table-scroll th,
	.bw-entry-content .bw-table-scroll td {
		padding: 11px 12px;
		font-size: 0.875rem;
		white-space: nowrap;
	}
}

/* Author & Meta Area */
.bw-author-meta {
	display: flex !important;
	/* Force flex to prevent stacking */
	flex-direction: row;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}

.bw-author-photo img,
.bw-author-photo .avatar {
	width: 42px !important;
	height: 42px !important;
	border-radius: 50% !important;
	object-fit: cover;
	display: block;
}

.bw-author-details {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bw-meta-author-name {
	font-weight: 600;
	color: var(--bw-fg-secondary);
	font-size: 1rem;
	text-decoration: none;
}

.bw-meta-sep {
	width: 3px;
	height: 3px;
	background: var(--bw-border-strong);
	border-radius: 50%;
	flex-shrink: 0;
}

.bw-author-date {
	font-weight: 600;
	font-size: 1rem;
	color: var(--bw-fg-secondary);
}

@media screen and (max-width: 768px) {
	.bw-author-meta {
		gap: 12px;
		margin-bottom: 16px;
	}

	.bw-author-photo img,
	.bw-author-photo .avatar {
		width: 42px !important;
		height: 42px !important;
	}

	.bw-author-details {
		flex-direction: column;
		align-items: flex-start;
		gap: 1px;
	}

	.bw-meta-sep {
		display: none;
	}

	.bw-meta-author-name {
		font-size: 0.875rem;
		line-height: 1.3;
	}

	.bw-author-date {
		font-size: 0.875rem;
		line-height: 1.3;
	}
}

/* Show More/Less Container */
.bw-intro-text {
	margin-bottom: 24px;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--bw-fg-secondary);
	position: relative;
}

.bw-intro-content.is-clamped {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	max-height: 6em;
	/* fallback: 4 lines × 1.5 line-height */
}

.bw-intro-content p {
	margin: 0 0 var(--bw-space-3) 0;
	line-height: 1.5;
}

.bw-intro-content p:last-child {
	margin-bottom: 0;
}



.bw-expand-trigger {
	margin-top: var(--bw-space-2);
	font-weight: 600;
	color: var(--bw-fg-primary);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	text-transform: none;
	letter-spacing: 0;
	background: none;
	border: none;
	padding: 0;
	position: relative;
	z-index: 2;
	opacity: 0.7;
}

.bw-expand-trigger:hover {
	background: none;
	border: none;
	color: var(--bw-fg-primary);
	opacity: 0.7;
	text-decoration: none;
}

.bw-expand-trigger:focus,
.bw-expand-trigger:focus-visible {
	background: none;
	border: none;
	color: var(--bw-fg-primary);
	text-decoration: none;
}

@media (max-width: 768px) {
	.bw-expand-trigger {
		font-size: 12px;
	}
}

@media (max-width: 768px) {
	.bw-entry-title {
		font-size: var(--bw-h1-size-mobile);
	}
}

/* ==========================================================================
   Hero: the title band below the site header
   ========================================================================== */

.bw-site-main.bw-site-main--singular {
	padding-top: 0;
}

.bw-hero {
	background-color: var(--bw-setting-hero-background, transparent);
	padding-top: var(--bw-space-6);
}

.bw-hero--colored {
	margin-bottom: var(--bw-space-6);
	padding-bottom: var(--bw-space-6);
}

.bw-hero--colored .bw-container> :last-child {
	margin-bottom: 0;
}

.bw-hero .bw-entry-title,
.bw-hero .bw-expand-trigger {
	color: var(--bw-setting-hero-heading-color, var(--bw-fg-primary));
}

.bw-hero .bw-intro-text,
.bw-hero .bw-meta-author-name,
.bw-hero .bw-author-date {
	color: var(--bw-setting-hero-text-color, var(--bw-fg-secondary));
}

@media (max-width: 768px) {
	.bw-hero {
		padding-top: var(--bw-space-4);
	}

	.bw-hero--colored {
		margin-bottom: var(--bw-space-5);
		padding-bottom: var(--bw-space-5);
	}
}

/* Jump links: keep the target clear of the top edge and of the sticky header. */
.bw-entry-content [id] {
	scroll-margin-top: var(--bw-space-5);
}

body.has-sticky-header .bw-entry-content [id] {
	scroll-margin-top: calc(var(--bw-header-height) + var(--bw-space-5));
}

/* Listicles from the Big Wins Listicle plugin span the content column. */
.bw-entry-content .bwl-listicle {
	margin: 0 0 var(--bw-space-6);
	max-width: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.bw-site-footer {
	background-color: var(--bw-footer-bg);
	border-top: 1px solid var(--bw-border-strong);
	padding: var(--bw-space-5) 0;
	margin-top: auto;
}

.bw-footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bw-site-info {
	color: var(--bw-footer-text);
	font-size: 0.875rem;
}

.bw-site-footer a {
	color: var(--bw-footer-link);
}

.bw-site-footer a:hover {
	color: var(--bw-footer-link-hover);
}

.bw-site-footer .bw-site-title a {
	color: var(--bw-footer-link);
}

.bw-site-footer .bw-site-title a:hover {
	color: var(--bw-footer-link-hover);
}

/* ==========================================================================
   Author Archive Page Redesign
   ========================================================================== */

.bw-author-archive-wrap {
	padding-top: 12px;
}

/* Breadcrumb Styling Refined */
.bw-breadcrumb-nav {
	margin-bottom: 24px;
	font-size: 0.9375rem;
	font-weight: 500;
}

.bw-breadcrumb-inner {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bw-breadcrumb-home {
	color: var(--bw-fg-secondary);
	text-decoration: none;
}

.bw-breadcrumb-separator {
	color: var(--bw-fg-secondary);
	display: flex;
	align-items: center;
}

.bw-breadcrumb-current {
	color: var(--bw-fg-secondary);
}

/* Author Header Refined */
.bw-author-header-refined {
	margin-bottom: 48px;
}

.bw-author-profile-grid {
	display: flex;
	align-items: center;
	gap: 32px;
}

.bw-author-avatar-big img {
	width: 180px;
	height: 180px;
	border-radius: 12px;
	object-fit: cover;
	background: var(--bw-bg-elevated);
}

.bw-author-info-stack {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bw-author-name {
	font-size: 2.75rem;
	font-weight: 800;
	margin: 0;
	color: var(--bw-fg-primary);
	line-height: 1;
}

h6 {
	font-family: var(--bw-font-heading);
	color: var(--bw-fg-primary);
	line-height: 1.2;
	margin: 0;
}

@media screen and (max-width: 1024px) {
	body {
		font-size: var(--bw-base-font-size-tablet);
	}

	h1 {
		font-size: var(--bw-h1-size-tablet);
	}

	h2 {
		font-size: var(--bw-h2-size-tablet);
	}

	h3 {
		font-size: var(--bw-h3-size-tablet);
	}

	h4 {
		font-size: var(--bw-h4-size-tablet);
	}

	h5 {
		font-size: var(--bw-h5-size-tablet);
	}

	h6 {
		font-size: var(--bw-h6-size-tablet);
	}
}

.bw-author-role {
	font-size: 1rem;
	color: var(--bw-fg-secondary);
	font-weight: 500;
}

.bw-author-badge-row {
	margin-top: 4px;
}

.bw-articles-counter {
	display: inline-flex;
	align-items: center;
	background: var(--bw-bg-elevated);
	color: var(--bw-fg-primary);
	font-weight: 700;
	font-size: 0.8125rem;
	padding: 6px 16px;
	border-radius: 8px;
}

.bw-author-bio-refined {
	margin-top: 32px;
	max-width: 100%;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--bw-fg-secondary);
}

/* Main Layout Grid */
.bw-author-main-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 60px;
}

@media screen and (max-width: 992px) {
	.bw-author-main-layout {
		grid-template-columns: 1fr;
		gap: 40px;
	}
}

.bw-archive-title-section {
	font-size: 2.25rem;
	font-weight: 800;
	margin-top: 16px;
	margin-bottom: 32px;
	color: var(--bw-fg-primary);
}

/* Article Cards Grid */
.bw-post-cards-grid {
	display: grid;
	grid-template-columns: repeat(var(--archive-grid-cols), 1fr);
	gap: 20px;
}

.bw-post-cards-grid.is-list-layout {
	grid-template-columns: 1fr;
}

.bw-post-cards-grid.is-list-layout .bw-article-card-minimal {
	padding: 28px;
}

.bw-post-cards-grid.has-columns-1 {
	grid-template-columns: 1fr;
}

.bw-post-cards-grid.has-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.bw-post-cards-grid.has-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.bw-article-card-minimal {
	display: block;
	background: var(--bw-bg-elevated);
	border-radius: 12px;
	padding: 32px;
	height: 100%;
	text-decoration: none;
	border: 1px solid var(--bw-border-subtle);
	transition: background 0.2s ease, border-color 0.2s ease;
}

.bw-article-card-minimal:hover {
	background: var(--bw-bg-elevated-hover);
}

.bw-article-card-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.bw-article-title {
	font-size: 1.5rem;
	font-weight: 800;
	margin: 0 0 16px 0;
	color: var(--bw-fg-primary);
	line-height: 1.25;
}

.bw-article-excerpt {
	font-size: 1rem;
	line-height: 1.4;
	color: var(--bw-fg-secondary);
	margin-bottom: 24px;
	flex: 1;
}

.bw-article-footer-meta {
	margin-top: auto;
	font-size: 0.8125rem;
	color: var(--bw-fg-secondary);
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}

.bw-meta-dot {
	opacity: 0.5;
}

/* Refined Sidebar Widget */
.bw-sidebar-widget-refined {
	position: sticky;
	top: 40px;
}

.bw-sidebar-widget-refined .bw-widget-title {
	font-size: 1.5rem;
	font-weight: 800;
	margin-bottom: 12px;
	color: var(--bw-fg-primary);
}

.bw-sidebar-authors-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bw-sidebar-author-item {
	display: flex;
	align-items: center;
	gap: 16px;
	text-decoration: none;
	padding: 12px;
	border-radius: 12px;
	transition: background 0.2s;
}

.bw-sidebar-author-item:hover {
	background: var(--bw-bg-elevated);
}

.bw-sidebar-author-item.is-active {
	background: var(--bw-bg-elevated);
}

.bw-sidebar-avatar-small img {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--bw-bg-elevated);
}

.bw-sidebar-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bw-sidebar-name {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 800;
	color: var(--bw-fg-primary);
}

.bw-sidebar-meta-stack {
	display: flex;
	flex-direction: column;
}

.bw-sidebar-role-meta {
	margin: 0;
	font-size: 0.75rem;
	color: var(--bw-fg-secondary);
	font-weight: 500;
}

.bw-sidebar-count-meta {
	margin: 0;
	font-size: 0.75rem;
	color: var(--bw-fg-secondary);
}

/* Pagination Refined */
.bw-pagination-nav {
	grid-column: 1 / -1;
	margin-top: 40px;
	display: flex;
	justify-content: flex-start;
	gap: 12px;
}

.bw-pagination-nav .page-numbers {
	padding: 8px 16px;
	background: var(--bw-bg-elevated);
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--bw-fg-secondary);
	text-decoration: none;
}

.bw-pagination-nav .current {
	background: var(--bw-fg-primary);
	color: var(--bw-bg-base);
}

/* Responsive Author Archive */
@media screen and (max-width: 1024px) {
	.bw-author-main-layout {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.bw-sidebar-widget-refined {
		position: static;
	}
}

@media screen and (max-width: 768px) {
	.bw-post-cards-grid {
		grid-template-columns: 1fr;
	}

	.bw-author-header-refined {
		margin-bottom: 24px;
	}

	.bw-author-profile-grid {
		flex-direction: row;
		align-items: flex-start;
		text-align: left;
		gap: 12px;
	}

	.bw-author-avatar-big img {
		width: 80px;
		height: 80px;
		border-radius: 8px;
	}

	.bw-author-info-stack {
		gap: 4px;
	}

	.bw-author-name {
		font-size: 1.6rem;
		line-height: 1.05;
	}

	.bw-author-role {
		font-size: 0.8125rem;
		line-height: 1.2;
	}

	.bw-author-badge-row {
		margin-top: 0;
	}

	.bw-articles-counter {
		font-size: 0.6875rem;
		padding: 4px 10px;
		border-radius: 6px;
	}

	.bw-archive-title-section {
		font-size: 1.75rem;
		margin-top: 0;
		margin-bottom: 20px;
	}

	.bw-author-bio-refined {
		margin-top: 14px;
		font-size: 0.9375rem;
	}
}

.bw-error-404 {
	max-width: 760px;
	margin: 0 auto;
	padding: 72px 0 96px;
	text-align: center;
}

.bw-error-404__eyebrow {
	margin: 0 0 12px;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bw-brand-base);
}

.bw-error-404__title {
	margin-bottom: 16px;
}

.bw-error-404__text {
	max-width: 620px;
	margin: 0 auto 28px;
	font-size: 1.0625rem;
	color: var(--bw-fg-secondary);
}

.bw-error-404__actions {
	display: flex;
	justify-content: center;
}

.bw-error-404__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 22px;
	border-radius: 999px;
	background: var(--bw-button-bg);
	color: var(--bw-button-text) !important;
	font-weight: 700;
	box-shadow: var(--bw-button-shadow-soft);
}

.bw-error-404__button:hover {
	background: var(--bw-button-bg-hover);
	color: var(--bw-button-text-hover) !important;
	box-shadow: var(--bw-button-shadow-strong);
}
