/*
PatSaTECH sitewide color tokens. Override Blocksy palette/button/link
variables so Woo and theme chrome pick up the same hex values.
*/
html:root,
body {
	--pst-cta: #E31E24;
	--pst-cta-hover: #C9141B;
	--pst-heading: #111827;
	--pst-text: #4B5563;
	--pst-meta: #6B7280;
	--pst-border: #E5E7EB;
	--pst-section: #F7F8FA;
	--pst-card: #FFFFFF;
	--pst-soft: var(--pst-section);
	--pst-on-cta: #FFFFFF;

	--theme-palette-color-1: var(--pst-cta);
	--theme-palette-color-2: var(--pst-cta-hover);
	--theme-palette-color-3: var(--pst-meta);
	--theme-palette-color-4: var(--pst-heading);
	--theme-palette-color-5: var(--pst-border);
	--theme-palette-color-6: var(--pst-section);
	--theme-palette-color-7: var(--pst-section);
	--theme-palette-color-8: var(--pst-card);

	--wp--preset--color--palette-color-1: var(--pst-cta);
	--wp--preset--color--palette-color-2: var(--pst-cta-hover);
	--wp--preset--color--palette-color-3: var(--pst-meta);
	--wp--preset--color--palette-color-4: var(--pst-heading);
	--wp--preset--color--palette-color-5: var(--pst-border);
	--wp--preset--color--palette-color-6: var(--pst-section);
	--wp--preset--color--palette-color-7: var(--pst-section);
	--wp--preset--color--palette-color-8: var(--pst-card);

	--theme-button-background-initial-color: var(--pst-cta);
	--theme-button-background-hover-color: var(--pst-cta-hover);
	--theme-button-text-initial-color: var(--pst-on-cta);
	--theme-button-text-hover-color: var(--pst-on-cta);
	--theme-link-initial-color: var(--pst-cta);
	--theme-link-hover-color: var(--pst-cta-hover);
	--theme-headings-color: var(--pst-heading);
	--theme-text-color: var(--pst-text);
	--theme-border-color: var(--pst-border);
	--theme-form-field-border-focus-color: var(--pst-cta);
	--theme-form-selection-field-active-color: var(--pst-cta);
	--theme-selection-background-color: var(--pst-cta);
	--theme-selection-text-color: var(--pst-on-cta);
}

html,
html body,
#main-container,
#main {
	background-color: var(--pst-section);
}

/*
Header chrome exception: Blocksy menu current/hover inherit --theme-link-*
(CTA red). Keep buttons and in-content links red; nav stays charcoal.
*/
#header [data-row="top"],
#header [data-row="middle"],
#header [data-row="bottom"] {
	--theme-link-initial-color: var(--pst-heading);
	--theme-link-hover-color: var(--pst-text);
}

#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link,
#header [data-row] [class*="header-menu"] > ul > li.current-menu-item > .ct-menu-link,
#header [data-row] [class*="header-menu"] > ul > li.current-menu-ancestor > .ct-menu-link,
#header [data-row] [class*="header-menu"] > ul > li.current_page_item > .ct-menu-link,
#header [data-row] .ct-header-cart,
#header [data-row] .ct-header-cart a,
#header [data-row] .ct-header-account,
#header [data-row] .ct-header-account a,
#header [data-row] .ct-header-search,
#header [data-row] .ct-header-search button {
	color: var(--pst-heading);
}

#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link:hover,
#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link:focus,
#header [data-row] [class*="header-menu"] > ul > li.current-menu-item > .ct-menu-link,
#header [data-row] [class*="header-menu"] > ul > li.current-menu-ancestor > .ct-menu-link,
#header [data-row] [class*="header-menu"] > ul > li.current_page_item > .ct-menu-link {
	color: var(--pst-text);
}

#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link::after,
#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link::before {
	background-color: var(--pst-heading);
	border-color: var(--pst-heading);
}

