/**
 * E-Tools archive.
 *
 * Scoped under `.wrc-etools`, a body class added only on the E-Tools page and on a
 * single tool (et_body_class() in inc/e-tools-front.php), so nothing here reaches
 * the Elementor header, the footer, or any other page.
 *
 * Palette and Montserrat come from the same tokens wrc-article.css,
 * wrc-innovations.css, wrc-watersa.css and wrc-waterwheel.css use. The dark title
 * band, breadcrumbs and headings are the parent theme's, untouched.
 *
 * Width: 1400px, matching the Water Wheel archive, centred on one shared inset.
 */

/* ==========================================================================
 * 1. Tokens
 * ========================================================================== */

.wrc-etools {
	--et-blue:      #094E9C;
	--et-lightblue: #00AEEF;
	--et-green:     #A9CC4F;
	--et-white:     #FFFFFF;

	--et-ink:       #16202C;
	--et-ink-soft:  #4A5764;
	--et-grey-bg:   #F4F7FA;
	--et-grey-line: #E1E8EF;

	--et-radius:    12px;
	--et-radius-sm: 8px;
	--et-shadow:    0 1px 2px rgba( 9, 78, 156, .04 ), 0 8px 24px rgba( 9, 78, 156, .07 );

	--et-width:  1400px;
	--et-gutter: var( --wrc-gutter, 30px );

	/* One alignment line for every band. 100% resolves against the element it is
	   used on, so only apply it to something already full width. */
	--et-inset: max( var( --et-gutter ), calc( ( 100% - var( --et-width ) ) / 2 ) );

	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wrc-etools .et-icon {
	width: 1em;
	height: 1em;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wrc-etools .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* Visible focus everywhere, for keyboard users. */
.wrc-etools a:focus-visible,
.wrc-etools button:focus-visible,
.wrc-etools input:focus-visible,
.wrc-etools select:focus-visible {
	outline: 3px solid var( --et-lightblue );
	outline-offset: 2px;
}

/* ==========================================================================
 * 2. The old plugin widget
 *
 * The WP File Download category browser is replaced by this archive. It is hidden
 * rather than deleted so the files stay reachable in wp-admin and nothing is lost
 * if this needs to be rolled back — and because deleting an Elementor widget is
 * the page editor's decision, not a stylesheet's.
 *
 * It also leaks an admin "Upload files in this category" drop zone onto the public
 * page for logged-in editors, which this removes as a side effect.
 * ========================================================================== */

.wrc-etools .elementor-widget-wpfd_choose_category,
.wrc-etools .elementor-widget-wpfd,
.wrc-etools .wpfd-elementor-category {
	display: none !important;
}

/* ==========================================================================
 * 3. Page measure
 *
 * Both `wp-page` AND `wp-post` are matched: Elementor labels these pages `wp-post`
 * even though they are WordPress Pages, and the qualified `.e-con-boxed` selector
 * is needed to outrank wrc-container.css's (0,6,0) site-wide cap.
 * ========================================================================== */

body.wrc-etools .elementor[data-elementor-type="wp-page"] > .e-con.e-con-boxed > .e-con-inner,
body.wrc-etools .elementor[data-elementor-type="wp-post"] > .e-con.e-con-boxed > .e-con-inner {
	max-width: min( 100%, var( --et-width ) );
	margin-left: auto;
	margin-right: auto;
	padding-left: 0;
	padding-right: 0;
}

body.wrc-etools .elementor[data-elementor-type="wp-page"] > .e-con.e-con-boxed,
body.wrc-etools .elementor[data-elementor-type="wp-post"] > .e-con.e-con-boxed {
	padding-left: var( --et-gutter );
	padding-right: var( --et-gutter );
	box-sizing: border-box;
}

.wrc-etools .et-archive-outer {
	width: 100%;
	padding-left: var( --et-inset );
	padding-right: var( --et-inset );
	padding-bottom: clamp( 34px, 4vw, 58px );
	box-sizing: border-box;
}

/* the single tool page */
body.wrc-etools .page-header > .container,
body.wrc-etools .container.container_vis {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	padding-left: var( --et-inset );
	padding-right: var( --et-inset );
	box-sizing: border-box;
}

body.wrc-etools .et-tool-page #core {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: clamp( 26px, 3vw, 42px ) 0 0;
	float: none;
}

body.wrc-etools .et-tool-page .fullcontent {
	width: 100%;
	max-width: 100%;
	margin: 0 auto clamp( 34px, 4vw, 58px );
	padding: 0;
	float: none;
	overflow-x: clip;
}

/* The site-wide `.p-border, .meta, .page-numbers { width: 1180px !important }`
   rule saved on the Elementor kit would break these out of the column. */
.wrc-etools .et-tool-page .p-border,
.wrc-etools .et-tool-page .meta {
	width: auto !important;
	max-width: 100% !important;
}

body.wrc-etools .et-tool-page .page-header h1.entry-title {
	margin: 0;
	overflow-wrap: break-word;
}

/* ==========================================================================
 * 4. Archive heading — the site's eyebrow + title pair
 * ========================================================================== */

.wrc-etools .et-archive {
	padding-top: clamp( 20px, 3vw, 36px );
}

.wrc-etools .et-archive__head {
	margin-bottom: clamp( 18px, 2.4vw, 30px );
}

.wrc-etools .et-eyebrow {
	position: relative;
	margin: 0 0 14px;
	padding-left: 54px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	color: #66777D;
	text-transform: none;
}

.wrc-etools .et-eyebrow::before {
	content: "";
	position: absolute;
	top: 5px;
	left: 0;
	width: 40px;
	height: 2px;
	background: var( --et-lightblue );
}

.wrc-etools .et-title {
	margin: 0;
	font-size: 32px;
	font-weight: 700;
	line-height: 1;
	color: #222222;
	text-transform: uppercase;
}

/* ==========================================================================
 * 5. Toolbar
 * ========================================================================== */

.wrc-etools .et-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 16px;
	margin: 0 0 22px;
	background: var( --et-grey-bg );
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius );
}

