/* ARD Search Project — search UI + card grid + lightbox.
   Brand accent injected per-instance via --ardsp-accent. Card look mirrors the
   ARDGroup Project plugin for visual consistency. */

.ardsp-wrap {
	--ardsp-accent: #F3953F;
	font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
}

/* ---- Page header: title + search side by side on desktop ---- */
.ardsp-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	flex-wrap: wrap;
	margin: 0 0 26px;
}

.ardsp-head .ardsp-page-title {
	margin: 0;
	flex: 1 1 auto;
}

.ardsp-head .ardsp-search {
	margin: 0;
	flex: 0 1 420px;
}

.ardsp-head .ardsp-search-box {
	max-width: none;
}

@media (max-width: 768px) {
	.ardsp-head {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}
}

/* ---- Search bar ---- */
.ardsp-search {
	margin: 0 0 18px;
}

.ardsp-search-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Compact pill with a leading search icon. Neutral grey at rest, accent ring on
   focus. Capped width so it reads as a search field, not a full-width bar. */
.ardsp-search-box {
	display: flex;
	align-items: center;
	gap: 9px;
	width: 100%;
	max-width: 420px;
	padding: 9px 16px;
	background: #f4f4f5;
	border: 1px solid #e4e4e7;
	border-radius: 999px;
	transition: border-color .2s, box-shadow .2s, background .2s;
}

.ardsp-search-box:focus-within {
	background: #fff;
	border-color: var(--ardsp-accent);
	box-shadow: 0 0 0 3px rgba(243, 149, 63, .15);
}

.ardsp-search-icon {
	flex: 0 0 auto;
	color: #9a9a9f;
	transition: color .2s;
}

.ardsp-search-box:focus-within .ardsp-search-icon {
	color: var(--ardsp-accent);
}

/* Beat the theme's input chrome (its own border / inner box-shadow) so only the
   outer pill shows. */
.ardsp-input,
.ardsp-input:focus {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14.5px;
	line-height: 1.4;
	color: #1a1a1a;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	outline: 0 !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.ardsp-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.ardsp-input::placeholder {
	color: #9a9a9f;
}

/* ---- Category pills (single scrollable row) ---- */
.ardsp-cat-pills {
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	margin: 12px 0 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
	padding-bottom: 6px;
}

.ardsp-cat-pills::-webkit-scrollbar {
	height: 5px;
}

.ardsp-cat-pills::-webkit-scrollbar-thumb {
	background: #d2d2d2;
	border-radius: 999px;
}

.ardsp-cat-pills::-webkit-scrollbar-track {
	background: transparent;
}

.ardsp-cat-pill {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 3px 11px;
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1.4;
	color: #666;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 999px;
	cursor: pointer;
	transition: background .18s, color .18s, border-color .18s;
}

.ardsp-cat-pill:hover {
	border-color: #bdbdbd;
	color: #222;
}

.ardsp-cat-pill.is-active {
	background: var(--ardsp-accent);
	border-color: var(--ardsp-accent);
	color: #fff;
}

.ardsp-status {
	min-height: 18px;
	margin: 14px 0;
	font-size: 13px;
	color: #777;
}

/* ---- Grid (JS round-robin masonry) ----
   column-count fills each column top-to-bottom first, so the reading order runs
   vertically (item 1,2 stack under each other before item 3 starts a new
   column). We want horizontal order — row 1 = items 1,2,3 — while keeping the
   staggered masonry look, which pure CSS columns can't do. So JS splits the
   cards into N `.ardsp-col` flex columns round-robin (card i -> col i % N). */
.ardsp-grid {
	display: flex;
	gap: 22px;
	align-items: flex-start;
	transition: opacity .15s;
}

.ardsp-col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.ardsp-grid.is-loading {
	opacity: .45;
	pointer-events: none;
}

.ardsp-empty {
	color: #888;
	font-size: 15px;
	padding: 20px 0;
}

