/**
 * Lethbridge Board Portal - front end styles.
 *
 * Deliberately minimal: only the fields the plugin outputs. Background,
 * headings and layout are left to Elementor.
 *
 * Colors live in the custom properties below, so they can be changed from
 * Elementor custom CSS without touching the plugin:
 *
 *   .lbp-login { --lbp-text: #fff; --lbp-input-text: #1E1E1E; }
 *
 * Selectors are doubled up on purpose. Elementor's global kit styles labels and
 * links with rules like `.elementor-kit-7 label`, which would otherwise win.
 *
 * Turn the file off entirely with: add_filter( 'lbp_load_front_styles', '__return_false' );
 */

.lbp-login {
	--lbp-text: #ffffff;
	--lbp-input-text: #1e1e1e;
	--lbp-input-bg: #ffffff;
	--lbp-input-border: rgba(0, 0, 0, 0.14);
	--lbp-placeholder: #8c8f94;
	--lbp-underline: rgba(255, 255, 255, 0.45);
	--lbp-underline-gap: 0px;

	color: var(--lbp-text);
}

.lbp-login__field {
	margin: 0 0 18px;
}

.lbp-login .lbp-login__label {
	display: block;
	margin: 0 0 8px;
	color: var(--lbp-text);
	font-size: 16px;
	font-weight: 325;
	line-height: 1.4;
}

.lbp-login .lbp-login__input {
	display: block;
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--lbp-input-border);
	border-radius: 8px;
	background: var(--lbp-input-bg);
	color: var(--lbp-input-text);
	font: inherit;
	line-height: 1.4;
	box-sizing: border-box;
}

.lbp-login .lbp-login__input::placeholder {
	color: var(--lbp-placeholder);
	opacity: 1;
}

/*
 * No focus ring on inputs, by request. The border still darkens so keyboard
 * users can tell which field they are in, which is the part that cannot go.
 */
.lbp-login .lbp-login__input:focus,
.lbp-login .lbp-login__input:focus-visible {
	border-color: var(--lbp-input-text);
	outline: none;
	box-shadow: none;
}

.lbp-login__field--check {
	margin-bottom: 14px;
}

.lbp-login .lbp-login__check {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--lbp-text);
	cursor: pointer;
}

/* Sits directly under the password field, not in the button row. */
.lbp-login .lbp-login__forgot {
	display: inline-block;
	margin: 10px 0 0;
	padding-bottom: var(--lbp-underline-gap);
	color: var(--lbp-text);
	font-size: 14px;
	text-decoration: none;
	border-bottom: 1px solid var(--lbp-underline);
}

.lbp-login .lbp-login__forgot:hover,
.lbp-login .lbp-login__forgot:focus {
	color: var(--lbp-text);
	border-bottom-color: var(--lbp-text);
}

.lbp-login__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 22px 0 0;
}

/* Bot trap: off screen but still submitted, so it must never be display:none. */
.lbp-login__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lbp-login__submit {
	cursor: pointer;
	border: 0;
	font: inherit;
}

.lbp-login__message {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.92);
	color: #1d2327;
	line-height: 1.45;
}

.lbp-login__message--error {
	background: #fcf0f1;
	color: #8a1f22;
}

.lbp-login__aside {
	margin: 12px 0 0;
	color: var(--lbp-text);
	font-size: 0.9em;
}

/* ---------------------------------------------------------------------------
 * Document type cards
 * ------------------------------------------------------------------------- */

.lbp-types {
	--lbp-card-gap: 21px;
	--lbp-card-padding: 21px;
	--lbp-card-radius: 8px;
	--lbp-card-border: #003955;
	--lbp-card-bg: #ffffff;
	--lbp-card-hover-bg: #003955;
	--lbp-card-icon: #003955;
	--lbp-card-icon-size: 55px;
	--lbp-card-title: #3e3e3e;
	--lbp-card-title-size: 32px;
	--lbp-card-text: #3e3e3e;
	--lbp-card-text-size: 18px;
	--lbp-card-text-weight: 300;
	--lbp-card-hover-text: #ffffff;
	--lbp-card-shadow: 0 4px 8px 0 #00000026;

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--lbp-card-gap);
}

