/*
 * Perepaik Theme — places directory (/kohad/).
 */

.pp-directory {
	width: 100%;
	max-width: calc(var(--pp-container) + 2 * var(--pp-gutter));
	margin: 0 auto;
	padding: 24px var(--pp-gutter) 0;
}

/* ---------------------------------------------------------
   Header: title, count, sorting, filters toggle
   --------------------------------------------------------- */

.pp-directory__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: 28px;
}

.pp-directory__title {
	margin: 0;
	color: var(--pp-ink);
	font-family: var(--pp-font-body);
	font-size: clamp(32px, 3.4vw, 44px);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.pp-directory__count {
	margin: 6px 0 0;
	color: var(--pp-ink-soft);
	font-size: 15px;
}

.pp-directory__tools {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pp-select {
	position: relative;
	display: block;
}

.pp-select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 18px;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 1.8px solid var(--pp-ink-soft);
	border-bottom: 1.8px solid var(--pp-ink-soft);
	transform: rotate(45deg);
	pointer-events: none;
}

.pp-select select,
.pp-filter-toggle {
	height: 46px;
	border: 1px solid var(--pp-line);
	border-radius: 999px;
	background: var(--pp-surface);
	box-shadow: var(--pp-shadow-sm);
	color: var(--pp-ink);
	font-family: var(--pp-font-body);
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}

.pp-select select {
	min-width: 220px;
	padding: 0 44px 0 18px;
	appearance: none;
	-webkit-appearance: none;
}

.pp-filter-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 0 22px 0 18px;
}

.pp-filter-toggle .pp-icon {
	font-size: 22px;
}

.pp-filter-toggle.is-active,
.pp-filter-toggle[aria-expanded="true"] {
	border-color: var(--pp-purple);
	color: #5d46a0;
}

/* ---------------------------------------------------------
   Search
   --------------------------------------------------------- */

.pp-search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 8px 8px 8px 24px;
	background: var(--pp-surface);
	border-radius: 999px;
	box-shadow: 0 6px 24px rgba(90, 64, 40, 0.06);
}

.pp-search:focus-within {
	box-shadow: 0 0 0 3px var(--pp-purple-soft), 0 6px 24px rgba(90, 64, 40, 0.06);
}

.pp-search__icon {
	color: var(--pp-ink-soft);
	font-size: 22px;
}

.pp-search__input {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: var(--pp-ink);
	font-family: var(--pp-font-body);
	font-size: 16px;
	outline: none;
}

.pp-search__input::placeholder {
	color: var(--pp-ink-soft);
	opacity: 1;
}

.pp-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

.pp-search__submit {
	height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: #6f55a8;
	color: #fff;
	font-family: var(--pp-font-body);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 160ms ease;
}

.pp-search__submit:hover,
.pp-search__submit:focus-visible {
	background: #5d46a0;
}

/* ---------------------------------------------------------
   Filter panel
   --------------------------------------------------------- */

.pp-directory__filters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	align-items: end;
	gap: 16px;
	margin-top: 16px;
	padding: 20px;
	background: var(--pp-surface);
	border: 1px solid var(--pp-line);
	border-radius: var(--pp-radius-lg);
}

.pp-directory__filters[hidden] {
	display: none;
}

.pp-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pp-field__label {
	color: var(--pp-ink-soft);
	font-size: 13px;
	font-weight: 600;
}

.pp-field select {
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--pp-line);
	border-radius: var(--pp-radius-sm);
	background: var(--pp-bg);
	color: var(--pp-ink);
	font-family: var(--pp-font-body);
	font-size: 15px;
}

.pp-directory__filter-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.pp-directory__filter-actions .pp-button {
	min-height: 46px;
}

.pp-directory__reset {
	color: var(--pp-ink-soft);
	font-size: 14px;
	white-space: nowrap;
}

/* ---------------------------------------------------------
   Category chips
   --------------------------------------------------------- */

.pp-chips {
	margin: 28px 0 32px;
}

