/* KPM Business Ads. Colours come from the KPM theme's tokens, with fallbacks for other themes. */

/* ---------------------------------------------------------------- Cards */

.kpm-adgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
}

.kpm-adcard {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--kpm-line, #e7dccb);
	border-radius: 14px;
	transition: box-shadow 0.15s, border-color 0.15s;
}

.kpm-adcard:hover,
.kpm-adcard:focus-within {
	border-color: var(--kpm-line-2, #d6c7ae);
	box-shadow: var(--kpm-shadow, 0 14px 34px rgba(19, 35, 63, 0.1));
}

/* A fixed 4:3 frame: the whole image shows (posters keep their text), on a sand background. */
.kpm-adcard__img {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--kpm-sand, #f4eada);
}

body .kpm-adcard__img img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: contain;
}

.kpm-adcard__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px 4px;
}

.kpm-adcard__cat {
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--kpm-saffron-dark, #a23a15);
}

body .kpm-adcard__name {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

body .kpm-adcard__name a {
	color: var(--kpm-navy, #13233f);
	text-decoration: none;
}

body .kpm-adcard__name a:hover {
	text-decoration: underline;
}

body .kpm-adcard__tag {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	font-size: 15px;
	line-height: 1.45;
	color: var(--kpm-stone, #5f5a53);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

body .kpm-adcard__place {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--kpm-stone, #5f5a53);
}

.kpm-adcard__place .kpm-ic {
	width: 16px;
	height: 16px;
}

.kpm-adcard__cta {
	display: flex;
	gap: 8px;
	padding: 12px 16px 16px;
}

body .kpm-adcard__cta .kpm-adbtn {
	flex: 1;
	gap: 6px;
	padding: 8px 10px;
	font-size: 15px;
}

.kpm-adbtn .kpm-ic {
	width: 18px;
	height: 18px;
}

/* ------------------------------------------- Cards beside other pages */

.kpm-adside {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.kpm-adside__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--kpm-stone, #5f5a53);
}

body .kpm-adside__head a {
	font-weight: 600;
	color: var(--kpm-saffron-dark, #a23a15);
	text-decoration: none;
}

body .kpm-adside__head a:hover {
	text-decoration: underline;
}

.kpm-adcard--side .kpm-adcard__body {
	padding: 12px 14px 2px;
}

body .kpm-adcard--side .kpm-adcard__name {
	font-size: 16.5px;
}

.kpm-adcard--side .kpm-adcard__cta {
	padding: 10px 14px 14px;
}

.kpm-adside--strip {
	margin-top: 36px;
}

.kpm-adside--strip .kpm-adside__cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}

/* ------------------------------------------ Single ad (other themes) */

.kpm-adsingle {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: 28px;
	align-items: start;
}

.kpm-adsingle__img {
	margin: 0;
	background: var(--kpm-sand, #f4eada);
	border-radius: 14px;
	overflow: hidden;
}

.kpm-adsingle__img img {
	display: block;
	width: 100%;
	height: auto;
}

.kpm-adsingle__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kpm-ads-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

@media (max-width: 760px) {
	.kpm-adsingle {
		grid-template-columns: 1fr;
	}
}

/* --------------------------------------------------- Profile tab form */

/* One field height and a visible border, whatever the theme does to inputs and selects
   (the KPM theme draws text inputs taller than selects). */
.kpm-ads-form .kpm-ff-field input:not([type=file]):not([type=checkbox]),
.kpm-ads-form .kpm-ff-field select {
	box-sizing: border-box;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 4px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background-color: #fff;
	font-size: 15px;
	line-height: 1.3;
}

.kpm-ads-form textarea {
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background-color: #fff;
	font-size: 15px;
}

.kpm-ads-editor .kpm-ad-pick {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.kpm-ad-pick__preview {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--kpm-sand, #f4eada);
	border: 1px dashed var(--kpm-line-2, #d6c7ae);
	border-radius: 10px;
	font-size: 14px;
	color: var(--kpm-stone, #5f5a53);
}

.kpm-ad-pick__preview img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kpm-ad-hint {
	display: block;
	margin: 4px 0 0;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--kpm-stone, #5f5a53);
}

.kpm-ad-hint.kpm-ad-required {
	margin: 0 0 8px;
	font-weight: 600;
	color: var(--kpm-saffron-dark, #a23a15);
}

.kpm-ad-check,
.kpm-ad-consent label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.45;
}

.kpm-ad-check input,
.kpm-ad-consent input {
	flex: none;
	margin-top: 4px;
}

.kpm-ad-buttons {
	margin: 12px 0 18px;
}

.kpm-ad-list {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.kpm-ad-list > li {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--kpm-line, #e7dccb);
}

.kpm-ad-list__img {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--kpm-sand, #f4eada);
	border-radius: 8px;
}

.kpm-ad-list__img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kpm-ad-list__cat,
.kpm-ad-list__hits {
	font-size: 14px;
	color: var(--kpm-stone, #5f5a53);
}

.kpm-ad-list__hits {
	margin-left: 8px;
}

.kpm-ad-list__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.kpm-ad-inline {
	display: inline;
	margin: 0;
}

.kpm-ad-state {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 99px;
	font-size: 13px;
	font-weight: 600;
	background: #eef0f5;
	color: #4a5263;
}

.kpm-ad-state--live {
	background: var(--kpm-leaf-bg, #e6f2ea);
	color: var(--kpm-leaf, #2d7653);
}

.kpm-ad-state--pending {
	background: #f6e6c4;
	color: #6b4a0e;
}

.kpm-ad-state--rejected,
.kpm-ad-state--removed {
	background: #fbeee6;
	color: var(--kpm-saffron-dark, #a23a15);
}

body .kpm-ad-quiet {
	opacity: 0.85;
}

@media (max-width: 640px) {
	.kpm-ads-editor .kpm-ad-pick {
		grid-template-columns: 1fr;
	}

	.kpm-ad-pick__preview {
		max-width: 320px;
	}

	.kpm-ad-list > li {
		grid-template-columns: 72px minmax(0, 1fr);
	}

	.kpm-ad-list__actions {
		grid-column: 1 / -1;
		justify-content: flex-start;
	}
}

/* ------------------------------------------------------------- Admin */

.kpm-ads-admin .kpm-ad-col-img {
	width: 84px;
}

.kpm-ads-admin .kpm-ad-col-img img {
	display: block;
	width: 80px;
	height: 60px;
	object-fit: contain;
	background: #f4eada;
	border-radius: 4px;
}

.kpm-ad-admin-top {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: flex-start;
}

.kpm-ad-admin-top .form-table {
	flex: 1;
	min-width: 320px;
	margin-top: 0;
}

.kpm-ad-admin-img {
	display: block;
	max-width: 320px;
	max-height: 260px;
	background: #f4eada;
	border-radius: 6px;
}

.kpm-ad-decide {
	margin: 12px 0 24px;
}

.kpm-ad-decide .kpm-ad-inline {
	display: inline-block;
	margin: 0 6px 6px 0;
}

.kpm-ads-admin .kpm-ad-danger {
	color: #b32d2e;
	border-color: #b32d2e;
}