.wrc-etools .et-field {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 280px;
	min-width: 0;
}

.wrc-etools .et-field__icon {
	position: absolute;
	left: 14px;
	font-size: 18px;
	color: var( --et-ink-soft );
	pointer-events: none;
}

.wrc-etools .et-field input[type="search"] {
	width: 100%;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px 0 42px;
	font-family: inherit;
	font-size: 15px;
	color: var( --et-ink );
	background: var( --et-white );
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius-sm );
	box-shadow: none;
	box-sizing: border-box;
}

.wrc-etools .et-select {
	height: 46px;
	max-width: 100%;
	margin: 0;
	padding: 0 34px 0 14px;
	font-family: inherit;
	font-size: 14px;
	color: var( --et-ink );
	background-color: var( --et-white );
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius-sm );
	box-sizing: border-box;
}

/* Buttons: `margin: 0` because the site gives every button a 15px bottom margin,
   which otherwise makes the toolbar row taller than its controls. */
.wrc-etools .et-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	margin: 0;
	padding: 0 20px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var( --et-blue );
	white-space: nowrap;
	background: var( --et-white );
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius-sm );
	cursor: pointer;
	text-decoration: none;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.wrc-etools .et-btn:hover,
.wrc-etools .et-btn:focus-visible {
	color: var( --et-blue );
	background: #EAF4FD;
	border-color: var( --et-lightblue );
	transform: translateY( -1px );
}

.wrc-etools .et-btn--solid {
	color: var( --et-white );
	background: var( --et-blue );
	border-color: var( --et-blue );
}

.wrc-etools .et-btn--solid:hover,
.wrc-etools .et-btn--solid:focus-visible {
	color: var( --et-white );
	background: #0B5CB8;
	border-color: #0B5CB8;
}