.pp-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pp-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	background: var(--pp-surface);
	border: 1px solid #ebe2d8;
	border-radius: 999px;
	color: var(--pp-ink);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.pp-chip:hover,
.pp-chip:focus-visible {
	border-color: #d9cbbd;
}

.pp-chip.is-active {
	background: var(--pp-purple-soft);
	border-color: var(--pp-purple);
	color: #4f3a8f;
}

.pp-chip__emoji {
	font-size: 16px;
	line-height: 1;
}

/* ---------------------------------------------------------
   Grid + full Place Card
   --------------------------------------------------------- */

.pp-place-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.pp-place-card--full {
	border: 0;
	border-radius: 28px;
	box-shadow: 0 4px 22px rgba(90, 64, 40, 0.06);
}

.pp-place-card--full:hover,
.pp-place-card--full:focus-within {
	box-shadow: 0 16px 40px rgba(90, 64, 40, 0.12);
	transform: translateY(-3px);
}

.pp-place-card--full .pp-place-card__media {
	aspect-ratio: 4 / 3;
}

.pp-place-card--full .pp-fav-toggle {
	top: 14px;
	right: 14px;
	width: 44px;
	height: 44px;
	font-size: 22px;
}

.pp-place-card--full .pp-place-card__body {
	padding: 20px 20px 18px;
}

.pp-place-card__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.pp-place-card--full .pp-place-card__title {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
}

.pp-place-card__price {
	flex: none;
	color: var(--pp-ink-soft);
	font-size: 16px;
	font-weight: 500;
	white-space: nowrap;
}

.pp-place-card__description {
	display: -webkit-box;
	margin: 10px 0 0;
	overflow: hidden;
	color: var(--pp-ink-soft);
	font-size: 16px;
	line-height: 1.5;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.pp-place-card__details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 12px 0 0;
	color: var(--pp-ink-soft);
	font-size: 14px;
}

.pp-place-card__details > span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.pp-place-card__details > span + span::before {
	content: "·";
	margin: 0 9px;
	color: var(--pp-muted);
}

.pp-place-card__region .pp-icon {
	font-size: 17px;
}

.pp-place-card__footer {
	display: flex;
	flex-wrap: wrap; /* Narrow cards: the button moves under the opening status. */
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 26px;
}

.pp-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	font-weight: 600;
}

.pp-status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.pp-status--open {
	color: #1f9254;
}

.pp-status--closed {
	color: var(--pp-coral-strong);
}

.pp-status:has(.pp-status__detail) {
	flex-wrap: wrap;
	row-gap: 1px;
	white-space: nowrap;
	line-height: 1.3;
}

.pp-status__detail {
	flex-basis: 100%;
	padding-left: 15px;
	font-size: 13px;
	font-weight: 500;
	color: var(--pp-muted);
}

.pp-place-card__more {
	margin-left: auto;
	padding: 7px 14px;
	border-radius: 999px;
	background: #f2ece4;
	color: var(--pp-ink);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color 160ms ease;
}

.pp-place-card--full:hover .pp-place-card__more {
	background: var(--pp-coral-soft);
}

/* ---------------------------------------------------------
   Pagination + empty state
   --------------------------------------------------------- */

.pp-pagination {
	margin-top: 40px;
}

.pp-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--pp-surface);
	box-shadow: var(--pp-shadow-sm);
	color: var(--pp-ink);
	font-weight: 600;
	text-decoration: none;
}

.pp-pagination .page-numbers.current {
	background: var(--pp-coral);
	color: #fff;
}

.pp-empty {
	padding: 56px 24px;
	background: var(--pp-surface);
	border-radius: 28px;
	text-align: center;
}

.pp-empty__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
}

.pp-empty__text {
	margin: 8px 0 22px;
	color: var(--pp-ink-soft);
}

