/**
 * Jones Listings — single page (Jackie Jones style)
 */

.jj-single {
	--jj-ink: #1a1a1a;
	--jj-muted: #6b6b6b;
	--jj-line: #e6e6e6;
	--jj-soft: #f5f5f5;
	--jj-white: #ffffff;
	--jj-red: #e10600;
	--jj-red-dark: #b80500;
	--jj-red-soft: #fff1f0;
	--jj-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--jj-max: 1180px;
	font-family: var(--jj-font);
	color: var(--jj-ink);
	background: var(--jj-white);
	padding: 28px 0 0;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
	box-sizing: border-box;
}

.jj-single *,
.jj-single *::before,
.jj-single *::after {
	box-sizing: border-box;
}

.jj-single__container {
	max-width: var(--jj-max);
	width: 100%;
	margin: 0 auto;
	padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}

.jj-single__layout,
.jj-single__main,
.jj-single__sidebar {
	min-width: 0;
	max-width: 100%;
}

/* Intro */
.jj-single__intro {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.jj-single__address {
	margin: 0;
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--jj-ink);
}

.jj-single__address-sub {
	margin: 6px 0 0;
	font-size: 15px;
	color: var(--jj-muted);
}

.jj-single__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.jj-single__share {
	display: flex;
	gap: 6px;
}

.jj-single__icon-btn {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--jj-line);
	border-radius: 50%;
	background: var(--jj-white);
	color: var(--jj-red);
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.jj-single__icon-btn:hover {
	background: var(--jj-red-soft);
	border-color: var(--jj-red);
	color: var(--jj-red);
}

.jj-single__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 18px;
	border-radius: 4px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.jj-single__btn--primary {
	background: var(--jj-red);
	color: #fff;
}

.jj-single__btn--primary:hover {
	background: var(--jj-red-dark);
	color: #fff;
}

.jj-single__btn--block {
	width: 100%;
}

/* Layout */
.jj-single__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 36px;
	align-items: start;
}

.jj-single__sidebar {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* Gallery styles live in gallery.css (loaded after theme). */

/* Summary */
.jj-single__summary {
	margin-bottom: 18px;
}

.jj-single__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.jj-single__badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--jj-soft);
	color: #555;
	font-size: 12px;
	font-weight: 600;
}

.jj-single__price {
	margin: 0;
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 800;
	line-height: 1.1;
	color: var(--jj-red);
	letter-spacing: -0.02em;
}

.jj-single__lease {
	margin: 6px 0 0;
	font-size: 15px;
	color: var(--jj-muted);
	font-weight: 600;
}

/* Description */
.jj-single__prose {
	font-size: 15px;
	line-height: 1.7;
	color: #333;
	margin-bottom: 20px;
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

.jj-single__prose img,
.jj-single__prose iframe,
.jj-single__prose table {
	max-width: 100%;
}

/* Quick actions */
.jj-single__quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 28px;
}

.jj-single__outline-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 16px;
	border: 1.5px solid var(--jj-red);
	border-radius: 4px;
	color: var(--jj-red);
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	background: #fff;
	transition: background 0.15s ease, color 0.15s ease;
}

.jj-single__outline-btn:hover {
	background: var(--jj-red);
	color: #fff;
}

.jj-single__outline-btn-icon {
	font-size: 12px;
}

/* Sections / facts / rooms */
.jj-single__section {
	margin-bottom: 32px;
}

.jj-single__heading {
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--jj-red);
	font-size: 18px;
	font-weight: 750;
	color: var(--jj-ink);
	letter-spacing: -0.01em;
}

.jj-facts {
	margin: 0;
	padding: 0;
	border: 1px solid var(--jj-line);
	border-radius: 6px;
	overflow: hidden;
	background: var(--jj-white);
}

.jj-facts__row {
	display: grid;
	grid-template-columns: minmax(140px, 34%) 1fr;
	gap: 0;
	margin: 0;
	border-bottom: 1px solid var(--jj-line);
}

.jj-facts__row:last-child {
	border-bottom: 0;
}

.jj-facts__row:nth-child(odd) {
	background: #fafafa;
}

.jj-facts__label,
.jj-facts__value {
	margin: 0;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.45;
}

