/*
Theme Name: Sportsman's Research
Theme URI: https://sportsmansresearch.com/
Author: Sportsman's Research
Author URI: https://sportsmansresearch.com/
Description: Theme for sportsmansresearch.com. Forked from Bark by Automattic (GPLv2+).
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
Version: 0.7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sportsmans-research
Tags: one-column, three-columns, wide-blocks, block-patterns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, style-variations, template-editing
*/

/* Progresive enhancement to reduce widows and orphans. */
h1,
h2,
h3,
h4,
h5,
h6,
blockquote {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

/* Tiny tweak to make sure footers are properly spaced. */
footer {
	margin-top: 0 !important;
}

/* Provide better default color for social links */
.wp-block-social-links.is-style-logos-only li.wp-social-link {
	color: currentcolor;
}

.wp-block-social-links.is-style-logos-only .wp-social-link svg {
	height: 1em;
	width: 1em;
}

.wp-block-social-links.has-small-icon-size {
	font-size: 20px;
}

/* Set default line height for font size presets. */
.has-xx-large-font-size {
	line-height: 1;
}

/* Add space between the header and first element, if its a paragraph. */
.entry-content > p:first-child {
	margin-top: var(--wp--style--root--padding-left);
}

/* Move header core/navigation to the right on mobile. */
.order-0 {
	order: 0;
}

.order-1 {
	order: 1;
}

.grow-0 {
	flex-grow: 0;
}

.grow {
	flex-grow: 1;
}

@media (min-width: 600px) {

	.md\:order-0 {
		order: 0;
	}

	.md\:order-1 {
		order: 1;
	}

	.md\:grow-0 {
		flex-grow: 0;
	}

	.md\:grow {
		flex-grow: 1;
	}

}

.overflow-hidden {
	overflow: hidden;
}

/* Style Jetpack forms */
.wp-block-jetpack-contact-form-container {
	--jetpack--contact-form--input-padding-left: 16px !important;
}

.wp-block-jetpack-contact-form input,
.wp-block-jetpack-contact-form textarea {
	backdrop-filter: saturate(1.1);
	background-color: transparent;
	border-color: var(--wp--custom--input--border--color);
	border-radius: var(--wp--custom--input--border--radius) !important; /* Requires !important to override local variables with theme variables. */
	border-width: var(--wp--custom--input--border--width) !important;  /* Requires !important to override local variables with theme variables. */
	filter: brightness(0.975);
	font-size: inherit;
	color: inherit;
	transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.jetpack-contact-form .jetpack-field .jetpack-field__input,
.jetpack-contact-form .jetpack-field .jetpack-field__textarea {
	border-color: var(--wp--custom--input--border--color);
}

.wp-block-jetpack-contact-form input:not(:placeholder-shown),
.wp-block-jetpack-contact-form textarea:not(:placeholder-shown),
.wp-block-jetpack-contact-form input:focus,
.wp-block-jetpack-contact-form textarea:focus {
	filter: brightness(1);
	backdrop-filter: saturate(1);
}

.wp-block-jetpack-contact-form input:focus,
.wp-block-jetpack-contact-form textarea:focus {
	border-color: var(--wp--custom--input--focus--border--color);
}

.contact-form .is-style-animated .grunion-field-wrap:not(.no-label) select,
.contact-form .is-style-animated .grunion-field-wrap:not(.no-label) > input,
.contact-form .is-style-animated .grunion-field-wrap:not(.no-label) > textarea {
	padding-top: var(--field-padding); /* Remove unnecessary padding adjustment from Jetpack. */
}

.contact-form .is-style-animated .grunion-field-wrap .animated-label__label {
	font-size: inherit;
	width: auto;
	padding: 0 4px;
	transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), top 0.15s cubic-bezier(0.4, 0, 0.2, 1), font-size 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-form .is-style-animated .grunion-field-wrap.grunion-field-select-wrap .animated-label__label,
.contact-form .is-style-animated .grunion-field-wrap .grunion-field.has-placeholder ~ .animated-label__label,
.contact-form .is-style-animated .grunion-field-wrap .grunion-field:focus ~ .animated-label__label,
.contact-form .is-style-animated .grunion-field-wrap .grunion-field:not(:placeholder-shown) ~ .animated-label__label {
	background-color: var(--wp--custom--input--color--background) !important;
	transform: translateY(-11px) translateX(-4px); /* Moves the label out of the field. */
}

.contact-form label,
.wp-block-jetpack-contact-form label,
.jetpack-field-label .rich-text.jetpack-field-label__input {
	font-weight: 500;
}

.contact-form__input-error {
	font-size: var(--wp--preset--font-size--small);
}

.error404 .wp-block-template-part {
	margin-top: 0 !important;
}
/* Step cards (Seed / Grow / Flourish / Harvest): same-height cards, buttons on one line. */
.sr-steps > .wp-block-column {
	display: flex;
	flex-direction: column;
}

.sr-steps > .wp-block-column > .wp-block-buttons {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
}

/* Two-card rows (two products since 2026-10-30, D21): cards at a sensible size, centred, rather
   than stretched across the wide width. */
.wp-block-columns.sr-pair {
	max-width: 820px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Products page: a quieter title area lined up with the left edge of the product cards (Chris).
   Black, "Products" a size down, the heading under it smaller still and on one line. */
.sr-page-products .wp-block-post-title,
.sr-products-intro {
	max-width: 820px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	color: var(--wp--preset--color--ink) !important;    /* the page template colours headings green */
}

.sr-page-products .wp-block-post-title {
	font-size: var(--wp--preset--font-size--x-large) !important;
}

.sr-products-intro {
	font-size: var(--wp--preset--font-size--large) !important;
	line-height: 1.2;
}

/* Outlined cards (True Believers): photos fill the card. Like the old site, the name isn't
   underlined and the button reads "Watch Video" (not upper case). */
.sr-card .wp-block-image img {
	width: 100%;
}
.sr-card h2 a {
	color: inherit;
	text-decoration: none;
}
.sr-card .wp-block-button__link {
	text-transform: none;
	white-space: nowrap;
	padding-inline: 1.25em;
}

/* The logo is black on transparent; on dark backgrounds (the header) show it white. */
.sr-logo-on-dark img {
	filter: brightness(0) invert(1);
}

.wp-block-image.size-full.is-resized a {
	display: inline-block;
}

/* Dropdown items in normal case, like the old site's menu (top level stays uppercase). */
.wp-block-navigation .wp-block-navigation__submenu-container {
	text-transform: none;
	letter-spacing: 0;
	min-width: 200px;
}

/* The header logo never gets squeezed by the menu and buttons. */
header .wp-block-image {
	flex-shrink: 0;
}

/* Small screens: keep the header buttons on one line, logo a little smaller. */
@media (max-width: 600px) {
	header .wp-block-image img {
		width: 110px !important;
	}

	/* No room for logo + search + "Where to buy" + menu on a phone; search shows from 601px up. */
	header .wp-block-search {
		display: none;
	}

	header .wp-block-button__link {
		padding: 10px 14px;
		font-size: 13px;
		white-space: nowrap;
	}
}

/* Footer, after the old site's: uppercase link lists at 75% white, a faint rule above the copyright. */
.sr-footer-links {
	list-style: none;
	padding-left: 0;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 15px;
}

.sr-footer-links li {
	margin: 0.7em 0;
}

.sr-footer-links a {
	text-decoration: none;
	opacity: 0.8;
}

.sr-footer-links a:hover,
.sr-footer-links a:focus {
	text-decoration: underline;
	opacity: 1;
}

.wp-block-separator.sr-footer-rule {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	opacity: 1;
	margin-top: var(--wp--preset--spacing--40);
	width: 100%;
	max-width: none;
}

/* Announcement bar, like the old site's: small, bold, centered; links get an arrow. */
.sr-announcements p {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* Rotating messages (assets/js/announcements.js): the old one fades out fully, then the new
   one fades in, so text never overlaps (an overlapping cross-fade reads as blur). */
.sr-announcements.sr-rotating {
	display: grid;
	align-items: center;    /* the bar is as tall as the longest message; centre shorter ones */
}

.sr-announcements.sr-rotating > p {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.6s ease-in-out, visibility 0s linear 0.6s;
}

.sr-announcements.sr-rotating > p.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.6s ease-in-out 0.6s, visibility 0s linear 0.6s;
}

@media (prefers-reduced-motion: reduce) {
	.sr-carousel.sr-carousel--ready > .wp-block-cover,
	.sr-announcements.sr-rotating > p {
		transition: none;
	}
}

.sr-announcements a::after {
	content: " \2192";
}

/* Header search: a plain magnifier like the old site, not a filled button. */
header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 0;
	padding: 8px;
}

header .wp-block-search__button svg {
	fill: currentColor;
	width: 26px;
	height: 26px;
}

/* Search box on the results page (button inside a rounded field): text clear of the rounded
   edge, at body size. */
.wp-block-search__button-inside .wp-block-search__input {
	padding-left: 1.5em;
	font-size: 20px;
}

/* Header search, opened: covers the whole header bar like the old site's (a full-width field with
   the magnifier inside, and a close ×), instead of squeezing the menu onto two lines. Core's
   search block toggles .wp-block-search__searchfield-hidden. Closing: Esc, clicking outside the
   field, or the ×, which is part of the block, so clicking it takes focus off the field and
   core's focus-out closes the search. */
.sr-header header.wp-block-group {
	position: relative;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden) {
	position: absolute;
	inset: -21px 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 20px;
	background: var(--wp--preset--color--theme-1);
	cursor: pointer;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden)::after {
	content: "\00d7";
	font-size: 44px;
	font-weight: 300;
	line-height: 1;
	padding: 0 4px;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
	position: relative;
	flex: 1;
	width: auto !important;
	height: 58px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--ink);
	cursor: auto;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
	width: 100% !important;
	height: 100%;
	padding: 0 60px 0 20px;
	border: 0;
	font-size: 20px;
	background: transparent;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper:focus-within {
	outline: 2px solid var(--wp--preset--color--theme-5);
	outline-offset: 2px;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input:focus {
	outline: none;
}

header .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__button {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	margin: 0;
}

/* Hero carousel (assets/js/carousel.js). Before the script runs, only the first slide shows. */
.sr-carousel > .wp-block-cover + .wp-block-cover {
	display: none;
}

.sr-carousel.sr-carousel--ready {
	display: grid;
}

.sr-carousel.sr-carousel--ready > .wp-block-cover {
	display: flex;
	grid-area: 1 / 1;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 1.5s ease-in-out, visibility 1.5s;
}

.sr-carousel.sr-carousel--ready > .wp-block-cover.is-active {
	opacity: 1;
	visibility: visible;
}

.sr-carousel__controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	background: var(--wp--preset--color--theme-1);
}

.sr-carousel__controls button {
	font-family: inherit;
	background: none;
	border: 0;
	color: var(--wp--preset--color--ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.sr-carousel__controls .sr-carousel__dot {
	width: 11px;
	height: 11px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--ink);
	border-radius: 50%;
}

.sr-carousel__controls .sr-carousel__dot[aria-current="true"] {
	background: var(--wp--preset--color--ink);
}

.sr-carousel__controls .sr-carousel__pause {
	font-size: 13px;
	margin-left: 14px;
	border-left: 1px solid #ddd;
	padding-left: 22px;
}

/* Contact form (Contact Form 7), like the old site's: square bordered fields, Name and Email side by side. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	word-wrap: normal !important;
}

.wpcf7 .sr-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 20px;
}

.wpcf7 .sr-field {
	display: block;
	margin-bottom: 20px;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #8a8a8a;
	border-radius: 0;
	background: var(--wp--preset--color--theme-1);
	padding: 16px 22px;
	font: inherit;
	font-size: 17px;
	color: var(--wp--preset--color--ink);
}

.wpcf7 textarea {
	height: 130px;
	resize: vertical;
}

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--theme-5);
	color: var(--wp--preset--color--theme-1);
	border: 0;
	border-radius: 0;
	padding: 16px 52px;
	font-family: var(--wp--preset--font-family--archivo);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus {
	background: var(--wp--preset--color--ink);
}

@media (max-width: 600px) {
	.wpcf7 .sr-form-row {
		grid-template-columns: 1fr;
	}
}

/* Product pages, after the old site's: brand line, uppercase title, details beside the gallery. */
.sr-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 12px !important;
	opacity: 0.75;
	margin-bottom: 4px;
}

.sr-product-title {
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--x-large) !important;
	line-height: 1.1;
	margin-top: 0;
}

.sr-product-info h2 {
	font-size: var(--wp--preset--font-size--large);
}

/* Gallery (assets/js/gallery.js): one large image, square thumbnails underneath. */
.sr-gallery-stage {
	margin: 0 0 12px;
}

.sr-gallery-stage img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	background: var(--wp--preset--color--theme-2);
	display: block;
}

