/**
 * Single agent profile (/agent/{slug}/) redesign — only enqueued on
 * singular hvnly_agent (mainsail_single_agent_enqueue_assets() in
 * functions.php). Restyles this theme's own content-single-agent.php
 * and single-agent/partials/sidebar.php overrides — Havenlytics' own
 * CSS is not modified, this file only adds new rules.
 */

.mainsail-agent-single {
	max-width: 1200px;
	margin: 0 auto;
	padding: 50px 20px 80px;
	box-sizing: border-box;
}

/* Full-width banner — Havenlytics' own ".hvnly-container" wraps the
   ENTIRE page body (hero included) and is capped to a max-width per
   breakpoint sitewide (Settings -> Properties -> Container Width),
   which boxes in the now-visible hero image. Same pattern already used
   for the agents archive: neutralized here, scoped to this page's own
   body class only, so the sitewide setting (also used by the locked
   property archive/single pages) is untouched. */
body.hvnly-agent-single .hvnly-container {
	max-width: none;
	width: 100%;
	padding-left: 0;
	padding-right: 0;
}

/* ----------------------------------------------------------------------
   Two-column layout — LEFT: photo + info card, RIGHT: about/bio.
   align-items:start keeps both columns top-aligned regardless of which
   one is taller (the default stretch would otherwise match their
   heights).
   ---------------------------------------------------------------------- */

.mainsail-agent-single__grid {
	display: grid;
	grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
	gap: clamp(32px, 4vw, 64px);
	align-items: start;
}

.mainsail-agent-single__col--profile {
	display: flex;
	flex-direction: column;
}

/* Photo — 2:3 portrait, per direct request. */
.mainsail-agent-single__photo {
	position: relative;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	background: var(--mainsail-color-dark-surface, #222222);
}

.mainsail-agent-single__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mainsail-agent-single__photo-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--mainsail-color-dark-surface-text, #f2f2f2);
	font-size: 64px;
}

/* Black info panel, per reference screenshot — sits directly below the
   photo with no gap, same column width, white text/icons throughout. */
.mainsail-agent-single__info {
	background: #222222;
	padding: 32px 28px 36px;
}

.mainsail-agent-single__name {
	margin: 0;
	font-family: var(--global-heading-font-family, "Cormorant", Georgia, "Times New Roman", serif);
	font-size: clamp(26px, 2.6vw, 34px);
	font-weight: 400;
	color: #ffffff;
}

/* ".mainsail-agent-single__info" ancestor scoping needed for
   specificity, not just style — this is a <p>, and Havenlytics' own
   ".hvnly-content-wrapper p" rule (0,1,1) otherwise beats a bare
   single-class selector (0,1,0) and this rendered black instead of
   white. */
.mainsail-agent-single__info .mainsail-agent-single__position {
	margin: 6px 0 0;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffffff;
}

/* Availability badge — Havenlytics' own .hvnly-agent-availability
   element, restyled to a small pill matching this page's palette
   instead of the plugin's default treatment. Extra padding-bottom on
   the wrapping paragraph-less badge itself separates it from the meta
   list below. */
.mainsail-agent-single__info .hvnly-agent-availability {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	margin-bottom: 8px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #ffffff;
}

.mainsail-agent-single__info .hvnly-agent-availability__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #3ddc84;
}

.mainsail-agent-single__info .hvnly-agent-availability--busy .hvnly-agent-availability__dot,
.mainsail-agent-single__info .hvnly-agent-availability--away .hvnly-agent-availability__dot {
	background: #f0b429;
}

.mainsail-agent-single__info .hvnly-agent-availability--offline .hvnly-agent-availability__dot {
	background: #ff6b6b;
}

/* Meta list — mobile/email/address/agency/license, only whichever of
   these the agent actually has (each list item is conditionally
   rendered in content-single-agent.php, not just hidden by CSS). */
.mainsail-agent-single__meta {
	list-style: none;
	margin: 20px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mainsail-agent-single__meta li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 16px;
	font-weight: 330;
	line-height: 1.5;
	color: #ffffff;
}

.mainsail-agent-single__meta li i {
	flex-shrink: 0;
	width: 18px;
	margin-top: 3px;
	color: rgba(255, 255, 255, 0.55);
	text-align: center;
}

.mainsail-agent-single__meta li a {
	color: inherit;
	text-decoration: none;
}

.mainsail-agent-single__meta li a:hover {
	text-decoration: underline;
}

/* Stats — active listings. padding-bottom (not just padding-top)
   separates the count from the social icons/buttons below it. */
.mainsail-agent-single__stats {
	display: flex;
	gap: 28px;
	margin-top: 24px;
	padding-top: 20px;
	padding-bottom: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mainsail-agent-single__stats > div {
	display: flex;
	flex-direction: column;
}

.mainsail-agent-single__stats strong {
	font-family: var(--global-heading-font-family, "Cormorant", Georgia, "Times New Roman", serif);
	font-size: 26px;
	font-weight: 400;
	color: #ffffff;
}

.mainsail-agent-single__stats span {
	margin-top: 2px;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 16px;
	font-weight: 330;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.6);
}

