/* ==========================================================================
   Avahi Team — "Meet the minds behind Avahi" grid + bio popup
   includes/elementor/class-av-team-widget.php

   Selectors that set type or colour are written as `.av-team .x`. The Elementor
   kit styles h2/h3/p/button/a at (0,1,1) — `.elementor-kit-6 h3` — which beats a
   single class, so a bare `.av-team-card__name` would silently take the kit's
   heading font and colour. Every value here can be changed from the widget's
   Style tab, whose selectors outrank these.
   ========================================================================== */
   .av-team-modal__link span {
    margin: 0 !important;
}
.av-team-modal__body span, .av-team-modal__body p, .av-team-modal__body h3, .av-team-modal__bio {
    margin-bottom: 20px;
}
.av-team .av-team__title,
.av-team .av-team__label,
.av-team .av-team__intro,
.av-team .av-team-card__name,
.av-team .av-team-card__name--featured,
.av-team .av-team-card__role,
.av-team .av-team-card__label,
.av-team .av-team-card__intro,
.av-team .av-team-modal__name,
.av-team .av-team-modal__role,
.av-team .av-team-modal__label,
.av-team .av-team-modal__bio,
.av-team .av-team-modal__link {
	font-family: Manrope;
}

.av-team {
	--av-team-ink: #121212;
	--av-team-muted: #6b6f76;
	--av-team-accent: #2f6be4;
	--av-team-bio: #3466D6;   /* the Read bio label AND its arrow */
	--av-team-line: #d8d8d4; 
	--av-team-photo: #ddd8d2;
	--av-team-popup: #f4f4f1;

	color: var(--av-team-ink);
}

/* -----------------------------------------------------------------------------
   Header
-------------------------------------------------------------------------- */
.av-team__head {
	margin-bottom: 40px;
}

.av-team__head--line {
	border-top: 1px solid var(--av-team-line);
	padding-top: 22px;
}

.av-team__headrow {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 18px;
}

.av-team .av-team__label,
.av-team .av-team-card__label,
.av-team .av-team-modal__label {
	display: block;
	color: #3466D6; 
	font-family: Manrope;
	font-size: 18px;
	font-style: normal;
	font-weight: 700;
	line-height: normal;
}

.av-team .av-team__intro {
	color: #000;
	font-family: Manrope;
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 26.4px;  
}

.av-team .av-team__title {
	margin: 0;
	font-size: clamp(32px, 3.6vw, 52px);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--av-team-ink);
}

/* -----------------------------------------------------------------------------
   Grid
   Column counts are written by the widget per device; these are the fallback
   when that CSS is missing (a freshly placed widget before Elementor regenerates).
-------------------------------------------------------------------------- */
.av-team__grid {
	display: grid;
	grid-template-columns: repeat(var(--av-team-cols, 4), minmax(0, 1fr));
	gap: 24px 20px;
	align-items: stretch;
}

.av-team-card--featured {
	grid-column: span 2;
}

/* Tablet and phone: the featured card takes the full row, whatever the column
   count, so the founder panel never gets squeezed into half a phone screen. */
@media (max-width: 1024px) {
	.av-team__grid { grid-template-columns: repeat(var(--av-team-cols-tablet, 2), minmax(0, 1fr)); }
	.av-team-card--featured { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
	.av-team__grid {
		grid-template-columns: repeat(var(--av-team-cols-mobile, 1), minmax(0, 1fr));
		gap: 22px 14px;
	}
}

/* -----------------------------------------------------------------------------
   Card
-------------------------------------------------------------------------- */
.av-team-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.av-team-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	background-color: var(--av-team-photo);
}

/* `.av-team` in front: `.elementor img { height: auto }` is the same weight as a
   bare `.av-team-card__media img` and would collapse the featured photo. */
.av-team .av-team-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}

.av-team .av-team-card:hover .av-team-card__media img {
	transform: scale(1.03);
}

.av-team-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding-top: 16px;
}

.av-team-card__name--featured {
	color: #000;
	font-family: Manrope !important;
	font-size: 36px !important;
	font-style: normal;
	font-weight: 600;
	line-height: 35.2px; 
	letter-spacing: -0.64px;
}
.av-team-card__name{
	color: #000 !important;
	font-family: Manrope !important;
	font-size: 24px !important;
	font-style: normal;
	font-weight: 600;
	line-height: 25.6px; 
	letter-spacing: -0.4px;
}

.av-team .av-team-card__role {
	color: #000;
	font-family: Manrope;
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 21.7px;  
}
.av-sec-m0 h3{
	margin: 0 !important;
}
/* "Read bio +" — a full-width row with a rule above, pinned to the card bottom
   so every card in a row lines up however long a name or role runs. */
