/* ==========================================================================
   AFP Fleet Directory  (salient-child)
   Listing: [afp_directory]   Single: single-directory.php
   Matches https://www.theafp.co.uk/afp-fleet-directory/ and
   https://www.theafp.co.uk/directory/safe2drive/
   ========================================================================== */

.afp-dir,
.afp-dir-single {
	--afp-dir-teal: #57b197;
	--afp-dir-green: #11b496;
	--afp-dir-dark: #221f20;
	--afp-dir-purple: #8e68a6;
	--afp-dir-text: #4a4a4a;
	--afp-dir-line: #f4f4f4;
	--afp-dir-soft: #f4f3ef;
}

.afp-dir *,
.afp-dir-single * {
	box-sizing: border-box;
}

.afp-dir ul.afp-dir-contact,
.afp-dir-single ul.afp-dir-contact {
	list-style: none;
	margin: 0;
}

.afp-dir-contact li {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ------------------------------------------------------------- filters */
.afp-dir__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 20px;
	margin: 0 0 60px;
}

.afp-dir input.afp-dir__search,
.afp-dir select.afp-dir__category {
	height: 62px;
	margin: 0;
	border-radius: 3px;
	font-family: inherit;
	font-size: 18px;
	color: var(--afp-dir-text);
	box-shadow: none;
}

.afp-dir input.afp-dir__search {
	width: 38%;
	min-width: 280px;
	padding: 8px 25px;
	border: 0;
	background-color: var(--afp-dir-soft);
}

.afp-dir select.afp-dir__category {
	width: 300px;
	padding: 0 12px;
	border: 1px solid #7c7979;
	background-color: #fff;
	cursor: pointer;
}

.afp-dir input.afp-dir__search:focus,
.afp-dir select.afp-dir__category:focus {
	outline: 2px solid var(--afp-dir-teal);
	outline-offset: 1px;
}

/* ---------------------------------------------------------------- grid */
.afp-dir__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	transition: opacity 0.2s ease;
}

.afp-dir.is-loading .afp-dir__grid {
	opacity: 0.45;
	pointer-events: none;
}

.afp-dir__empty {
	grid-column: 1 / -1;
	margin: 20px 0;
	text-align: center;
	font-size: 18px;
	color: var(--afp-dir-text);
}

/* ---------------------------------------------------------------- card */
.afp-dir__item {
	display: flex;
	flex-direction: column;
	background-color: #fff;
	border: 2px solid var(--afp-dir-line);
	border-radius: 3px;
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.afp-dir__item:hover {
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
	transform: translateY(-3px);
}

.afp-dir__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 10%;
	background-color: #fff;
	border-bottom: 2px solid var(--afp-dir-line);
}

.afp-dir__logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	margin: 0;
}

.afp-dir-logo-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 45%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background-color: var(--afp-dir-soft);
	color: var(--afp-dir-teal);
	font-size: 48px;
	font-weight: 600;
}

.afp-dir__body {
	flex: 1 1 auto;
	padding: 25px 30px 30px;
}

.afp-dir .afp-dir__title {
	margin: 0 0 20px;
	padding: 0;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
}

.afp-dir .afp-dir__title a {
	color: var(--afp-dir-text);
	text-decoration: none;
	transition: color 0.3s ease;
}

.afp-dir .afp-dir__title a:hover {
	color: var(--afp-dir-teal);
}

/* ------------------------------------------------------ contact rows */
.afp-dir-contact {
	display: grid;
	row-gap: 15px;
	padding: 0;
}

.afp-dir-contact a,
.afp-dir-contact__static {
	display: flex;
	align-items: center;
	column-gap: 16px;
	color: var(--afp-dir-text);
	text-decoration: none;
}

.afp-dir-contact__icon {
	flex: 0 0 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background-color: var(--afp-dir-text);
	color: #fff;
	transition: background-color 0.4s ease;
}

.afp-dir-contact a:hover .afp-dir-contact__icon {
	background-color: var(--afp-dir-teal);
}

/* Multi-line addresses: keep the icon level with the first line. */
.afp-dir-contact__item--address .afp-dir-contact__static {
	align-items: flex-start;
}

