/* Equipment Resources page template (template-resources.php).
   Everything is scoped to .mve-res so it cannot touch the site header/footer. */

.mve-res {
	--red: #e33f42;
	--red-dark: #c72b2e;
	--ink: #292929;
	--muted: #70706d;
	--paper: #f5f5f2;
	--line: #e4e4df;
	--card-line: #e0ded7;
	--cta: #d93636;
	--cta-dark: #c42d2d;
	--radius: 10px;
	--radius-sm: 6px;
	--font: 'Poppins', Arial, sans-serif;
	--gutter: 96px;
	background: #fff;
	color: var(--ink);
	font: 16px/1.55 var(--font);
}

.mve-res *,
.mve-res *::before,
.mve-res *::after { box-sizing: border-box; }

.mve-res [hidden] { display: none !important; }
.mve-res a { color: inherit; text-decoration: none; }
.mve-res h1, .mve-res h2, .mve-res h3 { color: inherit; font-family: var(--font); margin: 0; }
.mve-res p { margin: 0; }
.mve-res button {
	font-family: var(--font); cursor: pointer;
	transition: none; -webkit-user-select: auto; user-select: auto;
}
.mve-res svg { flex-shrink: 0; }

.mve-res-container { width: min(1280px, calc(100% - var(--gutter))); margin-inline: auto; }