/* Core galleries stretch the last row's images to fill it (8 images in 5 columns = 3 giant
   tiles). Product thumbnails stay one size on every row. */
.wp-block-gallery.sr-product-gallery > figure.wp-block-image {
	flex-grow: 0 !important;
	aspect-ratio: 1;
}

.wp-block-gallery.sr-product-gallery > figure.wp-block-image img {
	height: 100%;
	object-fit: cover;
}

/* Phones: core drops galleries to 2 per row; keep product thumbnails small, 4 per row. */
@media (max-width: 600px) {
	.wp-block-gallery.sr-product-gallery > figure.wp-block-image {
		width: calc(25% - var(--wp--style--unstable-gallery-gap, 16px) * 0.75) !important;
	}
}

.wp-block-gallery.sr-product-gallery.sr-gallery-ready > figure.wp-block-image {
	cursor: pointer;
	outline: 1px solid transparent;
	outline-offset: 2px;
}

.wp-block-gallery.sr-product-gallery.sr-gallery-ready > figure.wp-block-image.is-active,
.wp-block-gallery.sr-product-gallery.sr-gallery-ready > figure.wp-block-image:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
}

/* How it works: four bordered labels, like the old site's. */
.sr-benefits > .wp-block-column {
	border: 3px solid var(--wp--preset--color--theme-5);
	padding: 6px 10px;
}

