/**
 * Structural layout: containers, header, footer, sticky sidebar, grids.
 */

.bcm-container {
	width: 100%;
	max-width: var(--bcm-container-max);
	margin-inline: auto;
	padding-inline: var(--bcm-gutter);
}

.bcm-container--narrow {
	max-width: var(--bcm-container-narrow);
}

.bcm-section {
	padding-block: var(--bcm-space-8);
}

.bcm-section--tight {
	padding-block: var(--bcm-space-6);
}

.bcm-section__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--bcm-space-4);
	margin-bottom: var(--bcm-space-6);
}

.bcm-section__eyebrow {
	display: inline-block;
	font-family: var(--bcm-font-heading);
	font-weight: 600;
	font-size: var(--bcm-fs-sm);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bcm-color-accent-dark);
	margin-bottom: var(--bcm-space-2);
}

/* ---- Header ---- */
.bcm-site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: color-mix(in srgb, var(--bcm-color-surface) 92%, transparent);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--bcm-border-color);
	height: var(--bcm-header-height);
	display: flex;
	align-items: center;
}

.bcm-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--bcm-space-5);
	width: 100%;
}

.bcm-site-header__logo img {
	max-height: 32px;
	width: auto;
}

.bcm-site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--bcm-space-3);
}

.bcm-announcement-bar {
	background: var(--bcm-color-primary);
	color: var(--bcm-text-on-primary);
	font-size: var(--bcm-fs-sm);
	text-align: center;
	padding: var(--bcm-space-2) var(--bcm-gutter);
}

/* ---- Primary nav ---- */
.bcm-nav {
	display: none;
}

@media (min-width: 960px) {
	.bcm-nav {
		display: block;
	}
}

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

.bcm-nav__list > li {
	position: relative;
}

.bcm-nav__list a {
	color: var(--bcm-text-primary);
	font-weight: 500;
	text-decoration: none;
	padding: var(--bcm-space-2) 0;
}

.bcm-nav__list > li > a:hover,
.bcm-nav__list > li.current-menu-item > a {
	color: var(--bcm-color-primary);
}

/* Mega menu panel */
.bcm-mega-panel {
	position: absolute;
	top: calc(100% + var(--bcm-space-4));
	left: 50%;
	transform: translateX(-50%);
	width: min(920px, 90vw);
	background: var(--bcm-color-surface);
	border: 1px solid var(--bcm-border-color);
	border-radius: var(--bcm-radius-lg);
	box-shadow: var(--bcm-shadow-lg);
	padding: var(--bcm-space-6);
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--bcm-space-5);
	opacity: 0;
	visibility: hidden;
	transform-origin: top center;
	transition: opacity var(--bcm-duration-base) var(--bcm-ease), visibility var(--bcm-duration-base), transform var(--bcm-duration-base) var(--bcm-ease);
}

.bcm-nav__item--mega:hover > .bcm-mega-panel,
.bcm-nav__item--mega:focus-within > .bcm-mega-panel {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.bcm-mega-panel__col h4 {
	font-size: var(--bcm-fs-sm);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--bcm-text-muted);
	margin-bottom: var(--bcm-space-3);
}

.bcm-mega-panel__col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--bcm-space-2);
}

/* ---- Mobile menu ---- */
.bcm-mobile-toggle {
	display: inline-flex;
	background: none;
	border: 0;
	cursor: pointer;
	padding: var(--bcm-space-2);
}

@media (min-width: 960px) {
	.bcm-mobile-toggle {
		display: none;
	}
}

.bcm-mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 900;
	background: var(--bcm-color-surface);
	transform: translateX(100%);
	transition: transform var(--bcm-duration-slow) var(--bcm-ease);
	overflow-y: auto;
	padding: var(--bcm-space-6) var(--bcm-gutter);
}

.bcm-mobile-nav.is-open {
	transform: translateX(0);
}

/* ---- Main layout grid (content + sticky sidebar) ---- */
.bcm-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--bcm-space-7);
}