.wrc-etools .et-clear {
	font-size: 13px;
	font-weight: 600;
	color: var( --et-ink-soft );
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wrc-etools .et-clear:hover,
.wrc-etools .et-clear:focus-visible {
	color: var( --et-blue );
}

/* ==========================================================================
 * 6. Results
 * ========================================================================== */

.wrc-etools .et-count {
	margin: 0 0 14px;
	font-size: 14px;
	color: var( --et-ink-soft );
}

.wrc-etools .et-count strong {
	color: var( --et-ink );
}

.wrc-etools .et-empty {
	margin: 0;
	padding: 30px 22px;
	font-size: 15px;
	color: var( --et-ink-soft );
	text-align: center;
	background: var( --et-grey-bg );
	border: 1px dashed var( --et-grey-line );
	border-radius: var( --et-radius );
}

.wrc-etools .et-mark {
	padding: 0 2px;
	color: inherit;
	background: #FFF3BF;
	border-radius: 3px;
}

/* -- the tool list: a vertical list, not a grid ---------------------------- */

.wrc-etools .et-tools {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var( --et-grey-line );
}

.wrc-etools .et-tools__row {
	display: flex;
	align-items: flex-start;
	gap: clamp( 14px, 2vw, 24px );
	margin: 0;
	padding: 18px 4px;
	list-style: none;
	border-bottom: 1px solid var( --et-grey-line );
	transition: background-color .18s ease;
}

.wrc-etools .et-tools__row::before {
	content: none;
}

.wrc-etools .et-tools__row:hover {
	background: #FAFCFE;
}

.wrc-etools .et-tools__cover {
	flex: 0 0 auto;
	width: 78px;
}

.wrc-etools .et-tools__cover img {
	display: block;
	width: 78px;
	height: auto;
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius-sm );
}

.wrc-etools .et-tools__cover-blank {
	display: block;
	width: 78px;
	height: 100px;
	/* The tint keeps the tile in the WRC palette and stops a detailed photo
	   competing with the tool name beside it. */
	background-image: linear-gradient( 160deg, rgba( 9, 78, 156, .62 ), rgba( 0, 174, 239, .34 ) ), url( '../img/etools-tile.jpg' );
	background-size: cover;
	background-position: center;
	border: 1px solid #B9D3EA;
	border-radius: var( --et-radius-sm );
}

.wrc-etools .et-tools__body {
	flex: 1 1 auto;
	min-width: 0;
}

.wrc-etools .et-tools__name {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.wrc-etools .et-tools__name a {
	color: var( --et-blue );
	text-decoration: none;
}

.wrc-etools .et-tools__name a:hover,
.wrc-etools .et-tools__name a:focus-visible {
	color: var( --et-lightblue );
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wrc-etools .et-tools__desc {
	margin: 0 0 8px;
	font-size: 14.5px;
	line-height: 1.6;
	color: var( --et-ink-soft );
}

.wrc-etools .et-tools__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	color: var( --et-ink-soft );
}

.wrc-etools .et-tools__files {
	font-weight: 600;
	color: var( --et-ink );
}

.wrc-etools .et-tools__hosted {
	padding: 2px 9px;
	font-size: 11.5px;
	font-weight: 600;
	color: #2F6E00;
	text-transform: uppercase;
	letter-spacing: .04em;
	background: #F0F7DF;
	border-radius: 999px;
}

.wrc-etools .et-sep {
	color: #B6C2CE;
}

.wrc-etools .et-tools__hits {
	margin: 8px 0 0;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.7;
	color: var( --et-ink-soft );
	list-style: none;
	background: var( --et-grey-bg );
	border-left: 3px solid var( --et-lightblue );
	border-radius: 0 var( --et-radius-sm ) var( --et-radius-sm ) 0;
}

.wrc-etools .et-tools__hits li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wrc-etools .et-tools__hits li::before {
	content: none;
}

.wrc-etools .et-tools__actions {
	flex: 0 0 auto;
	align-self: center;
}

/* -- pagination ------------------------------------------------------------
 * width/border-color carry !important because the site-wide kit CSS forces
 * `.page-numbers { width: 1180px !important; border-color: #fff !important }`,
 * which otherwise puts each link on its own full-width line. `margin: 0` replaces
 * the parent theme's uneven `10px 8px 50px 0`, which gave the row three different
 * heights.
 * ---------------------------------------------------------------------- */

.wrc-etools .et-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 24px 0 0;
}

