/*
 * CaryTamura single Agent (CT Single Agent, Elementor template 5530,
 * /agent/{agent}/ — Agent URL Base, Settings -> Labels).
 *
 * SCOPE. Loaded on every rb_agent singular request (functions.php,
 * is_singular('rb_agent')).
 *
 * VALUES. Hero, Agent Details and Meet {First Name} are measured directly
 * from carytamura.com/agent/cary-tamura at 1440 wide (visual reconciliation
 * pass): a plain white Agent Details block (portrait + a static "Agent
 * Details" heading, never the agent's own name — that's already in the hero
 * and in "Meet {name}") next to, not floated under, the portrait; a separate
 * "Meet {First Name}" section below it. Browse My Properties (the card grid
 * inside CT Loop - Property Card, 5329) is measured from the same page. Work
 * With Cary is the global template (ct-agent-work-with), untouched here.
 */

/* ------------------------------------------------------------------ hero -- */
.ct-agent-hero.ct-page-hero.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	margin: var(--ct-body-padding) var(--ct-body-padding) 0;
	min-height: 0;
	height: 600px;
	padding: 0 var(--ct-body-padding);
}

.ct-agent-hero.ct-page-hero::before {
	background-color: var(--ct-overlay-strong);
}

.ct-agent-hero.ct-page-hero::after {
	content: none;
}

.ct-agent-hero .ct-page-hero__title {
	max-width: 900px;
}

.ct-agent-hero .ct-page-hero__title .elementor-heading-title {
	margin: 0 0 20px;
	font-size: var(--ct-size-h1);
	line-height: 1.25;
}

/* Live's sections abut: no gap between Meet, Browse My Properties and Work
 * With Cary (the 140px Meet padding alone separates Meet from the grid). */
.ct-page-body.e-con:has(.ct-agent-meet) {
	--gap: 0px;
	--row-gap: 0px;
	padding-block: 0;
}

/* -------------------------------------------------------------- agent meet --
 * One padded block (140px live) holding two children: the Agent Details row,
 * then Meet {First Name} 48px below it (live: bioSection margin-top). */
.ct-agent-meet.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	--padding-top: 140px;
	--padding-bottom: 140px;
	--padding-left: max(50px, calc((100% - 2 * var(--ct-body-padding) - 1010px) / 2));
	--padding-right: max(50px, calc((100% - 2 * var(--ct-body-padding) - 1010px) / 2));
	--kit-widget-spacing: 0px;
	display: block;
	margin-inline: var(--ct-body-padding);
	color: var(--ct-ink);
	letter-spacing: 1px;
}

/* ------------------------------------------------------------- agent row --
 * Portrait (420px, live) beside the Agent Details column, 130px apart
 * (live: 1010px content width - 420px portrait - 460px details column). */
.ct-agent-row.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
	--row-gap: 130px;
	--column-gap: 130px;
	flex-direction: row;
	align-items: flex-start;
}

.ct-agent-row__portrait.elementor-widget {
	flex: 0 0 420px;
	width: 420px;
}

.ct-agent-row__portrait img {
	display: block;
	width: 100%;
	aspect-ratio: 420 / 486;
	object-fit: cover;
}

.ct-agent-details.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
	--gap: 0px;
	--row-gap: 0px;
	--kit-widget-spacing: 0px;
	flex: 1 1 0%;
	min-width: 0;
}

.ct-agent-details__title .elementor-heading-title {
	margin: 0 0 25px;
	font-family: var(--ct-font-display);
	font-size: 29px;
	font-weight: 400;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--ct-ink);
}

.ct-agent-details .ct-agent-details__row.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
	--gap: 0px;
	margin-bottom: 24px;
	display: block;
	line-height: 25.6px;
}

/* A field with nothing to show (post-custom-field resolves empty): Elementor
 * drops the value heading's own title element entirely rather than rendering
 * it empty, so the row is hidden by the ABSENCE of that element. */
.ct-agent-details__row:not(:has(.ct-agent-details__value .elementor-heading-title)) {
	display: none;
}

.ct-agent-details__label,
.ct-agent-details__value {
	display: inline;
}

.ct-agent-details__label .elementor-heading-title,
.ct-agent-details__value .elementor-heading-title {
	display: inline;
	font-family: var(--ct-font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ct-ink);
}

.ct-agent-details__label .elementor-heading-title {
	font-size: var(--ct-size-h5);
	font-weight: 700;
	line-height: 24.99px;
	text-transform: uppercase;
}

.ct-agent-details__value .elementor-heading-title {
	margin-left: 4px;
	font-weight: 400;
}

/* Out-ranks Elementor's own `.elementor-heading-title[class*=elementor-size-]
 * > a { color: inherit }`. */
