/**
 * Stories (blog): article page and listing pages.
 *
 * Loaded on single posts, the posts page, category, tag and author archives
 * (see bootstrap.php). Markup: inc/boravision/frontend/blog.php. The listing
 * hero is the shared .bv-archive-hero component; product cards are the shared
 * .bv-product-card component.
 */

/* The parent theme wraps theme templates in padded containers; Stories sets
   its own widths. */
body.boravision .bv-blog-main {
	display: block;
	width: 100%;
}

body.boravision:is(.single-post, .blog, .category, .tag, .author, .page-template-page-document) #content.site-content,
body.boravision:is(.single-post, .blog, .category, .tag, .author, .page-template-page-document) .theme-container,
body.boravision:is(.single-post, .blog, .category, .tag, .author, .page-template-page-document) .page-content {
	max-width: none;
	margin: 0;
	padding: 0;
}

.bv-story,
.bv-stories {
	--bv-story-wide: min(calc(100% - (2 * var(--bv-page-gutter))), var(--bv-container));
	--bv-story-text: min(calc(100% - (2 * var(--bv-page-gutter))), 720px);
	color: var(--bv-color-text);
	font-family: var(--bv-font-body);
}

/* ---------- Article header ---------- */

.bv-story__header {
	width: min(calc(100% - (2 * var(--bv-page-gutter))), 900px);
	margin: 0 auto;
	padding: clamp(32px, 5vw, 72px) 0 clamp(24px, 3vw, 40px);
	text-align: center;
}

.bv-story__crumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 0 18px;
	color: var(--bv-color-text-muted);
	font-family: var(--bv-font-ui);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.bv-story__crumbs a {
	color: inherit;
	text-decoration: none;
}

.bv-story__crumbs a:hover,
.bv-story__crumbs a:focus-visible {
	color: var(--bv-color-black);
}

.bv-story__title {
	margin: 0;
	color: var(--bv-color-black);
	font-family: var(--bv-font-heading);
	font-size: clamp(40px, 6vw, 80px);
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.005em;
	text-transform: uppercase;
	text-wrap: balance;
}

.bv-story__dek {
	max-width: 62ch;
	margin: 20px auto 0;
	font-size: clamp(18px, 1.6vw, 21px);
	line-height: 1.5;
	text-wrap: pretty;
}

.bv-story__byline {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 18px;
	margin: 22px 0 0;
	color: var(--bv-color-text-muted);
	font-family: var(--bv-font-ui);
	font-size: 14px;
}

.bv-story__byline > :first-child {
	color: var(--bv-color-black);
	font-weight: 600;
}

/* ---------- Hero image ---------- */

.bv-story__hero {
	width: var(--bv-story-wide);
	margin: 0 auto;
}

.bv-story__hero img {
	display: block;
	width: 100%;
	max-height: 76vh;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--bv-radius);
	background: var(--bv-color-surface);
}

.bv-story__hero figcaption {
	margin-top: 10px;
	color: var(--bv-color-text-muted);
	font-size: 14px;
}

/* ---------- Layout: table of contents + body ---------- */

.bv-story__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	width: var(--bv-story-text);
	margin: clamp(32px, 5vw, 64px) auto 0;
}

@media (min-width: 1024px) {
	.bv-story__layout.has-toc {
		grid-template-columns: 240px minmax(0, 720px);
		justify-content: center;
		gap: 64px;
		width: var(--bv-story-wide);
	}

	.bv-story__toc {
		position: sticky;
		top: calc(var(--bv-header-height) + 24px);
		align-self: start;
	}
}

@media (min-width: 1280px) {
	.bv-story__layout.has-toc {
		grid-template-columns: 240px minmax(0, 720px) 240px;
	}
}

.bv-story__toc details {
	border-top: 2px solid var(--bv-color-black);
}

.bv-story__toc summary {
	padding: 14px 0;
	color: var(--bv-color-black);
	font-family: var(--bv-font-ui);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
}

.bv-story__toc summary::-webkit-details-marker {
	display: none;
}

.bv-story__toc summary::after {
	content: "+";
	float: right;
	font-size: 18px;
	line-height: 1;
}

