/* ==========================================================
   Listings Plugin — Frontend Styles
   ========================================================== */

/* ----------------------------------------------------------
   Search form
   ---------------------------------------------------------- */
.listings-search-wrap { margin: 1.5rem 0; }

/* .listings-search-inner is shared by [listing_search] and the
   inline bar inside [listing_results], so selectors target it directly. */
.listings-search-inner {
	display: flex;
	max-width: 600px;
	margin: 0 auto;
}

.listings-search-inner input[type="text"] {
	flex: 1;
	padding: .7rem 1rem;
	font-size: 1rem;
	border: 2px solid #e2e8f0;
	border-right: none;
	border-radius: 4px 0 0 4px;
	outline: none;
	transition: border-color .2s;
}
.listings-search-inner input[type="text"]:focus { border-color: #667eea; }

.listings-search-inner button {
	padding: .7rem 1.4rem;
	font-size: 1rem;
	background: #667eea;
	color: #fff;
	border: none;
	border-radius: 0 4px 4px 0;
	cursor: pointer;
	transition: background .2s;
	white-space: nowrap;
}
.listings-search-inner button:hover { background: #5a67d8; }

/* ----------------------------------------------------------
   Category grid
   ---------------------------------------------------------- */
.listings-categories-wrap { margin: 1.5rem 0; }

.listings-categories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 1rem;
}

.listings-category-card {
	position: relative;
	display: block;
	min-height: 160px;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: #fff;
	background: #2d3748;
	transition: transform .2s, box-shadow .2s;
}
.listings-category-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0,0,0,.2);
	color: #fff;
	text-decoration: none;
}

.listings-category-image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: .65;
}

.listings-category-body {
	position: relative;
	height: 160px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: .9rem 1rem;
	background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 65%);
}

.listings-category-count {
	font-size: .72rem;
	opacity: .85;
}

.listings-category-name {
	margin: .2rem 0 0;
	font-size: .95rem;
	font-weight: 700;
	color: #fff;
}

/* ----------------------------------------------------------
   Listing card grid
   ---------------------------------------------------------- */
.listings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1.25rem;
	margin: 1rem 0;
}

.listing-card {
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e2e8f0;
	transition: box-shadow .2s, transform .2s;
}
.listing-card:hover {
	box-shadow: 0 4px 18px rgba(0,0,0,.1);
	transform: translateY(-2px);
}
.listing-card a { text-decoration: none; color: inherit; display: block; }

.listing-card-image {
	height: 148px;
	background: #e2e8f0 center/cover no-repeat;
}
.listing-card-image--placeholder {
	background: linear-gradient(135deg, #667eea, #764ba2);
}

.listing-card-body { padding: .7rem 1rem; }

.listing-card-category {
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #667eea;
	font-weight: 700;
}

.listing-card-title {
	margin: .2rem 0 0;
	font-size: .92rem;
	font-weight: 600;
	color: #1a202c;
	line-height: 1.35;
}

/* ----------------------------------------------------------
   Listing row list (used in search results)
   ---------------------------------------------------------- */
.listings-list {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}

.listing-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .85rem 1rem;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s, border-color .15s;
}
.listing-row:hover {
	border-color: #667eea;
	box-shadow: 0 2px 12px rgba(102,126,234,.12);
	text-decoration: none;
	color: inherit;
}

.listing-row-image {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	border-radius: 6px;
	background: #e2e8f0 center/cover no-repeat;
}
.listing-row-image--placeholder {
	background: linear-gradient(135deg, #667eea, #764ba2);
}

.listing-row-body {
	flex: 1;
	min-width: 0;
}

.listing-row-category {
	display: block;
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #667eea;
	font-weight: 700;
	margin-bottom: .2rem;
}

.listing-row-title {
	margin: 0 0 .25rem;
	font-size: 1rem;
	font-weight: 600;
	color: #1a202c;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.listing-row-excerpt {
	margin: 0;
	font-size: .82rem;
	color: #718096;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.listing-row-arrow {
	flex-shrink: 0;
	color: #cbd5e0;
	font-size: 1.1rem;
	transition: color .15s, transform .15s;
}
.listing-row:hover .listing-row-arrow {
	color: #667eea;
	transform: translateX(3px);
}

/* ----------------------------------------------------------
   Pagination
   ---------------------------------------------------------- */
.listings-pagination {
	display: flex;
	align-items: center;
	gap: .35rem;
	margin-top: 1.25rem;
	flex-wrap: wrap;
}

.listings-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	padding: .35rem .6rem;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	background: #fff;
	color: #4a5568;
	font-size: .85rem;
	text-decoration: none;
	transition: border-color .15s, background .15s, color .15s;
}
.listings-page-btn:hover {
	border-color: #667eea;
	color: #667eea;
	text-decoration: none;
}
.listings-page-btn--active {
	background: #667eea;
	border-color: #667eea;
	color: #fff;
	font-weight: 600;
	pointer-events: none;
}