.mve-res-sr {
	position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Hero ------------------------------------------------------------ */

.mve-res-hero {
	display: grid;
	grid-template-columns: 47% 53%;
	min-height: 410px;
	position: relative;
	background: var(--ink);
	color: #fff;
	overflow: hidden;
}
.mve-res-hero__copy {
	position: relative; z-index: 1; display: flex; align-items: center;
	padding: 30px 52px 45px max(48px, calc((100vw - 1280px) / 2));
}
.mve-res-hero__copy-inner { max-width: 500px; }
.mve-res-hero h1 {
	font-size: clamp(30px, 8.5vw, 38px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -.3px;
	text-transform: uppercase;
	margin: 15px 0 23px;
}
.mve-res-hero h1 span { color: var(--red); }
.mve-res-hero p { font-size: 15px; line-height: 1.55; color: #cbcbc8; max-width: 34em; }
.mve-res-hero__photo { position: relative; min-height: 410px; }
.mve-res-hero__photo img {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; object-position: center;
}
.mve-res-hero__photo::after {
	content: ''; position: absolute; inset: 0;
	background: linear-gradient(90deg, rgba(0, 0, 0, .08), transparent 50%, rgba(0, 0, 0, .2));
}

/* ---- Library: search + layout ---------------------------------------- */

.mve-res-library { padding-top: 58px; padding-bottom: 72px; scroll-margin-top: 110px; }

.mve-res-search {
	display: flex; align-items: center; gap: 16px;
	min-height: 62px; padding: 0 20px; margin: 0 0 36px;
	background: #fff; border: 1px solid #d8d8d2; border-radius: var(--radius);
	transition: border-color .2s, box-shadow .2s;
}
.mve-res-search > svg { color: var(--red); }
.mve-res-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.mve-res-search input[type="search"],
.mve-res-search input[type="search"]:focus {
	flex: 1; width: 100%; min-width: 0; height: 58px; margin: 0; padding: 0;
	border: 0; outline: none; box-shadow: none; background: none; color: var(--ink);
	font: 15px var(--font); border-radius: 0; -webkit-appearance: none; appearance: none;
}
.mve-res-search input::placeholder { color: #8b8b87; }
.mve-res-search input::-webkit-search-cancel-button { display: none; }
.mve-res-search-count {
	font-size: 11px; color: #777; white-space: nowrap;
	border-left: 1px solid var(--line); padding-left: 22px;
}
.mve-res .mve-res-clear {
	background: var(--paper); color: var(--ink); border: 0; border-radius: var(--radius-sm);
	padding: 6px 12px; font-size: 12px; line-height: 1.4;
}
.mve-res .mve-res-clear:hover,
.mve-res .mve-res-clear:focus { background: #ebe9e2; color: var(--ink); }

.mve-res-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; }
.mve-res-catalogue { min-width: 0; }

/* ---- Category sidebar ------------------------------------------------ */

.mve-res-sidebar { align-self: start; position: sticky; top: 130px; }
body.admin-bar .mve-res-sidebar { top: 162px; }
@media (max-width: 782px) { body.admin-bar .mve-res-sidebar { top: 176px; } }
.mve-res-nav {
	display: flex; flex-direction: column; gap: 4px; padding: 12px;
	background: var(--ink); border-radius: 8px; box-shadow: 0 18px 36px -24px #00000066;
}
.mve-res .mve-res-filter {
	position: relative; display: flex; align-items: center; gap: 10px;
	width: 100%; min-height: 46px; padding: 0 16px; margin: 0;
	background: transparent; color: #d9d8d3;
	border: 1px solid transparent; border-radius: var(--radius-sm);
	font-size: 14px; font-weight: 500; line-height: 1.3; text-align: left; white-space: nowrap;
	transition: background .2s, color .2s;
}
.mve-res .mve-res-filter > span:first-of-type,
.mve-res .mve-res-filter > svg + span { overflow: hidden; text-overflow: ellipsis; }
.mve-res .mve-res-filter > svg { width: 18px; height: 18px; color: #fff; }
.mve-res .mve-res-filter[data-category="all"] { margin: 0 0 8px; font-weight: 600; color: #fff; background: #ffffff14; }
.mve-res .mve-res-filter:hover,
.mve-res .mve-res-filter:focus { background: #ffffff1a; color: #fff; }
.mve-res .mve-res-filter:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mve-res .mve-res-filter.is-active,
.mve-res .mve-res-filter.is-active:hover,
.mve-res .mve-res-filter.is-active:focus {
	background: var(--red); border-color: var(--red); color: #fff; font-weight: 600;
	padding-left: 18px; box-shadow: 0 8px 18px -10px #e33f42;
}
.mve-res-filter__count { margin-left: auto; font-size: 12px; font-weight: 500; color: #8c8b85; }
.mve-res .mve-res-filter:hover .mve-res-filter__count { color: #c9c8c2; }
.mve-res .mve-res-filter.is-active .mve-res-filter__count { color: #fff; opacity: .85; }

.mve-res-select { display: none; }

/* ---- Category sections ----------------------------------------------- */

.mve-res-section { padding-bottom: 32px; margin-bottom: 31px; border-bottom: 1px solid #ece9e2; scroll-margin-top: 110px; }
.mve-res-section__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.mve-res-section__head > div:first-child { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mve-res-section h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: 0; }
.mve-res-section__num { align-self: flex-start; padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--red); }
.mve-res-section__count { margin-left: 7px; font-size: 12px; color: #8c8c86; white-space: nowrap; }

.mve-res-controls { display: flex; gap: 6px; flex-shrink: 0; }
.mve-res .mve-res-controls button {
	display: flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; padding: 0; margin: 0;
	background: #fff; color: var(--ink); border: 1px solid #deded7; border-radius: var(--radius-sm);
}
.mve-res .mve-res-controls button:first-child svg { transform: rotate(180deg); }
.mve-res .mve-res-controls button:not(:disabled):hover,
.mve-res .mve-res-controls button:not(:disabled):focus { background: var(--ink); border-color: var(--ink); color: #fff; }
.mve-res .mve-res-controls button:disabled { opacity: .3; cursor: default; }

/* ---- Equipment row + cards ------------------------------------------- */

.mve-res-row {
	display: flex; gap: 12px; padding: 3px 2px 16px; scroll-padding-left: 2px;
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.mve-res-row::-webkit-scrollbar { display: none; }

.mve-res-card {
	flex: 0 0 300px; max-width: calc(100vw - 48px); min-width: 0;
	background: #fff; color: #1a1a1a;
	border: 1px solid var(--card-line); border-radius: var(--radius); overflow: hidden;
	scroll-snap-align: start;
}
.mve-res-card__link { height: 100%; display: flex; flex-direction: column; border-radius: var(--radius); }
.mve-res-card__link:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }
.mve-res-card__image { height: 196px; display: flex; align-items: center; justify-content: center; background: #efede7; position: relative; }
.mve-res-card__image img {
	width: 100%; height: 100%; max-width: 80%; max-height: 80%;
	object-fit: contain; mix-blend-mode: multiply; transition: transform .3s;
}
.mve-res-card:hover .mve-res-card__image img { transform: scale(1.04); }
.mve-res-card__copy { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 14px 16px 16px; }
.mve-res-card h3 { font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.mve-res-card__action {
	display: flex; align-items: center; justify-content: space-between;
	min-height: 44px; margin-top: auto; padding: 0 14px;
	background: var(--cta); color: #fff; border-radius: var(--radius-sm);
	font-size: 14px; font-weight: 600; text-transform: capitalize; transition: background .2s;
}
.mve-res-card__action svg { width: 18px; height: 18px; stroke-width: 2.2; transition: transform .2s; }
.mve-res-card:hover .mve-res-card__action { background: var(--cta-dark); }
.mve-res-card:hover .mve-res-card__action svg { transform: translateX(3px); }

/* While searching/filtering, rows become wrapped grids */
.mve-res-catalogue.is-filtered .mve-res-row {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 12px; overflow: visible;
}
.mve-res-catalogue.is-filtered .mve-res-card { max-width: none; }
.mve-res-catalogue.is-filtered .mve-res-controls { display: none; }

.mve-res-empty { padding: 65px 24px; text-align: center; background: var(--paper); border-radius: var(--radius); }
.mve-res-empty h3 { font-size: 30px; font-weight: 600; margin: 0 0 20px; }
.mve-res .mve-res-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
	padding: 12px 22px; background: var(--red); color: #fff; border: 1px solid transparent;
	border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
	transition: background .2s;
}
.mve-res .mve-res-btn:hover,
.mve-res .mve-res-btn:focus { background: var(--red-dark); color: #fff; }

/* ---- Breakpoints ----------------------------------------------------- */

@media (min-width: 640px) {
	.mve-res-hero h1 { font-size: clamp(36px, 5vw, 46px); }
	.mve-res-hero p { font-size: 16px; }
	.mve-res-section h2 { font-size: 24px; }
	.mve-res-row,
	.mve-res-catalogue.is-filtered .mve-res-row { gap: 16px; }
	.mve-res-card { flex: 0 0 calc((100% - 16px) / 2); max-width: none; }
}

@media (min-width: 1024px) {
	.mve-res-hero h1 { font-size: clamp(46px, 4vw, 56px); }
	.mve-res-hero p { font-size: 17px; }
	.mve-res-section h2 { font-size: 28px; }
	.mve-res-card h3 { font-size: 18px; }
}

@media (min-width: 1280px) {
	.mve-res-row,
	.mve-res-catalogue.is-filtered .mve-res-row { gap: 20px; }
	.mve-res-card { flex: 0 0 calc((100% - 40px) / 3); }
}

@media (min-width: 1600px) {
	.mve-res-hero { min-height: 470px; }
	.mve-res-hero__copy { padding-left: calc((100vw - 1280px) / 2); }
}

@media (max-width: 1199px) {
	.mve-res { --gutter: 64px; }
	.mve-res-hero__copy { padding-left: 32px; padding-right: 30px; }
}

@media (max-width: 1099px) {
	.mve-res-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 959px) {
	.mve-res { --gutter: 48px; }
	.mve-res-hero { min-height: 365px; }
	.mve-res-hero__copy { padding: 26px 26px 36px 24px; }
	.mve-res-hero__photo { min-height: 365px; }
	.mve-res-library { padding-top: 42px; }
	.mve-res-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 22px; }
	.mve-res-search-count { display: none; }
	.mve-res-section__head { gap: 10px; }
	.mve-res-section__head > div:first-child { gap: 7px; }
	.mve-res-section__count { margin-left: 0; }
	.mve-res .mve-res-controls button { width: 29px; height: 29px; }
}

@media (max-width: 639px) {
	.mve-res { --gutter: 36px; }
	.mve-res-hero { grid-template-columns: 1fr; }
	.mve-res-hero__copy { padding: 14px 24px 18px; }
	.mve-res-hero__copy-inner { max-width: none; width: 100%; }
	.mve-res-hero h1 { margin-block: 0 10px; line-height: 1.12; }
	/* Phone: the photo is the hero background and the dark panel becomes an overlay, so the hero is shorter */
	.mve-res-hero__photo { position: absolute; inset: 0; min-height: 0; }
	.mve-res-hero__photo img { object-position: center 58%; }
	.mve-res-hero__photo::after { background: linear-gradient(180deg, rgba(41, 41, 41, .88), rgba(41, 41, 41, .72)); }
	.mve-res-library { padding-top: 33px; padding-bottom: 35px; }
	.mve-res-search { min-height: 55px; padding-inline: 13px; gap: 10px; margin-bottom: 22px; }
	.mve-res-search input[type="search"] { height: 52px; font-size: 16px; }
	.mve-res-search > svg { width: 19px; }
	.mve-res .mve-res-clear { font-size: 10px; }
	.mve-res-layout { display: block; }
	.mve-res-sidebar { position: static; }
	.mve-res-nav { display: none; }
	.mve-res-select {
		display: block; width: 100%; min-height: 48px; margin: 0 0 20px; padding: 0 44px 0 16px;
		border: 1px solid var(--card-line); border-radius: var(--radius); color: #1a1a1a;
		font: 600 16px var(--font); -webkit-appearance: none; appearance: none;
		background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23d93636' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
	}
	.mve-res-select:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
	.mve-res-section { padding-bottom: 23px; margin-bottom: 24px; scroll-margin-top: 16px; }
	.mve-res-section h2 { font-size: 22px; }
	.mve-res-section__num { font-size: 12px; }
	.mve-res .mve-res-controls button { width: 30px; height: 30px; }
}

@media (hover: none) {
	.mve-res-card:hover .mve-res-card__image img,
	.mve-res-card:hover .mve-res-card__action svg { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.mve-res-card__image img,
	.mve-res-card__action svg { transition: none; transform: none !important; }
}

/* Hero height on tablet and phone */
@media (max-width: 959px) {
	.mve-res-hero { min-height: 300px; }
}
@media (max-width: 479px) {
	.mve-res-hero { min-height: 260px; }
}
