/* HP Requests — front-end styles. Namespaced under .hp-requests so it can never leak into or clash with other plugin/theme styles (including HivePress's own .hp-listing classes). */

.hp-requests {
	--hp-requests-primary: #2f6feb;
	--hp-requests-border: #e2e4e8;
	--hp-requests-muted: #6b7280;
	--hp-requests-radius: 8px;
	box-sizing: border-box;
}

.hp-requests *,
.hp-requests *::before,
.hp-requests *::after {
	box-sizing: inherit;
}

.hp-requests__page-header {
	margin-bottom: 1.5em;
}

.hp-requests__notice {
	padding: 12px 16px;
	border-radius: var(--hp-requests-radius);
	margin-bottom: 1.25em;
	font-size: 0.95em;
}

.hp-requests__notice--success { background: #e6f6ec; color: #1c6b3b; }
.hp-requests__notice--info { background: #e8f1fd; color: #1d4f91; }
.hp-requests__notice--error { background: #fdeceb; color: #a52a20; }
.hp-requests__notice ul { margin: 0; padding-left: 1.1em; }

/* Filters */
.hp-requests__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 1.75em;
}

.hp-requests__search {
	flex: 1 1 220px;
	min-width: 160px;
}

.hp-requests__filters input,
.hp-requests__filters select {
	padding: 8px 10px;
	border: 1px solid var(--hp-requests-border);
	border-radius: var(--hp-requests-radius);
	font-size: 0.95em;
}

/* Buttons */
.hp-requests__button {
	display: inline-block;
	padding: 9px 16px;
	border-radius: var(--hp-requests-radius);
	text-decoration: none;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	line-height: 1.2;
}

.hp-requests__button--primary {
	background: var(--hp-requests-primary);
	color: #fff;
}

.hp-requests__button--secondary {
	background: #fff;
	color: #222;
	border-color: var(--hp-requests-border);
}

.hp-requests__button--text {
	background: transparent;
	color: #a52a20;
	padding-left: 4px;
	padding-right: 4px;
}

/* Grid / cards */
.hp-requests__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
	margin-bottom: 2em;
}

.hp-requests__card {
	border: 1px solid var(--hp-requests-border);
	border-radius: var(--hp-requests-radius);
	overflow: hidden;
	transition: box-shadow 0.15s ease;
}

.hp-requests__card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.hp-requests__card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.hp-requests__card-image {
	aspect-ratio: 4 / 3;
	background: #f2f3f5;
	overflow: hidden;
}

.hp-requests__card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hp-requests__card-image-placeholder {
	display: block;
	width: 100%;
	height: 100%;
}

.hp-requests__card-body {
	padding: 14px 16px 18px;
}

.hp-requests__card-category {
	display: inline-block;
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--hp-requests-primary);
	margin-bottom: 6px;
}

.hp-requests__card-title {
	font-size: 1.1em;
	margin: 0 0 8px;
}

.hp-requests__card-excerpt {
	color: var(--hp-requests-muted);
	font-size: 0.92em;
	margin: 0 0 10px;
}

.hp-requests__card-meta {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.85em;
	color: var(--hp-requests-muted);
}

.hp-requests__card-meta li {
	margin-bottom: 2px;
}

/* Single */
.hp-requests--single .hp-requests__title {
	margin-bottom: 8px;
}

.hp-requests__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.hp-requests__badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.78em;
	font-weight: 600;
	text-decoration: none;
	background: #eef0f3;
	color: #333;
}

