/*
Theme Name: Brettro Base Block Theme
Theme URI: https://example.com/theme-brettro-base
Author: Brettrospective
Author URI: https://brettrospective.com
Description: A lightweight WordPress block theme with color controls, background customization, logo support, and Adobe Fonts integration.
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: theme-brettro-base
Tags: block-theme, full-site-editing, custom-colors, custom-background, custom-logo
*/

/* Frontend typography defaults are injected via functions.php so Adobe Fonts can override them. */

/* WordPress-specific compatibility tweaks layered on top of BDS core CSS. */

#bds-nav-primary {
	display: block;
}

#bds-nav-primary .wp-block-navigation {
	justify-content: center;
}

#bds-nav-primary .wp-block-navigation__container {
	gap: 18px;
}

#bds-nav-primary .wp-block-navigation__responsive-container-open,
#bds-nav-primary .wp-block-navigation__responsive-container-close {
	font-family: var(--brettro-heading-font-family, inherit);
}

/* Header branding: keep logo/title centered. */
#bds-container-masthead .bds-grid-col-12 {
	display: flex;
	flex-direction: column;
	align-items: center;
}

#bds-container-masthead .wp-block-site-logo,
#bds-container-masthead .wp-block-site-title {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

/* When a custom logo is set, hide the site title. */
body.wp-custom-logo #bds-container-masthead .wp-block-site-title {
	display: none;
}

/* Remove default root-block gap between header and main for BDS page structure. */
.wp-site-blocks > #bds-page-header + #bds-page-content {
	margin-block-start: 0;
}

/* Force override of WP root block spacing rule regardless of stylesheet order. */
.wp-site-blocks > #bds-page-content {
	margin-block-start: 0 !important;
}

/* Query Loop bridge: force predictable card grid and per-item card shell. */
.bds-query-cards {
	width: 100%;
}

.bds-query-cards .bds-cards-query-template {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--bds-spacing-2);
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Keep Query Loop columns native by mapping core columns-* classes when present. */
.bds-query-cards .bds-cards-query-template.columns-1 {
	grid-template-columns: 1fr;
}

.bds-query-cards .bds-cards-query-template.columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bds-query-cards .bds-cards-query-template.columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bds-query-cards .bds-cards-query-template.columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bds-query-cards .bds-cards-query-template.columns-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bds-query-cards .bds-cards-query-template.columns-6 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bds-query-cards .bds-cards-query-template > .wp-block-post {
	border: 0 !important;
	margin: 0;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
	min-width: 0;
}

.bds-query-cards .bds-cards-query-template > .wp-block-post > .bds-card {
	height: 100%;
}

.bds-query-cards .bds-card .bds-card-container > .bds-card-content {
	margin-block-start: 0 !important;
}

.bds-query-cards .bds-card-content-header > .wp-block-post-date,
.bds-query-cards .bds-card-content-header > .wp-block-post-terms,
.bds-query-collection .bds-collection-item-content-header > .wp-block-post-date,
.bds-query-collection .bds-collection-item-content-header > .wp-block-post-terms {
	display: inline;
	margin: 0;
}

.bds-query-cards .bds-card .bds-card-container > .bds-card-img:empty {
	display: none;
}

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

/* Keep Query "No Results" fallback for frontend, but hide it in editor canvas. */
.editor-styles-wrapper .bds-query-cards > .wp-block-query-no-results {
	display: none;
}

/* Query Loop bridge: collection list wrappers from post-template markup. */
.bds-query-collection {
	width: 100%;
}

.bds-query-collection .bds-collection-query-template {
	list-style: none;
	padding: 0;
	margin: 0;
}

.bds-query-collection .bds-collection-query-template > .wp-block-post {
	list-style: none;
	margin: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.bds-query-collection .bds-collection-query-template > .wp-block-post > .bds-collection-item {
	margin-block-start: 0 !important;
}

.bds-query-collection .bds-collection-query-template > .wp-block-post > .bds-collection-item > .bds-collection-item-content {
	margin-block-start: 0 !important;
}

/* Keep Query "No Results" fallback for frontend, but hide it in editor canvas. */
.editor-styles-wrapper .bds-query-collection > .wp-block-query-no-results {
	display: none;
}

/* Footer layout and social links. */
.bds-site-footer-row {
	padding-top: var(--bds-spacing-2);
	padding-bottom: var(--bds-spacing-2);
}

/* Let WP Social Icons control their own icon/link color in footer social nav. */
#bds-container-nav-social nav ul li a,
#bds-container-nav-social nav ul li a:visited {
	color: inherit;
}

/* Remove default WP flow spacing between footer columns in the row. */
.bds-site-footer-row.is-layout-flow > * + * {
	margin-block-start: 0;
}

/* Utility nav: keep WP spacing, add pipe separators between items. */
#bds-container-nav-utility nav ul li::before {
	content: none;
}

#bds-container-nav-utility .wp-block-navigation__container {
	gap: 0;
}

#bds-container-nav-utility nav ul li a {
	padding: 0;
}

#bds-container-nav-utility .wp-block-navigation-item:not(:last-child) .wp-block-navigation-item__content::after {
	content: "|";
	display: inline-block;
	margin-inline: var(--bds-spacing-1);
}

.bds-footer-social-list.is-labels-hidden .bds-social-label,
.bds-footer-social-links.is-labels-hidden .bds-social-label,
.bds-footer-social-nav.is-labels-hidden .bds-social-label {
	display: none;
}

.bds-site-footer-col-1 .bds-footer-col-text,
.bds-site-footer-col-2 .bds-footer-col-text {
	margin: 0;
}

.bds-site-footer-col-2 {
	text-align: right;
}

@media screen and (max-width: 768px) {
	.bds-site-footer-col-2 {
		text-align: left;
	}
}
