/*
 * Base styles. Colours, fonts and radii come from theme.json (CSS custom properties),
 * so there is one source of truth for design tokens. No external requests.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
}

img,
video {
	max-width: 100%;
	height: auto;
}

a {
	text-underline-offset: 0.15em;
}

/* Accessibility ------------------------------------------------------------ */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.screen-reader-text:focus,
.skip-link:focus {
	/* In flow rather than floating: a floating skip link would overlap the first link in every header. */
	position: static;
	background: var(--wp--preset--color--surface);
	clip: auto;
	clip-path: none;
	color: var(--wp--preset--color--ink);
	display: block;
	height: auto;
	left: var(--wp--custom--space--xs);
	margin: 0;
	padding: var(--wp--custom--space--xs) var(--wp--custom--space--sm);
	top: var(--wp--custom--space--xs);
	width: auto;
	z-index: 100000;
}

:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* Layout ------------------------------------------------------------------- */

.site-width {
	margin-inline: auto;
	max-width: var(--wp--style--global--wide-size, 1200px);
	padding-inline: var(--wp--custom--space--sm);
}

.site-width--narrow {
	max-width: calc(var(--wp--style--global--content-size, 720px) + 2 * var(--wp--custom--space--sm));
}

.site-main {
	padding-block: var(--wp--custom--space--lg);
}

/* Header and footer -------------------------------------------------------- */

.site-header {
	background: var(--wp--preset--color--surface);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.site-header__inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--space--sm) var(--wp--custom--space--md);
	justify-content: space-between;
	padding-block: var(--wp--custom--space--sm);
}

.site-branding {
	align-items: center;
	display: flex;
	gap: var(--wp--custom--space--xs);
}

.site-title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	margin: 0;
}

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

.menu {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--space--xs) var(--wp--custom--space--md);
	list-style: none;
	margin: 0;
	padding: 0;
}

.menu a {
	color: inherit;
	text-decoration: none;
}

.menu a:hover {
	text-decoration: underline;
}

.menu .sub-menu {
	list-style: none;
	padding-inline-start: var(--wp--custom--space--sm);
}

.site-footer {
	background: var(--wp--preset--color--surface);
	border-top: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--space--xs);
	padding-block: var(--wp--custom--space--md);
}

.site-footer__copy {
	margin: 0;
}

/* Content ------------------------------------------------------------------ */

.page-title,
.entry__title {
	font-family: var(--wp--preset--font-family--system-serif);
	line-height: 1.2;
	margin-block: 0 var(--wp--custom--space--xs);
}

.page-title {
	font-size: var(--wp--preset--font-size--xl);
	margin-bottom: var(--wp--custom--space--md);
}

.entry--single .entry__title,
.entry--page .entry__title {
	font-size: var(--wp--preset--font-size--xl);
}

.entry--excerpt .entry__title {
	font-size: var(--wp--preset--font-size--large);
}

.entry--excerpt .entry__title a {
	color: inherit;
	text-decoration: none;
}

.entry--excerpt .entry__title a:hover {
	text-decoration: underline;
}

.entry__meta {
	color: var(--wp--preset--color--muted);
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wp--preset--font-size--small);
	gap: var(--wp--custom--space--xs) var(--wp--custom--space--sm);
	margin: 0 0 var(--wp--custom--space--sm);
}

.entry-list {
	display: grid;
	gap: var(--wp--custom--space--md);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.entry--excerpt {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	overflow: hidden;
	padding: var(--wp--custom--space--sm);
}

.entry__thumb {
	display: block;
	margin: calc(-1 * var(--wp--custom--space--sm)) calc(-1 * var(--wp--custom--space--sm)) var(--wp--custom--space--sm);
}

.entry__thumb img {
	aspect-ratio: 16 / 9;
	display: block;
	object-fit: cover;
	width: 100%;
}

.entry__content > :first-child {
	margin-top: 0;
}

/* Pagination, comments, forms ---------------------------------------------- */

.pagination,
.post-navigation,
.comments-area {
	margin-top: var(--wp--custom--space--lg);
}

.pagination .nav-links,
.post-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--space--xs) var(--wp--custom--space--sm);
	justify-content: space-between;
}

.pagination .page-numbers {
	padding: var(--wp--custom--space--xs);
}

.comment-list {
	list-style: none;
	padding: 0;
}

.comment-list .children {
	list-style: none;
}

input[type="search"],
input[type="text"],
input[type="email"],
input[type="url"],
textarea {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: var(--wp--custom--radius--sm);
	color: inherit;
	font: inherit;
	max-width: 100%;
	padding: 0.5rem 0.75rem;
}

input[type="submit"],
button[type="submit"] {
	background: var(--wp--preset--color--accent);
	border: 0;
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--preset--color--on-accent);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 1rem;
}

/* Shared components used by every template and by product archives ------------ */

.tgk-ph {
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, var(--wp--preset--color--line), var(--wp--preset--color--surface));
	display: block;
	width: 100%;
}

.tgk-badge {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	color: var(--wp--preset--color--muted);
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 400;
	padding: 0 0.5rem;
	vertical-align: middle;
}

.tgk-rating {
	font-weight: 600;
	margin: 0.25rem 0;
}

.tgk-notice {
	background: var(--wp--preset--color--surface);
	border-left: 4px solid var(--wp--preset--color--accent);
	margin-block: var(--wp--custom--space--md);
	padding: var(--wp--custom--space--sm);
}

.tgk-button {
	background: var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--preset--color--on-accent);
	display: inline-block;
	font-weight: 600;
	padding: 0.6rem 1rem;
	text-decoration: none;
}

.tgk-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	overflow: hidden;
}

.tgk-card__media {
	display: block;
}

.tgk-card__body {
	padding: var(--wp--custom--space--sm);
}

.tgk-card__kicker {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
}

.tgk-card__title {
	font-size: 1.15rem;
	margin: 0.25rem 0 0.5rem;
}

.tgk-specs {
	font-size: var(--wp--preset--font-size--small);
	margin: 0.5rem 0;
}

.tgk-specs div,
.tgk-products .tgk-specs div {
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
}

.tgk-specs dt {
	color: var(--wp--preset--color--muted);
}

.tgk-specs dd {
	margin: 0;
}

/* Product archive ------------------------------------------------------------- */

.tgk-products__layout {
	display: grid;
	gap: var(--wp--custom--space--md);
	grid-template-columns: 1fr;
}

.tgk-products__filters ul {
	list-style: none;
	margin: 0 0 var(--wp--custom--space--sm);
	padding: 0;
}

.tgk-products__filters li a {
	display: block;
	padding: 0.35rem 0;
}

.tgk-products__h {
	font-size: 1rem;
	margin: var(--wp--custom--space--sm) 0 0.25rem;
}

.tgk-products__count {
	color: var(--wp--preset--color--muted);
}

.tgk-products__sort {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-top: 0;
}

.tgk-products__sort a[aria-current] {
	font-weight: 700;
	text-decoration: none;
}

.tgk-products__grid {
	display: grid;
	gap: var(--wp--custom--space--md);
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (min-width: 800px) {
	.tgk-products__layout {
		grid-template-columns: 220px 1fr;
	}
}

.tgk-products__layout > * {
	min-width: 0;
}