.sr-benefits p {
	margin: 0;
	font-weight: 600;
	font-size: 16px;
	letter-spacing: 0.04em;
}

/* Step-card product names: small enough to stay on one line at desktop widths. */
.sr-steps p.has-small-font-size a {
	font-size: 14px;
}

/* Product names on cards (program strip, "You may also like"): like the product page's title,
   uppercase and bold, no underline until hovered. */
.sr-card-title {
	margin-top: var(--wp--preset--spacing--20);
	margin-bottom: 0;
	font-size: 20px !important;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.sr-card-title a {
	color: inherit;
	text-decoration: none;
}

.sr-card-title a:hover,
.sr-card-title a:focus {
	text-decoration: underline;
}

/* Header menu like the old site's: ~30px between items, soft ink that darkens on hover. */
header .wp-block-navigation .wp-block-navigation__container {
	gap: 30px;
}

header .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	color: rgba(34, 34, 34, 0.75);
}

header .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
header .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:focus {
	color: var(--wp--preset--color--ink);
}

/* Header bar height = 21px + row + 21px (prod's ~102px); no default block gap between them. */
.sr-header > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Full-width covers with left-aligned text (About hero): the text sits in the same box as the
   header (wide width + the page's side padding), so the heading starts under the logo at every
   width, like the old site, instead of hugging the window edge. */
.wp-block-cover.alignfull.is-position-center-left {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.wp-block-cover.alignfull.is-position-center-left .wp-block-cover__inner-container {
	width: 100% !important; /* core sizes a positioned cover's text box to its content */
	box-sizing: border-box;
	max-width: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right)) !important;
	padding-left: var(--wp--style--root--padding-left) !important;
	padding-right: var(--wp--style--root--padding-right) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.wp-block-cover.alignfull.is-position-center-left .wp-block-cover__inner-container > * {
	margin-left: 0 !important;
	max-width: 760px;
}

/* Buttons on photos (hero carousel), like prod's: bold, 19px, 62px tall. */
.wp-block-cover .wp-block-button__link {
	font-weight: 700;
	font-size: 19px;
	padding: 20px 20px;
	min-width: 150px;
}

/* Text links on photos (e.g. "AnabolicGRO™" in the yield band): the theme's green link colour
   disappears on the dark overlay, so they take the text colour, underlined. */
.wp-block-cover p a:not(.wp-element-button) {
	color: inherit;
	text-decoration: underline;
}

/* Header "Where to buy" (no prod equivalent): compact, so the bar stays ~102px. */
header .wp-block-button__link {
	font-size: 15px;
	font-weight: 600;
	padding: 14px 22px;
}