.afp-dir-contact__item--address .afp-dir-contact__text {
	padding-top: 9px;
}

.afp-dir-contact__text {
	min-width: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.afp-dir-contact a:hover .afp-dir-contact__text {
	color: var(--afp-dir-teal);
}

/* Long website URLs stay on one line in the cards. */
.afp-dir-contact--card .afp-dir-contact__item--link .afp-dir-contact__text {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow-wrap: normal;
}

/* ----------------------------------------------------------- load more */
.afp-dir__more {
	margin-top: 50px;
	text-align: center;
}

.afp-dir__more[hidden] {
	display: none;
}

.afp-dir-btn,
.afp-dir .afp-dir__more-btn {
	display: inline-block;
	padding: 12px 34px 11px;
	border: 0;
	border-radius: 50px;
	background-color: var(--afp-dir-purple);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.5s ease;
}

.afp-dir-btn:hover,
.afp-dir-btn:focus-visible,
.afp-dir .afp-dir__more-btn:hover,
.afp-dir .afp-dir__more-btn:focus-visible {
	background-color: var(--afp-dir-dark);
	color: #fff;
}

.afp-dir .afp-dir__more-btn[disabled] {
	opacity: 0.7;
	cursor: wait;
}

/* ===================================================== single entry */
body .container-wrap.afp-dir-single-wrap {
	background-color: #f9f9f9;
}

.afp-dir-single {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
	gap: 60px;
	align-items: start;
	padding: 80px 0 100px;
}

.afp-dir-single--no-side {
	grid-template-columns: minmax(0, 1fr);
}

.afp-dir-single__back {
	display: inline-block;
	margin-bottom: 25px;
	color: var(--afp-dir-teal);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.afp-dir-single__back:hover {
	color: var(--afp-dir-dark);
}

.afp-dir-single .afp-dir-single__title {
	margin: 0 0 40px;
	padding: 0;
	color: #000;
	font-size: 42px;
	font-weight: 600;
	line-height: 1.2;
}

.afp-dir-single .afp-dir-single__subhead {
	margin: 0 0 15px;
	color: #000;
	font-size: 26px;
	font-weight: 700;
}

.afp-dir-single__content {
	color: #000;
	font-size: 16px;
	line-height: 1.9;
}

.afp-dir-single__content p {
	margin: 0 0 1.1em;
	padding: 0;
}

.afp-dir-single__content img {
	max-width: 100%;
	height: auto;
}

.afp-dir-single__card {
	padding: 30px;
	border: 2px solid #eee;
	background-color: #fff;
}

.afp-dir-single__logo {
	margin-bottom: 30px;
	text-align: center;
}

.afp-dir-single__logo img {
	display: inline-block;
	max-width: 100%;
	max-height: 260px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.afp-dir-single .afp-dir-single__card-title {
	margin: 0 0 30px;
	padding: 0 0 25px;
	border-bottom: 2px solid #eee;
	color: #000;
	font-size: 28px;
	font-weight: 600;
}

.afp-dir-single__cta {
/*	display: block;*/
	margin-top: 25px;
	text-align: center;
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1199px) {
	.afp-dir-single {
		gap: 40px;
	}
}

@media (max-width: 991px) {
	.afp-dir__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}
	.afp-dir-single {
		grid-template-columns: minmax(0, 1fr);
		padding: 50px 0 70px;
	}
	.afp-dir-single .afp-dir-single__title {
		font-size: 34px;
		margin-bottom: 25px;
	}
}

@media (max-width: 767px) {
	.afp-dir__filters {
		flex-direction: column;
		align-items: stretch;
		margin-bottom: 40px;
	}
	.afp-dir input.afp-dir__search,
	.afp-dir select.afp-dir__category {
		width: 100%;
		min-width: 0;
		height: 54px;
		font-size: 16px;
	}
}

@media (max-width: 600px) {
	.afp-dir__grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.afp-dir__body {
		padding: 22px 22px 26px;
	}
	.afp-dir .afp-dir__title {
		font-size: 22px;
	}
	.afp-dir-single .afp-dir-single__title {
		font-size: 30px;
	}
	.afp-dir-single__card {
		padding: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.afp-dir__item,
	.afp-dir__grid {
		transition: none;
	}
	.afp-dir__item:hover {
		transform: none;
	}
}

/* ============================================ single entry — extras
   Category tags, image gallery, login prompt, reviews and video.
   Tag + gallery styles match update26.theafp.co.uk/directory/… (were in
   Salient's Theme Options > Custom CSS there); the rest is ported from
   the old theafp theme. */

/* Category tags (pills). */
.afp-dir-single ul.bullet__points {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 32px 18px;
	margin: 0;
	padding: 15px 0 45px;
	list-style: none;
}

.afp-dir-single ul.bullet__points li.jobs-tag {
	margin: 0;
	padding: 0;
	list-style: none;
}

.afp-dir-single ul.bullet__points li.jobs-tag::before,
.afp-dir-single ul.bullet__points li.jobs-tag::marker {
	content: none;
}

.afp-dir-single .jobs-tag a {
	position: relative;
	overflow: hidden;
	padding: 8px 20px;
	border-radius: 27px;
	background-color: var(--afp-dir-green);
	color: #fff;
	font-size: 16px;
	line-height: 1.7;
	text-decoration: none;
	transition: 0.7s;
	cursor: default;
}

.afp-dir-single .jobs-tag a:hover {
	border-radius: 0;
	background-color: var(--afp-dir-dark);
	color: #fff;
	transition: 0.9s;
}

/* Image gallery: two per row with spacing, like the live site
   (Bootstrap col-md-6: 24px between columns, 22px between rows, every
   image 227px tall). */
.afp-dir-single .afp-dir-single__gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: 22px 24px;
	margin: 30px 0 0;
	padding: 0;
}

.afp-dir-single .afp-dir-single__gallery::before,
.afp-dir-single .afp-dir-single__gallery::after {
	content: none; /* Salient clearfix pseudo-elements would take grid cells. */
}

.afp-dir-single .afp-dir-single__gallery .dircol {
	float: none;
	width: auto;
	margin: 0 !important;
	padding: 0;
}

.afp-dir-single .afp-dir-single__gallery a {
	display: block;
}

.afp-dir-single .afp-dir-single__gallery a {
	overflow: hidden;
}

/* Extra .dircol beats Salient's ".row .col img:not([srcset]) { width: auto }". */
.afp-dir-single .afp-dir-single__gallery .dircol img {
	display: block;
	width: 100%;
	max-width: none;
	height: 227px;
	margin: 0;
	object-fit: cover; /* same size for every photo, without stretching it */
	transition: transform 0.5s ease;
}

.afp-dir-single .afp-dir-single__gallery .dircol a:hover img {
	transform: scale(1.04);
}

/* "Please login" prompt (non-members). */
.afp-dir-single__login {
	margin-top: 3rem;
}

.afp-dir-single__login p {
	margin: 0 0 15px;
	padding: 0;
	color: #000;
	font-size: 16px;
	line-height: 1.6;
}

/* Reviews (Reviews Plus). */
.afp-dir-single__reviews {
	margin-top: 3rem;
}

.afp-dir-single .hide_review_form #respond {
	display: none !important;
}

.afp-dir-single .review_section .review-avatar img {
	position: inherit;
}

.afp-dir-single .review_section .rating-label {
	display: inline-block;
	width: 100%;
}

.afp-dir-single .review_section .reviewer-name span a {
	color: var(--afp-dir-teal);
}

.afp-dir-single .review_section .reply a {
	color: #000;
}

.afp-dir-single .review_section .ic_rev .review-time {
	padding-bottom: 10px;
}

.afp-dir-single .review-totals {
	margin-bottom: 45px;
}

/* Video under the contact card (16:9, full width). */
.afp-dir-single__video {
	position: relative;
	margin-top: 25px;
	aspect-ratio: 16 / 9;
}

.afp-dir-single__video iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

@media (max-width: 767px) {
	.afp-dir-single .jobs-tag a {
		padding: 5px 10px;
		font-size: 14px;
	}
}

@media (max-width: 575px) {
	.afp-dir-single ul.bullet__points {
		gap: 20px 12px;
	}
	.afp-dir-single .afp-dir-single__gallery {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}
}