#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link:hover::after,
#header [data-row] [class*="header-menu"] > ul > li > .ct-menu-link:focus::after,
#header [data-row] [class*="header-menu"] > ul > li.current-menu-item > .ct-menu-link::after,
#header [data-row] [class*="header-menu"] > ul > li.current-menu-ancestor > .ct-menu-link::after {
	background-color: var(--pst-text);
}

/*
Homepage / site canvas: paper or white only. No soft-red wash.
Hero Browse / Custom CTAs still use --pst-cta.
*/
body.home #main-container > #main > .ct-container-full,
body.patsatech-home #main-container > #main > .ct-container-full {
	background-color: var(--pst-card);
}

/*
Partners injection (blocksy-pattern-before-footer / reusable block 7198).
The plugin wraps the strip in a .ct-container with inline background-color:white.
Inherit the page canvas (#F7F8FA or that page’s main). No pink wash.
*/
#main-container > #main > .ct-container:has(.custom-pattern-wrapper),
#main > .ct-container:has(.custom-pattern-wrapper),
#main > .ct-container:has(.custom-pattern-wrapper) > section,
#main > .ct-container:has(.custom-pattern-wrapper) article.post,
.ct-container:has(.custom-pattern-wrapper),
.ct-container:has(.custom-pattern-wrapper) > section,
.ct-container:has(.custom-pattern-wrapper) article.post,
.custom-pattern-wrapper,
.custom-pattern-wrapper .ct-container {
	background: transparent !important;
	background-color: transparent !important;
}

.custom-pattern-wrapper,
.custom-pattern-wrapper .ct-container,
.custom-pattern-wrapper [style*="background-color"] {
  background: transparent !important;
  background-color: transparent !important;
}

/*
Blog/archive cards: PatSaTECH featured art is 16:9. Blocksy card thumbs use 4:3 +
object-fit cover, which crops infographic headlines on the sides. Match 16:9 and
show the full frame (letterbox if needed).
*/
body[data-prefix="blog"] .entry-card .ct-media-container.boundless-image,
body[data-prefix="categories"] .entry-card .ct-media-container.boundless-image,
body[data-prefix="author"] .entry-card .ct-media-container.boundless-image,
body[data-prefix="search"] .entry-card .ct-media-container.boundless-image {
	--theme-object-fit: contain;
	background-color: var(--pst-card);
}

body[data-prefix="blog"] .entry-card .ct-media-container.boundless-image::before,
body[data-prefix="categories"] .entry-card .ct-media-container.boundless-image::before,
body[data-prefix="author"] .entry-card .ct-media-container.boundless-image::before,
body[data-prefix="search"] .entry-card .ct-media-container.boundless-image::before {
	padding-bottom: 56.25%;
}

body[data-prefix="blog"] .entry-card .ct-media-container.boundless-image img,
body[data-prefix="categories"] .entry-card .ct-media-container.boundless-image img,
body[data-prefix="author"] .entry-card .ct-media-container.boundless-image img,
body[data-prefix="search"] .entry-card .ct-media-container.boundless-image img {
	aspect-ratio: 16 / 9 !important;
	object-fit: contain !important;
}

/*
Blog listing: Blocksy enhanced-grid uses 6 cols + span 2 (3 cards/row on desktop).
Force a plain 2-column grid on post archives.
*/
@media (min-width: 690px) {
	body[data-prefix="blog"] .entries[data-layout="enhanced-grid"],
	body[data-prefix="categories"] .entries[data-layout="enhanced-grid"],
	body[data-prefix="author"] .entries[data-layout="enhanced-grid"] {
		--grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body[data-prefix="blog"] .entries[data-layout="enhanced-grid"] > *,
	body[data-prefix="categories"] .entries[data-layout="enhanced-grid"] > *,
	body[data-prefix="author"] .entries[data-layout="enhanced-grid"] > * {
		grid-column: span 1 !important;
	}
}