.jj-facts__label {
	font-weight: 700;
	color: #444;
	border-right: 1px solid var(--jj-line);
}

.jj-facts__value {
	color: #222;
	font-weight: 500;
}

.jj-facts__tags {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.jj-facts__tag {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--jj-soft);
	border: 1px solid var(--jj-line);
	font-size: 12px;
	font-weight: 650;
	color: #444;
	line-height: 1.3;
}

/* Rooms grid (avoids theme table styles) */
.jj-rooms {
	border: 1px solid var(--jj-line);
	border-radius: 6px;
	overflow: hidden;
	background: var(--jj-white);
}

.jj-rooms__head,
.jj-rooms__row {
	display: grid;
	grid-template-columns: 1.1fr 1.2fr 1fr 1fr 1.2fr;
	gap: 0;
}

.jj-rooms__head {
	background: var(--jj-soft);
	border-bottom: 2px solid var(--jj-red);
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #555;
}

.jj-rooms__head span,
.jj-rooms__cell {
	padding: 12px 14px;
	border-right: 1px solid var(--jj-line);
}

.jj-rooms__head span:last-child,
.jj-rooms__cell:last-child {
	border-right: 0;
}

.jj-rooms__row {
	border-bottom: 1px solid var(--jj-line);
	font-size: 14px;
	color: #222;
}

.jj-rooms__row:last-child {
	border-bottom: 0;
}

.jj-rooms__row:nth-child(even) {
	background: #fafafa;
}

.jj-rooms__cell {
	display: flex;
	align-items: center;
	min-height: 44px;
}

@media (max-width: 720px) {
	.jj-facts__row {
		grid-template-columns: 1fr;
	}

	.jj-facts__label {
		border-right: 0;
		border-bottom: 1px dashed var(--jj-line);
		padding-bottom: 6px;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: var(--jj-muted);
	}

	.jj-facts__value {
		padding-top: 8px;
	}

	.jj-rooms__head {
		display: none;
	}

	.jj-rooms__row {
		grid-template-columns: 1fr;
		padding: 8px 0;
	}

	.jj-rooms__row:nth-child(even) {
		background: #fff;
	}

	.jj-rooms__cell {
		border-right: 0;
		border-bottom: 1px solid var(--jj-line);
		justify-content: space-between;
		gap: 12px;
		min-height: 0;
		padding: 10px 14px;
	}

	.jj-rooms__cell:last-child {
		border-bottom: 0;
	}

	.jj-rooms__cell::before {
		content: attr(data-label);
		font-size: 12px;
		font-weight: 700;
		color: var(--jj-muted);
		text-transform: uppercase;
		letter-spacing: 0.03em;
	}

	.jj-rooms__row + .jj-rooms__row {
		border-top: 2px solid var(--jj-line);
	}
}

/* Legacy table hooks (if any remain) */
.jj-single__table-wrap {
	overflow-x: auto;
}

.jj-single__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.jj-single__table th,
.jj-single__table td {
	padding: 11px 0;
	border-bottom: 1px solid var(--jj-line);
	text-align: left;
	vertical-align: top;
}

.jj-single__table th {
	width: 40%;
	font-weight: 700;
	color: #444;
	padding-right: 16px;
}

.jj-single__table td {
	color: #333;
}

.jj-single__table--rooms thead th {
	background: transparent;
	color: var(--jj-ink);
	border-bottom: 2px solid var(--jj-red);
	font-weight: 700;
	padding-right: 12px;
	white-space: nowrap;
}

.jj-single__table--rooms tbody td {
	padding-right: 12px;
}

/* Schedule */
.jj-single__schedule {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jj-single__schedule li {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--jj-line);
	font-size: 14px;
}

.jj-single__schedule a {
	color: var(--jj-red);
	font-weight: 700;
}

/* Map */
.jj-single__map-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: var(--jj-soft);
	border: 1px solid var(--jj-line);
	overflow: hidden;
}

.jj-single__map-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Sidebar cards */
.jj-single__card {
	background: var(--jj-white);
	border: 1px solid var(--jj-line);
	border-radius: 6px;
	padding: 20px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.jj-single__card-title {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 750;
}

.jj-single__card-sub {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--jj-muted);
}