.av-team .av-team-card__bio,
.av-team .av-team-card__bio:hover,
.av-team .av-team-card__bio:focus,
.av-team .av-team-card__bio:active {
	display: flex;
	align-items: center; 
	gap: 12px;
	width: 100%;
	margin: auto 0 0;
	padding: 12px 0 0;
	border: 0; 
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #3466D6;
	text-align: center;
	font-family: Manrope;
	font-size: 16px;
	font-style: normal;
	font-weight: 700;
	line-height: normal;
}

/*
 * Some pages wrap the grid in a section that zeroes every p and h3 margin with
 * !important (the DLS page CSS: `.dls-fp-xxxx .av-team p { margin:0!important }`).
 * These spacings are part of the design, so they are held with !important too.
 */
/* One class more than `.dls-fp-xxxx .av-team h3` (0,2,1), so these win outright. */
.av-team .av-team-card .av-team-card__name,
.av-team .av-team-card .av-team-card__name--featured { margin: 0 0 4px !important; padding: 0 !important; }
.av-team .av-team-card .av-team-card__role  { margin: 0 !important; }
.av-team .av-team__head .av-team__intro     { margin: 0 !important; }
.av-team .av-team__head .av-team__title     { margin: 0 !important; padding: 0 !important; }
.av-team .av-team-card.av-team-card--featured .av-team-card__name--featured { margin-bottom: 6px !important; }
.av-team .av-team-card .av-team-card__intro { margin: 22px 0 24px !important; }

/* The rule sits a little below the role on plain cards. The space goes on the
   role, not on the button: a margin-top on the button would replace its `auto`,
   and the rows would stop lining up with the taller featured card beside them. */
.av-team .av-team-card:not(.av-team-card--featured) .av-team-card__role {
	margin-bottom: 15px !important;
}
.p.av-team-card__role{
	color: #000;
	font-family: Manrope;
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 19.5px;  
}
/* Popup text: the same page rules reach into the dialog, so the same treatment. */
.av-team .av-team-modal .av-team-modal__name   { margin: 0 0 20px !important; padding: 0 36px 0 0 !important; }
 
.av-team .av-team-modal .av-team-modal__bio p  { margin: 0 0 20px !important; }
.av-team .av-team-modal .av-team-modal__bio p:last-child { margin-bottom: 0 !important; }
.av-team .av-team-modal .av-team-modal__beyond p { margin: 0 !important; }

.av-team .av-team-card__bio:hover,
.av-team .av-team-card__bio:focus-visible {
	color: var(--av-team-accent);
}

.av-team .av-team-card__bio:focus-visible {
	outline: 2px solid var(--av-team-accent);
	outline-offset: 4px;
}

/* "Read bio →" arrow. The SVG strokes with currentColor and this element sets
   no colour of its own, so the arrow always inherits the label's colour - the
   two cannot drift apart, and a colour set in the Style tab moves both at once.
   It nudges right on hover rather than rotating, which is what an arrow does. */
.av-team-card__plus {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	transition: transform .3s ease;
}

/* The button sets font-size, and an inline SVG would take a line-height slot
   from it — display:block keeps the box exactly 15px and vertically centred. */
.av-team-card__plus svg {
	display: block;
	width: 100%;
	height: 100%;
}

.av-team .av-team-card__bio:hover .av-team-card__plus,
.av-team .av-team-card__bio:focus-visible .av-team-card__plus {
	transform: translateX(3px);
}

/* -----------------------------------------------------------------------------
   Featured (founder) card — photo beside a panel
-------------------------------------------------------------------------- */
.av-team-card--featured {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	overflow: hidden;
}

.av-team-card--featured .av-team-card__media {
	aspect-ratio: auto;
	height: 100%;
	min-height: 320px;
	border-radius: 0;
}

.av-team-card--featured .av-team-card__body {
	padding: 44px; 
	border: 1px solid rgba(255, 255, 255, 0.20);
    background: #EDF0F2;
    backdrop-filter: blur(30px);
}

.av-team .av-team-card--featured .av-team-card__label {
	margin-bottom: 18px;
}

.av-team .av-team-card--featured .av-team-card__name--featured {
	margin-bottom: 6px;
	font-size: 30px;
}

.av-team .av-team-card__intro {
	margin: 22px 0 24px;
	max-width: 340px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--av-team-muted);
}

@media (max-width: 767px) {
	.av-team-card--featured {
		grid-template-columns: minmax(0, 1fr);
	}

	.av-team-card--featured .av-team-card__media {
		aspect-ratio: 4 / 5;
		height: auto;
		min-height: 0;
	}

	.av-team .av-team-card--featured .av-team-card__name--featured {
		font-size: 26px;
	}
}