.bv-story__toc details[open] summary::after {
	content: "\2212";
}

.bv-story__toc ol {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0 0 16px;
	list-style: none;
}

.bv-story__toc li.is-h3 {
	padding-left: 14px;
}

.bv-story__toc a {
	display: block;
	padding: 6px 0 6px 12px;
	border-left: 2px solid var(--bv-color-border);
	color: var(--bv-color-text-muted);
	font-size: 15px;
	line-height: 1.35;
	text-decoration: none;
	transition: color var(--bv-transition-fast), border-color var(--bv-transition-fast);
}

.bv-story__toc a:hover,
.bv-story__toc a:focus-visible,
.bv-story__toc a[aria-current] {
	border-left-color: var(--bv-color-black);
	color: var(--bv-color-black);
}

@media (max-width: 1023px) {
	.bv-story__toc {
		margin-bottom: 32px;
	}

	.bv-story__toc details {
		padding: 0 16px;
		border: 1px solid var(--bv-color-border);
		border-radius: var(--bv-radius);
		background: var(--bv-color-surface);
	}
}

/* ---------- Article typography ---------- */

.bv-story__content {
	font-size: 18px;
	line-height: 1.7;
}

.bv-story__content > * {
	margin-top: 0;
	margin-bottom: 1.25em;
}

.bv-story__content :is(h2, h3, h4) {
	position: relative;
	scroll-margin-top: calc(var(--bv-header-height) + 24px);
	color: var(--bv-color-black);
	font-family: var(--bv-font-heading);
	font-weight: 800;
	line-height: 1.05;
	text-transform: uppercase;
	text-wrap: balance;
}

.bv-story__content h2 {
	margin-top: 2em;
	margin-bottom: 0.6em;
	font-size: clamp(30px, 3.4vw, 42px);
}

.bv-story__content h3 {
	margin-top: 1.6em;
	margin-bottom: 0.5em;
	font-size: clamp(23px, 2.4vw, 28px);
}

.bv-story__anchor {
	margin-left: 0.3em;
	color: var(--bv-color-decor);
	font-weight: 600;
	text-decoration: none;
	opacity: 0;
	transition: opacity var(--bv-transition-fast);
}

.bv-story__content :is(h2, h3):hover .bv-story__anchor,
.bv-story__anchor:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.bv-story__anchor {
		display: none;
	}
}

.bv-story__content a:not(.bv-story__anchor) {
	color: var(--bv-color-black);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.bv-story__content a:not(.bv-story__anchor):hover {
	text-decoration-thickness: 2px;
}

.bv-story__content :is(ul, ol) {
	padding-left: 1.3em;
}

.bv-story__content li + li {
	margin-top: 0.4em;
}

.bv-story__content li::marker {
	color: var(--bv-color-decor);
	font-weight: 700;
}

.bv-story__content blockquote {
	margin-left: 0;
	margin-right: 0;
	padding: 4px 0 4px 24px;
	border-left: 4px solid var(--bv-color-black);
	color: var(--bv-color-black);
	font-family: var(--bv-font-heading);
	font-size: clamp(24px, 2.6vw, 30px);
	font-weight: 600;
	line-height: 1.25;
}

.bv-story__content blockquote p {
	margin: 0;
}

.bv-story__content blockquote cite {
	display: block;
	margin-top: 10px;
	color: var(--bv-color-text-muted);
	font-family: var(--bv-font-ui);
	font-size: 14px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bv-story__content :is(figure, .wp-block-image) {
	margin-left: 0;
	margin-right: 0;
}

.bv-story__content img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--bv-radius);
}

.bv-story__content .alignwide,
.bv-story__content .alignfull {
	width: min(100vw - (2 * var(--bv-page-gutter)), 1040px);
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.bv-story__content figcaption {
	margin-top: 10px;
	color: var(--bv-color-text-muted);
	font-size: 14px;
	text-align: left;
}

.bv-story__content .wp-block-table,
.bv-story__content figure.wp-block-table {
	overflow-x: auto;
}

.bv-story__content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
}

.bv-story__content :is(th, td) {
	padding: 12px 14px;
	border-bottom: 1px solid var(--bv-color-border);
	text-align: left;
	vertical-align: top;
}