@media (min-width: 560px) {
	.lbp-types {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Only three types or more get a third column; two always split the row. */
@media (min-width: 900px) {
	.lbp-types--cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.lbp-type-card {
	display: flex;
	flex-direction: column;
	padding: var(--lbp-card-padding);
	border: 2px solid var(--lbp-card-border);
	border-radius: var(--lbp-card-radius);
	background: var(--lbp-card-bg);
	box-shadow: var(--lbp-card-shadow);
	color: var(--lbp-card-text);
	text-decoration: none;
}

a.lbp-type-card {
	cursor: pointer;
}

.lbp-type-card__icon {
	display: block;
	margin: 0 0 14px;
	line-height: 0;
	color: var(--lbp-card-icon);
}

.lbp-type-card__icon .lbp-icon {
	width: var(--lbp-card-icon-size);
	height: var(--lbp-card-icon-size);
}

.lbp-type-card__image {
	display: block;
	width: var(--lbp-card-icon-size);
	height: var(--lbp-card-icon-size);
	object-fit: contain;
}

/* Scoped one level deeper so it outranks the theme heading rules. */
.lbp-types .lbp-type-card__title {
	display: block;
	margin: 0;
	color: var(--lbp-card-title);
	font-size: var(--lbp-card-title-size);
	font-weight: 700;
	line-height: 1.25;
}

.lbp-type-card__description {
	display: block;
	margin: 8px 0 0;
	color: var(--lbp-card-text);
	font-size: var(--lbp-card-text-size);
	font-weight: var(--lbp-card-text-weight);
	line-height: 1.45;
}

a.lbp-type-card:hover,
a.lbp-type-card:focus-visible {
	background: var(--lbp-card-hover-bg);
	outline: none;
}

a.lbp-type-card:hover .lbp-type-card__title,
a.lbp-type-card:hover .lbp-type-card__description,
a.lbp-type-card:hover .lbp-type-card__icon,
a.lbp-type-card:focus-visible .lbp-type-card__title,
a.lbp-type-card:focus-visible .lbp-type-card__description,
a.lbp-type-card:focus-visible .lbp-type-card__icon {
	color: var(--lbp-card-hover-text);
}

/* Uploaded icons are flat dark artwork, so they can be flipped to white. */
a.lbp-type-card:hover .lbp-type-card__image,
a.lbp-type-card:focus-visible .lbp-type-card__image {
	filter: brightness(0) invert(1);
}

/* ---------------------------------------------------------------------------
 * Document library
 * ------------------------------------------------------------------------- */

.lbp-library {
	--lbp-lib-navy: #003955;
	--lbp-lib-title: #1d1d1d;
	--lbp-lib-text: #6b7280;
	--lbp-lib-line: #0000004d;
	--lbp-lib-line-width: 1.5px;
	/* Selects share the search field palette so every control matches. */
	--lbp-lib-field-border: var(--lbp-lib-search-border);
	--lbp-lib-field-bg: var(--lbp-lib-search-bg);
	--lbp-lib-search-border: #dadada;
	--lbp-lib-search-bg: #f9f9f9;
	--lbp-lib-search-text: #737373;
	--lbp-lib-accent: #d2601a;
	--lbp-lib-accent-text: #ffffff;
	--lbp-lib-radius: 5px;

	--lbp-doc-tile: 75px;
	--lbp-lib-font: "Gotham", "Gotham HTF", sans-serif;
	--lbp-doc-title: #0f0f0f;
	--lbp-doc-title-font: var(--lbp-lib-font);
	--lbp-doc-muted: #0f0f0f99;
	--lbp-doc-rule: #cb5e27;

	width: 100%;
	color: var(--lbp-lib-title);
}

.lbp-library.is-loading .lbp-library__results {
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

/*
 * Breadcrumb
 *
 * It carries the Rank Math class and its markup, so the styling the site already
 * applies to the theme breadcrumb applies here too. Nothing else is styled on
 * purpose. The lbp- classes are there only as hooks, in case something needs
 * forcing later.
 */

.lbp-breadcrumb {
	margin: 0 0 14px;
}

.lbp-breadcrumb p {
	margin: 0;
}

/* Heading and filters */

.lbp-library__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 28px;
	margin: 0 0 20px;
}

.lbp-library__intro {
	flex: 1 1 260px;
	min-width: 0;
}

.lbp-library__title {
	margin: 0;
	color: var(--lbp-lib-title);
	font-size: 32px;
	line-height: 1.2;
}

.lbp-library__description {
	margin: 8px 0 0;
	color: var(--lbp-lib-text);
	font-family: var(--lbp-lib-font);
	font-size: 18px;
	font-weight: 300;
	line-height: 1.45;
}

.lbp-library__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px;
}

.lbp-library__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.lbp-library .lbp-library__label {
	color: var(--lbp-lib-title);
	font-size: 14px;
	font-weight: 400;
}

/*
 * The native arrow sits wherever the browser puts it, usually hard against the
 * edge, so it is replaced by an inline SVG that can be positioned properly.
 */
.lbp-library .lbp-library__select {
	min-width: 150px;
	padding: 10px 44px 10px 14px;
	border: 1px solid var(--lbp-lib-field-border);
	border-radius: var(--lbp-lib-radius);
	background-color: var(--lbp-lib-field-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	color: var(--lbp-lib-search-text);
	font-family: var(--lbp-lib-font);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

.lbp-library .lbp-library__select::-ms-expand {
	display: none;
}

.lbp-library__field--action {
	justify-content: flex-end;
}

/* 9px padding plus the 2px border matches the height of the selects. */
.lbp-library .lbp-library__clear {
	padding: 9px 18px;
	border: 2px solid var(--lbp-lib-navy);
	border-radius: var(--lbp-lib-radius);
	background: none;
	color: var(--lbp-lib-navy);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

/* Same treatment as the View PDF button. */
.lbp-library .lbp-library__clear:hover,
.lbp-library .lbp-library__clear:focus {
	background: var(--lbp-lib-navy);
	color: #fff;
}

/* Search */

.lbp-library__search {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 18px;
}

.lbp-library__search-field {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 260px;
	min-width: 0;
}

.lbp-library__search-field .lbp-icon {
	position: absolute;
	left: 18px;
	width: 16px;
	height: 16px;
	color: var(--lbp-lib-search-text);
	pointer-events: none;
}

.lbp-library .lbp-library__search-input {
	width: 100%;
	/* Left padding clears the icon: 18px offset + 16px icon + 18px of gap. */
	padding: 13px 18px 13px 52px;
	border: 1px solid var(--lbp-lib-search-border);
	border-radius: 5px;
	background: var(--lbp-lib-search-bg);
	color: var(--lbp-lib-search-text);
	font-family: var(--lbp-lib-font);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.4;
	box-sizing: border-box;
}

.lbp-library .lbp-library__search-input::placeholder {
	color: var(--lbp-lib-search-text);
	opacity: 1;
}

.lbp-library .lbp-library__search-input:focus {
	border-color: var(--lbp-lib-navy);
	outline: none;
}

.lbp-library .lbp-library__search-submit {
	padding: 12px 26px;
	border: 0;
	border-radius: var(--lbp-lib-radius);
	background: var(--lbp-lib-accent);
	color: var(--lbp-lib-accent-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

/* Results */

/* Collapses when there is no count to show, so the empty state reads once. */
.lbp-library__summary:empty {
	display: none;
}

.lbp-library__summary {
	margin: 0 0 6px;
	color: var(--lbp-lib-text);
	font-size: 14px;
}

.lbp-doc {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 0;
	border-top: var(--lbp-lib-line-width) solid var(--lbp-lib-line);
}

.lbp-doc:last-child {
	border-bottom: var(--lbp-lib-line-width) solid var(--lbp-lib-line);
}

.lbp-doc__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--lbp-doc-tile);
	height: var(--lbp-doc-tile);
	border-radius: 4px;
	background: var(--lbp-lib-navy);
	color: #fff;
}

/* Uploaded icons are flat dark artwork, so they read as white on the navy tile. */
.lbp-doc__image {
	width: 46px;
	height: 46px;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

.lbp-doc__body {
	flex: 1 1 auto;
	min-width: 0;
}

.lbp-library .lbp-doc__title {
	margin: 0;
	color: var(--lbp-doc-title);
	font-family: var(--lbp-doc-title-font);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.35;
}

.lbp-doc__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	margin: 5px 0 0;
	color: var(--lbp-doc-muted);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
}

.lbp-doc__separator {
	color: var(--lbp-doc-rule);
}

.lbp-doc__description {
	margin: 5px 0 0;
	color: var(--lbp-doc-muted);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.5;
}

.lbp-doc__action {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
	align-self: center;
}

.lbp-library .lbp-doc__download {
	color: var(--lbp-lib-navy);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.lbp-library .lbp-doc__download:hover,
.lbp-library .lbp-doc__download:focus {
	color: var(--lbp-lib-accent);
	text-decoration: none;
}

.lbp-library .lbp-doc__button {
	display: inline-block;
	padding: 10px 22px;
	border: 2px solid var(--lbp-lib-navy);
	border-radius: var(--lbp-lib-radius);
	color: var(--lbp-lib-navy);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.lbp-library .lbp-doc__button:hover,
.lbp-library .lbp-doc__button:focus {
	background: var(--lbp-lib-navy);
	color: #fff;
}

.lbp-doc__missing,
.lbp-library__empty {
	color: var(--lbp-lib-text);
	font-size: 14px;
}

.lbp-library__empty {
	padding: 24px 0;
}

.lbp-library__more {
	margin: 22px 0 0;
	text-align: center;
}

.lbp-library .lbp-library__more-button {
	padding: 11px 28px;
	border: 1px solid var(--lbp-lib-navy);
	border-radius: var(--lbp-lib-radius);
	background: none;
	color: var(--lbp-lib-navy);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.lbp-library .lbp-library__more-button:hover {
	background: var(--lbp-lib-navy);
	color: #fff;
}

@media (max-width: 782px) {
	.lbp-library__head {
		align-items: stretch;
	}

	.lbp-library__filters {
		width: 100%;
	}

	.lbp-library__field {
		flex: 1 1 140px;
	}

	.lbp-library .lbp-library__select {
		min-width: 0;
		width: 100%;
	}
}

@media (max-width: 600px) {
	.lbp-library__title {
		font-size: 26px;
	}

	.lbp-doc {
		flex-wrap: wrap;
	}

	.lbp-doc__action {
		flex: 1 1 100%;
		align-self: stretch;
		justify-content: space-between;
		margin-top: 12px;
	}

	.lbp-library .lbp-doc__button {
		display: block;
		text-align: center;
	}

	.lbp-library__search-submit {
		flex: 1 1 100%;
	}
}

/* Themes that do not ship the WordPress helper still need it. */
.lbp-library .screen-reader-text,
.lbp-login .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
 * Elementor global kit overrides
 *
 * The kit styles every field with `.elementor-kit-N input:not([type="button"])
 * :not([type="submit"])`, which scores 0-3-1. No reasonable class selector of
 * ours beats that, so the handful of properties it sets are forced back here.
 *
 * Everything is grouped in this one block on purpose: it is the only place the
 * plugin uses !important, so what is fighting what stays obvious.
 * ------------------------------------------------------------------------- */

.lbp-library .lbp-library__search-input {
	padding: 13px 18px 13px 52px !important;
	border: 1px solid var(--lbp-lib-search-border) !important;
	border-radius: 5px !important;
	background-color: var(--lbp-lib-search-bg) !important;
	color: var(--lbp-lib-search-text) !important;
	font-family: var(--lbp-lib-font) !important;
	font-size: 16px !important;
	font-weight: 300 !important;
}

/* Background is set per property so the chevron image survives. */
.lbp-library .lbp-library__select {
	padding: 10px 44px 10px 14px !important;
	border: 1px solid var(--lbp-lib-field-border) !important;
	border-radius: var(--lbp-lib-radius) !important;
	background-color: var(--lbp-lib-field-bg) !important;
	background-repeat: no-repeat !important;
	background-position: right 16px center !important;
	color: var(--lbp-lib-search-text) !important;
	font-family: var(--lbp-lib-font) !important;
	font-size: 16px !important;
	font-weight: 300 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
}

/* The shadow is part of the card in every state, including hover and focus. */
.lbp-types .lbp-type-card,
.lbp-types a.lbp-type-card:hover,
.lbp-types a.lbp-type-card:focus,
.lbp-types a.lbp-type-card:focus-visible {
	box-shadow: var(--lbp-card-shadow) !important;
}

/*
 * Buttons keep their own hover: the theme adds lifts, shadows and color swaps
 * that fight the design, so those are zeroed out and hover is just the same
 * button rendered slightly darker.
 */
.lbp-library .lbp-library__clear:hover,
.lbp-library .lbp-library__clear:focus,
.lbp-library .lbp-library__search-submit:hover,
.lbp-library .lbp-library__search-submit:focus {
	transform: none !important;
	box-shadow: none !important;
	text-decoration: none !important;
	border-radius: var(--lbp-lib-radius) !important;
}

.lbp-library .lbp-library__search-submit:hover,
.lbp-library .lbp-library__search-submit:focus {
	filter: brightness(0.88) !important;
}

.lbp-library .lbp-library__clear:hover,
.lbp-library .lbp-library__clear:focus {
	background: var(--lbp-lib-navy) !important;
	color: #fff !important;
	border-color: var(--lbp-lib-navy) !important;
}

.lbp-library .lbp-library__search-submit:hover,
.lbp-library .lbp-library__search-submit:focus {
	background: var(--lbp-lib-accent) !important;
	color: var(--lbp-lib-accent-text) !important;
}

/* View PDF and Clear share the same outlined treatment. */
.lbp-library .lbp-doc__button {
	border: 2px solid var(--lbp-lib-navy) !important;
}

.lbp-library .lbp-library__clear {
	border: 2px solid var(--lbp-lib-navy) !important;
	font-family: var(--lbp-lib-font) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
}

/* The download link never underlines; hover is carried by the accent color. */
.lbp-library .lbp-doc__download,
.lbp-library .lbp-doc__download:hover,
.lbp-library .lbp-doc__download:focus {
	text-decoration: none !important;
}

.lbp-login .lbp-login__input {
	padding: 12px 16px !important;
	border: 1px solid var(--lbp-input-border) !important;
	border-radius: 8px !important;
	background-color: var(--lbp-input-bg) !important;
	color: var(--lbp-input-text) !important;
}

.lbp-message {
	margin: 0;
	padding: 12px 14px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.92);
	color: #1d2327;
	line-height: 1.45;
}

.lbp-message--error {
	background: #fcf0f1;
	color: #8a1f22;
}

.lbp-login .lbp-login__aside a {
	display: inline-block;
	padding-bottom: var(--lbp-underline-gap);
	color: var(--lbp-text);
	text-decoration: none;
	border-bottom: 1px solid var(--lbp-underline);
}

/* ---------------------------------------------------------------------------
 * Login / logout link
 *
 * Standalone, so it carries its own values rather than inheriting the library
 * or login tokens. It can land in a header or a menu, anywhere on the site.
 * ------------------------------------------------------------------------- */

.lbp-login-link {
	display: inline-block;
	color: #003955;
	font-family: "Gotham", "Gotham HTF", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
}

.lbp-login-link:hover,
.lbp-login-link:focus {
	color: #003955;
	text-decoration: underline;
}

/* Theme link rules outweigh a single class, so these are forced. */
a.lbp-login-link {
	color: #003955 !important;
	font-family: "Gotham", "Gotham HTF", sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
}

/* ---------------------------------------------------------------------------
 * Motion
 *
 * One duration for every hover in the plugin. Only the properties that actually
 * change are listed: transition: all would animate layout too, and a width or a
 * padding easing into place on hover reads as a glitch rather than a nicety.
 * ------------------------------------------------------------------------- */

.lbp-login a,
.lbp-login button,
.lbp-login .lbp-login__input,
.lbp-type-card,
.lbp-library a,
.lbp-library button,
.lbp-library select,
.lbp-library input,
.lbp-login-link {
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

/* Someone who asked their system to calm animations down gets no transitions. */
@media (prefers-reduced-motion: reduce) {
	.lbp-login a,
	.lbp-login button,
	.lbp-login .lbp-login__input,
	.lbp-type-card,
	.lbp-library a,
	.lbp-library button,
	.lbp-library select,
	.lbp-library input,
	.lbp-login-link {
		transition: none;
	}
}