/* Social icons. */
.mainsail-agent-single__social {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
}

.mainsail-agent-single__social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #ffffff;
	font-size: 14px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mainsail-agent-single__social a:hover,
.mainsail-agent-single__social a:focus-visible {
	background: #ffffff;
	color: #000000;
}

/* Send Message / Call buttons — stacked full width, Send Message on
   top (solid) and Call below it (outline), per reference image. */
.mainsail-agent-single__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 28px;
}

/* Both Send Message and Call share one look — white rounded border,
   white text, transparent fill in the normal state; hover fills solid
   white with black text. 16px / font-weight 300, all caps, per direct
   request. ".mainsail-agent-single__actions" ancestor scoping needed
   for specificity, not just style — the button is a <button>, and
   Havenlytics' own ".hvnly-content-wrapper button" reset (0,1,1)
   otherwise beats a bare single-class selector (0,1,0), which silently
   dropped the border and uppercase transform. */
.mainsail-agent-single__actions .mainsail-agent-single__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 16px 28px;
	border: 1px solid #ffffff;
	border-radius: 6px;
	background: transparent;
	color: #ffffff;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 16px;
	font-weight: 300;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mainsail-agent-single__actions .mainsail-agent-single__btn:hover,
.mainsail-agent-single__actions .mainsail-agent-single__btn:focus-visible {
	background: #ffffff;
	color: #000000;
}

/* The phone glyph's open/hollow side faces left by default — flipped
   so it faces the "Call" label to its right, per direct request. */
.mainsail-agent-single__btn--outline i {
	display: inline-block;
	transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
	.mainsail-agent-single__social a,
	.mainsail-agent-single__btn {
		transition: none;
	}
}

/* ----------------------------------------------------------------------
   About/bio column — Havenlytics' own .hvnly-agent-single__about
   element (from the unmodified single-agent/partials/about.php),
   restyled to match this page's typography.
   ---------------------------------------------------------------------- */

/* Havenlytics' own .hvnly-agent-single__about element ships with a
   default "card" treatment (border/radius/shadow/white background/
   padding) — neutralized here so it sits flush in this column instead,
   per direct request to drop the card look. */
.mainsail-agent-single__col--about .hvnly-agent-single__about {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	padding: 0;
}

/* The page banner above already says "About / <agent name>", so Havenlytics'
   repeated "About <name>" heading is hidden visually (kept for screen readers). */
.mainsail-agent-single__col--about .hvnly-agent-single__section-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mainsail-agent-single__col--about .hvnly-agent-single__about-content {
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 15px;
	line-height: 1.85;
	color: var(--mainsail-color-ink-muted, rgba(0, 0, 0, 0.75));
}

.mainsail-agent-single__col--about .hvnly-agent-single__about-content p {
	margin: 0 0 1em;
}

/* ----------------------------------------------------------------------
   Listings section — single-agent/partials/properties.php (this
   theme's own override, see havenlytics/single-agent/partials/
   properties.php) reuses the exact same property-card partial
   (content-property.php) as the main /properties/ archive AND now
   carries the same "mshm-archive-grid" class the archive's own grid
   wrapper does, with the "mshm-archive-page" body class also applied
   here (functions.php). Together those restore every ".mshm-archive-
   grid"/"body.mshm-archive-page"-scoped rule this page was previously
   missing (column count, gap, and the card typography/spacing that
   depends on the --mshm-archive-* custom properties only defined
   under that body class) — full parity with the archive, no
   duplicate/hand-rolled grid CSS needed here.

   The section itself ships with Havenlytics' own default "card"
   treatment though (border/radius/shadow/white background/padding) —
   neutralized here, replaced with a plain divider line above the
   section per direct request, matching the About column's treatment.
   ---------------------------------------------------------------------- */

.mainsail-agent-single .hvnly-agent-single__properties {
	margin-top: clamp(56px, 6vw, 88px);
	padding: clamp(40px, 5vw, 56px) 0 0;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	border-right: 0;
	border-bottom: 0;
	border-left: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
}

/* Department filter pills (All/Commercial/Let/Rent/Sale) — Havenlytics'
   own ".hvnly-agent-single__status-tab" element; only font-size is
   theme-specific here (16px per direct request), everything else is
   the plugin's own styling. */
.mainsail-agent-single .hvnly-agent-single__status-tab {
	font-size: 16px;
}

/* Fixes a large empty gap between "N properties assigned" and the
   filter pills below it, on narrower widths — Havenlytics' own
   ".hvnly-agent-single__properties-header" switches to
   flex-direction:column there, but its title/count child still
   carries the desktop-layout ".hvnly-agent-single__properties-header
   > div:first-child { flex: 1 1 220px }" rule. In a column flex
   context flex-basis sets height, not width, so that div (whose real
   content is under 90px tall) was reserving a fixed 220px-tall box
   before the tabs, leaving a large blank gap. Reset to auto so the
   div sizes to its actual content instead. */