.wrc-etools .et-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	width: auto !important;
	max-width: 100% !important;
	margin: 0;
	padding: 0 13px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var( --et-blue );
	text-decoration: none;
	background: var( --et-white );
	border: 1px solid var( --et-grey-line ) !important;
	border-radius: var( --et-radius-sm );
	box-sizing: border-box;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.wrc-etools .et-pagination a.page-numbers:hover,
.wrc-etools .et-pagination a.page-numbers:focus-visible {
	background: #EAF4FD;
	border-color: var( --et-lightblue ) !important;
}

.wrc-etools .et-pagination .page-numbers.current {
	color: var( --et-white );
	background: var( --et-blue );
	border-color: var( --et-blue ) !important;
}

.wrc-etools .et-pagination .page-numbers.dots {
	background: transparent;
	border-color: transparent !important;
}

/* -- loading indicator ---------------------------------------------------- */

.wrc-etools .et-results[aria-busy="true"] {
	opacity: .45;
	transition: opacity .15s ease;
}

.wrc-etools .et-spinner {
	display: flex;
	justify-content: center;
	padding: 14px 0 0;
}

.wrc-etools .et-spinner[hidden] {
	display: none;
}

.wrc-etools .et-spinner span {
	width: 26px;
	height: 26px;
	border: 3px solid var( --et-grey-line );
	border-top-color: var( --et-blue );
	border-radius: 50%;
	animation: et-spin .7s linear infinite;
}

@keyframes et-spin {
	to { transform: rotate( 360deg ); }
}

/* ==========================================================================
 * 7. Single tool page
 * ========================================================================== */

.wrc-etools .et-tool__backrow {
	margin: 0 0 18px;
}

.wrc-etools .et-tool__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var( --et-blue );
	text-decoration: none;
}

.wrc-etools .et-tool__back:hover,
.wrc-etools .et-tool__back:focus-visible {
	color: var( --et-lightblue );
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wrc-etools .et-tool__masthead {
	display: flex;
	flex-wrap: wrap;
	gap: clamp( 20px, 3vw, 40px );
	padding: 0 0 clamp( 22px, 3vw, 34px );
	border-bottom: 1px solid var( --et-grey-line );
}

.wrc-etools .et-tool__cover {
	flex: 0 0 auto;
	width: min( 240px, 42vw );
}

.wrc-etools .et-tool__cover img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius-sm );
}

.wrc-etools .et-tool__cover-blank {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	background-image: linear-gradient( 160deg, rgba( 9, 78, 156, .62 ), rgba( 0, 174, 239, .34 ) ), url( '../img/etools-tile.jpg' );
	background-size: cover;
	background-position: center;
	border: 1px solid #B9D3EA;
	border-radius: var( --et-radius-sm );
}

.wrc-etools .et-tool__facts {
	flex: 1 1 320px;
	min-width: 0;
}

.wrc-etools .et-tool__group {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	color: var( --et-ink-soft );
	text-transform: uppercase;
	letter-spacing: .06em;
}

.wrc-etools .et-tool__desc {
	margin: 0 0 18px;
	font-size: 15.5px;
	line-height: 1.7;
	color: var( --et-ink );
}

.wrc-etools .et-tool__desc p:last-child {
	margin-bottom: 0;
}

.wrc-etools .et-tool__actions {
	margin: 0 0 8px;
}

.wrc-etools .et-tool__hosted-note {
	margin: 0 0 18px;
	font-size: 13px;
	color: var( --et-ink-soft );
}

.wrc-etools .et-tool__contact {
	padding: 16px 18px;
	background: var( --et-grey-bg );
	border: 1px solid var( --et-grey-line );
	border-radius: var( --et-radius-sm );
}

.wrc-etools .et-tool__contact-head {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	color: var( --et-ink );
	text-transform: uppercase;
	letter-spacing: .05em;
}

.wrc-etools .et-tool__contact-name {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	color: var( --et-ink );
}

.wrc-etools .et-tool__contact-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wrc-etools .et-tool__contact-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	padding: 0;
	font-size: 14px;
	color: var( --et-ink-soft );
	list-style: none;
}

.wrc-etools .et-tool__contact-list li::before {
	content: none;
}

