/*
 Theme Name:   Training Puppies Hello Child
 Theme URI:    https://training-puppies.com/
 Description:  Child theme of Hello Elementor for training-puppies.com. Owns the global shell: skip link, sticky header, primary navigation with mobile menu, main landmark and footer, plus shell-level CSS.
 Author:       Training Puppies
 Template:     hello-elementor
 Version:      0.4.4
 Requires at least: 6.0
 Requires PHP: 7.4
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  tp-hello-child
*/

/* ------------------------------------------------------------------
   Tokens (approved design system). Every selector below is namespaced
   "tp-" or scoped to the shell, so plugin and WooCommerce UI is not
   restyled. Breakpoints: desktop >= 1024, tablet 768-1023, mobile <= 767.
------------------------------------------------------------------- */
body.tp-shell {
	--tp-primary: #1F6F5C;
	--tp-primary-dark: #15503F;
	--tp-tint: #E7F2EE;
	--tp-text: #23201D;
	--tp-border: #E3DCD1;
	--tp-cream: #FAF6F0;
	--tp-footer-bg: #2C2824;
	--tp-footer-text: #E8E4DE;
	--tp-footer-muted: #B8B0A6;
	--tp-footer-link: #7DCCC0;
	--tp-radius: 8px;
	--tp-header-h: 64px;
	--tp-gutter: 48px;
	--tp-section-space: 64px;
	--tp-admin: var(--wp-admin--admin-bar--height, 0px);
	--tp-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
	--tp-serif: Georgia, "Times New Roman", serif;
}

@media (max-width: 1023px) {
	body.tp-shell {
		--tp-gutter: 24px;
		--tp-section-space: 48px;
	}
}

@media (max-width: 767px) {
	body.tp-shell {
		--tp-header-h: 56px;
		--tp-gutter: 16px;
		--tp-section-space: 40px;
	}
}

/* Page background (the kit's body rule has equal weight; this one is more specific). */
html body.tp-shell {
	background-color: var(--tp-cream);
}

/* Anchor offset below the sticky header: 80px (72px on mobile). */
html {
	scroll-padding-top: calc(80px + var(--wp-admin--admin-bar--height, 0px));
}

@media (max-width: 767px) {
	html {
		scroll-padding-top: calc(72px + var(--wp-admin--admin-bar--height, 0px));
	}
}

/* Heading tracking (approved), scoped to the main landmark. */
#main h1 {
	letter-spacing: -0.02em;
}

#main h2 {
	letter-spacing: -0.015em;
}

/* ------------------------------------------------------------------
   Main landmark and focus ring
------------------------------------------------------------------- */
.tp-main {
	display: block;
}

#main:focus {
	outline: 0; /* programmatic focus target after the skip link; not an interactive control */
}

.tp-site-header :focus-visible,
#main :focus-visible,
.tp-skip-link:focus-visible {
	outline: 3px solid var(--tp-primary);
	outline-offset: 2px;
}

