/* ==========================================================================
   Happy Properties — Modern property page styles
   Loaded after style.css; overrides legacy property layout patterns.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Property Grid — archive & taxonomy card layout
   -------------------------------------------------------------------------- */
.property-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	padding: 0 1.5rem;
	max-width: 1400px;
	margin: 0 auto 3rem;
}

/* --------------------------------------------------------------------------
   Property Card — used in archive & taxonomy grids
   -------------------------------------------------------------------------- */
.property-card {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.property-card a {
	display: block;
	text-decoration: none;
	color: inherit;
}

.property-card__image {
	aspect-ratio: 16 / 9;
	width: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.property-card:hover .property-card__image {
	transform: scale(1.05);
}

.property-card__title {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	margin: 0;
	padding: 1.25rem 1rem;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
	color: #fff;
	font-family: 'Raleway', sans-serif;
	font-weight: 800;
	font-size: 1.35rem;
	line-height: 1.3;
	text-transform: uppercase;
	text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Property Details Bar — price / location / acreage row
   -------------------------------------------------------------------------- */
.property-details-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	margin: 1.5rem 0;
	padding: 0;
}

.property-details-bar .prop-details {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4em;
	border-bottom: 2px solid #66b3ed;
	padding-bottom: 0.4em;
}

.property-details-bar .prop-details .label {
	font-weight: 300;
	font-style: italic;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-size: 0.85em;
}

.property-details-bar .prop-details .label + span {
	font-weight: 800;
	font-size: 1.35em;
}

.property-details-bar .prop-details .label + span a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: #66b3ed;
	text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Property Content Wrap — two-column layout (content + sidebar)
   -------------------------------------------------------------------------- */
.property-content-wrap {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 2rem;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.property-content-wrap .property-main {
	min-width: 0; /* prevent grid blowout */
}

.property-content-wrap .property-main .details {
	font-size: 1.25rem;
	line-height: 1.6;
	float: none;
	width: 100%;
	padding-right: 0;
}

/* --------------------------------------------------------------------------
   Property Gallery Grid — thumbnail grid with lightbox links
   -------------------------------------------------------------------------- */
.property-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 0.75rem;
	margin-top: 2rem;
	margin-bottom:2em;
}

.property-gallery-grid a {
	display: block;
	overflow: hidden;
	border-radius: 4px;
}

.property-gallery-grid img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
	cursor: pointer;
}

.property-gallery-grid a:hover img {
	transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   Property Sidebar — sticky agent contact
   -------------------------------------------------------------------------- */
.property-sidebar {
	position: relative;
}

.property-sidebar .contact {
	position: sticky;
	top: 100px;
	color: #fff;
	padding: 1.5em;
	box-sizing: border-box;
	border-radius: 8px;
	background: linear-gradient(120deg, #4672d7 1%, #66b3ed 70%);
	float: none;
	width: 100%;
	margin-top: 0;
}

.property-sidebar .contact .listing_agent {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.property-sidebar .contact .listing_agent div {
	font-style: italic;
	text-transform: uppercase;
}

.property-sidebar .contact .listing_agent div p {
	margin: 0;
}

.property-sidebar .contact .listing_agent div .agent_name {
	font-weight: bold;
	font-size: 1.5em;
	margin-bottom: 1em;
	font-style: normal;
	font-family: 'Raleway', sans-serif;
}

.property-sidebar .contact .listing_agent img {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	border: 5px solid #fff;
	object-fit: cover;
	flex-shrink: 0;
}

.property-sidebar .contact .interested {
	text-align: center;
	margin-bottom: 0;
}

.property-sidebar .contact .contact_us {
	margin-top: 0;
	text-align: center;
	font-weight: bold;
	text-transform: uppercase;
	font-family: 'Raleway', sans-serif;
}

.property-sidebar .contact input,
.property-sidebar .contact textarea {
	color: #000;
}

.property-sidebar .contact input[type="submit"] {
	background: #fff;
	color: #000;
	transition: background 0.2s, color 0.2s;
}

.property-sidebar .contact input[type="submit"]:hover {
	background: #000;
	color: #fff;
}

.property-sidebar .contact .gform_confirmation_message {
	margin: 5em 0;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Page banner offset — constrain to gutters on property pages
   -------------------------------------------------------------------------- */
.tax-type #page-banner-offset,
.post-type-archive-properties #page-banner-offset {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 1.5rem;
	box-sizing: border-box;
}

.loaded.tax-type #page-banner-offset h1,
.loaded.post-type-archive-properties #page-banner-offset h1 {
	margin-left: 0;
}

@media screen and (max-width: 768px) {
	.tax-type #page-banner-offset,
	.post-type-archive-properties #page-banner-offset {
		padding: 0 1rem;
	}
}

/* --------------------------------------------------------------------------
   Archive / Taxonomy section headings
   -------------------------------------------------------------------------- */
.property-section-heading {
	max-width: 1400px;
	margin: 2.5rem auto 1rem;
	padding: 0 1.5rem;
	font-family: 'Raleway', sans-serif;
	font-weight: 800;
	font-size: 1.75rem;
	text-transform: uppercase;
}

.property-archive-intro {
	max-width: 1400px;
	margin: 0 auto 2rem;
	padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Overrides for legacy styles
   -------------------------------------------------------------------------- */

/* Override old rotated row layout */
.tax-type #primary.properties {
	max-width: 1400px;
	margin: 2rem auto;
	padding: 0;
}

/* Override old footer margin hack on taxonomy pages */
.tax-type #site-footer {
	padding-top: 0;
	margin-top: 0;
}

/* Override old single property float layout */
.property.single .details {
	float: none;
	width: 100%;
	padding-right: 0;
}

.property.single .contact {
	float: none;
	width: 100%;
}

.property.single .addtl_images {
	clear: none;
}

/* Back button row */
.property-back-row {
	max-width: 1400px;
	margin: 1rem auto;
	padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Agents archive — modern card layout
   -------------------------------------------------------------------------- */

/* Constrain heading to gutters */
.post-type-archive-agents #page-banner-offset {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 1.5rem;
	box-sizing: border-box;
}

.loaded.post-type-archive-agents #page-banner-offset h1 {
	margin-left: 0;
}