.wrc-etools .et-tool__contact-list a {
	color: var( --et-blue );
	text-decoration: none;
	overflow-wrap: anywhere;
}

.wrc-etools .et-tool__contact-list a:hover,
.wrc-etools .et-tool__contact-list a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wrc-etools .et-tool__contact-note {
	font-style: italic;
}

/* -- downloads ------------------------------------------------------------ */

.wrc-etools .et-files__heading {
	margin: clamp( 26px, 3vw, 38px ) 0 14px;
	font-size: 20px;
	font-weight: 700;
	color: var( --et-ink );
}

.wrc-etools .et-files {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var( --et-grey-line );
}

.wrc-etools .et-files__item {
	display: flex;
	align-items: center;
	gap: clamp( 12px, 2vw, 20px );
	margin: 0;
	padding: 14px 4px;
	list-style: none;
	border-bottom: 1px solid var( --et-grey-line );
	transition: background-color .18s ease;
}

.wrc-etools .et-files__item::before {
	content: none;
}

.wrc-etools .et-files__item:hover {
	background: #FAFCFE;
}

.wrc-etools .et-files__type {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	color: var( --et-white );
	background: #8795A3;
	border-radius: var( --et-radius-sm );
}

.wrc-etools .et-files__type--pdf  { background: #C0392B; }
.wrc-etools .et-files__type--zip  { background: #2F8F4E; }
.wrc-etools .et-files__type--docx { background: #1F5FA8; }
.wrc-etools .et-files__type--xlsx { background: #1E7145; }

.wrc-etools .et-files__body {
	flex: 1 1 auto;
	min-width: 0;
}

.wrc-etools .et-files__title {
	margin: 0 0 3px;
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var( --et-ink );
	overflow-wrap: anywhere;
}

.wrc-etools .et-files__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	color: var( --et-ink-soft );
}

.wrc-etools .et-files__actions {
	flex: 0 0 auto;
}

/* ==========================================================================
 * 8. Responsive
 * ========================================================================== */

@media ( max-width: 1024px ) {

	.wrc-etools .et-title {
		font-size: 28px;
	}

	.wrc-etools .et-field {
		flex: 1 1 100%;
	}

	.wrc-etools .et-select {
		flex: 1 1 auto;
	}
}

@media ( max-width: 782px ) {

	.wrc-etools .et-toolbar {
		gap: 10px;
	}

	.wrc-etools .et-select,
	.wrc-etools .et-toolbar .et-btn {
		flex: 1 1 100%;
		width: 100%;
	}

	.wrc-etools .et-tools__row {
		flex-wrap: wrap;
	}

	.wrc-etools .et-tools__actions {
		flex: 1 1 100%;
		align-self: stretch;
		padding-left: calc( 78px + clamp( 14px, 2vw, 24px ) );
	}

	.wrc-etools .et-tools__actions .et-btn {
		width: 100%;
		justify-content: center;
	}

	.wrc-etools .et-tool__masthead {
		gap: 18px;
	}

	.wrc-etools .et-tool__cover {
		width: min( 180px, 48vw );
	}
}

@media ( max-width: 560px ) {

	.wrc-etools .et-title {
		font-size: 24px;
	}

	.wrc-etools .et-tools__cover,
	.wrc-etools .et-tools__cover img,
	.wrc-etools .et-tools__cover-blank {
		width: 58px;
	}

	.wrc-etools .et-tools__cover-blank {
		height: 76px;
	}

	.wrc-etools .et-tools__actions {
		padding-left: 0;
	}

	.wrc-etools .et-files__item {
		flex-wrap: wrap;
	}

	.wrc-etools .et-files__actions {
		flex: 1 1 100%;
		padding-left: calc( 52px + clamp( 12px, 2vw, 20px ) );
	}

	.wrc-etools .et-files__actions .et-btn {
		width: 100%;
		justify-content: center;
	}

	.wrc-etools .et-tool__cover {
		width: min( 150px, 50vw );
	}
}

@media ( prefers-reduced-motion: reduce ) {

	.wrc-etools *,
	.wrc-etools *::before,
	.wrc-etools *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
