/* Small-screen overrides. Loaded last. */

@media (max-width: 1024px) {
	.vfb-article-body { flex-direction: column; }
	.vfb-article-aside { position: static; width: 100%; flex-basis: auto !important; }
	.vfb-toc { margin-bottom: 1rem; }
	.vfb-cards.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 781px) {
	.vfb-top .wp-block-column { flex-basis: 100% !important; }
	.vfb-latest { margin-top: 1.5rem; }
	.vfb-footer-cols { gap: 1.5rem; flex-wrap: wrap !important; }
	.vfb-footer-cols > .wp-block-column { flex-basis: calc(50% - .75rem) !important; flex-grow: 0; }
	.vfb-footer-cols > .wp-block-column:first-child { flex-basis: 100% !important; }
	.admin-bar .vfb-header { top: 46px; }
}

@media (max-width: 600px) {
	.vfb-header { position: static; }
	.vfb-cards.is-layout-grid { grid-template-columns: 1fr !important; }
	.vfb-section { margin-top: 2.25rem !important; }
}

/* Store layout */
@media (max-width: 1024px) {
	.vfb-guide-row.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 781px) {
	.vfb-store-top > .wp-block-column, .vfb-store-pair > .wp-block-column { flex-basis: 100% !important; }
	.vfb-panel { padding: 1rem !important; }
}
@media (max-width: 781px) {
	.vfb-store-links { gap: 1rem; }
	.vfb-wordmark-text { font-size: 1.0625rem; letter-spacing: .03em; }
}
@media (max-width: 480px) {
	/* Both header links stay: Kit builder and Fit Finder. The wordmark scales down to fit beside them. */
	.vfb-wordmark-text { font-size: .9375rem; letter-spacing: .02em; }
	.vfb-store-links { gap: .75rem; }
	.vfb-store-links a { font-size: .875rem; }
	.vfb-guide-row.is-layout-grid { grid-template-columns: 1fr !important; }
}