.jj-single__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.jj-single__form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.jj-single__label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: #444;
}

.jj-single__label input,
.jj-single__label textarea {
	width: 100%;
	border: 1px solid var(--jj-line);
	border-radius: 4px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	color: var(--jj-ink);
	background: #fff;
	box-shadow: none;
}

.jj-single__label input:focus,
.jj-single__label textarea:focus {
	outline: none;
	border-color: var(--jj-red);
	box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.12);
}

.jj-single__notice {
	padding: 10px 12px;
	border-radius: 4px;
	font-size: 13px;
	margin: 0 0 12px;
}

.jj-single__notice--ok {
	background: #ecfdf3;
	color: #067647;
}

.jj-single__notice--err {
	background: var(--jj-red-soft);
	color: var(--jj-red-dark);
}

.jj-single__agent {
	display: flex;
	gap: 14px;
	align-items: center;
}

.jj-single__agent + .jj-single__agent {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--jj-line);
}

.jj-single__agent-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--jj-red), #7a0a0a);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 22px;
	font-weight: 700;
	flex-shrink: 0;
}

.jj-single__agent-name {
	margin: 0 0 2px;
	font-size: 16px;
	font-weight: 750;
}

.jj-single__agent-pos,
.jj-single__agent-office {
	margin: 0;
	font-size: 13px;
	color: var(--jj-muted);
	line-height: 1.4;
}

/* Footer */
.jj-single__footer {
	margin-top: 28px;
	padding: 18px 0 40px;
	border-top: 1px solid var(--jj-line);
	font-size: 12px;
	color: var(--jj-muted);
}

.jj-single__disclaimer {
	margin: 0 0 12px;
	line-height: 1.5;
}

.jj-single__meta-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jj-single__meta-list li {
	margin: 0 0 4px;
}

.jj-single__meta-list strong {
	color: #444;
}

@media (max-width: 980px) {
	.jj-single {
		padding-top: 20px;
	}

	.jj-single__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	/* Keep gallery + details first; contact/agents after on tablet/mobile. */
	.jj-single__sidebar {
		position: static;
		order: 2;
	}

	.jj-single__main {
		order: 1;
	}
}

@media (max-width: 720px) {
	.jj-single {
		padding-top: 16px;
	}

	.jj-single__container {
		padding-left: max(14px, env(safe-area-inset-left, 0px));
		padding-right: max(14px, env(safe-area-inset-right, 0px));
	}

	.jj-single__intro {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		margin-bottom: 16px;
	}

	.jj-single__address {
		font-size: clamp(20px, 6vw, 26px);
		word-break: break-word;
	}

	.jj-single__address-sub {
		font-size: 14px;
	}

	.jj-single__actions {
		width: 100%;
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 10px;
	}

	.jj-single__actions .jj-single__btn {
		flex: 1 1 auto;
		min-width: 140px;
	}

	.jj-single__price {
		font-size: clamp(24px, 8vw, 34px);
	}

	.jj-single__quick-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		margin-bottom: 22px;
	}

	.jj-single__outline-btn {
		width: 100%;
		justify-content: center;
	}

	.jj-single__section {
		margin-bottom: 24px;
	}

	.jj-single__heading {
		font-size: 16px;
	}

	.jj-single__form-row {
		grid-template-columns: 1fr;
	}

	.jj-single__card {
		padding: 16px;
	}

	.jj-single__agent {
		align-items: flex-start;
	}

	.jj-single__map-frame {
		aspect-ratio: 4 / 3;
	}

	.jj-single__schedule li {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.jj-single__footer {
		padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 480px) {
	.jj-single__share {
		width: 100%;
		justify-content: flex-start;
	}

	.jj-single__actions .jj-single__btn {
		width: 100%;
		min-width: 0;
	}

	.jj-facts__label,
	.jj-facts__value {
		padding-left: 12px;
		padding-right: 12px;
	}
}

@media print {
	.jj-single__sidebar,
	.jj-single__actions,
	.jj-single__nav,
	.jj-single__photos-meta,
	.jj-single__lightbox,
	.jj-single__quick-actions {
		display: none !important;
	}

	.jj-single__layout {
		grid-template-columns: 1fr;
	}
}
