/*
Theme Name: Pure Breed Poultry
Theme URI: https://thepurebreedpoultry.co.uk/
Author: Smart Insight
Description: Trade-first block theme for The Pure Breed Poultry Company. Works with BSO, the trade portal and the product catalogue.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: tpbpc
*/

/* Small pieces theme.json can't express. Keep this file short. */

.tpbpc-badge {
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--brown-mid);
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--green);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
}

.tpbpc-hero-media { position: relative; }
.tpbpc-hero-media img { border-radius: 24px; width: 100%; height: 440px; object-fit: cover; display: block; }
.tpbpc-seal {
	position: absolute; right: -12px; bottom: -24px;
	width: 150px; height: 150px; border-radius: 50%;
	background: var(--wp--preset--color--gold); border: 6px solid var(--wp--preset--color--cream);
	color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
	text-align: center; font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 1.05rem; line-height: 1.15;
	margin: 0 !important;
}

.tpbpc-stat-number { font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 2rem; line-height: 1.1; margin: 0 !important; }
.tpbpc-stat-label { margin-top: 0.25rem !important; font-size: 0.9375rem; }

.tpbpc-card { border: 1px solid var(--wp--preset--color--line); border-radius: 20px; }
.tpbpc-breed img { border-radius: 16px; width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 320px; object-fit: cover; object-position: center 40%; display: block; }
.tpbpc-breed a { text-decoration: none; color: inherit; }

.tpbpc-ticks { list-style: none; padding-left: 0; }
.tpbpc-ticks li { padding-left: 2rem; position: relative; margin-bottom: 0.9rem; }
.tpbpc-ticks li::before {
	content: ""; position: absolute; left: 0; top: 0.3rem; width: 1.1rem; height: 1.1rem; border-radius: 50%;
	background: var(--wp--preset--color--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
}

.site-header { border-bottom: 1px solid var(--wp--preset--color--line); }
@media (min-width: 1100px) {
	.site-header > .wp-block-group { flex-wrap: nowrap; }
	.site-header .wp-block-navigation { flex: 1 1 auto; }
	.site-header .wp-block-navigation__container { gap: 1.1rem; flex-wrap: nowrap; }
	.site-header .wp-block-buttons { flex-wrap: nowrap; flex-shrink: 0; }
	.site-header .wp-block-site-title { white-space: nowrap; }
	.site-header .wp-block-navigation-item__content { white-space: nowrap; }
}
.site-header .wp-block-button__link { padding: 0.6rem 1.1rem; font-size: 0.9375rem; }
.site-header .wp-block-image { flex-shrink: 0; }
.site-header .wp-block-image img { max-width: none; }
.site-footer a { color: inherit; }

/* Older plugin output (catalogue, portal) sits inside the content width. */
.wp-site-blocks .entry-content > table, .wp-block-post-content > table { width: 100%; }

@media (max-width: 781px) {
	.tpbpc-seal { width: 120px; height: 120px; font-size: 0.9rem; right: 8px; }
	.tpbpc-hero-media img { height: 300px; }
}

/* ---------- Breed catalogue grids (eCommerce Product Catalog plugin) ----------
   Photos are square, so tiles are square and the whole bird shows.
   4 per row on desktop, 3 on tablet, 2 on phone. Name sits on a strip at the bottom. */
.product-list.default,
.product-subcategories.default {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	padding: 0.5rem 0 1.5rem !important;
}
@media (min-width: 700px) {
	.product-list.default,
	.product-subcategories.default { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
}
@media (min-width: 1000px) {
	.product-list.default,
	.product-subcategories.default { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
}
.product-list.default::before, .product-list.default::after,
.product-subcategories.default::before, .product-subcategories.default::after { display: none !important; content: none !important; }
.product-list.default > :not(.modern-grid-element),
.product-subcategories.default > :not(.modern-grid-element) { grid-column: 1 / -1; }

.product-list .modern-grid-element,
.product-subcategories .modern-grid-element {
	float: none !important;
	width: auto !important;
	height: auto !important;
	max-width: none !important;
	margin: 0 !important;
	aspect-ratio: 1 / 1;
	position: relative;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 14px;
	background: var(--wp--preset--color--sand) !important;
	box-shadow: none !important;
}
.modern-grid-element .pseudo { display: none !important; }
.modern-grid-element .pseudo-a { position: absolute; inset: 0; z-index: 3; }
.modern-grid-element img.modern-grid-image {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	object-fit: cover;
	object-position: center;
	transition: transform 0.35s ease;
}
.modern-grid-element:hover img.modern-grid-image { transform: scale(1.04); }
.modern-grid-element h3.product-name {
	position: absolute !important;
	left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
	z-index: 2;
	margin: 0 !important;
	padding: 2.2rem 0.85rem 0.7rem !important;
	background: linear-gradient(to bottom, rgba(46, 31, 21, 0), rgba(46, 31, 21, 0.85)) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1rem !important;
	line-height: 1.25;
	text-align: left;
	width: auto !important;
	max-width: none !important;
}
/* The category picture is for the tile on /products/ only, not a banner on the category page. */
.ic-catalog-container > .taxonomy-image { display: none !important; }

/* Simple data tables (egg producers page) */
.tpbpc-table table { border-collapse: collapse; width: 100%; background: var(--wp--preset--color--paper); border-radius: 14px; overflow: hidden; font-size: 0.975rem; }
.tpbpc-table th, .tpbpc-table td { padding: 0.7rem 1rem; border: 0; border-bottom: 1px solid var(--wp--preset--color--line); text-align: left; }
.tpbpc-table thead th { background: var(--wp--preset--color--green); color: #fff; font-weight: 600; border-bottom: 0; }
.tpbpc-table tbody tr:last-child td { border-bottom: 0; }
.tpbpc-table td:nth-child(2) { font-variant-numeric: tabular-nums; }
