/* 1RR Home page sections — tile overlap + Newest Listings + Blog preview.
 * Scoped to .rr-prehero--tiles-over modifier and #rr-newest / #rr-blog-preview
 * so it does not collide with the off-limits core .rr-prehero / .rr-tile rules.
 */

/* ----- Tile-overlap (Realtor.com pattern) -----
 * Taller hero, bigger tile overlap, and a gradient-fade bottom edge that
 * softens the image transition while still terminating in a definite line.
 *
 * We avoid `mask-image` on the section (would fade any pseudo-elements we
 * added for the solid bottom line). Instead:
 *   - Section is taller (min-height 85vh) with extra bottom padding
 *   - An ::after pseudo-element paints a gradient from transparent down to
 *     the page background color, ending in a crisp navy line — this IS the
 *     fade + solid edge
 *   - .rr-prehero-inner is lifted above the fade so headline/search stay legible
 */

.rr-prehero--tiles-over {
	position: relative;
	min-height: 88vh;         /* 25% taller than the default 70vh */
	padding-bottom: 0;        /* no fade zone; tiles overlap via negative margin */
}

/* No fade — the hero image renders to its hard bottom edge. Dropping the
   mask / overlay experiments; re-introduce later if we find a clean approach. */

.rr-prehero--tiles-over + .rr-tiles {
	/* Pull the tiles section UP so tile cards visibly overlap the hero
	   image. Background is transparent so the image shows through the gaps
	   between tile cards — otherwise the section would paint a white band
	   across the photo. Reduced bottom padding so Newest Listings sits
	   closer below. */
	margin-top: -180px;
	padding-top: 0;
	padding-bottom: 1rem;
	background: transparent;
	position: relative;
	z-index: 3;
}

.rr-prehero--tiles-over + .rr-tiles .rr-tile {
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
	/* Body at the TOP of each tile — title/desc first, THEN the icon below. */
	justify-content: flex-start;
	padding-top: 1.25rem; /* no special clearance — the icon is moving to the bottom */
}

/* Move the tile icon from top-left to bottom-left so the title/description
   render ABOVE the icon, not below it. */
.rr-prehero--tiles-over + .rr-tiles .rr-tile-icon {
	top: auto;
	bottom: 1rem;
}

/* Arrow indicator moves to bottom-right so it doesn't crowd the top title. */
.rr-prehero--tiles-over + .rr-tiles .rr-tile-arrow {
	position: absolute;
	bottom: 1rem;
	right: 1rem;
	margin: 0;
}

/* Gradient overlay was darkening the BOTTOM for bottom-aligned text; flip it
   so the TOP is darkest for readability of the repositioned title. */
.rr-prehero--tiles-over + .rr-tiles .rr-tile--photo .rr-tile-overlay {
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.70) 0%,
		rgba(0, 0, 0, 0.35) 45%,
		rgba(0, 0, 0, 0.10) 75%,
		rgba(0, 0, 0, 0) 100%
	);
}

/* Hide the "What can we help you do today?" section heading without touching
   the core .rr-tiles-heading rule. Using `.rr-prehero--tiles-over ~` so the
   hide is scoped to pages that opted into the overlap layout. */
.rr-prehero--tiles-over ~ .rr-tiles .rr-tiles-heading,
.rr-prehero--tiles-over + .rr-tiles .rr-tiles-heading {
	display: none;
}

@media (max-width: 720px) {
	/* Mobile: same mask (it's responsive), but minimal tile overlap so
	   stacked tiles don't get swallowed. */
	.rr-prehero--tiles-over {
		min-height: 70vh;
		padding-bottom: 30px;
	}
	.rr-prehero--tiles-over + .rr-tiles {
		margin-top: -40px;
	}
}

/* ----- Newest Listings ----- */

#rr-newest {
	max-width: 1200px;
	margin: 8px auto 0;
	padding: 0 16px;
}

#rr-newest > h2 {
	margin: 0 0 16px;
	font-size: clamp(1.2rem, 2.2vw, 1.6rem);
	font-weight: 700;
	color: #004274;
}

.rr-newest-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
}

.rr-newest-grid:empty::before {
	content: 'Loading…';
	display: block;
	grid-column: 1 / -1;
	color: #9ca3af;
	font-size: 14px;
	padding: 24px 0;
	text-align: center;
}

.rr-newest-card {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	text-decoration: none;
	color: inherit;
	transition: transform 150ms ease, box-shadow 150ms ease;
}

.rr-newest-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.rr-newest-card-img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: #f3f4f6;
}

.rr-newest-card-body {
	padding: 10px 12px 12px;
}

.rr-newest-card-price {
	font-size: 1.1rem;
	font-weight: 700;
	color: #1a2433;
}

.rr-newest-card-title {
	margin-top: 2px;
	font-size: 13.5px;
	color: #4b5563;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rr-newest-card-specs {
	margin-top: 6px;
	display: flex;
	gap: 10px;
	font-size: 12.5px;
	color: #6b7280;
}

.rr-newest-card-specs span {
	white-space: nowrap;
}

/* ----- Blog preview ----- */

#rr-blog-preview {
	max-width: 1200px;
	margin: 40px auto 0;
	padding: 0 16px;
}

#rr-blog-preview[hidden] { display: none; }

#rr-blog-preview > h2 {
	margin: 0 0 16px;
	font-size: clamp(1.2rem, 2.2vw, 1.6rem);
	font-weight: 700;
	color: #004274;
}

.rr-blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
}

.rr-blog-card {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	text-decoration: none;
	color: inherit;
	transition: transform 150ms ease, box-shadow 150ms ease;
}

.rr-blog-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.rr-blog-card-img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: #e5e7eb;
}

.rr-blog-card-body {
	padding: 12px 14px 14px;
}

.rr-blog-card-date {
	font-size: 12px;
	color: #6b7280;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.rr-blog-card-title {
	margin-top: 4px;
	font-size: 1.05rem;
	font-weight: 600;
	color: #1a2433;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rr-blog-card-excerpt {
	margin-top: 6px;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