.hp-requests__badge--open { background: #e6f6ec; color: #1c6b3b; }
.hp-requests__badge--fulfilled { background: #e8f1fd; color: #1d4f91; }
.hp-requests__badge--closed { background: #f0f0f0; color: #666; }

.hp-requests__byline {
	color: var(--hp-requests-muted);
	font-size: 0.9em;
	margin-bottom: 1.5em;
}

.hp-requests__byline--profiles {
	display: flex;
	gap: 18px;
	margin-top: -1em;
}

.hp-requests__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 10px;
	margin-bottom: 1.5em;
}

.hp-requests__gallery img {
	width: 100%;
	border-radius: var(--hp-requests-radius);
	display: block;
	object-fit: cover;
	aspect-ratio: 1 / 1;
	border: 1px solid var(--border);
}

.hp-requests__details {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	padding: 14px 0;
	border-top: 1px solid var(--hp-requests-border);
	border-bottom: 1px solid var(--hp-requests-border);
	margin-bottom: 1.5em;
}

.hp-requests__detail strong {
	display: block;
	font-size: 0.78em;
	text-transform: uppercase;
	color: var(--hp-requests-muted);
	margin-bottom: 2px;
}

.hp-requests__description {
	margin-bottom: 1.75em;
	line-height: 1.7;
}

.hp-requests__actions {
	display: flex;
	gap: 10px;
}

/* Forms */
.hp-requests__form .hp-requests__field {
	margin-bottom: 1.1em;
}

.hp-requests__form label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 0.92em;
}

.hp-requests__required { color: #a52a20; }
.hp-requests__hint { font-weight: 400; color: var(--hp-requests-muted); }

.hp-requests__form input[type="text"],
.hp-requests__form input[type="email"],
.hp-requests__form input[type="date"],
.hp-requests__form textarea,
.hp-requests__form select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--hp-requests-border);
	border-radius: var(--hp-requests-radius);
	font-size: 0.95em;
	font-family: inherit;
}

.hp-requests__field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 14px;
}

.hp-requests__existing-images {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0;
}

.hp-requests__existing-image {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	font-size: 0.75em;
	font-weight: 400;
}

.hp-requests__existing-image img {
	border-radius: 6px;
	display: block;
}

.hp-requests__submit-section {
	margin-top: 2.5em;
	padding-top: 2em;
	border-top: 1px solid var(--hp-requests-border);
}

/* Custom attribute fields */
.hp-requests__section-title {
	font-size: 1em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--hp-requests-muted);
	margin: 1.75em 0 1em;
	padding-top: 1.25em;
	border-top: 1px solid var(--hp-requests-border);
}

.hp-requests__checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
}

.hp-requests__checkbox-option {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
	font-size: 0.95em;
}

.hp-requests__checkbox-option input {
	width: auto;
}

.hp-requests__filter-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9em;
	padding: 8px 4px;
}

.hp-requests__filter-checkbox input {
	width: auto;
}

.hp-requests__details--attributes {
	margin-top: 0;
}

.hp-requests__color-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	vertical-align: middle;
	margin-right: 4px;
}

/* Fallback styling for HivePress's generic .hp-form__message container, in
   case the active theme doesn't already style these modifiers (used by our
   plain, non-AJAX form submissions). Low-specificity, single class only, so
   an existing theme rule always wins. */
.hp-form__message {
	display: block;
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 1.25em;
	font-size: 0.92em;
	list-style: none;
}