/* Image-led store */
@media (max-width: 781px) {
	.vfb-photo { padding-top: 2rem !important; padding-bottom: 2rem !important; }
	.vfb-photo:not(.vfb-photo-head) .wp-block-cover__background { background: rgba(15, 9, 32, .78) !important; }
	.vfb-hero { min-height: 0 !important; }
	.vfb-photo-head { min-height: 240px !important; }
	.vfb-article-hero, .vfb-photo--kit { min-height: 360px !important; }
	.vfb-home-kits, .vfb-home-uses, .vfb-home-guides { margin-top: 1.75rem !important; }
}
@media (max-width: 480px) {
	.vfb-hero-line, .vfb-hero-line p { font-size: 1rem; }
	/* Guide cards turn into rows: small photo left, title right. */
	.vfb-guide-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: .85rem; align-items: center; }
	.vfb-guide-card .wp-block-post-featured-image { margin: 0 !important; }
	.vfb-guide-card .wp-block-post-title { font-size: 1rem !important; }
	.vfb-guide-grid, .vfb-guide-row { gap: .85rem !important; }
}
@media (max-width: 480px) {
	.vrfb-guide-cards { grid-template-columns: 1fr; gap: .85rem; }
	.vrfb-guide-cards .wp-block-post-featured-image { margin: 0; }
}
@media (max-width: 781px) {
	.vfb-article-panel { padding: 1.1rem 1rem !important; }
	.vfb-article-hero { max-height: none; }
	.vfb-product-head .vrfb-icon-tile { max-height: 200px; }
}
@media (max-width: 600px) {
	/* Shop by part: four columns of icon and a 14px label. */
	.vfb-home-parts .vrfb-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
}
@media (max-width: 1024px) {
	/* Guide contents on narrow screens: one row of section links that scrolls sideways. */
	.vfb-toc .vfb-box-label { border-bottom: 0; padding-bottom: .35rem; }
	.vfb-toc ol { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: 0 2.5rem .25rem 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
	.vfb-toc ol::-webkit-scrollbar { display: none; }
	.vfb-toc li { flex: none; border: 0; }
	.vfb-toc a { padding: .4rem .75rem; white-space: nowrap; background: #fff; border: 1px solid #d9d6e3; border-radius: 8px; color: var(--vfb-ink); }
}
@media (max-width: 374px) {
	/* The smallest phones fit the wordmark and one tool link. "Kit builder" is the same /kits/ page as
	   "Complete kits" in the category row just below, so it steps out here; the link stays in the HTML. */
	.vfb-store-links p:first-child { display: none; }
	.vfb-wordmark-text { font-size: .875rem; }
}

/* Touch screens (2026-11-17): footer links, breadcrumbs and guide contents are 44px targets. */
@media (max-width: 1024px), (pointer: coarse) {
	.vfb-footer-list li { margin: 0; }
	.vfb-footer-list a { display: flex; align-items: center; min-height: 44px; }
	.vfb-wordmark--footer a { min-height: 44px; }
	.vfb-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
	.vfb-toc a { display: flex; align-items: center; min-height: 44px; box-sizing: border-box; }
}
@media (max-width: 781px) {
	/* Footer: the brand line on top, then the link lists two to a row (core would stack all five). */
	.vfb-footer-cols.wp-block-columns { flex-wrap: wrap !important; column-gap: 1.5rem; row-gap: 1.25rem; }
	.vfb-footer-cols.wp-block-columns > .wp-block-column:not(:first-child) { flex-basis: calc(50% - .75rem) !important; flex-grow: 0; min-width: 0; }
	.vfb-footer-cols.wp-block-columns > .wp-block-column:first-child { flex-basis: 100% !important; }
}
@media (max-width: 600px) {
	/* Guide tables keep whole words: the table keeps a readable width and scrolls inside its own box. */
	.wp-block-table table { min-width: 34rem; table-layout: auto; }
	.wp-block-table th, .wp-block-table td { overflow-wrap: normal; word-break: normal; hyphens: manual; }
}
@media (max-width: 1024px), (pointer: coarse) {
	/* Guides and product pages: FAQ questions, kit links and the part type link are 44px targets. */
	.wp-block-details summary { padding-block: .5rem; }
	.vrfb-kit-link, .vfb-product-type a { display: inline-flex; align-items: center; min-height: 44px; }
	.vrfb-pick-title a, .wp-block-post-title > a { display: flex; align-items: center; min-height: 44px; }
}

/* Marketer review (2026-11-17): the last touch targets under 44px. */
@media (max-width: 1024px), (pointer: coarse) {
	/* Page numbers and Next on guide lists, audience hubs and search. */
	.vfb-pagination .page-numbers,
	.vfb-pagination .wp-block-query-pagination-next,
	.vfb-pagination .wp-block-query-pagination-previous { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; box-sizing: border-box; }
	/* Glossary terms. */
	.vrfb-glossary-row dt a { display: inline-flex; align-items: center; min-height: 44px; }
	/* Gear sort menu. */
	.vrfb-shop-sort select { min-height: 44px; }
}
@media (max-width: 600px) {
	/* Guide tables (labelled by assets/tables.js): one card per row, first cell as its title,
	   then "heading: answer" lines. Replaces the 34rem table that scrolled sideways. */
	.wp-block-table:has(> table.vfb-stack) { overflow: visible; }
	.wp-block-table table.vfb-stack { display: block; min-width: 0; width: 100%; border: 0; }
	.wp-block-table table.vfb-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
	.wp-block-table table.vfb-stack tbody { display: block; }
	.wp-block-table table.vfb-stack tr { display: block; margin: 0 0 .75rem; padding: .75rem .9rem; border: 1px solid #d9d6e3; border-radius: 10px; background: #fff; }
	.wp-block-table table.vfb-stack td, .wp-block-table table.vfb-stack th { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .75rem; padding: .35rem 0; border: 0; text-align: left; background: transparent; }
	.wp-block-table table.vfb-stack td::before, .wp-block-table table.vfb-stack th::before { content: attr(data-label); color: #505050; font-size: .875rem; }
	.wp-block-table table.vfb-stack tr > :first-child { display: block; padding: 0 0 .35rem; margin-bottom: .2rem; border-bottom: 1px solid #ebe9f1; font-weight: 600; font-size: 1rem; }
	.wp-block-table table.vfb-stack tr > :first-child::before { content: none; }
	.wp-block-table table.vfb-stack td:not([data-label])::before { content: none; }
	.wp-block-table table.vfb-stack td:not([data-label]) { display: block; }
}

@media (max-width: 1024px), (pointer: coarse) {
	/* Category labels on guide cards ("Comparisons", "Learn") are 44px touch targets too. */
	.wp-block-post-terms a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 600px) {
	/* Marketer, 2026-11-30: on a phone the header plus a 360px kit photo filled the whole first screen, so a
	   Google visitor saw no part, no verdict and no button before scrolling. Kit headers on phones keep the
	   same 240px as the other photo headers (above), which still shows the top of the photo over the title. */
	.vfb-photo--kit { min-height: 240px !important; }
}