.ct-agent-details .ct-agent-details__value .elementor-heading-title[class*="elementor-size-"] > a {
	color: #404040;
	text-decoration: none;
}

.ct-agent-details .ct-agent-details__value .elementor-heading-title[class*="elementor-size-"] > a:hover {
	text-decoration: underline;
}

/* Directly under the last row's own 24px margin (live). The accent circles,
 * white glyph and 20px spacing are the widget's own Elementor settings; the
 * section's 1px tracking is dropped so it doesn't widen the font-size:0
 * whitespace between the icons. */
.ct-agent-details .ct-agent-details__social.elementor-widget {
	margin: 0;
	letter-spacing: normal;
}

/* An individual social field left empty: Elementor still renders the icon
 * anchor (unlike a heading widget, which drops empty titles entirely) but
 * without an href, so each empty icon is hidden on its own — never the whole
 * row for one missing platform. The whole grid item goes, not just the
 * anchor: the widget spaces its inline items with word-spacing, so an empty
 * item left in place still adds a gap before the next icon. */
.ct-agent-details__social .elementor-grid-item:not(:has(.elementor-social-icon[href])) {
	display: none;
}

/* No social link at all: only then is the row itself dropped, along with its
 * top margin. */
.ct-agent-details .ct-agent-details__social.elementor-widget:not(:has(.elementor-social-icon[href])) {
	display: none;
}

/* -------------------------------------------------------- meet first name -- */
.ct-meet.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
	--kit-widget-spacing: 0px;
	--gap: 24px;
	--row-gap: 24px;
	margin-top: 48px;
}

.ct-meet__title .elementor-heading-title {
	margin: 0 0 12px;
	font-family: var(--ct-font-display);
	font-size: var(--ct-size-h2);
	font-weight: 400;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--ct-ink);
}

.ct-meet__bio,
.ct-meet__bio p,
.ct-meet__bio li {
	font-family: var(--ct-font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ct-ink);
}

.ct-meet__bio p {
	margin: 0 0 25.6px;
}

.ct-meet__bio p:last-child {
	margin-bottom: 0;
}

.ct-meet__bio ul {
	margin: 0 0 15px;
	padding-left: 25px;
	list-style: disc outside;
}

/* An agent with no biography (post_content empty): the empty block is
 * dropped rather than leaving blank space under the heading. */
.ct-meet__bio:empty {
	display: none;
}

/* ------------------------------------------------------ work with agent -- */
@media (min-width: 901px) and (max-width: 1024px) {
	.ct-agent-work-with .ct-work-with.e-con {
		min-height: 689px;
	}
}

/* ----------------------------------------------------- browse my properties --
 * Live (1440): the 1300px box, title 60px above two 607px cards 86px apart
 * (30px between rows), 140px below. Each card is the Team page's portfolio
 * card (team.css, same live design): 315px photo with the status on a
 * #f8f7f5 tab at its top right, then the stone panel, centred — Playfair 21
 * name, Lato 700 14 address and facts, 17 price. The card template's own
 * summary shortcode supplies the address/facts line, so no data is added. */
.ct-agent-properties.e-con {
	--padding-top: 0px;
	/* 110px live, plus the 30px bottom margin live's last card row keeps. */
	--padding-bottom: 140px;
	--padding-left: max(50px, calc((100% - 2 * var(--ct-body-padding) - 1300px) / 2));
	--padding-right: max(50px, calc((100% - 2 * var(--ct-body-padding) - 1300px) / 2));
	letter-spacing: 1px;
}

.ct-agent-properties:not(:has(.ct-prop-card)) {
	display: none;
}

.ct-agent-properties .ct-agent-properties__grid.elementor-widget {
	margin-top: 60px;
}

.ct-agent-properties__grid .elementor-loop-container {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 30px 86px;
}

.ct-agent-properties .ct-prop-card.e-con {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 500px;
	background-color: var(--ct-surface);
}

.ct-agent-properties .ct-prop-card__img img {
	height: auto;
	aspect-ratio: 607 / 315;
	background-color: gray;
}

.ct-agent-properties .ct-prop-card__status {
	top: 0;
	right: 0;
}

.ct-agent-properties .ct-prop-card__status .elementor-heading-title {
	padding: 8px 34px;
	font-size: 14px;
	font-weight: 700;
	line-height: 22.4px;
	text-transform: uppercase;
	color: var(--ct-ink);
	background-color: #f8f7f5;
}