.mainsail-agent-single .hvnly-agent-single__properties-header > div:first-child {
	flex-basis: auto;
}

/* ----------------------------------------------------------------------
   "Send Me A Message" modal — Havenlytics' own existing contact form
   (this theme's single-agent/partials/sidebar.php override), just
   presented as a centered popup instead of an always-visible sidebar
   block. Opened/closed by mainsail-single-agent-modal.js.
   ---------------------------------------------------------------------- */

/* [hidden] and this custom display:flex are equal specificity (0,1,0
   each); without this, the modal rendered open by default since this
   stylesheet loads after the browser's own [hidden]{display:none} —
   same recurring gotcha hit elsewhere in this project. Explicit,
   higher-specificity override, not !important. */
.mainsail-agent-modal[hidden] {
	display: none;
}

.mainsail-agent-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.6);
	box-sizing: border-box;
}

.mainsail-agent-modal__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: min(720px, 90vh);
	overflow-y: auto;
	padding: 40px;
	background: #ffffff;
	box-sizing: border-box;
}

/* Extra ".mainsail-agent-modal" ancestor scoping (not just the bare
   ".mainsail-agent-modal__close" class) is needed for specificity, not
   just style — Havenlytics' own generic button reset
   (".hvnly-content-wrapper button", 0,1,1) otherwise beats a plain
   single-class selector (0,1,0) and this button rendered
   position:relative (top-left, in normal flow) instead of the intended
   absolute top-right. */
.mainsail-agent-modal .mainsail-agent-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	left: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--mainsail-color-ink, #000000);
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mainsail-agent-modal .mainsail-agent-modal__close:hover,
.mainsail-agent-modal .mainsail-agent-modal__close:focus-visible {
	background: #000000;
	color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
	.mainsail-agent-modal .mainsail-agent-modal__close {
		transition: none;
	}
}

body.mainsail-agent-modal-open {
	overflow: hidden;
}

.mainsail-agent-single .hvnly-agent-single__contact-title {
	margin: 0;
	font-family: var(--global-heading-font-family, "Cormorant", Georgia, "Times New Roman", serif);
	font-size: 26px;
	font-weight: 400;
	color: var(--mainsail-color-ink, #000000);
}

.mainsail-agent-single .hvnly-agent-single__contact-subtitle {
	margin: 8px 0 0;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 14px;
	color: var(--mainsail-color-ink-muted, rgba(0, 0, 0, 0.65));
}

.mainsail-agent-single .hvnly-agent-single__field {
	margin-top: 16px;
}

.mainsail-agent-single .hvnly-agent-single__field label {
	display: block;
	margin-bottom: 6px;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 13px;
	font-weight: 600;
	color: var(--mainsail-color-ink, #000000);
}

.mainsail-agent-single .hvnly-agent-single__field input,
.mainsail-agent-single .hvnly-agent-single__field select,
.mainsail-agent-single .hvnly-agent-single__field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 14px;
	color: var(--mainsail-color-ink, #000000);
	box-sizing: border-box;
}

.mainsail-agent-single .hvnly-contact-agent__field--honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mainsail-agent-single .hvnly-agent-single__form-actions {
	margin-top: 20px;
}

/* .js-hvnly-contact-agent-submit added too, not just for the JS hook it
   already needed to be there for — Havenlytics' own .hvnly-agent-
   single__form-actions .hvnly-agent-single__submit rule is the same
   (0,2,0) specificity as a 2-class selector here, so which one won
   depended on stylesheet load order rather than intent. Three classes
   here beats it outright regardless of order. */
.mainsail-agent-single .hvnly-agent-single__submit.js-hvnly-contact-agent-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 28px;
	border: 1px solid #000000;
	background: #000000;
	color: #ffffff;
	font-family: var(--global-body-font-family, "Roboto", sans-serif);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mainsail-agent-single .hvnly-agent-single__submit.js-hvnly-contact-agent-submit:hover,
.mainsail-agent-single .hvnly-agent-single__submit.js-hvnly-contact-agent-submit:focus-visible {
	background: #ffffff;
	color: #000000;
}

.mainsail-agent-single .hvnly-agent-single__submit.js-hvnly-contact-agent-submit:disabled {
	opacity: 0.5;
	cursor: default;
}

@media (prefers-reduced-motion: reduce) {
	.mainsail-agent-single .hvnly-agent-single__submit {
		transition: none;
	}
}

@media (max-width: 860px) {
	.mainsail-agent-single__grid {
		grid-template-columns: 1fr;
	}

	.mainsail-agent-single__col--profile {
		max-width: 430px;
		margin: 0 auto;
	}
}