.bv-story__content thead th {
	border-bottom: 2px solid var(--bv-color-black);
	color: var(--bv-color-black);
	font-family: var(--bv-font-ui);
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bv-story__content hr {
	height: 0;
	margin: 2.5em 0;
	border: 0;
	border-top: 1px solid var(--bv-color-border);
}

/* Optional callout: add the "bv-callout" class to a paragraph or group. */
.bv-story__content .bv-callout {
	padding: 20px 22px;
	border-radius: var(--bv-radius);
	background: var(--bv-color-surface);
	font-size: 17px;
}

/* Gutenberg details block, used for article FAQs. */
.bv-story__content details {
	border-bottom: 1px solid var(--bv-color-border);
}

.bv-story__content details > summary {
	padding: 16px 0;
	color: var(--bv-color-black);
	font-weight: 600;
	cursor: pointer;
}

.bv-story__content details > :not(summary) {
	margin-top: 0;
}

/* ---------- Article footer ---------- */

.bv-story__footer {
	display: grid;
	gap: 24px;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--bv-color-border);
}

.bv-story__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bv-story__tags a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid var(--bv-color-border);
	border-radius: var(--bv-radius-full);
	color: var(--bv-color-text);
	font-size: 14px;
	text-decoration: none;
}

.bv-story__tags a:hover,
.bv-story__tags a:focus-visible {
	border-color: var(--bv-color-black);
	color: var(--bv-color-black);
}

.bv-story__share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 18px;
	font-family: var(--bv-font-ui);
	font-size: 14px;
	font-weight: 600;
}

.bv-story__share > span {
	color: var(--bv-color-text-muted);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.bv-story__share a,
.bv-story__share button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--bv-color-black);
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.bv-story__share button.is-copied {
	text-decoration: none;
}

.bv-story__author {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 20px;
	border-radius: var(--bv-radius);
	background: var(--bv-color-surface);
}

.bv-story__author img {
	flex: none;
	border-radius: 50%;
}

.bv-story__author p {
	margin: 0;
	font-size: 15px;
}

.bv-story__author .bv-story__author-name {
	margin-bottom: 4px;
	color: var(--bv-color-black);
	font-weight: 700;
}

/* ---------- Shop the story / More stories ---------- */

.bv-story__shop,
.bv-story__more {
	width: var(--bv-story-wide);
	margin: clamp(64px, 8vw, 112px) auto 0;
}

.bv-story__more {
	padding-bottom: clamp(64px, 8vw, 112px);
}

.bv-story__section-head {
	margin-bottom: 24px;
}

.bv-story__kicker {
	margin: 0 0 8px;
	color: var(--bv-color-decor);
	font-family: var(--bv-font-ui);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.bv-story__section-head h2 {
	margin: 0;
	color: var(--bv-color-black);
	font-family: var(--bv-font-heading);
	font-size: clamp(32px, 4vw, 48px);
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
}

.bv-story__products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--bv-grid-gap);
}

/* Equal-height cards with the button on one line across the row. */
.bv-story__products .bv-product-card {
	display: flex;
	flex-direction: column;
}

.bv-story__products .bv-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
}

.bv-story__products .bv-product-card__tagline {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.bv-story__products .bv-product-card__button {
	margin-top: auto;
}

@media (max-width: 1023px) {
	.bv-story__products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Story cards ---------- */

.bv-story-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(32px, 4vw, 48px) var(--bv-grid-gap);
}

@media (max-width: 1023px) {
	.bv-story-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.bv-story-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.bv-story-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.bv-story-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	border-radius: var(--bv-radius);
	background: var(--bv-color-surface);
}

.bv-story-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms cubic-bezier(.2, .7, .2, 1);
}

.bv-story-card:hover .bv-story-card__media img {
	transform: scale(1.03);
}

.bv-story-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.bv-story-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin: 0;
	color: var(--bv-color-text-muted);
	font-family: var(--bv-font-ui);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.bv-story-card__meta span {
	color: var(--bv-color-black);
}