.tp-site-footer :focus-visible {
	outline: 3px solid var(--tp-footer-link);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------
   Skip link
------------------------------------------------------------------- */
.tp-skip-link {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.tp-skip-link:focus {
	z-index: 100001;
	top: calc(8px + var(--tp-admin, 0px));
	left: 16px;
	display: inline-flex;
	align-items: center;
	width: auto;
	height: auto;
	min-height: 44px;
	margin: 0;
	padding: 0 24px;
	overflow: visible;
	clip: auto;
	background: var(--tp-primary);
	border-radius: var(--tp-radius);
	color: #FFFFFF;
	font: 600 16px/1 var(--tp-sans);
	text-decoration: none;
	outline: 3px solid var(--tp-primary-dark);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------
   Header (sticky, direct child of body)
------------------------------------------------------------------- */
.tp-site-header {
	position: sticky;
	top: var(--tp-admin, 0px);
	z-index: 50;
	background: #FFFFFF;
	border-bottom: 1px solid var(--tp-border);
	font-family: var(--tp-sans);
}

.tp-site-header .tp-header-inner {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: 1216px;
	height: var(--tp-header-h);
	margin: 0 auto;
	padding: 0 var(--tp-gutter);
}

.tp-site-header .tp-brand,
.tp-site-footer .tp-brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	color: var(--tp-text);
	text-decoration: none;
}

.tp-site-header .tp-brand:hover,
.tp-site-header .tp-brand:focus {
	color: var(--tp-text);
	text-decoration: none;
}

.tp-site-header .tp-brand-name,
.tp-site-footer .tp-brand-name {
	font-family: var(--tp-serif);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
}

.tp-site-header .tp-brand-mark {
	flex: none;
}

/* Buttons: neutralise the kit's/theme's global button styling inside the shell (all states). */
.tp-site-header .tp-btn,
.tp-site-header .tp-btn:hover,
.tp-site-header .tp-btn:focus,
.tp-site-header .tp-btn:active {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 12px;
	background: transparent;
	border: 0;
	border-radius: var(--tp-radius);
	box-shadow: none;
	color: var(--tp-text);
	font: 500 16px/1 var(--tp-sans);
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
}

.tp-site-header .tp-nav-button[aria-expanded="true"] {
	color: var(--tp-primary);
}

.tp-site-header .tp-chevron {
	flex: none;
}

.tp-site-header .tp-nav-button[aria-expanded="true"] .tp-chevron {
	transform: rotate(180deg);
}

.tp-site-header .tp-menu-toggle,
.tp-site-header .tp-menu-toggle:hover,
.tp-site-header .tp-menu-toggle:focus,
.tp-site-header .tp-menu-toggle:active {
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	background: #FFFFFF;
	border: 1px solid var(--tp-border);
}

.tp-site-header .tp-menu-toggle .tp-icon-close,
.tp-site-header .tp-menu-toggle[aria-expanded="true"] .tp-icon-open {
	display: none;
}

.tp-site-header .tp-menu-toggle[aria-expanded="true"] .tp-icon-close {
	display: block;
}

/* Navigation list */
.tp-site-header .tp-nav-list {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-site-header .tp-nav-item {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Links: explicit states so the kit's link colors cannot win. */
.tp-site-header .tp-link,
.tp-site-header .tp-link:visited {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--tp-radius);
	background: transparent;
	color: var(--tp-text);
	font: 500 16px/1.3 var(--tp-sans);
	text-decoration: none;
}

.tp-site-header .tp-link:hover,
.tp-site-header .tp-link:focus,
.tp-site-header .tp-nav-button:hover,
.tp-site-header .tp-nav-button:focus {
	color: var(--tp-primary-dark);
	text-decoration: underline;
}

.tp-site-header .tp-link[aria-current="page"],
.tp-site-header .tp-link[aria-current="page"]:hover,
.tp-site-header .tp-link[aria-current="page"]:focus {
	background: var(--tp-tint);
	color: var(--tp-primary-dark);
}

/* Dropdown panels (desktop) */
.tp-site-header .tp-sub {
	position: absolute;
	top: 52px;
	left: 0;
	z-index: 5;
	box-sizing: border-box;
	width: max-content;
	min-width: 220px;
	max-width: 320px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: #FFFFFF;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
}

.tp-site-header .tp-nav-item:last-child .tp-sub {
	right: 0;
	left: auto;
}

.tp-site-header .tp-sub[hidden] {
	display: none;
}

.tp-site-header .tp-sub li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-site-header .tp-scrim {
	display: none;
}

/* Without the script the navigation stays visible and fully expanded. */
html:not(.tp-js) .tp-site-header .tp-header-inner {
	flex-wrap: wrap;
	height: auto;
	padding-top: 4px;
	padding-bottom: 4px;
}

html:not(.tp-js) .tp-site-header .tp-sub {
	position: static;
	width: auto;
	border: 0;
}

/* ------------------------------------------------------------------
   Compact header: tablet and mobile (<= 1023px)
------------------------------------------------------------------- */
@media (max-width: 1023px) {
	.tp-site-header .tp-brand {
		gap: 10px;
	}

	.tp-site-header .tp-brand-name {
		font-size: 20px;
	}

	.tp-site-header .tp-brand-mark {
		width: 36px;
		height: 36px;
	}

	.tp-js .tp-site-header .tp-menu-toggle,
	.tp-js .tp-site-header .tp-menu-toggle:hover,
	.tp-js .tp-site-header .tp-menu-toggle:focus,
	.tp-js .tp-site-header .tp-menu-toggle:active {
		display: inline-flex;
	}

	.tp-js .tp-site-header .tp-primary-nav {
		display: none;
	}

	.tp-js .tp-site-header .tp-primary-nav.tp-open {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		z-index: 2;
		display: block;
		box-sizing: border-box;
		max-height: calc(100vh - var(--tp-header-h) - var(--tp-admin, 0px));
		padding: 8px var(--tp-gutter) 16px;
		overflow-y: auto;
		background: #FFFFFF;
		border-bottom: 1px solid var(--tp-border);
	}

	.tp-site-header .tp-nav-list {
		display: block;
	}

	.tp-site-header .tp-nav-item {
		border-bottom: 1px solid var(--tp-border);
	}

	.tp-site-header .tp-nav-item:last-child {
		border-bottom: 0;
	}

	.tp-site-header .tp-primary-nav .tp-link,
	.tp-site-header .tp-primary-nav .tp-nav-button,
	.tp-site-header .tp-primary-nav .tp-nav-button:hover,
	.tp-site-header .tp-primary-nav .tp-nav-button:focus {
		justify-content: space-between;
		width: 100%;
		min-height: 48px;
		margin: 4px 0;
	}

	.tp-site-header .tp-nav-item > .tp-link {
		justify-content: flex-start;
	}

	.tp-site-header .tp-nav-item:last-child .tp-sub,
	.tp-site-header .tp-sub {
		position: static;
		width: auto;
		min-width: 0;
		max-width: none;
		margin: 0 0 8px;
		padding: 0 0 0 16px;
		background: transparent;
		border: 0;
		border-radius: 0;
	}

	.tp-site-header .tp-sub-link {
		min-height: 44px;
	}

	.tp-js .tp-site-header .tp-scrim.tp-open {
		position: fixed;
		top: calc(var(--tp-header-h) + var(--tp-admin, 0px));
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 1;
		display: block;
		background: rgba(35, 32, 29, 0.5);
	}
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.tp-site-footer {
	background: var(--tp-footer-bg);
	color: var(--tp-footer-text);
	font-family: var(--tp-sans);
}

.tp-site-footer .tp-footer-inner {
	box-sizing: border-box;
	max-width: 1216px;
	margin: 0 auto;
	padding: var(--tp-section-space) var(--tp-gutter);
}

.tp-site-footer .tp-footer-grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(var(--tp-cols, 0), 1fr);
	gap: 48px;
}

.tp-site-footer .tp-footer-brand {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tp-site-footer .tp-brand,
.tp-site-footer .tp-brand:hover,
.tp-site-footer .tp-brand:focus {
	align-self: flex-start;
	color: #FFFFFF;
	text-decoration: none;
}

.tp-site-footer .tp-footer-heading {
	margin: 0 0 12px;
	color: var(--tp-footer-muted);
	font: 700 13px/1.3 var(--tp-sans);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.tp-site-footer .tp-footer-list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-site-footer .tp-footer-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-site-footer .tp-footer-link,
.tp-site-footer .tp-footer-link:visited {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--tp-footer-link);
	font: 400 14px/1.4 var(--tp-sans);
	text-decoration: none;
}

.tp-site-footer .tp-footer-link:hover,
.tp-site-footer .tp-footer-link:focus {
	color: var(--tp-footer-link);
	text-decoration: underline;
}

.tp-site-footer .tp-footer-bottom {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid #5A534B;
	color: var(--tp-footer-muted);
	font-size: 14px;
	line-height: 1.5;
}

@media (max-width: 1023px) {
	.tp-site-footer .tp-footer-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}
