/**
 * Realty Theme - Main Stylesheet
 *
 * Handles layout and component styles not covered by theme.json.
 * Organized by section for easy navigation during iteration.
 *
 * @package RealtyTheme
 * @since   1.0.0
 */

/* ==========================================================================
   SECTION: CSS Custom Properties
   Handles: Theme-level variables extending theme.json tokens
   ========================================================================== */

:root {
	--realty-header-height: 72px;
	--realty-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	--realty-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
	--realty-transition: 250ms ease;
}

/* ==========================================================================
   SECTION: Base / Reset Additions
   Handles: Minimal resets not covered by WordPress defaults
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ==========================================================================
   SECTION: Site Header
   Handles: Header layout, logo, navigation
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   SECTION: Hero Section
   Handles: Homepage cover hero styling
   ========================================================================== */

.hero-section .wp-block-cover__inner-container {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
}

/* ==========================================================================
   SECTION: Property Card (Archive Grid)
   Handles: Card component used in property archives and featured grid
   ========================================================================== */

.property-card {
	background: var(--wp--preset--color--white);
	border-radius: var(--wp--custom--border-radius--medium);
	overflow: hidden;
	box-shadow: var(--realty-card-shadow);
	transition: box-shadow var(--realty-transition), transform var(--realty-transition);
}

.property-card:hover {
	box-shadow: var(--realty-card-shadow-hover);
	transform: translateY(-2px);
}

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

.property-card__image {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--wp--preset--color--light);
}

.property-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--realty-transition);
}

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

.property-card__placeholder {
	width: 100%;
	height: 100%;
	background: var(--wp--preset--color--light);
}

.property-card__type {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-size: 0.7rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: var(--wp--custom--border-radius--small);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.property-card__status {
	position: absolute;
	top: 12px;
	right: 12px;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: var(--wp--custom--border-radius--small);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.property-card__status--sold,
.property-card__status--let {
	background: #dc2626;
	color: #fff;
}

.property-card__status--under-offer {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--dark);
}

.property-card__body {
	padding: 16px 20px 20px;
}

.property-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 4px;
	color: var(--wp--preset--color--dark);
	line-height: 1.3;
}

.property-card__parish {
	font-size: 0.8rem;
	color: var(--wp--preset--color--muted);
	margin: 0 0 8px;
}

.property-card__price {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	margin: 0 0 12px;
}

.property-card__stats {
	display: flex;
	gap: 16px;
	font-size: 0.8rem;
	color: var(--wp--preset--color--muted);
}

.property-card__stat {
	white-space: nowrap;
}

/* ==========================================================================
   SECTION: Property Archive
   Handles: Archive page layout — header, map, grid, pagination
   ========================================================================== */

.property-archive-header {
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30);
}

.property-archive-header__inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
}

.property-archive-header__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 600;
	margin: 0;
}

.property-archive-header__desc {
	margin: 8px 0 0;
	opacity: 0.8;
}

.property-archive-map__container {
	width: 100%;
	background: var(--wp--preset--color--light);
}

.property-archive-grid__inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30);
}

.property-archive-grid__count {
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
	margin-bottom: var(--wp--preset--spacing--40);
}

.property-archive-grid__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

.property-archive-grid__pagination {
	margin-top: var(--wp--preset--spacing--50);
	text-align: center;
}

.property-archive-grid__pagination .page-numbers {
	display: inline-flex;
	list-style: none;
	gap: 4px;
	padding: 0;
	margin: 0;
}

.property-archive-grid__pagination .page-numbers li a,
.property-archive-grid__pagination .page-numbers li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: var(--wp--custom--border-radius--small);
	font-size: 0.875rem;
	text-decoration: none;
	color: var(--wp--preset--color--dark);
	background: var(--wp--preset--color--light);
	transition: background var(--realty-transition), color var(--realty-transition);
}

.property-archive-grid__pagination .page-numbers li a:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.property-archive-grid__pagination .page-numbers li .current {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.property-archive-grid__empty {
	text-align: center;
	padding: var(--wp--preset--spacing--70) 0;
	color: var(--wp--preset--color--muted);
}

/* ==========================================================================
   SECTION: Single Property - Hero
   Handles: Full-width property hero, gallery strip, info bar
   ========================================================================== */

.property-hero__image {
	position: relative;
	width: 100%;
	max-height: 560px;
	overflow: hidden;
	background: var(--wp--preset--color--light);
}

.property-hero__img {
	width: 100%;
	height: 560px;
	object-fit: cover;
}

.property-hero__badge {
	position: absolute;
	top: 20px;
	right: 20px;
	padding: 6px 16px;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: var(--wp--custom--border-radius--small);
}

.property-hero__badge--sold,
.property-hero__badge--let {
	background: #dc2626;
	color: #fff;
}

.property-hero__badge--under-offer {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--dark);
}

/* Gallery thumbnail strip */
.property-hero__gallery-strip {
	display: flex;
	gap: 8px;
	padding: 12px var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--dark);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.property-hero__thumb {
	flex-shrink: 0;
	width: 80px;
	height: 56px;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	padding: 0;
	background: none;
	opacity: 0.6;
	transition: opacity var(--realty-transition), border-color var(--realty-transition);
}

.property-hero__thumb:hover,
.property-hero__thumb--active {
	opacity: 1;
	border-color: var(--wp--preset--color--secondary);
}

.property-hero__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.property-hero__thumb--more {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.15);
	color: var(--wp--preset--color--white);
	font-size: 0.875rem;
	font-weight: 600;
	opacity: 1;
}

/* Info bar (title, price, stats) */
.property-hero__info {
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--light);
}

.property-hero__info-inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--40);
	flex-wrap: wrap;
}

.property-hero__type {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--wp--preset--color--primary);
	margin-bottom: 4px;
}