@media (min-width: 1100px) {
	.bcm-layout--with-sidebar {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
}

/* Archive/taxonomy pages: filter sidebar on the LEFT, results on the right. */
@media (min-width: 900px) {
	.bcm-layout--filters {
		grid-template-columns: 260px minmax(0, 1fr);
		align-items: start;
	}
}

.bcm-sidebar {
	min-width: 0;
}

@media (min-width: 1100px) {
	.bcm-sidebar__sticky {
		position: sticky;
		top: calc(var(--bcm-header-height) + var(--bcm-space-5));
		display: flex;
		flex-direction: column;
		gap: var(--bcm-space-5);
		max-height: calc(100vh - var(--bcm-header-height) - var(--bcm-space-6));
		overflow-y: auto;
	}
}

/* ---- Footer ---- */
.bcm-site-footer {
	background: var(--bcm-color-dark);
	color: #E9E4DC;
	margin-top: var(--bcm-space-9);
}

.bcm-site-footer a {
	color: #E9E4DC;
}

/* Centered "Follow Us" row */
.bcm-footer-social {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--bcm-space-3);
	padding-top: var(--bcm-space-7);
	text-align: center;
}

.bcm-footer-social__label {
	font-family: var(--bcm-font-heading);
	font-size: var(--bcm-fs-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #B7B0A6;
}

.bcm-footer-social__icons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--bcm-space-2);
}

.bcm-footer-social__icons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding-inline: var(--bcm-space-3);
	border-radius: var(--bcm-radius-pill);
	border: 1px solid rgba(255, 255, 255, 0.15);
	font-size: var(--bcm-fs-xs);
	text-decoration: none;
}

.bcm-footer-social__icons a:hover {
	background: rgba(255, 255, 255, 0.08);
}

/* Trust badge strip */
.bcm-footer-trust {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--bcm-space-5);
	padding-block: var(--bcm-space-6);
	margin-top: var(--bcm-space-6);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bcm-footer-trust__item {
	display: flex;
	align-items: center;
	gap: var(--bcm-space-3);
}

.bcm-footer-trust__item svg {
	flex-shrink: 0;
	color: var(--bcm-color-accent);
}

.bcm-footer-trust__item strong {
	display: block;
	font-size: var(--bcm-fs-sm);
}

.bcm-footer-trust__item span {
	display: block;
	font-size: var(--bcm-fs-xs);
	color: #B7B0A6;
}

.bcm-site-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--bcm-space-6);
	padding-block: var(--bcm-space-6) var(--bcm-space-7);
}

@media (min-width: 780px) {
	.bcm-site-footer__grid {
		grid-template-columns: 1.4fr 1fr 1fr 1fr;
	}
}

.bcm-footer-nav {
	list-style: none;
	padding-left: 0;
	margin: 0;
	font-size: var(--bcm-fs-sm);
}

.bcm-footer-nav li {
	margin-bottom: var(--bcm-space-2);
}

.bcm-site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-block: var(--bcm-space-4);
	display: flex;
	flex-wrap: wrap;
	gap: var(--bcm-space-3);
	align-items: center;
	justify-content: space-between;
	font-size: var(--bcm-fs-sm);
	color: #B7B0A6;
}

.bcm-site-footer__bottom--centered {
	justify-content: center;
	text-align: center;
}

/* ---- Generic responsive grids ---- */
.bcm-grid {
	display: grid;
	gap: var(--bcm-space-4);
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.bcm-grid--2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bcm-grid--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bcm-grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ---- Floating share bar ---- */
.bcm-floating-share {
	position: fixed;
	left: var(--bcm-space-4);
	top: 50%;
	transform: translateY(-50%);
	z-index: 400;
	display: none;
	flex-direction: column;
	gap: var(--bcm-space-2);
	background: var(--bcm-color-surface);
	border: 1px solid var(--bcm-border-color);
	border-radius: var(--bcm-radius-pill);
	padding: var(--bcm-space-2);
	box-shadow: var(--bcm-shadow-md);
}

@media (min-width: 1300px) {
	.bcm-floating-share {
		display: flex;
	}
}

/* ---- Reading progress bar ---- */
.bcm-reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0%;
	background: linear-gradient(90deg, var(--bcm-color-primary), var(--bcm-color-accent));
	z-index: 1000;
	transition: width 80ms linear;
}

/* ---- Back to top ---- */
.bcm-back-to-top {
	position: fixed;
	right: var(--bcm-space-5);
	bottom: var(--bcm-space-5);
	z-index: 400;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--bcm-color-primary);
	color: #fff;
	border: 0;
	box-shadow: var(--bcm-shadow-md);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all var(--bcm-duration-base) var(--bcm-ease);
}

.bcm-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