.bv-story-card__title {
	margin: 0;
	font-family: var(--bv-font-heading);
	font-size: clamp(24px, 2.2vw, 30px);
	font-weight: 800;
	line-height: 1.02;
	text-transform: uppercase;
	text-wrap: balance;
}

.bv-story-card__title a {
	color: var(--bv-color-black);
	text-decoration: none;
}

.bv-story-card__title a:hover,
.bv-story-card__title a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.bv-story-card__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.55;
}

.bv-story-card__read {
	margin: 0;
	color: var(--bv-color-text-muted);
	font-size: 14px;
}

@media (min-width: 900px) {
	.bv-story-card--feature {
		display: grid;
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
		align-items: center;
		gap: clamp(32px, 4vw, 64px);
	}
}

.bv-story-card--feature .bv-story-card__media {
	aspect-ratio: 16 / 10;
}

.bv-story-card--feature .bv-story-card__title {
	font-size: clamp(34px, 4vw, 56px);
	line-height: 0.95;
}

.bv-story-card--feature .bv-story-card__excerpt {
	font-size: 18px;
}

/* ---------- Listing page ---------- */

.bv-stories__inner {
	display: grid;
	gap: clamp(40px, 5vw, 72px);
	width: var(--bv-story-wide);
	margin: 0 auto;
	padding: clamp(28px, 4vw, 48px) 0 clamp(64px, 8vw, 112px);
}

.bv-stories__filters {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	margin-bottom: calc(-1 * clamp(8px, 2vw, 24px));
	padding-bottom: 4px;
	scrollbar-width: none;
}

.bv-stories__filters::-webkit-scrollbar {
	display: none;
}

.bv-stories__filters a {
	display: inline-flex;
	flex: none;
	align-items: center;
	min-height: 40px;
	padding: 0 18px;
	border: 1px solid var(--bv-color-border);
	border-radius: var(--bv-radius-full);
	color: var(--bv-color-text);
	font-family: var(--bv-font-ui);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.bv-stories__filters a:hover,
.bv-stories__filters a:focus-visible {
	border-color: var(--bv-color-black);
	color: var(--bv-color-black);
}

.bv-stories__filters a[aria-current] {
	border-color: var(--bv-color-black);
	background: var(--bv-color-black);
	color: var(--bv-color-white);
}

.bv-stories__empty {
	margin: 0;
	font-size: 18px;
}

.bv-stories__empty a {
	color: var(--bv-color-black);
	font-weight: 600;
}

.bv-stories__pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bv-stories__pagination :is(a, span) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--bv-color-border);
	border-radius: var(--bv-radius-full);
	color: var(--bv-color-text);
	font-weight: 600;
	text-decoration: none;
}

.bv-stories__pagination .current {
	border-color: var(--bv-color-black);
	background: var(--bv-color-black);
	color: var(--bv-color-white);
}

@media (prefers-reduced-motion: reduce) {
	.bv-story-card__media img {
		transition: none;
	}
}

/* ---------- Document pages (legal & support) ---------- */

.bv-document {
	padding-bottom: clamp(64px, 8vw, 112px);
}

.bv-document .bv-story__content {
	font-size: 17px;
}

.bv-document .bv-story__content h2 {
	font-size: clamp(26px, 2.8vw, 34px);
}

.bv-document .bv-story__content h3 {
	font-size: clamp(20px, 2vw, 24px);
}

.bv-story__content .bv-legal-updated {
	color: var(--bv-color-text-muted);
	font-family: var(--bv-font-ui);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* WooCommerce order tracking form on a document page. */
.bv-document .woocommerce-form-track-order .form-row input {
	min-height: var(--bv-control-height);
	border: 1px solid var(--bv-color-border);
	border-radius: var(--bv-radius);
}

.bv-document .woocommerce-form-track-order button {
	min-height: var(--bv-control-height);
	padding: 0 28px;
	border-radius: var(--bv-radius-full);
	background: var(--bv-color-black);
	color: var(--bv-color-white);
}

/* Facts still to be confirmed by the owner, highlighted until replaced. */
.bv-story__content mark.bv-todo {
	padding: 1px 4px;
	border-radius: var(--bv-radius-sm);
	background: #fff3c4;
	color: #6b4e00;
	font-size: 0.92em;
}