.hp-form__message--success { background: #e6f6ec; color: #1c6b3b; }
.hp-form__message--info { background: #e8f1fd; color: #1d4f91; }
.hp-form__message--error { background: #fdeceb; color: #a52a20; }

/* Section headings above the Featured / All Requests grids on the archive
   page — plain, theme-inheriting typography. */
.hp-requests__section-heading {
	font-size: 1.2em;
	margin: 1.5em 0 1em;
}

/* "Browse by category" grid shown on the assigned Requests Page. Reuses
   .hp-listing for the card shell so it matches the regular grid, with a
   couple of tweaks since it has no image. */
.hp-requests__category-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	text-decoration: none;
	color: inherit;
	padding: 18px 20px;
}

.hp-requests__category-card .hp-listing__title {
	margin: 0;
}

.hp-requests__card--featured {
	position: relative;
}

.hp-requests__location-field-wrap .hp-requests__location-field {
	margin-top: 4px;
}

/* Minimal fallbacks for markup borrowed from HivePress's real Listings
   page, in case the active theme doesn't already style these (harmless,
   low-specificity — any real theme rule for the same classes wins). */
.hp-listing__location {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85em;
	color: var(--hp-requests-muted, #6b7280);
}

/* Location field */
.hp-requests__location-field {
	position: relative;
}

.hp-requests__location-field input[type="text"] {
	width: 100%;
}

.hp-requests__locate-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-top: 8px;
	background: #fff;
	border: 1px solid var(--hp-requests-border);
	border-radius: 50%;
	cursor: pointer;
	color: var(--hp-requests-primary);
	text-decoration: none;
}

.hp-requests__locate-btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.hp-requests__location-suggestions {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 20;
	background: #fff;
	border: 1px solid var(--hp-requests-border);
	border-radius: var(--hp-requests-radius);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
	max-height: 220px;
	overflow-y: auto;
	margin-top: 2px;
}

.hp-requests__location-suggestion {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	background: none;
	border: none;
	border-bottom: 1px solid #f0f0f0;
	font-size: 0.88em;
	cursor: pointer;
}

.hp-requests__location-suggestion:hover {
	background: #f5f7fa;
}

.hp-requests__location-picker {
	margin-top: 12px;
	height: 240px;
	border-radius: var(--hp-requests-radius);
	overflow: hidden;
	background: #f2f3f5;
}

.hp-requests__mapbox-geocoder {
	width: 100%;
}

.hp-requests__mapbox-geocoder .mapboxgl-ctrl-geocoder {
	width: 100%;
	max-width: none;
	box-shadow: none;
	border: 1px solid var(--hp-requests-border);
}

.hp-requests__map {
	height: 280px;
	border-radius: var(--hp-requests-radius);
	overflow: hidden;
	background: #f2f3f5;
	margin-bottom: 1.75em;
	position: relative;
	z-index: 0;
}

/* Single request page: keep the map clear of the card below it (the theme's
   member card pulls its logo up with a negative margin). */
.hp-requests__map-wrap {
	display: flow-root;
	position: relative;
	z-index: 0;
	margin: 0 0 2.5em;
	padding-bottom: 1.5em;
}

.hp-requests__map-wrap .hp-requests__map {
	margin-bottom: 0;
}

.hp-requests__map-wrap + * {
	position: relative;
	z-index: 1;
	clear: both;
}

/* My Requests table */
.hp-requests__table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.25em 0;
}

.hp-requests__table th,
.hp-requests__table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--hp-requests-border);
	font-size: 0.92em;
}

.hp-requests__table-actions a {
	margin-right: 10px;
}

.hp-requests__delete-link {
	color: #a52a20;
}

.hp-requests__pagination {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.hp-requests__pagination .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--hp-requests-border);
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
}

.hp-requests__pagination .page-numbers.current {
	background: var(--hp-requests-primary);
	color: #fff;
	border-color: var(--hp-requests-primary);
}

/* Request card footer: Block (primary) attributes, laid out like a listing's. */
.hp-listing__attributes--primary {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}

/* Single request page: listing-page style two-column layout. */
.hp-requests--single .hp-page__sidebar > * { margin-bottom: 1.5em; }
.hp-requests--single .hp-listing__attributes--primary .hp-listing__attribute { margin-bottom: .5em; }
.hp-requests--single .hp-requests__actions { display: flex; flex-direction: column; gap: 12px; }
.hp-requests--single .hp-listing__images img { width: 100%; height: auto; display: block; }
.hp-requests--single .hp-listing__images { margin-bottom: 1.5em; }