/* -----------------------------------------------------------------------------
   Bio popup — a native <dialog>, so the browser holds focus, makes the page
   behind inert and closes on Esc.
-------------------------------------------------------------------------- */
.av-team-modal {
	width: 100%;
	max-width: min(1140px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--av-team-ink);
	overflow: visible;
}

/* The dialog itself takes focus when it opens; the browser outlines it, which
   drew a dark frame round the whole popup. The close button and link keep their
   own focus rings for keyboard users. */
.av-team-modal:focus,
.av-team-modal:focus-visible {
	outline: none;
}

.av-team-modal::backdrop {
	background-color: rgba(18, 18, 18, .58);
}

.av-team-modal[open] {
	animation: av-team-in .32s cubic-bezier(.2, .7, .3, 1);
}

.av-team-modal[open]::backdrop {
	animation: av-team-fade .32s ease;
}

@keyframes av-team-in {
	from { opacity: 0; transform: translateY(16px) scale(.985); }
	to   { opacity: 1; transform: none; }
}

@keyframes av-team-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.av-team-modal__inner {
	display: grid;
	grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
	max-height: calc(100vh - 32px);
	overflow: hidden;
}

/* The photo is laid over its column rather than sized by it, so it always fills
   the full height of the popup. Sized by its own height:100%, it stopped short
   when a long bio made the text side taller, leaving a grey band under it. */
.av-team-modal__media {
	position: relative;
	/* Tall enough to show the whole portrait, never taller than the screen. */
	min-height: min(700px, calc(100vh - 64px));
	overflow: hidden;
	background-color: #e8e7e3;
}

/* Inset from the sides so a light strip frames the photo, as in the design. */
.av-team .av-team-modal__media img {
	position: absolute;
	inset: 0 28px;
	display: block;
	width: calc(100% - 56px);
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center top;
}

.av-team-modal__body {
	position: relative;
	/* Its own scroll, capped at the screen: without the cap the grid row grew to
	   the full text height and the bottom of a long bio was clipped, not scrolled. */
	max-height: calc(100vh - 32px);
	padding: 68px 54px 56px;
	background-color: var(--av-team-popup);
	overflow-y: auto;
	overscroll-behavior: contain;
}

/*
 * Position and size live on the button alone, never on :hover / :focus.
 *
 * They used to be declared for all three states. The phone rule further down
 * pins the button with position:fixed, but a tap puts the button into :hover,
 * and ".close:hover" out-ranks ".close" — so on touch the button jumped back to
 * position:absolute inside the scrolling text column the instant the finger
 * landed. The touch events hit the X, the click that follows hit the photo
 * underneath, and the popup never closed. The same jump happened with a mouse
 * in a narrow window: hovering the X moved it away from the pointer.
 */
.av-team .av-team-modal__close {
	position: absolute;
	top: 26px;
	right: 26px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	/*
	 * A solid black circle with a white X, so it reads on any photo (on a phone
	 * it sits over the picture) as well as on the light panel. !important on the
	 * colours: the Elementor kit repaints every button on :hover / :focus, and a
	 * tap on a phone leaves the button focused.
	 */
	background: #121212 !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	color: #fff !important;
	cursor: pointer;
	/* No tap delay or double-tap zoom on the button. */
	touch-action: manipulation;
	transition: background-color .2s ease, transform .2s ease;
}

/* States change colour only. !important because the kit and the theme reset
   repaint every button on :hover / :focus. */
.av-team .av-team-modal__close:hover,
.av-team .av-team-modal__close:focus,
.av-team .av-team-modal__close:active {
	background: #121212 !important;
	color: #fff !important;
}

/* The turn is for a real pointer only; a finger has no hover to show it. */
@media (hover: hover) {
	.av-team .av-team-modal__close:hover {
		background: #3a3a3a !important;
		transform: rotate(90deg);
	}
}

.av-team .av-team-modal__close:focus-visible {
	outline: 2px solid var(--av-team-accent);
	outline-offset: 2px;
}

 

.av-team .av-team-modal__name {
	color: #000;
	font-family: Manrope;
	font-size: 24px;
	font-style: normal;
	font-weight: 600;
	line-height: 25.6px;  
	letter-spacing: -0.4px;
    margin-bottom: 20px !important;
}

.av-team .av-team-modal__role {
	color: #000;
	font-family: Manrope;
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 19.5px; 
	margin-bottom: 20px !important; 
}

 

.av-team .av-team-modal__bio p {
	margin: 0 0 20px !important;
	color: #000;
	font-family: Manrope;
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 26.4px;
}

.av-team .av-team-modal__bio p:last-child {
	margin-bottom: 0 !important;
}