/* Override old slanted full-width layout */
#primary.agents {
	max-width: 1400px;
	margin: 2rem auto;
	padding: 0 1.5rem;
}

.agents-grid {
	display: flex;
	flex-direction: column;
	gap: 3rem;
}

/* Override old agent-loop slant */
.agent-card {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 2rem;
	align-items: start;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	padding: 2rem;
}

.agent-card:nth-child(2n) {
	background: linear-gradient(120deg, #4672d7 1%, #66b3ed 70%);
	color: #fff;
}

.agent-card:nth-child(2n) a {
	color: #fff;
}

.agent-card:nth-child(2n) a:hover {
	color: #000;
}

.agent-card:nth-child(2n) hr {
	border-color: rgba(255, 255, 255, 0.4);
}

.agent-card__image-wrap {
	background-size: cover;
	background-position: center;
	border-radius: 8px;
	overflow: hidden;
}

.agent-card__photo {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
	transition: opacity 0.3s ease;
}

.agent-card__photo.hasbg:hover {
	opacity: 0;
}

.agent-card__name {
	margin-top: 0;
	text-transform: uppercase;
	font-family: 'Raleway', sans-serif;
	font-weight: 800;
}

.agent-card hr {
	margin: 1em 0;
	border: none;
	border-top: 1px solid #66b3ed;
	max-width: 200px;
}

.agent-card__contact a {
	margin-right: 0.75em;
	font-size: 1.2em;
}

.agent-card__info a {
	color: #66b3ed;
}

.agent-card__info a:hover {
	color: #000;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media screen and (max-width: 1023px) {
	.property-content-wrap {
		grid-template-columns: 1fr;
	}

	.property-sidebar .contact {
		position: static;
	}

	.property-sidebar .contact .listing_agent img {
		width: 120px;
		height: 120px;
	}

	.property-details-bar .prop-details {
		border-bottom: none;
		flex-basis: 100%;
	}
}

@media screen and (max-width: 768px) {
	.property-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
		padding: 0 1rem;
	}

	.property-gallery-grid {
		grid-template-columns: 1fr 1fr;
	}

	.property-content-wrap {
		padding: 0 1rem;
	}

	.property-section-heading {
		padding: 0 1rem;
	}

	.agent-card {
		grid-template-columns: 1fr;
		text-align: center;
		padding: 1.5rem;
	}

	.agent-card__image-wrap {
		max-width: 240px;
		margin: 0 auto;
	}

	.agent-card__name {
		text-align: center;
	}

	.agent-card hr {
		margin: 1em auto;
	}

	#primary.agents {
		padding: 0 1rem;
	}

	.post-type-archive-agents #page-banner-offset {
		padding: 0 1rem;
	}
}

@media screen and (max-width: 480px) {
	.property-gallery-grid {
		grid-template-columns: 1fr;
	}

	.property-card__title {
		font-size: 1.1rem;
	}

	.property-details-bar .prop-details .label + span {
		font-size: 1.1em;
	}
}