/* Required-field marker (matches the theme's span.required). */
.hp-form--request-submit span.required {
	color: var(--prim, #f0905f);
}

/* "Fulfilled" / "Closed" badge shown instead of the reply button. */
.hp-requests__status-badge {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: rgba(14, 35, 64, 0.07);
	color: var(--navy, #0d3b66);
}

.hp-requests__status-badge--fulfilled {
	background: #e6f4ea;
	color: #1e6b34;
}

.hp-requests__status-badge--closed {
	background: #eef0f2;
	color: #5a5a5a;
}

/* Request card footer: the reply action ("Send Message" or the status
   badge) always sits on the right-hand side. */
.hp-requests__card .hp-listing__footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 8px 16px;
}

.hp-requests__card .hp-listing__footer .hp-listing__actions {
	margin-left: auto;
	float: none;
	text-align: right;
}

/* Reply / "Send Message" link on request cards. */
.hp-listing__action--message {
	display: inline-block;
	padding: 5px 0;
	border-bottom: 1px solid var(--white);
}

.hp-listing__action--message:hover {
	border-bottom: 1px solid var(--prim);
}

/* Member block in the request sidebar: same card as Founder / Provider,
   plus a "Member" chip like their role badge. */
.hp-requests__member-role {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 12px 0 0;
	padding: 7px 10px;
	border-radius: 20px;
	background: rgba(14, 35, 64, 0.07);
	color: var(--navy, #0d3b66);
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	text-transform: none;
}

.hp-requests__member {
	position: relative;
}

/* The theme stretches vendor cards to full height and spreads their parts
   apart (for the directory grid); in the sidebar keep them stacked at the top. */
html body .hp-requests__member.hp-vendor--view-block {
	min-height: 0;
	height: auto;
	align-self: flex-start;
	justify-content: flex-start;
}

/* Founder / Provider / Member chip, same as on the Members page cards. */
.hp-requests__label {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	padding: 2px 10px;
	border-radius: 12px;
	background: #f1f1f1;
	font-size: .7em;
	letter-spacing: .05em;
	text-transform: uppercase;
	line-height: 1.6;
}

.hp-requests__member .hp-vendor__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 12px;
}

.hp-requests__member .hp-vendor__footer > :not(.hp-vendor__actions) {
	flex: 1 1 auto;
	min-width: 0;
}

.hp-requests__member-company {
	overflow-wrap: anywhere;
}

.hp-requests__member .hp-vendor__actions {
	margin-left: auto;
	text-align: right;
}

.hp-requests__gallery-item--placeholder img {
	opacity: .55;
}

/* Gallery lightbox */
.hp-requests__zoom {
	display: block;
	cursor: zoom-in;
}

.hp-requests__lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.88);
	cursor: zoom-out;
}

.hp-requests__lightbox img {
	max-width: 92vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	border: 0;
	aspect-ratio: auto;
	object-fit: contain;
	border-radius: 4px;
	cursor: default;
}

.hp-requests__lightbox-btn {
	position: absolute;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: 0;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 28px;
	line-height: 1;
	padding: 0;
	cursor: pointer;
}

.hp-requests__lightbox-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

.hp-requests__lightbox-close {
	top: 16px;
	right: 16px;
}

.hp-requests__lightbox-prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.hp-requests__lightbox-next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.hp-requests__lightbox--single .hp-requests__lightbox-prev,
.hp-requests__lightbox--single .hp-requests__lightbox-next {
	display: none;
}

/* "Added on" and "Ends <date>" on one line, wrapping when too narrow. */
.hp-requests__dates {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 20px;
}

.hp-requests__dates > * {
	display: inline-block;
	margin: 0;
}

.hp-requests__ends {
	text-transform: uppercase;
	letter-spacing: .05em;
	font-size: .85em;
}

.hp-requests__renew {
	margin-left: 8px;
	text-transform: none;
	letter-spacing: 0;
}

/* My Requests on phones: each request becomes a stacked card instead of a
   table that runs off the screen. */
@media (max-width: 768px) {
	.hp-requests__table,
	.hp-requests__table tbody,
	.hp-requests__table tr,
	.hp-requests__table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.hp-requests__table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.hp-requests__table tr {
		margin: 0 0 16px;
		padding: 8px 14px;
		border: 1px solid var(--hp-requests-border, #ddd);
		border-radius: 6px;
		background: #fff;
	}

	.hp-requests__table td {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		gap: 4px 12px;
		padding: 8px 0;
		border: 0;
		border-bottom: 1px solid rgba(0, 0, 0, .06);
		text-align: right;
	}

	.hp-requests__table td:last-child {
		border-bottom: 0;
	}

	.hp-requests__table td::before {
		content: attr(data-label);
		flex: 0 0 auto;
		font-weight: 600;
		text-align: left;
	}

	.hp-requests__table td.hp-requests__cell-title {
		font-size: 1.1em;
		font-weight: 600;
		text-align: left;
	}

	.hp-requests__table td.hp-requests__cell-title::before {
		display: none;
	}

	.hp-requests__table td.hp-requests__table-actions {
		justify-content: flex-start;
		gap: 8px 16px;
		text-align: left;
	}

	.hp-requests__table td.hp-requests__table-actions::before {
		flex: 0 0 100%;
	}
}