.av-team .av-team-modal__beyond {
	margin-top: 34px;
	padding-top: 28px;
	border-top: 1px solid #cfcfcb;
}

.av-team .av-team-modal__beyond .av-team-modal__label {
	margin-bottom: 14px;
}

.av-team .av-team-modal__beyond p {
	margin: 0 !important;
	font-size: 15px;
	line-height: 1.7;
	color: #3f4246;
}

.av-team .av-team-modal__link,
.av-team .av-team-modal__link:hover,
.av-team .av-team-modal__link:focus {
	display: inline-flex;
	align-items: center;
	gap: 18px;
	color: #3466D6; 
    font-family: Manrope !important;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.av-team .av-team-modal__link svg {
	transition: transform .25s ease;
}

/*
 * The icons draw in currentColor. The header template's CSS carries
 *   .av-header-lang-sec .av-lang__cur, svg { color:#fff !important }
 * whose stray comma makes EVERY svg on the site white, which turned the LinkedIn
 * arrow and the close X invisible on the light panel. Taking the colour back
 * from the link / button keeps them matching the text and any colour chosen in
 * the widget's Style tab.
 */
.av-team .av-team-modal__link svg,
.av-team .av-team-modal__close svg {
	color: inherit !important;
}

.av-team .av-team-modal__link:hover svg,
.av-team .av-team-modal__link:focus-visible svg {
	transform: translate(2px, -2px);
}

/* Browsers without <dialog>.showModal(): a fixed box with a shadow as overlay. */
.av-team-modal.is-fallback {
	position: fixed;
	inset: 0;
	z-index: 100000;
	box-shadow: 0 0 0 100vmax rgba(18, 18, 18, .58);
}

/* The page behind stays put while a bio is open. */
html.av-team-lock,
html.av-team-lock body {
	overflow: hidden;
}

@media (max-width: 767px) {
	.av-team-modal__inner {
		grid-template-columns: minmax(0, 1fr);
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.av-team-modal__media {
		min-height: 0;
		aspect-ratio: 4 / 3;
		padding: 0;
	}

	.av-team .av-team-modal__media img {
		inset: 0;
		width: 100%;
	}

	.av-team-modal__body {
		max-height: none;
		padding: 32px 22px 28px;
		overflow: visible;
	}

	.av-team .av-team-modal__close {
		position: fixed;
		top: 26px;
		right: 26px;
		width: 40px;
		height: 40px;
	}
}

/* Phone, two cards to a row: scale the type to the narrower card. */
@media (max-width: 767px) {
	.av-team .av-team-card__name {
		font-size: 17px;
	}

	.av-team .av-team-card__role {
		font-size: 12px;
	}

	.av-team .av-team-card__bio,
	.av-team .av-team-card__bio:hover,
	.av-team .av-team-card__bio:focus,
	.av-team .av-team-card__bio:active {
		font-size: 12px;
	}

	.av-team-card__body {
		padding-top: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.av-team .av-team-modal__close:hover {
		transform: none;
	}

	.av-team-modal[open],
	.av-team-modal[open]::backdrop {
		animation: none;
	}

	.av-team .av-team-card__media img,
	.av-team-card__plus {
		transition: none;
	}
}

/* -----------------------------------------------------------------------------
   The "about <name>" part of the Read bio label
-------------------------------------------------------------------------- */
/*
 * Shown on the founder card, hidden everywhere else — see the comment on the
 * button in includes/team.php. It inherits the button's font and colour on
 * purpose, so "Read bio about Jack Singh" and "Read bio" read as the same
 * control; it only gets its own class so page CSS can reach one without the
 * other, and so it never picks up the nowrap the hidden version needs.
 */
.av-team .av-team-card__bio-name {
	font: inherit;
	color: inherit;
}

/* -----------------------------------------------------------------------------
   Visually-hidden label
-------------------------------------------------------------------------- */
/*
 * The "about <name>" text that gives each Read bio button a unique accessible
 * name. It carries the theme's own class rather than the generic
 * `screen-reader-text`, because WordPress, Hello Elementor and page builders all
 * style that name too — one `position: static` or `width: auto` from outside and
 * the label renders as visible text in the card. That is what put "Read bio
 * about Jack Singh" on the founder card: its __body sets backdrop-filter, which
 * makes it a containing block for absolutely positioned children, so the founder
 * card is the first to show the leak.
 *
 * !important + clip-path matches .av-pg-sr-only / .av-pc-sr-only elsewhere in
 * the theme, so no outside rule can reveal it. The old class name is kept as a
 * second selector so pages still serving cached markup stay hidden too.
 */
.av-team .av-team-sr,
.av-team .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