/* ----------------------------------------------------------
   Results layout (search bar + sidebar + main)
   ---------------------------------------------------------- */

/* Reuse the same search bar styles; just add spacing below */
.listings-results-search-wrap { margin-bottom: 1.5rem; }

.listings-results-wrap {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 2rem;
	margin: 1rem 0;
	align-items: start;
}
@media (max-width: 600px) {
	.listings-results-wrap { grid-template-columns: 1fr; }
}

.listings-results-sidebar {
	background: #f7fafc;
	border-radius: 8px;
	padding: 1rem;
}

.listings-cat-list {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}
.listings-cat-option {
	display: flex;
	align-items: center;
	gap: .4rem;
	font-size: .88rem;
	cursor: pointer;
}

.listings-no-results { padding: 2.5rem 1rem; color: #4a5568; }
.listings-no-results h2 { margin-top: 0; }

/* ----------------------------------------------------------
   Submission form
   ---------------------------------------------------------- */
.listings-form-wrap { max-width: 740px; margin: 0 auto; }

.listings-form {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 2rem;
}

.listings-form-field { margin-bottom: 1.2rem; }

.listings-form-field label {
	display: block;
	font-weight: 600;
	font-size: .88rem;
	color: #2d3748;
	margin-bottom: .35rem;
}

.listings-required { color: #e53e3e; margin-left: 2px; }

.listings-form-field input[type="text"],
.listings-form-field input[type="email"],
.listings-form-field input[type="url"],
.listings-form-field input[type="tel"],
.listings-form-field input[type="number"],
.listings-form-field select,
.listings-form-field textarea {
	width: 100%;
	padding: .6rem .75rem;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	font-size: .95rem;
	box-sizing: border-box;
	transition: border-color .2s, box-shadow .2s;
}
.listings-form-field input:focus,
.listings-form-field select:focus,
.listings-form-field textarea:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

.listings-form-field textarea { min-height: 120px; resize: vertical; }

.listings-checkbox-label {
	display: flex;
	align-items: center;
	gap: .4rem;
	font-weight: normal;
	cursor: pointer;
}

.listings-file-wrap .description {
	margin: 0 0 .35rem;
	font-size: .82rem;
	color: #718096;
}

.listings-image-preview {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin-top: .5rem;
}
.listings-image-preview img {
	width: 78px;
	height: 78px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #e2e8f0;
}

.listings-form-submit { margin-top: 1.5rem; }

.listings-submit-btn {
	padding: .7rem 2rem;
	background: #667eea;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	cursor: pointer;
	transition: background .2s;
}
.listings-submit-btn:hover { background: #5a67d8; }

/* Success / empty states */
.listings-success {
	padding: 1.2rem 1.5rem;
	background: #f0fff4;
	border: 1px solid #9ae6b4;
	border-radius: 6px;
	color: #276749;
	font-size: 1rem;
}
.listings-none { color: #718096; font-style: italic; }

/* ----------------------------------------------------------
   Single listing
   ---------------------------------------------------------- */
.listings-single { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }

.listings-single-hero {
	width: 100%;
	height: 280px;
	border-radius: 8px;
	background: #e2e8f0 center/cover no-repeat;
	margin-bottom: 1.5rem;
}

.listings-single-cats { margin-bottom: .75rem; }

.listings-single-cat {
	display: inline-block;
	background: #667eea;
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding: .2rem .6rem;
	border-radius: 999px;
	margin-right: .3rem;
}

.listings-single-title {
	font-size: 1.9rem;
	font-weight: 700;
	color: #1a202c;
	margin: 0 0 1rem;
}

.listings-single-description {
	font-size: 1rem;
	line-height: 1.75;
	color: #4a5568;
	margin-bottom: 1.5rem;
}

.listings-single-meta { margin-bottom: 1.5rem; }

.listings-meta-row {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: .5rem;
	padding: .55rem 0;
	border-bottom: 1px solid #edf2f7;
	font-size: .9rem;
}
.listings-meta-label { font-weight: 600; color: #4a5568; }
.listings-meta-value { color: #2d3748; }
.listings-meta-value a { color: #667eea; }

.listings-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: 1.5rem;
}
.listings-gallery-item img {
	width: 100px;
	height: 100px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.listings-back-link { color: #667eea; text-decoration: none; font-size: .88rem; }
.listings-back-link:hover { text-decoration: underline; }