/* ---- Card ---- */
.ardsp-card {
	display: block;
	width: 100%;
	margin: 0;
	text-decoration: none;
	color: inherit;
	border: 1px solid #ededed;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow .25s, transform .25s, border-color .25s;
}

.ardsp-card:hover {
	box-shadow: 0 10px 30px rgba(243, 149, 63, .18);
	border-color: var(--ardsp-accent);
	transform: translateY(-2px);
}

.ardsp-card-thumb {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #f4f4f4;
	cursor: pointer;
	line-height: 0;
}

/* The video card thumb is a <button>; kill the UA + theme chrome so it matches
   the image card's <a> exactly (no gap, no border, no purple focus ring). The
   !important beats the theme's global button hover/focus styles. */
button.ardsp-card-thumb,
button.ardsp-card-thumb:hover,
button.ardsp-card-thumb:focus,
button.ardsp-card-thumb:active,
button.ardsp-card-thumb:focus-visible {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: block !important;
	width: 100% !important;
	font: inherit;
	color: inherit;
	text-align: left;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	background: #f4f4f4;
}

.ardsp-card-thumb img,
.ardsp-video-frame {
	display: block;
	width: 100%;
	height: auto;
}

.ardsp-video-frame {
	aspect-ratio: 16 / 9;
	border: 0;
}

/* Force a flush 16:9 box and let the poster fill it (cover). YouTube hqdefault
   is 4:3 with baked-in black bars; absolute-fill cover crops them so the video
   cover looks full, identical to an image cover — no gap, no letterbox. */
.ardsp-card-thumb.is-video {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.ardsp-card-thumb.is-video img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ardsp-card-thumb.is-video::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center;
	transition: background-color .2s;
}

.ardsp-card-thumb.is-video:hover::after {
	background-color: var(--ardsp-accent);
}

.ardsp-card-body {
	padding: 16px 18px 18px;
}

.ardsp-card-cats {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--ardsp-accent);
	margin: 0 0 6px;
}

.ardsp-card-cats a {
	color: inherit;
	text-decoration: none;
}

.ardsp-card-title {
	font-size: 18px;
	line-height: 1.3;
	margin: 0 0 8px;
	color: #1a1a1a;
}

.ardsp-card-sow {
	font-size: 13px;
	color: #555;
	margin: 0 0 8px;
}

.ardsp-sow-label,
.ardsp-share-label {
	display: block;
	font-weight: 600;
	color: #333;
	margin: 0 0 2px;
}

.ardsp-card-sow ul,
.ardsp-card-sow ol {
	margin: 4px 0 0;
	padding-left: 18px;
}

.ardsp-card-client {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.ardsp-card-year {
	font-size: 12px;
	color: #999;
}

.ardsp-card-cta {
	display: inline-block;
	margin-top: 12px;
	padding: 9px 18px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--ardsp-accent);
	border-radius: 8px;
	text-decoration: none;
	transition: filter .2s;
}

.ardsp-card-cta:hover {
	filter: brightness(.92);
}

/* ---- Load more ---- */
.ardsp-more-wrap {
	text-align: center;
	margin: 10px 0 0;
}

.ardsp-load-more {
	padding: 11px 28px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ardsp-accent);
	background: #fff;
	border: 1.5px solid var(--ardsp-accent);
	border-radius: 10px;
	cursor: pointer;
	transition: background .2s, color .2s;
}

.ardsp-load-more:hover {
	background: var(--ardsp-accent);
	color: #fff;
}

.ardsp-load-more:disabled {
	opacity: .6;
	cursor: default;
}

/* ---- Lightbox ---- */
.ardsp-lb-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .85);
	padding: 30px;
}

.ardsp-lb-overlay[hidden] {
	display: none;
}

.ardsp-lb-inner {
	max-width: 92vw;
	max-height: 88vh;
}