/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 1080px) {
	.pp-place-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pp-directory__filters {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.pp-directory__filter-actions {
		grid-column: 1 / -1;
	}
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 767px) {
	.pp-directory {
		padding-top: 12px;
	}

	.pp-directory__header {
		align-items: flex-start;
		flex-direction: column;
		margin-bottom: 18px;
	}

	.pp-directory__count {
		font-size: 14px;
	}

	.pp-directory__tools {
		width: 100%;
	}

	.pp-select {
		flex: 1;
	}

	.pp-select select {
		width: 100%;
		min-width: 0;
		height: 44px;
		font-size: 14px;
	}

	.pp-filter-toggle {
		height: 44px;
		font-size: 14px;
	}

	.pp-search {
		min-height: 56px;
		padding: 6px 6px 6px 18px;
		gap: 8px;
	}

	.pp-search__input {
		font-size: 15px;
	}

	.pp-search__submit {
		height: 44px;
		padding: 0 18px;
		font-size: 15px;
	}

	.pp-directory__filters {
		grid-template-columns: minmax(0, 1fr);
		padding: 16px;
	}

	.pp-directory__filter-actions .pp-button {
		flex: 1;
	}

	/* One swipeable row of chips. */
	.pp-chips {
		margin: 18px calc(-1 * var(--pp-gutter)) 22px;
	}

	.pp-chips__list {
		flex-wrap: nowrap;
		gap: 8px;
		padding: 0 var(--pp-gutter) 4px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.pp-chips__list::-webkit-scrollbar {
		display: none;
	}

	.pp-chip {
		min-height: 38px;
		padding: 0 14px;
		font-size: 14px;
	}

	.pp-place-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	.pp-place-card--full {
		border-radius: 22px;
	}

	.pp-place-card--full .pp-place-card__media {
		aspect-ratio: 16 / 10;
	}

	.pp-place-card--full .pp-fav-toggle {
		width: 40px;
		height: 40px;
		font-size: 20px;
	}

	.pp-place-card--full .pp-place-card__body {
		padding: 16px 16px 16px;
	}

	.pp-place-card--full .pp-place-card__title {
		font-size: 18px;
	}

	.pp-place-card__description {
		font-size: 15px;
	}

	.pp-place-card__footer {
		padding-top: 18px;
	}
}

/* ---------------------------------------------------------
   Active filters (incl. the finder's free-text request)
   --------------------------------------------------------- */

.pp-active-filters {
	margin: 0 0 26px;
}

.pp-active-filters__query {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 12px;
	color: var(--pp-ink-soft);
	font-size: 15px;
}

.pp-active-filters__query strong {
	color: var(--pp-ink);
}

.pp-active-filters__icon {
	flex: none;
	margin-top: 1px;
	color: var(--pp-purple);
	font-size: 20px;
}

.pp-active-filters__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pp-active-filter {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 0 12px 0 16px;
	background: var(--pp-purple-soft);
	border-radius: 999px;
	color: #4f3a8f;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.pp-active-filter:hover {
	background: #e2daf5;
}

.pp-active-filter__remove {
	font-size: 18px;
	line-height: 1;
	opacity: 0.7;
}

.pp-active-filters__reset {
	margin-left: 4px;
	color: var(--pp-ink-soft);
	font-size: 14px;
}

.pp-active-filters__more {
	margin: 12px 0 0;
	font-size: 15px;
}

.pp-active-filters__more a {
	color: #6f55a8;
	font-weight: 600;
}

/* ---------------------------------------------------------
   Region / category pages (taxonomy.php)
   --------------------------------------------------------- */

.pp-term {
	padding-bottom: 56px;
}

.pp-term__crumb {
	margin: 0 0 6px;
	font-size: 15px;
}

.pp-term__crumb a {
	color: var(--pp-ink-soft);
}

.pp-term__intro {
	max-width: 640px;
	margin: 10px 0 0;
	color: var(--pp-ink-soft);
	font-size: 17px;
	line-height: 1.5;
}

.pp-term__children {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 32px;
}

.pp-term__section + .pp-term__section {
	margin-top: 48px;
}

.pp-term__section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.pp-term__section-title {
	margin: 0;
	color: var(--pp-ink);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.pp-term__more {
	color: var(--pp-ink);
	font-weight: 600;
	white-space: nowrap;
}