.property-hero__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 600;
	color: var(--wp--preset--color--dark);
	margin: 0 0 8px;
	line-height: 1.2;
}

.property-hero__price {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	margin: 0;
}

.property-hero__stats {
	display: flex;
	gap: 24px;
	flex-shrink: 0;
}

.property-hero__stat {
	text-align: center;
}

.property-hero__stat-value {
	display: block;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--wp--preset--color--dark);
	line-height: 1;
}

.property-hero__stat-label {
	display: block;
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
	margin-top: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ==========================================================================
   SECTION: Single Property - Details
   Handles: Description, details table, documents
   ========================================================================== */

.property-details__inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
}

.property-details__description h2 {
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--30);
}

.property-details__content {
	line-height: 1.7;
	margin-bottom: var(--wp--preset--spacing--50);
}

.property-details__table-wrap {
	margin-bottom: var(--wp--preset--spacing--50);
}

.property-details__table-wrap h3 {
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--20);
}

.property-details__table {
	width: 100%;
	border-collapse: collapse;
}

.property-details__table th,
.property-details__table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--wp--preset--color--light);
	font-size: 0.925rem;
}

.property-details__table th {
	font-weight: 600;
	color: var(--wp--preset--color--dark);
	width: 40%;
}

.property-details__table td {
	color: var(--wp--preset--color--muted);
}

.property-details__table tr:last-child th,
.property-details__table tr:last-child td {
	border-bottom: none;
}

.property-details__documents h3 {
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--20);
}

.property-details__doc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.property-details__doc-list li {
	padding: 10px 0;
	border-bottom: 1px solid var(--wp--preset--color--light);
}

.property-details__doc-list a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	font-weight: 500;
}

.property-details__doc-list a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   SECTION: Single Property - Features
   Handles: Checkmark grid of features
   ========================================================================== */

.property-features {
	background: var(--wp--preset--color--light);
}

.property-features__inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
}

.property-features__inner h2 {
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--40);
}

.property-features__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px 32px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.property-features__item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.925rem;
	color: var(--wp--preset--color--dark);
}

.property-features__check {
	color: var(--wp--preset--color--primary);
	flex-shrink: 0;
}

/* ==========================================================================
   SECTION: Single Property - Map
   Handles: Location map container
   ========================================================================== */

.property-map__inner {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
}

.property-map__inner h2 {
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--30);
}

.property-map__container {
	background: var(--wp--preset--color--light);
}

/* ==========================================================================
   SECTION: Footer
   Handles: Footer-specific overrides
   ========================================================================== */

.site-footer a {
	color: var(--wp--preset--color--light);
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--wp--preset--color--secondary);
}

/* ==========================================================================
   SECTION: Lightbox Gallery
   Handles: Full-screen overlay gallery with navigation
   ========================================================================== */

.realty-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 250ms ease, visibility 250ms ease;
}

.realty-lightbox--open {
	opacity: 1;
	visibility: visible;
}

.realty-lightbox__close {
	position: absolute;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 8px;
	opacity: 0.7;
	transition: opacity 150ms ease;
	z-index: 10;
}

.realty-lightbox__close:hover {
	opacity: 1;
}

.realty-lightbox__image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 90vw;
	max-height: 85vh;
}

.realty-lightbox__img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: var(--wp--custom--border-radius--small, 4px);
	user-select: none;
}

.realty-lightbox__prev,
.realty-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #fff;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.7;
	transition: opacity 150ms ease, background 150ms ease;
	z-index: 10;
}

.realty-lightbox__prev:hover,
.realty-lightbox__next:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.2);
}

.realty-lightbox__prev {
	left: 16px;
}

.realty-lightbox__next {
	right: 16px;
}

.realty-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 1px;
}

/* ==========================================================================
   SECTION: Responsive
   Handles: Mobile-first responsive adjustments
   ========================================================================== */

/* ==========================================================================
   SECTION: Mobile Navigation Refinements
   Handles: Hamburger animation, overlay transitions, touch-friendly targets
   ========================================================================== */

/* Larger touch targets for nav links (44px minimum) */
.wp-block-navigation .wp-block-navigation-item a {
	padding: 6px 12px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

/* Hamburger button — improved touch target and styling */
.wp-block-navigation__responsive-container-open {
	padding: 8px;
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Hamburger close button */
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
}

/* Mobile overlay refinements */
.wp-block-navigation__responsive-container.is-menu-open {
	animation: realtySlideIn 300ms ease forwards;
}

@keyframes realtySlideIn {
	from {
		opacity: 0;
		transform: translateX(20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Overlay background */
.wp-block-navigation__responsive-container.is-menu-open::before {
	background: rgba(0, 0, 0, 0.4);
}

/* Overlay navigation links — spaced out for touch */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a {
	padding: 14px 24px;
	font-size: 1.1rem;
	min-height: 48px;
	border-bottom: 1px solid var(--wp--preset--color--light, #F7F8FA);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:last-child a {
	border-bottom: none;
}

/* Active nav link highlight */
.wp-block-navigation-item.current-menu-item a {
	color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   SECTION: Responsive
   Handles: Mobile-first responsive adjustments
   ========================================================================== */

@media (max-width: 768px) {

	.property-hero__img {
		height: 320px;
	}

	.property-hero__info-inner {
		flex-direction: column;
		gap: var(--wp--preset--spacing--20);
	}

	.property-hero__stats {
		gap: 16px;
	}

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

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

	/* Lightbox navigation on mobile */
	.realty-lightbox__prev,
	.realty-lightbox__next {
		width: 40px;
		height: 40px;
	}

	.realty-lightbox__prev {
		left: 8px;
	}

	.realty-lightbox__next {
		right: 8px;
	}
}

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