/**
 * TMR design foundation. Intrinsic layouts allow variable-length content to
 * determine its own height; media queries are reserved for real layout shifts.
 */

:root {
	--tmr-shadow-card: 0 0.25rem 1rem rgb(13 27 42 / 10%);
	--tmr-shadow-raised: 0 0.5rem 1.5rem rgb(13 27 42 / 16%);
	--tmr-gold-hover: #b48d16;
	--tmr-gutter: clamp(1rem, 3vw, 2rem);
	--tmr-section-space: clamp(2rem, 5vw, 4.5rem);
	--tmr-readable: 72ch;
}

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

html {
	scroll-behavior: smooth;
}

body {
	overflow-wrap: break-word;
}

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

:where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

.wp-site-blocks {
	min-height: 100vh;
}

.tmr-site-header {
	position: relative;
	z-index: 20;
	box-shadow: 0 1px 0 rgb(255 255 255 / 12%);
}

.tmr-header-bar {
	display: grid !important;
	grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 18rem) auto;
	align-items: center;
	gap: clamp(0.75rem, 2vw, 1.5rem);
}

.tmr-site-header :where(a, .wp-block-navigation-item__content) {
	color: var(--wp--preset--color--white);
}

.tmr-site-header :where(a, .wp-block-navigation-item__content):hover {
	color: var(--wp--preset--color--gold);
}

.tmr-site-brand {
	flex: 0 1 auto;
	min-width: 0;
}

.tmr-site-brand .wp-block-site-logo img {
	display: block;
	width: 3.75rem;
	height: 3.75rem;
	object-fit: contain;
}

.tmr-site-brand .wp-block-site-title {
	margin: 0;
	white-space: nowrap;
}

.tmr-primary-navigation {
	justify-self: end;
}

.tmr-primary-navigation .wp-block-navigation__container {
	column-gap: clamp(0.75rem, 1.4vw, 1.25rem);
}

.tmr-header-search {
	width: 100%;
	min-width: 0;
}

.tmr-header-search :where(.wp-block-fibosearch-search, .dgwt-wcas-search-wrapp) {
	width: 100% !important;
	max-width: none !important;
	min-width: 0;
}

.tmr-header-search .dgwt-wcas-search-input {
	min-height: 2.75rem !important;
}

.tmr-header-search .dgwt-wcas-search-submit {
	width: 3rem !important;
	min-width: 3rem !important;
}

.tmr-site-footer :where(h2, h3, p, a, .wp-block-navigation-item__content) {
	color: var(--wp--preset--color--white);
}

.tmr-site-footer :where(a, .wp-block-navigation-item__content):hover {
	color: var(--wp--preset--color--gold);
}

.tmr-site-footer .wp-block-navigation {
	align-items: flex-start;
}

.tmr-section {
	padding-block: var(--tmr-section-space);
}

.tmr-section-heading {
	margin-block-start: 0;
	padding-block-end: 0.65rem;
	border-bottom: 1px solid var(--wp--preset--color--bordergrey);
}

.tmr-card-grid,
.tmr-category-grid,
.tmr-news-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
	align-items: stretch;
}

.tmr-home-hero {
	display: grid;
	align-content: center;
	min-height: clamp(24rem, 58vw, 38rem);
	padding: clamp(2rem, 7vw, 6rem) var(--tmr-gutter);
	background-color: var(--wp--preset--color--navy);
	background-position: center;
	background-size: cover;
	color: var(--wp--preset--color--white);
}

.tmr-home-hero > * {
	width: min(100%, var(--wp--style--global--content-size));
	margin-inline: auto;
}

.tmr-home-hero :where(h1, h2, p) {
	color: inherit;
}

.tmr-home-hero :where(h1, h2) {
	max-width: 20ch;
	text-wrap: balance;
}

.tmr-category-card,
.tmr-news-card {
	position: relative;
	overflow: hidden;
	min-width: 0;
	border: 1px solid var(--wp--preset--color--bordergrey);
	border-radius: 6px;
	background: var(--wp--preset--color--white);
	box-shadow: var(--tmr-shadow-card);
}

.tmr-category-card img,
.tmr-news-card img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.tmr-category-card__title,
.tmr-news-card__title {
	margin: 0;
	padding: 0.75rem 1rem;
	font-size: clamp(1rem, 0.95rem + 0.3vw, 1.25rem);
}

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

@media (max-width: 72rem) {
	.tmr-header-bar {
		grid-template-columns: auto auto minmax(12rem, 1fr) auto;
	}

	.tmr-primary-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none !important;
	}

	.tmr-primary-navigation .wp-block-navigation__responsive-container-open {
		display: flex !important;
	}

	.tmr-site-brand .wp-block-site-title {
		display: none;
	}
}

@media (max-width: 40rem) {
	.tmr-header-bar {
		grid-template-columns: auto 1fr auto;
	}

	.tmr-site-brand {
		grid-column: 1;
		grid-row: 1;
	}

	.tmr-primary-navigation {
		grid-column: 2;
		grid-row: 1;
	}

	.tmr-header-search {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.tmr-header-bar > .wp-block-woocommerce-mini-cart {
		grid-column: 3;
		grid-row: 1;
	}
}