.ct-agent-properties .ct-prop-card__info.e-con {
	--padding-top: 28px;
	--padding-bottom: 28px;
	--padding-left: 28px;
	--padding-right: 28px;
	position: static;
	flex-grow: 1;
	width: 100%;
	background-color: var(--ct-surface);
	text-align: center;
	opacity: 1;
	visibility: visible;
}

.ct-agent-properties .ct-prop-card__info::after,
.ct-agent-properties .ct-prop-card__specs {
	display: none;
}

.ct-agent-properties .ct-prop-card__name .elementor-heading-title,
.ct-agent-properties .ct-prop-card__name .elementor-heading-title a {
	margin: 0 0 7px;
	font-size: var(--ct-size-h4);
	line-height: 31.5px;
	text-transform: none;
}

.ct-agent-properties .ct-prop-card__summary {
	display: block;
}

.ct-agent-properties .ct-listing-address,
.ct-agent-properties .ct-listing-specs {
	display: block;
	margin: 0 0 7px;
	font-family: var(--ct-font-body);
	font-size: 14px;
	font-weight: 700;
	line-height: 22.4px;
	text-transform: uppercase;
	color: var(--ct-ink);
}

.ct-agent-properties .ct-listing-price {
	margin: 0;
	text-transform: uppercase;
}

/* VIEW PROPERTY (live): a 75% white veil over the whole card, the accent
 * button 210px down, fading in over 0.2s. Keyboard/touch users still reach
 * the same link through the image and title, which are linked regardless. */
.ct-agent-properties .ct-prop-card__view {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	margin: 0;
	padding: 210px 15px 15px;
	background-color: rgba(255, 255, 255, 0.75);
	opacity: 0;
	transition: opacity 0.2s linear;
	z-index: 3;
}

.ct-agent-properties .ct-prop-card:hover .ct-prop-card__view {
	opacity: 1;
}

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 1024px) {
	.ct-agent-meet.e-con {
		--padding-left: 40px;
		--padding-right: 40px;
	}

	.ct-agent-row.e-con {
		--row-gap: 40px;
		--column-gap: 40px;
	}

	.ct-agent-row__portrait.elementor-widget {
		flex: 0 0 260px;
		width: 260px;
	}

	/* The photo scales with the card below desktop, so the card sizes to its
	 * content rather than holding live's 1440 height. */
	.ct-agent-properties .ct-prop-card.e-con {
		min-height: 0;
	}
}

@media (max-width: 900px) {
	.ct-agent-meet.e-con {
		--padding-left: 80px;
		--padding-right: 80px;
	}
}

@media (max-width: 768px) {
	.ct-agent-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 32px;
	}

	.ct-agent-meet.e-con {
		--padding-top: var(--ct-section-padding-compact);
		--padding-bottom: var(--ct-section-padding-compact);
	}

	.ct-agent-properties.e-con {
		--padding-top: var(--ct-section-padding-compact);
		--padding-bottom: var(--ct-section-padding-compact);
	}

	.ct-agent-details .ct-agent-details__social .elementor-social-icons-wrapper {
		--grid-column-gap: 10px;
		--grid-row-gap: 10px;
	}
}

@media (max-width: 767px) {
	.ct-agent-hero.ct-page-hero.e-con {
		--width: 100%;
		margin: 0;
		height: 600px;
		padding: 0 var(--ct-body-padding);
	}

	.ct-agent-meet.e-con {
		--width: 100%;
		--padding-left: 24px;
		--padding-right: 24px;
		margin-inline: 0;
	}

	.ct-agent-row.e-con {
		flex-direction: column;
	}

	.ct-agent-row__portrait.elementor-widget {
		width: 100%;
		flex-basis: auto;
		margin-bottom: 24px;
	}

	.ct-meet__title .elementor-heading-title {
		font-size: 32px;
	}

	.ct-agent-properties.e-con {
		--padding-left: 25px;
		--padding-right: 25px;
	}

	.ct-agent-properties__grid .elementor-loop-container {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	/* Social icons centred as a group, 60px apart (live: each 40px icon
	 * carries its 20px gap after it, in a centred list with 20px right
	 * padding). Padding, not margin, on the item: Elementor's WebKit rule
	 * zeroes left-aligned grid items' inline margins. */
	.ct-agent-details .ct-agent-details__social .elementor-social-icons-wrapper {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		padding-right: 20px;
		--grid-column-gap: 0px;
	}

	.ct-agent-details .ct-agent-details__social .elementor-grid-item {
		padding-inline-end: 20px;
	}
}

@media (max-width: 568px) {
	.ct-agent-hero .ct-page-hero__title .elementor-heading-title {
		line-height: 1.6;
	}
}

@media (max-width: 360px) {
	.ct-agent-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ct-agent-properties .ct-prop-card__view {
		transition: none;
	}
}