.ardsp-lb-inner img {
	max-width: 92vw;
	max-height: 88vh;
	display: block;
}

.ardsp-lb-close {
	position: absolute;
	top: 18px;
	right: 24px;
	width: 44px;
	height: 44px;
	font-size: 30px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 0;
	cursor: pointer;
}

/* ---- Navbar trigger ---- */
.ardsp-nav-item {
	display: flex;
	align-items: center;
}

.ardsp-nav-trigger {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: currentColor;
	line-height: 0;
}

.ardsp-nav-trigger svg {
	display: block;
}

/* ---- Spotlight popup (navbar) ---- */
body.ardsp-spot-open {
	overflow: hidden;
}

.ardsp-spot {
	position: fixed;
	inset: 0;
	z-index: 100000;
	--ardsp-accent: #F3953F;
	font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
}

.ardsp-spot[hidden] {
	display: none;
}

.ardsp-spot-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 15, .5);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.ardsp-spot-box {
	position: absolute;
	top: 16vh;
	left: 50%;
	transform: translateX(-50%);
	width: min(620px, 92vw);
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .12);
	overflow: hidden;
	animation: ardsp-spot-pop .2s cubic-bezier(.2, .8, .2, 1);
}

@keyframes ardsp-spot-pop {
	from { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.98); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.ardsp-spot-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px 24px;
	border-bottom: 1px solid #f0f0f0;
	transition: border-color .2s;
}

.ardsp-spot-box:focus-within .ardsp-spot-row {
	border-bottom-color: var(--ardsp-accent);
}

.ardsp-spot-icon {
	color: #b5b5b5;
	flex: 0 0 auto;
	transition: color .2s;
}

.ardsp-spot-box:focus-within .ardsp-spot-icon {
	color: var(--ardsp-accent);
}

/* Beat the theme's input chrome (the box-in-box border / inner shadow). */
.ardsp-spot-input,
.ardsp-spot-input:focus {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.2;
	color: #1a1a1a;
	-webkit-appearance: none;
	appearance: none;
}

.ardsp-spot-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.ardsp-spot-input::placeholder {
	color: #b0b0b0;
	font-weight: 400;
}

.ardsp-spot-hint {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 24px;
	background: #fafafa;
	font-size: 12px;
	color: #999;
}

.ardsp-spot-keys {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #aaa;
}

.ardsp-spot-keys kbd {
	display: inline-block;
	min-width: 18px;
	padding: 2px 6px;
	font-family: inherit;
	font-size: 11px;
	line-height: 1.4;
	text-align: center;
	color: #666;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 5px;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

/* ---- Owned search page ---- */
.ardsp-page {
	max-width: 1180px;
	margin: 0 auto;
	padding: 10px 22px 64px;
}

.ardsp-page-title {
	font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
	font-size: 30px;
	margin: 0 0 22px;
	color: #1a1a1a;
}

.ardsp-lock-note {
	margin: 0 0 16px;
	font-size: 14px;
	color: #555;
}

.ardsp-lock-note strong {
	color: #1a1a1a;
}

/* Share-now (UTM) split: prompt + search box on the left, the shared project
   card on the right, 50/50. JS removes .is-locked on first search -> stacks. */
.ardsp-wrap.is-locked .ardsp-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: center;
}

/* Project card on the left, search prompt on the right. */
.ardsp-wrap.is-locked .ardsp-split-card {
	order: 1;
}

.ardsp-wrap.is-locked .ardsp-split-search {
	order: 2;
}

.ardsp-wrap.is-locked .ardsp-split-card .ardsp-card {
	margin-bottom: 0;
}

.ardsp-split-prompt {
	margin: 0 0 16px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1a1a;
}

@media (max-width: 768px) {
	.ardsp-wrap.is-locked .ardsp-split {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	/* Card first, prompt + box under it on mobile. */
	.ardsp-wrap.is-locked .ardsp-split-card {
		order: -1;
	}
}
